Method for preferentially sensing task unloading in vehicle-mounted fog computing based on SAC

By adopting SAC-based on-vehicle fog calculation method in the Internet of Vehicles, the task offloading strategy is optimized, and the problem of difficult to effectively consider task priority and service availability in traditional methods is solved, and the effect of maximizing task effectiveness and reducing delay in a dynamic environment is achieved.

CN120166460APending Publication Date: 2025-06-17HANGZHOU DIANZI UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510317109.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

In the Internet of Vehicles, traditional task offloading methods are difficult to effectively consider the priority of tasks and the service availability of adjacent vehicles, resulting in some tasks with strict delay requirements being unable to be completed within the maximum delay, and dynamically adjusting the unloading strategy to optimize task effectiveness is a challenge.

Method used

Using Soft Actor-Critic (SAC)-based on-vehicle fog calculation method, we will optimize the task offload strategy by introducing task priority awareness and service vehicle availability assessment, combined with deep reinforcement learning. In the cloud-fog fusion network scenario of V2V communication, this method uses a dynamic pricing mechanism to encourage vehicles to share computing resources and maximize the average utility.

Benefits of technology

It maximizes task effectiveness and reduces delays in a dynamic environment, improves the performance and efficiency of the Internet of Vehicles system, and ensures efficient on-board task unloading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120166460A_ABST
    Figure CN120166460A_ABST
Patent Text Reader

Abstract

The invention discloses a method for preferentially sensing task unloading in vehicle-mounted fog computing based on SAC. According to the method, firstly, task states are obtained, task data are obtained, the cost for completing task payment is set, and time delay and task effectiveness are calculated according to the task data. Secondly, obtaining a vehicle service ratio according to the time delay of task completion and the speeds and positions of the task vehicle and the service vehicle, and judging whether the service vehicle accepts task unloading or not; and finally, according to the task utility and the cost paid for completing the task, determining a reward function of an SAC algorithm, and through training of the SAC algorithm, selecting an optimal service vehicle to perform task unloading. According to the method, the task unloading strategy can be quickly converged and optimized in a high-dynamic and uncertain Internet of Vehicles environment, and the task utility is maximized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of fog computing optimization in the Internet of Vehicles (IoV), and particularly relates to a task offloading method with priority perception in vehicle-mounted fog computing based on Soft Actor-Critic (SAC). Background Art

[0002] With the rapid development of 5G technology, the Internet of Vehicles (IoV), as the core technology of intelligent transportation systems, demonstrates great application potential. The IoV can achieve real-time data exchange and collaborative processing through the communication between vehicles and other vehicles, infrastructure, and cloud servers. However, due to the long distance of data processing in the traditional cloud computing architecture, there are significant latency problems, making it difficult to meet the requirements of the IoV for low latency and high real-time performance. To overcome these limitations, fog computing has been introduced into the IoV, deploying computing resources to the network edge, close to the data source, reducing latency and improving task processing efficiency. Especially in the Vehicle-to-Vehicle (V2V) communication scenario, vehicles can directly exchange data and allocate tasks, further reducing the dependence on cloud servers.

[0003] However, although fog computing and V2V communication have advantages in reducing latency, with the expansion of the scale of the IoV, problems in the task offloading process become increasingly prominent. Task offloading in V2V communication requires coordinating computing and communication resources among multiple nodes such as task vehicles and service vehicles, and there are significant differences in energy consumption among each node. Especially in a dynamic network environment, how to reasonably allocate offloading tasks to ensure latency requirements has become an important challenge in task offloading in the IoV. The instability of V2V communication links and the mobility of service vehicles further increase the complexity of task offloading.

[0004] Traditional task offloading methods rarely consider the priority of tasks and the service availability of adjacent vehicles. All tasks have the same probability of being offloaded to the server and obtaining corresponding computing resources, and some tasks with strict latency requirements may not be completed within the maximum latency. In addition, factors such as payment costs related to task offloading need to be considered, dynamically adjusting the offloading strategy, optimizing task utility, so as to improve the overall efficiency and resource utilization efficiency of the IoV system. Summary of the Invention

