Vehicle-mounted task unloading and resource allocation method and device, equipment and storage medium

Through data mapping between the vehicle and the digital twin and Markov model training, the offloading and resource allocation of vehicle tasks are optimized, and the problems of insufficient vehicle computing power and cloud communication delay are solved, and rapid task processing and resource allocation are achieved.

CN118972804AActive Publication Date: 2024-11-15Shenzhen Big Data Research Institute Wuxi Innovation Center

Patent Information

Application Number
CN202411260885.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2024-11-15
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

Vehicles have limited computing power and are difficult to meet computing resources and delay requirements. Cloud processing leads to excessive communication delay and it is difficult to quickly receive data.

Method used

Using twin system building modules, communication rate calculation modules, Markov model building modules and MADDPG model training modules, build Markov model and train MADDPG model through data mapping between digital twins and vehicles, optimize task unloading and resources Allocation scheme to realize task synchronization and intelligent allocation of computing resources.

Benefits of technology

In a single time slot and multi-task scenario, quickly optimize task offloading and allocation solutions, reduce vehicle tasks processing delays, improve data reception efficiency, and realize intelligent allocation of edge server resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118972804A_ABST
    Figure CN118972804A_ABST
Patent Text Reader

Abstract

The invention relates to a vehicle-mounted task unloading and resource allocation method and device, equipment and a storage medium, and is applied to the field of Internet of Vehicles, and the method comprises the steps: building a twinning system of a vehicle and a digital twinning body, the twinning system comprising a physical layer and a cloud digital twinning layer; calculating a communication rate between the vehicle and the edge server and delay time of vehicle task processing; constructing a Markov model corresponding to the vehicle, and training the MADDPG model; when the vehicle generates a task, the vehicle synchronizes the task to the digital twin body corresponding to the vehicle; and the digital twin calculates the vehicle task by using the trained MADDPG model to obtain an unloading scheme and a distribution scheme corresponding to the vehicle task, and synchronizes the unloading scheme and the distribution scheme to the vehicle. The method has the technical effects that the vehicle user can quickly obtain a better task unloading and allocation scheme, and the real-time computing resources of the edge server are intelligently and quickly allocated to the multiple tasks generated by the vehicle in a single-gap and multi-task scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of vehicle networking, and in particular to a method, device, equipment and storage medium for vehicle-mounted task offloading and resource allocation. Background Art

[0002] At present, with the rapid development of Internet of Things technology and 5G wireless communication technology, a large number of new applications have emerged in the field of Internet of Vehicles, such as autonomous driving, video surveillance and traffic control. These applications related to intelligent transportation systems first need to collect a large amount of environmental data, such as road network information, real-time traffic information, vehicle driving information, etc. Then, based on these data, the vehicle or other sensing devices perform corresponding processing, such as face recognition, target detection, traffic prediction, etc. It can be seen that these applications are all based on computationally intensive data-driven.

[0003] However, due to the limited computing power of vehicles, it is difficult to meet the requirements of computing resources and delays. The emergence of cloud computing has alleviated this situation to a certain extent; for example, vehicle edge computing can offload the vehicle's computing tasks to the VEC server or roadside unit, and use the computing resources of the VEC server itself to assist in processing computing tasks. This kind of cloud computing integrates a large number of servers with powerful computing capabilities. By offloading part of the computing tasks to the cloud, the delay in application operation can be reduced. However, since the cloud is far away from the vehicle, this cloud processing method will result in excessively high communication delays, which is difficult to meet the vehicle's requirements for fast data reception. Summary of the invention

[0004] In order to help improve the efficiency of a vehicle in receiving data and processing tasks, the present application provides a vehicle-mounted task offloading and resource allocation method, device, equipment and storage medium.

[0005] In a first aspect, the present application provides a method for vehicle-mounted task offloading and resource allocation, which adopts the following technical solution: the method includes: a twin system establishment module, which is used to establish a twin system of a vehicle and a digital twin, the twin system includes a physical layer and a cloud digital twin layer, the physical layer includes a number of vehicles and an edge server, and the cloud digital twin layer is a digital twin of a number of vehicles that constitutes a digital mapping in the cloud; A communication rate calculation module, used to calculate the communication rate between the vehicle and the edge server; A delay time calculation module, used to calculate the delay time of vehicle task processing; A Markov model building module, used to build a Markov model corresponding to the vehicle according to the communication rate and the delay time; MADDPG model training module, used to train the MADDPG model using the Markov model; A vehicle task synchronization module is used for synchronizing the task to the digital twin corresponding to the vehicle when the vehicle generates a task; The unloading plan calculation module is used to calculate the vehicle tasks using the trained MADDPG model, obtain the unloading plan and allocation plan corresponding to the vehicle tasks and synchronize them to the vehicle.

