In mobile crowdsensing (MCS), the battery of participants is often limited. When participants perform too many sensing tasks resulting in insufficient remaining energy, they will exit the MCS system. This article mainly addresses the energy balancing problem to prolong the system lifespan. By this means, it can ensure adequate participants and promote the completion of tasks. First, it formulates a discrete time optimization model, which transforms abovementioned problem into the online control of task admission and allocation. In addition, this model uses remaining energy variance of the participants to measure the degree of balance. Next, an online energy balancing strategy (OEBS) is proposed based on the Lyapunov optimization, which can realize energy balance without utility loss. Finally, an approximate optimal policy is presented based on the linear programming and genetic algorithm to solve abovementioned optimization problem. Experiments show that OEBS effectively maintains adequate participants, prolongs the lifespan of MCS system and maximizes the system utility even when there are few participants with multiple tasks. Specifically, the lifespan in OEBS is longer than that in utility optimization algorithm (UOA) and LP-relaxation algorithm significantly. The total utility in OEBS is more than that in UOA. OEBS can maximizes average utility of system by adjusting ${\bm{V}}$ . In addition, the energy balancing ability of OEBS is always effective as ${\bm{V}}$ changes.
In Mobile Crowdsensing (MCS), sensing tasks have different impacts and contributions to the whole system or specific targets, so the importance of the tasks is different. Since resources for performing tasks are usually limited, prioritizing the allocation of resources to more important tasks can ensure that key data or information can be collected promptly and accurately, thus improving overall efficiency and performance. Therefore, it is very important to consider the importance of tasks in the task selection and allocation of MCS. In this paper, a task queue is established, the importance of tasks, the ability of participants to perform tasks, and the stability of the task queue are considered, and a novel task selection and allocation scheme (TSAS) in the MCS system is designed. This scheme introduces the Lyapunov optimization method, which can be used to dynamically keep the task queue stable, balance the execution ability of participants and the system load, and perform more important tasks in different system states, even when the participants are limited. In addition, the Double Deep Q-Network (DDQN) method is introduced to improve on the traditional solution of the Lyapunov optimization problem, so this scheme has a certain predictive ability and foresight on the impact of future system states. This paper also proposes action-masking and iterative training methods for the MCS system, which can accelerate the training process of the neural network in the DDQN and improve the training effect. Experiments show that the TSAS based on the Lyapunov optimization method and DDQN performs better than other algorithms, considering the long-term stability of the queue, the number and importance of tasks to be executed, and the congestion degree of tasks.