[0005] To address the above problems, the present invention proposes a method for prioritized perception task offloading in SAC-based vehicular fog computing. In the scenario of a cloud-edge fusion network based on V2V (Vehicle-to-Vehicle) communication, by introducing task priority perception and service vehicle availability assessment, and combining deep reinforcement learning to optimize the task offloading strategy, the aim is to address the problems existing in the existing system. By considering task priority, vehicle mobility, and service availability, and adopting a dynamic pricing mechanism to incentivize vehicles to share computing resources, the average utility is maximized within a certain period of time, and the performance and efficiency of the vehicle networking system are improved. To achieve efficient vehicular task offloading, the task utility is maximized and the latency is reduced in a dynamic environment.

[0006] To achieve the above objectives, the present invention adopts the following technical solutions:

[0007] A method for prioritized perception task offloading in SAC-based vehicular fog computing includes the following steps:

[0008] S1. Obtain the task status to get task data;

[0009] The task data includes: the size D of the input data n , the CPU cycle computation amount C required for task computation, the latency constraint τ n , the priority k of the task n , the total number of vehicles K, the computing power f of the task vehicle t , the computing power f of the service vehicle k , the location x of the task vehicle t , the velocity v of the task vehicle t , the location x of the service vehicle k , the velocity v of the service vehicle k . The channel bandwidth B allocated between the task vehicle and the service vehicle t , the power p of the uplink up , the noise power p in the channel;

[0010] S2. Set the cost for completing the task payment, and calculate the latency and task utility according to the task data;

[0011] S3. Obtain the vehicle service ratio based on the latency for completing the task, the velocities and locations of the task vehicle and the service vehicle, and determine whether the service vehicle accepts the task offloading;

[0012] S4. Determine the reward function of the SAC algorithm according to the task utility and the cost for completing the task payment;

[0013] S5. Through the training of the SAC algorithm, select the optimal service vehicle for task offloading.

[0014] As a preferred solution, in step S2, calculating the latency includes:

[0015] Calculate the latency of local execution of the computing task and the latency of offloading it to the service vehicle. The latency required for the task to be executed locally is called the local latency, and the latency of offloading the task to the service vehicle for execution is called the offloading latency;

[0016] The actual latency of the user is the maximum of the local latency and the offloading latency;

[0017] The latency of local execution of the computing task The latency of offloading to the service vehicle for execution and the transmission rate r t :

[0018]

[0019]

[0020] where k is the set bandwidth allocation, and O n represents the proportion of the computing task retained locally. is the time for transmitting the task, is the time required for the computing task. p up is the power of the uplink, g in is the channel gain, p is the noise power in the channel, α0 is the reference channel gain at a distance of 1m, which is -30dB, and d t is the distance between the task vehicle and the service vehicle. The transmission time of the calculation result is ignored when calculating the offloading latency of the computing task, because generally, for some tasks, the size of the input task data is much larger than the data obtained after the task is processed to a certain extent. Among the local computing latency and the offloading computing latency, the actual latency is the maximum of the two

[0021]

[0022] As a preferred solution, in the step S2, calculating the task utility includes:

[0023] Task utility function:

[0024]

[0025] where ω is different weight factors for different task priorities. The weight factor of a high-priority task is greater than that of a low-priority task, so as to ensure that the utility obtained by successfully executing a high-priority task may be greater than the utility obtained by executing a low-priority task.

[0026] Set the cost ρ for completing the task payment. Within a certain range, associate it with the utility, so that it is necessary to consider paying an appropriate unit price to incentivize the service vehicle to share its computing resources, and at the same time consider whether the unit price paid can maximize the utility of task offloading as much as possible

[0027] u n = u a - ρ (7)

[0028] Among them, u n is the final task utility.

[0029] As an optimal solution, in step S3, consider the availability of the service vehicle. According to the V2V link duration and service probability, judge whether the service vehicle can meet the task delay requirement. First, not all vehicles can be service vehicles that provide computing resources for the task vehicle, because the total delay of the task offloading process may exceed the contact time between the task vehicle and the service vehicle. This is the vehicle service availability that needs to be considered in step S3. To evaluate the vehicle service availability, first represent the V2V link duration between the task vehicle and the service vehicle as:

[0030]