[0006] Through the above technical solution, when a vehicle generates multiple tasks, the tasks can be first synchronized to the digital twin of the vehicle, and then the digital twin of the vehicle can use the MADDPG model trained by the Markov model to perform calculation and analysis on the vehicle tasks, and then obtain optimized delays, unloading plans and allocation plans for multiple vehicle tasks. Since there is a corresponding relationship in data mapping between the vehicle and the digital twin, the vehicle user can quickly obtain better task unloading and allocation plans; that is, in a single time slot and multi-task scenario, the real-time computing resources of the edge server are intelligently and quickly allocated to the multiple tasks generated by the vehicle.

[0007] In a specific implementation scheme, the calculation of the communication rate between the vehicle and the edge server includes: Communication rate between vehicle and edge server It can be expressed as:

[0008] in, For communication bandwidth, Transmit power to the vehicle, is the noise power, is the channel gain between the vehicle and the base station; Channel gain between vehicle and base station The calculation process is:

[0009] in, is a small-scale fading, is the large-scale path fading and shadowing, and for small-scale fading , using the general fading model, is calculated as:

[0010] in, Obeys a circularly symmetric complex Gaussian distribution with unit variance, is the correlation coefficient, It is a vehicle In time slot location, is the location of the base station, is the path loss exponent.

[0011] In a specific implementation scheme, the calculation of the delay time of vehicle task processing includes: When a vehicle generates a task, if the vehicle's task If local processing is required, the delay in local processing It can be calculated as:

[0012] in, The unloading ratio given for the digital twin, The amount of data generated for the kth task of the vehicle, The CPU cycles required to process a unit task, The computing resources of the vehicle itself; If the vehicle's mission Need to offload to edge server processing, the edge processing delay It can be calculated as:

[0013] in, is the communication rate between the vehicle and the edge server, To provide a digital twin of the vehicle for the task Estimated computing resources, is the estimation error; Estimation Error is the error between the computing resources caused by the mapping relationship and the actual situation, the estimated error The calculation of is as follows:

[0014] If the vehicle's tasks are processed locally and on the edge server at the same time, the required delay time It can be expressed as:

[0015] For multiple tasks generated by a single vehicle processing them simultaneously, the total delay in executing all tasks It can be expressed as:

[0016] In a specific implementation scheme, constructing a Markov model corresponding to the vehicle includes: Building a Markov state space :

[0017] in, The set of tasks generated for the vehicle, is the estimated deviation of the digital twin corresponding to the vehicle, is the position of the vehicle in the time slot, is the channel gain between the vehicle and the base station; Building a Markov action space : The vehicle is based on the observed state , make an action ; Vehicles in the gap The action is:

[0018] in, is the uninstall ratio, Estimated computational resources for the digital twin; Building the Markov Reward Function :

[0019] in, and is the weight factor, is the number of tasks generated by the vehicle in a single time slot, for The maximum time limit for completing a single task, The delay time when the vehicle is being processed locally and unloaded at the same time, is the number of vehicles, The maximum number of computing resources of the vehicle itself; Long-term rewards are :

[0020] in, is the discount factor, Between 0 and 1; Indicates past time, Indicates the communication rate at the past time.

[0021] In a specific possible implementation, the MADDPG model includes an actor network deployed on the vehicle side and a critic network deployed on the edge server; The use of the Markov model to train the MADDPG model includes: The Markov model is used to obtain and update the Q value of the critic network in the MADDPG model to maximize the Q value of the critic network.

[0022] In a specific possible implementation scheme, the critic network includes an estimated critic network and a target critic network; The method of obtaining and updating the Q value of the critic network in the MADDPG model by using the Markov model includes: Get the Q value of the critic network:

[0023]

[0024] in, To estimate the parameters of the critic network, are the parameters of the target critic network; Calculate the loss function:

[0025] in, is the time difference error, The calculation formula is:

[0026] Update the critic network parameters via stochastic gradient descent :

[0027] Soft update the parameters of the target critic network:

[0028] in, is the parameter update rate, between 0 and 1.

[0029] In a specific implementation scheme, the digital twin uses the trained MADDPG model to calculate the vehicle task, obtains the optimized delay, unloading scheme and allocation scheme corresponding to the vehicle task and synchronizes them to the vehicle, including: The digital twin will calculate the total delay of the task The optimized delay input to the MADDPG model for solution calculation; The digital twin inputs the local state of the vehicle into the MADDPG model to solve and calculate the unloading plan and allocation plan; The digital twin synchronizes the optimized latency as well as the unloading and allocation plans to the vehicle.

