With the proliferation of the Internet of Things, embedded applications are widely utilized in various fields. Due to the sustainable and environmental friendly features, energy harvesting embedded devices are rapidly expanding in the market. Yet, these energy harvesting embedded systems are usually resource-constrained, which extremely affects the task execution performance of the embedded system. Therefore, this work studies the scheduling problem of aperiodic tasks in energy harvesting systems and designs an energy-constrained scheduling algorithm based on the dynamic voltages frequency scaling (DVFS) technique. For stochastic arrived tasks with multiple levels of Quality of Service (QoS), the execution frequency and service-level are selected according to the available energy and the task deadline, so that the task execution can be completed with a relatively large reward. Experimental results demonstrate that the proposed algorithm significantly improves the system QoS reward compared with the baselines.