[0031] Among them, R represents the V2V communication range. To better evaluate the vehicle service availability, introduce a concept called Service Ratio (SR), which depends on both the probability that the vehicle is willing to accept the task, called the service probability, and the V2V link duration between the task vehicle and the service vehicle. Denote SR as β k , expressed as

[0032]

[0033] Among them, ε k is the probability that the service vehicle accepts the task. Given a threshold of SR, if the value of β k is greater than the threshold, it indicates that the service vehicle can accept the request of the task vehicle, otherwise it rejects the offloading request.

[0034] As an optimal solution, in step S4, determine the reward function, including:

[0035] The average utility of executing the task within one period is the reward function R:

[0036]

[0037] Among them, there are T time slots within one period, and in each time slot, a task offloading process will be executed once.

[0038] The present invention has the following technical effects compared with the prior art:

[0039] (1) A VFC framework considering task priorities is established. In this framework, computing tasks have different priority attributes, corresponding to different reward and punishment situations. In addition, in order to encourage service vehicles to share idle computing resources, a pricing mechanism is introduced. The service availability of vehicles is evaluated and modeled. By comprehensively considering the link duration and service ratio, the service availability of vehicles can be better evaluated.

[0040] (2) The SAC algorithm is adopted. By introducing policy entropy, the system can make effective task offloading decisions when facing complex vehicle mobility and dynamic environments. The robustness of the SAC algorithm enables the system to adapt to changing environments, ensuring that in a highly dynamic and uncertain vehicle networking environment, the task offloading strategy can quickly converge and be optimized, achieving the maximization of task utility. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a flowchart of a priority-aware task offloading method in SAC-based vehicular fog computing;

[0042] Figure 2 It is a network model diagram of a priority-aware task offloading method in SAC-based vehicular fog computing;

[0043] Figure 3 It is a schematic diagram of the average utility of the present invention and RBA over a period of time;

[0044] Figure 4 It is a schematic diagram of the average utility of offloading tasks under different learning rates of the present invention;

[0045] Figure 5 It is a comparison schematic diagram of the present invention and RBA in terms of offloading task completion time. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0046] The following specific embodiments illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.

[0047] Such as Figure 1As shown in the figure, the method for preferentially perceiving task offloading in SAC vehicle-mounted fog computing of this embodiment is based on V2V communication technology. By using this model, the average utility of task execution is maximized and the time delay is minimized to obtain an optimal offloading scheme. The method includes the following steps:

[0048] S1. Obtain task status.

[0049] The information of the status includes: the size D of the input data n , the CPU cycle calculation amount C required for task calculation, the delay constraint τ n , the priority k of the task n , and the priority of the task is marked by k n , the total number of vehicles K, the computing power f of the task vehicle t , the computing power f of the service vehicle k , the position x of the task vehicle t , the speed v of the task vehicle t , the position x of the service vehicle k , the speed v of the service vehicle k . The channel bandwidth B allocated between the task vehicle and the service vehicle t , the uplink power p up , and the noise power p in the channel;

[0050] S2 Performance analysis. Set the cost of completing the task payment, and calculate the time delay and task utility according to the task data.

[0051] Furthermore, the step S2 includes the following steps:

[0052] S2.1 Calculate the time delay; the time delay mainly consists of two parts, the transmission time delay and the calculation time delay. At the same time, the calculation task can be partly left in the vehicle locally and partly offloaded to the service vehicle for execution. If the calculation task is executed in the task vehicle itself, then the delay of this task only depends on the computing power of the vehicle, the size of the input data, and the number of CPU cycles required to process each bit. This part of the time delay is considered the local time delay. When the task is offloaded to the service vehicle, the time delay is jointly determined by the data transmission time (calculated according to the channel bandwidth, transmission power, and channel gain) and the calculation time delay of the service vehicle. This part of the time delay is considered the offloading time delay. Considering the situations of local processing and remote offloading comprehensively, the larger value of the two is taken as the total time delay of the task, so as to accurately reflect the delay of the entire offloading process.

[0053] S2.2 Calculate the task utility;