[0030] In a second aspect, the present application provides a vehicle-mounted task unloading and resource allocation device, which adopts the following technical solution: the device comprises: A twin system establishment module is used to establish a twin system of a vehicle and a digital twin. The twin system includes a physical layer and a cloud digital twin layer. The physical layer includes a number of vehicles and edge servers. The cloud digital twin layer is a digital twin of a number of vehicles that is digitally mapped in the cloud. A communication rate calculation module, used to calculate the communication rate between the vehicle and the edge server; A delay time calculation module, used to calculate the delay time of vehicle task processing; A Markov model building module, used to build a Markov model corresponding to the vehicle according to the communication rate and the delay time; MADDPG model training module, used to train the MADDPG model using the Markov model; A vehicle task synchronization module is used for synchronizing the task to the digital twin corresponding to the vehicle when the vehicle generates a task; The unloading plan calculation module is used to calculate the vehicle tasks using the trained MADDPG model, obtain the unloading plan and allocation plan corresponding to the vehicle tasks and synchronize them to the vehicle.

[0031] In a third aspect, the present application provides a computer device, which adopts the following technical solution: it includes a memory and a processor, and the memory stores a computer program that can be loaded by the processor and executes any of the above-mentioned vehicle-mounted task offloading and resource allocation methods.

[0032] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution: storing a computer program that can be loaded by a processor and execute any of the above-mentioned vehicle-mounted task offloading and resource allocation methods.

[0033] To summarize, the present application has the following beneficial technical effects: when a vehicle generates multiple tasks, the tasks can be first synchronized to the digital twin of the vehicle, and then the digital twin of the vehicle can use the MADDPG model trained by the Markov model to perform calculation and analysis on the vehicle tasks, and then obtain optimized delays, unloading plans and allocation plans for multiple vehicle tasks. Since there is a corresponding relationship in data mapping between the vehicle and the digital twin, vehicle users can quickly obtain better task unloading and allocation plans; that is, in a single time slot and multi-task scenario, the real-time computing resources of the edge server are intelligently and quickly allocated to the multiple tasks generated by the vehicle. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a system scenario diagram of the vehicle-mounted task offloading and resource allocation method in an embodiment of the present application.

[0035] Figure 2 It is a flowchart of the vehicle-mounted task offloading and resource allocation method in an embodiment of the present application.

[0036] Figure 3 It is a comparison chart of simulation results of the Markov reward curve in the embodiment of the present application.

[0037] Figure 4 It is a comparison chart of simulation results of resource allocation in the embodiment of the present application.

[0038] Figure 5 It is a comparison chart of simulation results of task processing delay in the embodiment of the present application.

[0039] Figure 6 It is a structural block diagram of the vehicle-mounted task unloading and resource allocation device in an embodiment of the present application.

[0040] Figure numerals: 601, twin system establishment module; 602, communication rate calculation module; 603, delay time calculation module; 604, Markov model construction module; 605, MADDPG model training module; 606, vehicle task synchronization module; 607, unloading plan calculation module. DETAILED DESCRIPTION

[0041] The following is combined with Figure 1-6 This application is described in further detail.

[0042] The embodiment of the present application discloses a method for vehicle-mounted task offloading and resource allocation. The implementation of the method is based on a twin system of a vehicle and a digital twin, that is, the premise for the implementation of the method is to establish a twin system of a vehicle and a digital twin; specifically, refer to Figure 1 The vehicle and digital twin system includes a physical layer and a cloud digital twin layer. The physical layer includes several vehicles and an edge server (VECServer). The cloud digital twin layer is a digital twin (Digitaltwin) of several vehicles that form a digital mapping in the cloud. When a vehicle generates multiple tasks (Task) in a single time slot, due to the data mapping relationship between the vehicle and the digital twin, the vehicle can use the digital twin deployed in the cloud and the MADDPG model deployed in the cloud to calculate the optimized delay, offloading scheme and allocation scheme of multiple tasks, and then offload the tasks that need to be offloaded to the edge server for calculation and processing according to the calculation results.

[0043] Specifically, Figure 2 As shown, the method comprises the following steps: S10, establish a twin system of vehicle and digital twin.

[0044] Specifically, the twin system includes a physical layer and a cloud digital twin layer. The physical layer includes several vehicles and edge servers, and the cloud digital twin layer is a digital twin of several vehicles that constitutes a digital mapping in the cloud.

[0045] S20, calculating the communication rate between the vehicle and the edge server.

[0046] S30, calculating the delay time of vehicle task processing.

[0047] S40, constructing a Markov model corresponding to the vehicle according to the communication rate and the delay time.

[0048] S50, train the MADDPG model using the Markov model.

[0049] S60, when the vehicle generates a task, the vehicle synchronizes the task to the digital twin corresponding to the vehicle.

[0050] S70, the digital twin uses the trained MADDPG model to calculate the vehicle task, obtains the optimized delay, unloading plan and allocation plan corresponding to the vehicle task, and synchronizes them to the vehicle.

[0051] Specifically, after receiving the calculated unloading plan and allocation plan, the vehicle can unload to the edge server for calculation according to the unloading plan and allocation plan; when the vehicle generates multiple tasks, the solution of the present application can first synchronize the tasks to the digital twin of the vehicle, and then the digital twin of the vehicle can use the MADDPG model trained by the Markov model to perform calculation and analysis on the vehicle tasks, and then obtain the optimized delay and unloading plan and allocation plan for multiple vehicle tasks. Since there is a corresponding relationship in data mapping between the vehicle and the digital twin, the vehicle user can quickly obtain a better task unloading and allocation plan; that is, in a single time slot and multi-task scenario, the real-time computing resources of the edge server are intelligently and quickly allocated to the multiple tasks generated by the vehicle.

[0052] In one embodiment, the step of calculating the communication rate between the vehicle and the edge server may be specifically performed as follows: Establish a communication model, which is used for data communication between vehicles, digital twins, and edge servers; take the number of vehicles N as an example, N vehicles correspond to N V2I links, and N V2I links apply orthogonal frequency division multiple access (OFDMA); that is, N V2I links are pre-allocated to orthogonal sub-bands, where N V2I links occupy N sub-bands. Therefore, the communication rate between the vehicle and the base station can be expressed as:

[0053] in, For communication bandwidth, Transmit power to the vehicle, is the noise power, is the channel gain between the vehicle and the base station; Channel gain between vehicle and base station The calculation process is:

[0054] in, is a small-scale fading, is the large-scale path fading and shadowing, and for small-scale fading , using the general fading model, is calculated as:

[0055] in, Obeys a circularly symmetric complex Gaussian distribution with unit variance, is the correlation coefficient, It is a vehicle In time slot location, is the location of the base station, is the path loss exponent.

[0056] In one embodiment, the step of calculating the delay time of vehicle task processing may be specifically performed as follows: First, represents the task set generated by vehicle n. For each task of the vehicle, it can be expressed as ;in, represents the data size of the kth task generated by vehicle n, The CPU cycles required to process a unit task, is the maximum time limit required for the task. For the processing of computing task k of vehicle n, the digital twin of the vehicle will give a Unloading ratio; specifically, when =0, it means that the vehicle does not unload the task and all tasks are processed locally in the vehicle; When , it means that the vehicle partially offloads the task, that is, part of the task is processed locally, and part is offloaded to the edge server for processing; when , it means that the vehicle completely offloads the task to the edge server for processing.

[0057] Therefore, when a vehicle generates a task, if the vehicle's task If local processing is required, the delay in local processing It can be calculated as:

[0058] in, The unloading ratio given for the digital twin, The amount of data generated for the kth task of the vehicle, The CPU cycles required to process a unit task, The computing resources of the vehicle itself.

[0059] If there is a task that needs to be unloaded in the kth task of vehicle n, the vehicle needs to first transmit the task that needs to be unloaded to the base station of the edge server through the communication model; in this process, the digital twin of the vehicle mapped in the cloud needs to estimate and allocate the computing resources required for the task, and return the calculation results to the vehicle. Based on this information transmission scenario, since the data volume of the calculation results of the digital twin is much smaller than the data volume of the uploaded part, and the communication efficiency of the downlink is higher than the communication efficiency of the uplink; therefore, in the present application scheme, the delay caused by the calculation output results returned to the vehicle is not considered. Therefore, if the vehicle's task Need to offload to edge server processing, the edge processing delay It can be calculated as:

[0060] in, is the communication rate between the vehicle and the edge server, To provide a digital twin of the vehicle for the task Estimated computing resources, is the estimation error; It should be noted that the vehicle’s digital twin is Estimated computing resources This parameter is the data obtained by the digital twin after requesting the MADDPG model; in the actual operation process, in the early stage, the MADDPG model will lack experience due to insufficient training. In this case, the vehicle may take random actions to autonomously explore more actions; therefore, in the early stage of model training processing, This parameter actually comes from the scenario where the vehicle takes random actions; later, as the MADDPG model is continuously trained and optimized, This parameter gradually becomes the parameter directly fed back by the MADDPG model.

[0061] Estimation Error The error between the computing resources and the actual situation caused by the mapping relationship. The estimated error may be positive or negative. Specifically, the estimated error The calculation of is as follows:

[0062] For the task If there are parts that need to be offloaded and parts that need to be processed locally at the same time, it can be considered that the two are executed in parallel. Therefore, if the vehicle's tasks are processed locally and by the edge server at the same time, the required delay time is It can be expressed as:

[0063] That is, for the case where a vehicle task has both a part that needs to be unloaded and a part that needs to be processed locally, the maximum value of the local processing delay and the edge processing delay is used as the required delay time.

[0064] For a single vehicle, since multiple tasks are generated and processed simultaneously, the total delay required to execute all tasks is It can be expressed as:

[0065] That is, for multiple tasks of a single vehicle, the delay time corresponding to the task with the longest delay time among the multiple tasks is taken as the total delay time.

[0066] In one embodiment, the step of constructing a Markov model corresponding to the vehicle may be specifically performed as follows: establishing a state space, an action space, and a reward function of the Markov model respectively; Specifically, the steps of establishing the state space of the Markov model include: Assume that the task set generated by vehicle n is , the estimated deviation of the digital twin corresponding to the vehicle , the position of vehicle n at time slot t and the channel gain between vehicle n and the edge server base station ; Therefore, the state of vehicle n at time slot t can be expressed as:

[0067] The steps to establish the action space of the Markov model include: For each vehicle n, we can use the observed vehicle status Make a move ,action Then including the digital twin will give the uninstall ratio and computational resources estimated by digital twins , therefore, the action of vehicle n at time slot t is:

[0068] The steps to establish the reward function of the Markov model include:

[0069] Among them, among them, and is the weight factor, is the number of tasks generated by the vehicle in a single time slot, The maximum time limit for completing a single task, The delay time when the vehicle is being processed locally and unloaded at the same time, is the number of vehicles, The maximum number of computing resources of the vehicle itself; Furthermore, long-term rewards for:

[0070] in, is the discount factor, Between 0 and 1; Indicates past time, Indicates the communication rate at the past time.

[0071] In one embodiment, the MADDPG model includes an actor network deployed on the vehicle side and a critic network deployed on the edge server; the actor network includes an estimated actor network and a target actor network, and the critic network includes an estimated critic network and a target critic network; the MADDPG model is specifically divided into two parts: centralized training and distributed execution; specifically, since the server manages the critical network of each agent, it can obtain the status and actions of all vehicles. Therefore, when the MADDPG model is centrally trained, the server first obtains the status and actions of all vehicles so that the server can train the estimated critical network of each vehicle, thereby achieving the purpose of maximizing the Q value of the MADDPG model.

[0072] Specifically, the steps of training the MADDPG model using the Markov model include: The Markov model is used to obtain and update the Q value of the critic network in the MADDPG model to maximize the Q value of the critic network.

[0073] Specifically, the steps of obtaining and updating the Q value of the critic network in the MADDPG model using the Markov model to maximize the Q value of the critic network can be specifically performed as follows: a. Get the Q value of the critic network:

[0074]

[0075] in, To estimate the parameters of the critic network, are the parameters of the target critic network; b. Calculate the loss function: Since the critic network consists of Parameter control, so in order to obtain the optimal parameters, you need to know the loss function, which can be expressed as:

[0076] in, is the time difference error, The calculation formula is:

[0077] c. Update the critic network parameters by stochastic gradient descent ; Specifically, in order to minimize the loss function, the present application scheme updates the critic network parameters by stochastic gradient descent. :

[0078] It should be noted that since the distributed execution of the actor network is deployed on the vehicle, the vehicle takes specific actions by observing the local state of the vehicle. Therefore, for the parameter update scheme of the actor network, we use the gradient descent method:

[0079] in, Represents the action strategy taken by vehicle n based on the current local state.

[0080] d. Soft update the parameters of the target critic network: Specifically, during the training of the MADDPG model, in order to ensure the stability of the algorithm, the present application performs soft updates on the parameters of the target actor network and the target critic network respectively:

[0081]

[0082] in, is the parameter update rate, between 0 and 1. and are the parameters of the estimated target actor network and the estimated actor network, respectively.

[0083] In one embodiment, the digital twin uses the trained MADDPG model to calculate the vehicle task, obtains the optimized delay, unloading plan and allocation plan corresponding to the vehicle task and synchronizes them to the vehicle. The steps can be specifically performed as follows: The digital twin will calculate the total delay of the task The optimized time delay is input into the MADDPG model for solution calculation; the local state of the vehicle is input into the MADDPG model for solution calculation to obtain the unloading plan and allocation plan; finally, the digital twin synchronizes the optimized time delay, unloading plan and allocation plan to the vehicle, so that the vehicle can allocate and unload the current task according to the received optimized time delay, unloading plan and allocation plan. Specifically, after vehicle n observes and obtains the local state, it uses the strategy fed back by the MADDPG model Execute the action; the local state of the vehicle is the state corresponding to the state space of the vehicle in the Markov model mentioned above. It should be noted here again that in the early stage of MADDPG model training, the vehicle follows the strategy When executing actions, the vehicle may not follow the strategy due to the lack of experience of the MADDPG model. Instead of performing actions, the digital twin of the vehicle mentioned above is used to perform random actions to explore more possible actions. Estimated computing resources In the early stage, this parameter actually came from the scenario where the vehicle took random actions; later, as the MADDPG model was continuously trained and optimized, This parameter gradually becomes the parameter directly fed back by the MADDPG model.