[0054] Task utility is an important metric for measuring the performance of offloading schemes, reflecting the benefits obtained when a task is completed within the specified deadline or the penalties incurred when it fails to be completed on time. When designing the task utility function, the deadline of the task, the actual completion time, and the task weight factor are introduced. For high-priority tasks, since they have higher requirements for system performance, if the task is completed within the deadline, a relatively large positive utility is obtained; otherwise, if the deadline is exceeded, a relatively large negative utility is incurred as a penalty. For low-priority tasks, both their positive and negative utilities are relatively low to reflect the differential impact of task priority on utility.

[0055] To incentivize service vehicles to share computing resources, the task vehicle needs to pay a certain unit price to the service vehicle. The payment cost directly affects the net utility of the offloading task. By introducing a payment cost function to relate the unit price and the task resource demand, it is ensured that while motivating service vehicles to participate in resource sharing, the overall utility of task offloading is maximized.

[0056] S2.3 Evaluate the vehicle service availability.

[0057] Vehicle service availability refers to whether a stable and reliable V2V communication link can be established between the task vehicle and the candidate service vehicle during the task offloading process, and the service vehicle is willing to accept the offloading task. First, calculate the V2V link duration between the task vehicle and the service vehicle; this time depends on the relative positions, speeds of the two vehicles, and the V2V communication range. Second, define the service ratio (SR), which comprehensively considers the probability of the service vehicle accepting the task and the link duration. Finally, set a threshold for SR. When the SR of the candidate service vehicle is greater than this threshold, its service is considered available and can be used as an alternative for task offloading; otherwise, this service vehicle is not considered.

[0058] S3. Determine the optimization problem.

[0059] The core objective of the optimization problem is to maximize the average utility of task offloading over a period of time while satisfying the delay constraint in the entire vehicular network offloading process. Specifically: taking the average value of the utility values obtained during the task offloading process in all time slots as the objective, considering the sum of the positive utility of task completion and the negative utility of overdue penalties. At the same time, it is constrained by the delay constraint and vehicle service availability, so as to maximize the overall utility of all tasks over a period of time.

[0060] S4. Define the state space and action space.

[0061] To enable the agent to accurately describe the current vehicle networking environment and task status and make reasonable offloading decisions, it is necessary to carefully characterize the status information and optional actions. The status description should include all key factors that can reflect the current situation of the system, including the basic information of the vehicle, such as the current positions, speeds, and remaining computing resources of the task vehicle and candidate service vehicles; the attributes of the current task, such as the data size, the amount of computing required for the task, the task deadline, and the task priority; for the action space, at each decision-making moment, the agent needs to select a set of offloading parameters, which include: selecting a candidate vehicle as the task offloading target, that is, determining which service vehicle to send the task to; determining the unit price that the task vehicle pays to the service vehicle, which directly affects the enthusiasm of the vehicle to share resources; deciding the resource allocation ratio between local execution of the task and offloading to the service vehicle.

[0062] The design of the action space requires that each decision can reflect the actual resource situation of the vehicle and the task requirements, ensuring that the subsequent offloading process can not only meet the latency constraints but also obtain a higher overall utility.

[0063] S5. Reward function design.

[0064] When the task is completed within the deadline, a positive reward is given; if it exceeds the deadline, a negative reward is given. For high-priority tasks, the reward and punishment are more severe to reflect their higher impact on the system utility.

[0065] Offloading tasks requires paying fees to incentivize service vehicles, and the payment cost will directly deduct the utility obtained by the task. The reward design should consider both the task completion utility and the cost expenditure, so that the decision-making not only pursues the timely completion of the task but also strives to reduce costs.

[0066] The reward function aims to guide the agent to select the strategy that maximizes the utility of the entire offloading process, that is, while ensuring the timely completion of the task, improving the overall utility by reasonably controlling costs. The feedback mechanism prompts the agent to continuously adjust the strategy, so as to obtain a higher average utility in multiple decision-making.

[0067] S6. Task offloading strategy based on SAC

[0068] S6.1 Initialize the experience replay pool, parameter setting, etc.

[0069] Initialize the experience replay pool M, set parameters such as the learning rate δ, batch size β, discount factor γ, etc.

[0070] S6.2 Collect the task offloading requests and vehicle environment status s of the task vehicle t 。