[0084] For the above-mentioned trained MADDPG model, this application conducted relevant simulation experiments using the SAC model as a comparison, and proved through simulation experiments that the MADDPG model trained by the present application scheme does have better performance.

[0085] Specifically, refer to Figure 3 , as the number of training iterations increases, the reward curve of the MADDPG model eventually converges to a larger value, while the reward curve of the SAC model always fluctuates. The main reason is that the SAC model only updates the operation based on the local observation of one agent at each epocht, while the operations of other agents remain unchanged. At the same time, a single DQN is shared among all agents, making it impossible for the SAC model to learn a suitable solution.

[0086] Furthermore, from the perspective of the performance comparison of the task processing delay and resource allocation of the vehicle, Figure 4, the present application scheme compares the performance of the MADDPG model and the SAC model in terms of resource utilization. It can be seen that compared with the SAC model, the MADDPG model in the present application scheme uses fewer computing resources. This is mainly because when faced with multiple tasks for a vehicle, the MADDPG model can flexibly allocate computing resources according to the size of each task based on global information. In addition, as the number of vehicles increases, the number of computing resources used by the two models will also increase. This is because an increase in the number of vehicles will also increase the number of tasks that need to be processed in a single time slot. In order to not exceed the task deadline, the vehicle will use more resources. Figure 5 In the present application, the task processing delays of the two algorithms under different estimation errors are also compared. Specifically, the mapping error between the digital twin and the vehicle may cause some processing delays. When the error is positive, that is, ∆f=0.2, the digital twin overestimates the resource allocation required for task processing, thereby allocating more computing resources to the computing tasks, naturally reducing the computing delay. On the contrary, when the error is negative, that is, ∆f=−0.2, due to the underestimation of the digital twin, the resources obtained by the vehicle computing task are reduced, resulting in increased computing delay.

[0087] It should also be noted that the parameters of the simulation experiment conducted in this application solution can be carried out according to the following table:

[0088] Here we further supplement the algorithm settings. The numbers of hidden layer neurons in the actor network and critic network are 300, 100, 6 and 300, 100, 1 respectively; the exploration noise is Gaussian noise.

[0089] Figure 2 FIG. 1 is a flow chart of a method for offloading vehicle-mounted tasks and allocating resources in one embodiment. It should be understood that although Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but the steps are not necessarily executed in the order indicated by the arrows; unless otherwise specified in this document, there is no strict order restriction for the execution of the steps, and the steps may be executed in other orders; and Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0090] Based on the above method, an embodiment of the present application also discloses a vehicle-mounted task offloading and resource allocation device.

[0091] like Figure 6 As shown, the device includes the following modules: A twin system establishment module 601 is used to establish a twin system of a vehicle and a digital twin, wherein the twin system includes a physical layer and a cloud digital twin layer, wherein the physical layer includes a number of vehicles and an edge server, and the cloud digital twin layer is a digital twin of a number of vehicles that constitutes a digital mapping in the cloud; A communication rate calculation module 602, used to calculate the communication rate between the vehicle and the edge server; The delay time calculation module 603 is used to calculate the delay time of vehicle task processing; A Markov model building module 604, configured to build a Markov model corresponding to the vehicle according to the communication rate and the delay time; A MADDPG model training module 605, for training the MADDPG model using a Markov model; The vehicle task synchronization module 606 is used for synchronizing the task to the digital twin corresponding to the vehicle when the vehicle generates a task; The unloading plan calculation module 607 is used to calculate the vehicle task using the trained MADDPG model, obtain the unloading plan and allocation plan corresponding to the vehicle task and synchronize them to the vehicle.

[0092] In one embodiment, the communication rate calculation module 602 is specifically used for the communication rate between the vehicle and the edge server. It can be expressed as:

[0093] in, For communication bandwidth, Transmit power to the vehicle, is the noise power, is the channel gain between the vehicle and the base station; Channel gain between vehicle and base station The calculation process is:

[0094] in, is a small-scale fading, is the large-scale path fading and shadowing, and for small-scale fading , using the general fading model, is calculated as:

[0095] in, Obeys a circularly symmetric complex Gaussian distribution with unit variance, is the correlation coefficient, It is a vehicle In time slot location, is the location of the base station, is the path loss exponent.

[0096] In one embodiment, the delay time calculation module 603 is specifically used when a vehicle generates a task. If local processing is required, the delay in local processing It can be calculated as:

[0097] in, The unloading ratio given for the digital twin, The amount of data generated for the kth task of the vehicle, The CPU cycles required to process a unit task, The computing resources of the vehicle itself; If the vehicle's mission Need to offload to edge server processing, the edge processing delay It can be calculated as:

[0098] in, is the communication rate between the vehicle and the edge server, To provide a digital twin of the vehicle for the task Estimated computing resources, is the estimation error; Estimation Error is the error between the computing resources caused by the mapping relationship and the actual situation, the estimated error The calculation of is as follows:

[0099] If the vehicle's tasks are processed locally and on the edge server at the same time, the required delay time It can be expressed as:

[0100] For multiple tasks generated by a single vehicle processing them simultaneously, the total latency of executing all tasks It can be expressed as:

[0101] In one embodiment, the Markov model building module 604 is specifically used to establish a Markov state space :

[0102] in, The set of tasks generated for the vehicle, is the estimated deviation of the digital twin corresponding to the vehicle, is the position of the vehicle in the time slot, is the channel gain between the vehicle and the base station; Building a Markov action space : The vehicle is based on the observed state , make an action ; Vehicles in the gap The action is:

[0103] in, is the uninstall ratio, Estimated computational resources for the digital twin; Building the Markov Reward Function :

[0104] in, and is the weight factor, is the number of tasks generated by the vehicle in a single time slot, for The maximum time limit for completing a single task, The delay time when the vehicle is being processed locally and unloaded at the same time, is the number of vehicles, The maximum number of computing resources of the vehicle itself; Long-term rewards are :

[0105] in, is the discount factor, Between 0 and 1; Indicates past time, Indicates the communication rate at the past time.

[0106] In one embodiment, the MADDPG model includes an actor network deployed on the vehicle side and a critic network deployed on the edge server; the MADDPG model training module 605 is specifically used to obtain and update the Q value of the critic network in the MADDPG model using the Markov model to maximize the Q value of the critic network.

[0107] In one embodiment, the critic network includes an estimated critic network and a target critic network; the MADDPG model training module 605 is also used to obtain the Q value of the critic network:

[0108]

[0109] in, To estimate the parameters of the critic network, are the parameters of the target critic network; Calculate the loss function:

[0110] in, is the time difference error, The calculation formula is:

[0111] Update the critic network parameters via stochastic gradient descent :

[0112] Soft update the parameters of the target critic network:

[0113] in, is the parameter update rate, between 0 and 1.

[0114] In one embodiment, the offloading solution calculation module 607 is specifically used for the digital twin to calculate the total delay of the task The optimized delay input to the MADDPG model for solution calculation; The digital twin inputs the local state of the vehicle into the MADDPG model to solve and calculate the unloading plan and allocation plan; The digital twin synchronizes the optimized latency as well as the unloading and allocation plans to the vehicle.

[0115] The embodiment of the present application also discloses a computer device.

[0116] Specifically, the computer device includes a memory and a processor, and the memory stores a computer program that can be loaded by the processor and execute the above-mentioned vehicle-mounted task unloading and resource allocation method.

[0117] The embodiment of the present application also discloses a computer-readable storage medium.

[0118] Specifically, the computer-readable storage medium stores a computer program that can be loaded by a processor and executes the above-mentioned vehicle task unloading and resource allocation method. The computer-readable storage medium includes, for example: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0119] This specific embodiment is merely an explanation of the present invention and is not a limitation of the present invention. After reading this specification, those skilled in the art may make non-creative modifications to the present embodiment as needed. However, as long as they are within the scope of the claims of the present invention, they are protected by the patent law.

Claims

1. A vehicle-mounted task offloading and resource allocation method, characterized in that: The method comprises: Establishing a twin system of vehicles and digital twins, wherein the twin system includes a physical layer and a cloud digital twin layer, wherein the physical layer includes a number of vehicles and edge servers, and the cloud digital twin layer is a digital twin of a number of vehicles that constitutes a digital mapping in the cloud; Calculate the communication rate between the vehicle and the edge server; Calculate the delay time of vehicle task processing; Constructing a Markov model corresponding to the vehicle according to the communication rate and the delay time; Use the Markov model to train the MADDPG model; When a vehicle generates a task, the vehicle synchronizes the task to the digital twin corresponding to the vehicle; The digital twin uses the trained MADDPG model to calculate the vehicle tasks, obtains the optimized delay, unloading plan and allocation plan corresponding to the vehicle tasks, and synchronizes them to the vehicle.

2. The method according to claim 1, characterized in that The calculation of the communication rate between the vehicle and the edge server includes: Communication rate between vehicle and edge server It can be expressed as: ,in, For communication bandwidth, Transmit power to the vehicle, is the noise power, is the channel gain between the vehicle and the base station; Channel gain between vehicle and base station The calculation process is: ,in, is a small-scale fading, is the large-scale path fading and shadowing, and for small-scale fading , using the general fading model, is calculated as: ,in, Obeys a circularly symmetric complex Gaussian distribution with unit variance, is the correlation coefficient, It is a vehicle In time slot location, is the location of the base station, is the path loss exponent.