[0071] S6.3 Generate actions using the policy network of the SAC algorithm to determine actions a such as the service vehicle number, payment cost, and offloading ratio t 。

[0072] S6.4 The environment returns the immediate reward r t and generates the next state s t+1 。

[0073] S6.5 Store (s t , a t , r t , s t+1 ) as a tuple in the experience replay pool M

[0074] S6.6 Take out a batch of β tuples from M and update the network parameters

[0075] S6.7 Repeat the process from S6.2 to S6.6 until the stopping condition is met

[0076] S7. Obtain the optimal solution

[0077] Select the optimal task offloading strategy through the SAC algorithm, including the optimal service vehicle selection, payment cost, and offloading ratio

[0078] S8. Execute task offloading

[0079] According to the optimal strategy, offload the tasks to the service vehicles, ensuring that the task offloading strategy is dynamically adjusted according to the vehicle service availability to minimize the delay and maximize the task utility

[0080] Example

[0081] This example is applicable to the vehicle-to-everything (V2X) network model based on fog computing. The model diagram is referred to Figure 2 as shown. In this network, the edge devices mainly include in-vehicle devices (such as in-vehicle sensors, driver assistance systems, and intelligent transportation devices, etc.). These devices are interconnected through vehicle-to-vehicle (V2V) communication and use vehicle nodes acting as fog nodes for task transmission. As fog computing nodes, vehicle nodes can process the computing tasks of surrounding vehicles nearby, reducing the delay of the transmission system and improving the computing efficiency of the system. It is applicable to the V2X scenario with strong dynamics and low latency requirements. The following assumptions are made in this example

[0082] (1) The tasks generated by the edge devices can be divided into two subtasks according to a certain proportion. One subtask is executed locally, and the other subtask is offloaded to the service vehicle for computing

[0083] (2) Since the computing results are usually relatively small, the transmission time of the computing results in task offloading is ignored

[0084] (3) Assume that there is no waiting time for task offloading in the V2V mode, which can meet the delay-sensitive task offloading.

[0085] Specifically, the method for preferential perception task offloading in the vehicle-mounted fog computing based on SAC in this embodiment includes the following steps:

[0086] S1. Obtain task status.

[0087] The information of the status includes: the size D of the input data n , the CPU cycle computation amount C required for task computation n , the delay constraint τ n , the deadline or maximum tolerated delay of the task is an important indicator to measure the urgency of the task. The stricter the delay constraint, the shorter the time within which the task must be completed, and the task priority k n , the task priority determines the importance of the task in resource scheduling. High-priority tasks usually involve key requirements such as safety and real-time performance, and their successful completion has a greater impact on the overall utility of the system. Therefore, introducing the task priority into the status information can help the decision-making strategy distinguish the urgency of tasks, so as to give more resources and faster responses to high-priority tasks when allocating offloading resources. The total number of vehicles K represents the number of vehicles participating in cooperation in the system; the computing power f of the task vehicle t , the computing power f of the service vehicle k , the location x of the task vehicle t , the speed v of the task vehicle t , the location x of the service vehicle k , the speed v of the service vehicle k , for the task vehicle and the service vehicle, their location information and speed are key factors in judging the stability of the communication link between vehicles. The channel bandwidth B allocated between the task vehicle and the service vehicle t , the power p of the uplink up , the noise power p in the channel;

[0088] S2 Performance analysis.

[0089] Furthermore, step S2 includes the steps:

[0090] S2.1 Calculate the delay of the task;

[0091] S2.2 Calculate the utility of the task;

[0092] S2.3 Evaluate the service availability of the vehicle.

[0093] And in step S2.1:

[0094] The actual task completion delay is the maximum of the local delay and the offloading delay. Determining which one of the local computing delay and the transmission delay is the main factor of the overall communication delay can ensure that when considering the overall communication delay, the focus is placed on the factor that has a greater impact on the delay. The delay of the task executed locally is calculated using the following formula, i.e., the local delay The delay of offloading to the service vehicle for execution, i.e., the offloading delay

[0095]

[0096] where k is the set bandwidth allocation, taking a fixed value of 0.5. O n represents the proportion of the computing task retained locally, and C represents the number of CPU cycles required to process one bit. is the time for the transmission task, is the time required for the computing task. p up is the power of the uplink, g in is the channel gain, p is the noise power in the channel, α0 is the reference channel gain of -30 dB at a distance of 1 m, and d t is the distance between the task vehicle and the service vehicle. Among the local computing delay and the offloading computing delay, the actual task completion delay is the maximum of the two, i.e., the delay of task offloading is:

[0097]

[0098] In step S2.2:

[0099] Calculate the utility obtained by executing the task

[0100]

[0101] where ω is the different weight factors for different task priorities. The weight factor of high-priority tasks is greater than that of low-priority tasks, which can ensure that the utility obtained by successfully executing high-priority tasks may be greater than that of executing low-priority tasks. For high-priority tasks, since they have higher requirements for system performance, if the task is completed within the deadline, a greater positive utility is obtained; otherwise, if it exceeds the deadline, a greater negative utility is generated as a penalty. For low-priority tasks, their positive and negative utilities are both lower to reflect the differential impact of task priorities on utility.

[0102] Calculate the payment cost ρ of the task vehicle:

[0103] u n = u a - ρ (7)

[0104] Among them, the unit price ρ is within a certain range, and it is associated with the utility. In this way, it is necessary to consider paying an appropriate unit price to motivate the service vehicle to share its computing resources, and at the same time consider whether the paid unit price can maximize the utility of task offloading as much as possible.

[0105] In step S2.3:

[0106] Evaluate the service availability of the vehicle, introduce the service ratio SR, and use β k to represent:

[0107]

[0108] Among them, T k represents the duration of the V2V link between the task vehicle and the service vehicle, R represents the communication range of V2V, and ε k is the probability that the service vehicle accepts the task, which is called the service probability. The service ratio SR depends on both the service probability and the duration of the V2V link between the task vehicle and the service vehicle. Given a threshold of SR, if the value of β k is greater than the threshold, it indicates that the service vehicle can accept the request of the task vehicle; otherwise, it rejects the offloading request.

[0109] S3. Determine the joint optimization problem.

[0110] The goal is to design a reasonable payment cost to maximize the task utility while ensuring the task delay requirement. In this system, the core goal of the optimization problem is to maximize the average utility of task offloading within a certain period of time for the entire vehicle network offloading process under the premise of meeting the delay constraint. Specifically: taking the average value of the utility values obtained during the task offloading process in all time slots as the goal, considering the sum of the positive utility of task completion and the negative utility of overdue penalty. At the same time, it is constrained by the delay constraint and vehicle service availability, so as to maximize the overall utility of all tasks within a certain period of time.

[0111] S4. Define the state space and action space.

[0112] State space S and action space A:

[0113] s(t) = [v1(t),…v k (t), x1(t)…, v k (t), f1(t),…, f k (t), D(t), C(t), τ(t), k(t)] (10)

[0114] a t = [k(t), ρ(t), O(t)] (11)

[0115] Among them, the state space S is used to comprehensively reflect the current vehicle networking environment and task characteristics, helping the agent accurately evaluate the potential impacts of different offloading decisions. The state space S includes, at time t, the vehicle speed v of the serving vehicle, the position x of the serving vehicle; the computing power f of the serving vehicle k ; the size D(t) of the input task data; the CPU cycle computation amount C(t) required to complete the task computation; the latency constraint τ(t) of high-priority or low-priority tasks; the priority k(t) of the task. The action space A, on the other hand, clarifies the decision-making content of the agent at each moment, helping to dynamically adjust the offloading strategy, so as to achieve a more optimal task allocation and resource utilization. In the action space A, k(t) represents the number of the serving vehicle selected by the agent at time t, ρ(t) represents the unit price paid to the serving vehicle at time t, and O(t) represents the proportion of the computing task retained for local execution at time t.

[0116] S5. Design of the reward function.

[0117] The average utility R of executing tasks within one cycle:

[0118]

[0119] Among them, in each process, the agent observes the state, selects an action, and then obtains an immediate reward. The reward is the utility obtained from vehicle task offloading, which is related to the priority of the offloaded task, the maximum tolerable delay of the task, and the time to complete the task. There are T time slots within one cycle, and in each time slot, a task offloading process is executed once.