3. The method according to claim 1, characterized in that The calculation of the delay time of vehicle task processing includes: When a vehicle generates a task, if the vehicle's task If local processing is required, the delay in local processing It can be calculated as: ,in, The unloading ratio given for the digital twin, The amount of data generated for the kth task of the vehicle, The CPU cycles required to process a unit task, The computing resources of the vehicle itself; If the vehicle's mission Need to offload to edge server processing, the edge processing delay It can be calculated as: ,in, is the communication rate between the vehicle and the edge server, To provide a digital twin of the vehicle for the task Estimated computing resources, is the estimation error; Estimation Error is the error between the computing resources caused by the mapping relationship and the actual situation, the estimated error The calculation of is as follows: If the vehicle's tasks are processed locally and on the edge server at the same time, the required delay time is It can be expressed as: , for a single vehicle processing multiple tasks generated simultaneously, the total delay in executing all tasks is It can be expressed as:

4. The method according to claim 1, characterized in that: The constructing of the Markov model corresponding to the vehicle comprises: Building a Markov state space : ,in, The set of tasks generated for the vehicle, is the estimated deviation of the digital twin corresponding to the vehicle, is the position of the vehicle in the time slot, is the channel gain between the vehicle and the base station; Building a Markov action space : The vehicle is based on the observed state , make an action ; Vehicles in the gap The action is: ,in, is the uninstall ratio, Estimated computational resources for the digital twin; Building the Markov Reward Function : ,in, and is the weight factor, is the number of tasks generated by the vehicle in a single time slot, for The maximum time limit for completing a single task, The delay time when the vehicle is being processed locally and unloaded at the same time, is the number of vehicles, The maximum number of computing resources of the vehicle itself; Long-term rewards are : ,in, is the discount factor, Between 0 and 1; Indicates past time, Indicates the communication rate at the past time.

5. The method according to claim 1, characterized in that The MADDPG model consists of an actor network deployed on the vehicle side and a critic network deployed on the edge server; The use of the Markov model to train the MADDPG model includes: The Markov model is used to obtain and update the Q value of the critic network in the MADDPG model to maximize the Q value of the critic network.

6. The method according to claim 5, characterized in that The critic network includes an estimated critic network and a target critic network; The method of obtaining and updating the Q value of the critic network in the MADDPG model by using the Markov model includes: Get the Q value of the critic network: , ,in, To estimate the parameters of the critic network, are the parameters of the target critic network; Calculate the loss function: ,in, is the time difference error, The calculation formula is: , update the critic network parameters by stochastic gradient descent : , soft update the parameters of the target critic network: ,in, is the parameter update rate, between 0 and 1.

7. The method according to claim 1, characterized in that The digital twin calculates the vehicle task using the trained MADDPG model, obtains the optimized delay, unloading scheme and allocation scheme corresponding to the vehicle task and synchronizes them to the vehicle, including: The digital twin will calculate the total delay of the task Input into MADDPG model to solve and calculate to get the optimized delay; The digital twin inputs the local state of the vehicle into the MADDPG model to solve and calculate the unloading plan and allocation plan; The digital twin synchronizes the optimized latency as well as the unloading and allocation plans to the vehicle.

8. A vehicle-mounted task unloading and resource allocation device, characterized in that: The device comprises: A twin system establishment module (601) is used to establish a twin system of a vehicle and a digital twin, wherein the twin system includes a physical layer and a cloud digital twin layer, wherein the physical layer includes a plurality of vehicles and an edge server, and the cloud digital twin layer is a digital twin of a plurality of vehicles that constitutes a digital mapping in the cloud; A communication rate calculation module (602), used to calculate the communication rate between the vehicle and the edge server; A delay time calculation module (603), used to calculate the delay time of vehicle task processing; A Markov model building module (604), configured to build a Markov model corresponding to the vehicle according to the communication rate and the delay time; A MADDPG model training module (605), used to train the MADDPG model using a Markov model; A vehicle task synchronization module (606), configured to synchronize the task to the digital twin corresponding to the vehicle when the vehicle generates a task; The unloading plan calculation module (607) is used to calculate the vehicle task using the trained MADDPG model, obtain the unloading plan and allocation plan corresponding to the vehicle task and synchronize them to the vehicle.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program which can be loaded by the processor and executes the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Edge cloud extensible task unloading method based on multiple agents

    CN113064671A

  • Task unloading method, system and equipment for power internet of things, and medium

    CN117528657A

  • Digital twinning enabled industrial internet of things resource allocation system and method

    CN117749635A

  • Task processing method for edge computing of Internet of Vehicles

    CN117956523A

Cited By

  • Task unloading strategy determination and resource allocation method for vehicle edge computing network

    CN120075227A

  • Digital twin assisted vehicle task unloading and computing resource allocation optimization method

    CN120111575A

  • Optimization Method for Vehicle Task Offloading and Computing Resource Allocation Assisted by Digital Twin

    CN120111575B