[0120] The experimental results are as Figure 3 shown. The average utilities of the SAC algorithm and RBA over a period of time are studied and compared in the context of vehicle networking task offloading. It can be seen that the average utility of the offloaded tasks in the proposed algorithm reaches convergence after about 2000 training times, and its average utility is significantly higher than that of RBA. Figure 4 Shows the average utility of offloaded tasks in the SAC algorithm under different learning rates. Figure 5 Shows the comparison between the SAC algorithm and RBA in terms of the offloading task completion time. After multiple iterations, the average latency obtained using the SAC algorithm is significantly lower than that using RBA, indicating that the SAC algorithm has better performance in task execution.

[0121] The above is only a detailed description of the preferred embodiments and principles of the present invention. For those of ordinary skill in the art, according to the idea provided by the present invention, there will be changes in the specific implementation manners, and these changes should also be regarded as the protection scope of the present invention.

Claims

1. A method for unloading priority perception tasks in SAC vehicle-mounted fog computing, characterized in that: The following steps are involved: S1. Obtain task status and obtain task data; S2. Set the cost to be paid for completing the task, and calculate the delay and task utility based on the task data; S3, according to the time delay of completing the task, the speed and position of the task vehicle and the service vehicle, the vehicle service ratio is obtained, and it is determined whether the service vehicle accepts the task unloading; S4. Determine the reward function of the SAC algorithm based on the task utility and the cost paid to complete the task; S5. Through the training of SAC algorithm, the optimal service vehicle is selected to perform task offloading.

2. The method for unloading priority sensing tasks in SAC vehicle-mounted fog computing according to claim 1 is characterized in that: The task data includes: the size D of the input data n , the CPU cycle calculation amount C required for task calculation, delay constraint τ n , the priority of the task k n , the total number of vehicles K, the computing power of the mission vehicle f t , the computing power of the service vehicle f k , mission vehicle position x t , mission vehicle position v t , service vehicle position x k , service vehicle speed v k ; Channel bandwidth B allocated between mission vehicle and service vehicle t , the uplink power p up , the noise power p in the channel.

3. The method for unloading priority sensing tasks in SAC vehicle-mounted fog computing according to claim 2 is characterized in that: The specific implementation process of calculating the delay is as follows: Calculate the delay of task execution locally and the delay of offloading to the service vehicle. The delay required for task execution locally is called local delay, and the delay of task offloading to the service vehicle is called offloading delay. The actual user delay is the maximum of the local delay and the offload delay; the delay of the calculation task being executed locally Delay in unloading to service vehicle execution and the transmission rate r t : Where k is the bandwidth allocation set, O n Indicates the proportion of computing tasks retained locally; is the time for the transmission task, To calculate the time required for the task, g in is the channel gain, α0 is the reference channel gain -30dB when the distance is 1m, d t is the distance between the task vehicle and the service vehicle; In the local computing delay and offload computing delay, the actual delay is the maximum of the two.

4. The method for unloading priority sensing tasks in SAC vehicle-mounted fog computing according to claim 3 is characterized in that: The computing task utility includes: Task utility function: Among them, ω is the different weight factors of different task priorities; Set the cost ρ to complete the task: in n =in a -ρ Among them, u n For the ultimate mission utility.

5. The method for unloading priority sensing tasks in SAC vehicle-mounted fog computing according to claim 4 is characterized in that: The specific implementation process of step S3 is as follows: First, the duration of the V2V link between the task vehicle and the service vehicle is expressed as: Where R represents the communication range of V2V; the service ratio β is introduced k , which depends on both the probability that a vehicle is willing to accept a task, called the service probability, and the duration of the V2V link between the task vehicle and the service vehicle, expressed as: Among them, ε k For the probability of the service vehicle accepting the task, set a β k If β k If the value of is greater than the threshold, it indicates that the service vehicle accepts the request of the task vehicle, otherwise it rejects the unloading request.

6. The method for unloading priority sensing tasks in SAC vehicle-mounted fog computing according to claim 5 is characterized in that: In step S4, the reward function is as follows: The average utility of executing a task in a cycle is the reward function R: There are T time slots in one cycle, and in each time slot, a task offloading process is performed.