Task unloading method and device based on edge computing, base station and medium
Through edge computing and DDPG algorithms, different unloading strategies are automatically sorted, which solves the problem of low efficiency in obtaining the optimal unloading strategy in the existing technology, and achieves efficient completion of computing tasks.
Patent Information
- Application Number
- CN202411014902.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-07-26
AI Technical Summary
In the existing task unloading methods, the process of obtaining the optimal unloading strategy is cumbersome, resulting in inefficiency and consuming a lot of manpower and time resources.
Using edge computing-based method, using MEC server and DDPG algorithm, the average reduction delay under different unloading strategies is determined by obtaining the status data of user vehicles and base stations, and automatically sorting, marking the optimal unloading strategy to achieve no manual intervention. Optimal strategy acquisition.
The process of obtaining the optimal uninstall strategy is simplified, manpower and time resources are saved, the efficiency of obtaining the uninstall strategy is improved, and the completion time of computing tasks is reduced.
Smart Images

Figure CN119012280A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a task offloading method, device, base station and medium based on edge computing. Background Art
[0002] With the development of artificial intelligence and Internet of Vehicles technology, various in-vehicle applications have emerged in smart transportation scenarios, such as autonomous driving and automatic navigation. Cloud computing provides remote computing resources for applications, but remote task offloading can lead to unpredictable transmission delays and severe degradation of service quality. Therefore, vehicle edge computing extends cloud computing to the edge of the network with the goal of performing computing near the data source, thereby reducing data transmission delays and meeting the service quality required by user vehicles.
[0003] However, in the existing task offloading methods, the process of obtaining the optimal offloading strategy is cumbersome, which is not conducive to improving the efficiency of obtaining the optimal offloading strategy. The reason is that task offloading usually generates a large number of offloading strategies. If the manual method is used to obtain the optimal offloading strategy from a large number of offloading strategies, the workload will be very huge, and the time to obtain the optimal offloading strategy will be very long, which will consume a lot of human resources and time resources. Therefore, the process of obtaining the optimal offloading strategy is cumbersome, which is not conducive to improving the efficiency of obtaining the optimal offloading strategy. Summary of the invention
[0004] The embodiments of the present application provide a task offloading method, device, base station and medium based on edge computing to solve the technical problem that the process of obtaining the above-mentioned optimal offloading strategy is cumbersome and is not conducive to improving the efficiency of obtaining the optimal offloading strategy.
[0005] In a first aspect, an embodiment of the present application provides a task offloading method based on edge computing, which is applied to a base station equipped with an MEC server, and the task offloading method includes:
[0006] Obtaining the number of pending tasks of the user's vehicle, where the number of pending tasks is the number of pending computing tasks;
[0007] Obtaining a network delay between the user vehicle and the base station;
[0008] Acquire a first computing capability of the user vehicle, and acquire a second computing capability of the MEC server;
[0009] The number of tasks to be processed, the network delay, the first computing capability, and the second computing capability form current state data corresponding to the user vehicle;
[0010] Determine the current task processing time corresponding to the user vehicle according to the preset DDPG algorithm and the current state data, wherein the current task processing time indicates the time taken by the user vehicle and the MEC server to jointly process the number of tasks to be processed;
[0011] Determine the average reduced delay corresponding to different unloading strategies according to the current task processing time, the preset processing time and the total number of the user vehicles corresponding to each of the user vehicles under different unloading strategies;
[0012] The average reduced delays corresponding to the offloading strategies are sorted, and the offloading strategy corresponding to the smallest average reduced delay is marked as the optimal offloading strategy.
[0013] In a possible implementation of the first aspect, obtaining the number of pending tasks of the user vehicle includes:
[0014] Connect to the user vehicle within the coverage area and obtain the number of tasks to be processed of the user vehicle.
[0015] In a possible implementation manner of the first aspect, the acquiring the first computing capability of the user vehicle and the acquiring the second computing capability of the MEC server include:
[0016] Obtain a current CPU usage rate of the user vehicle, set the current CPU usage rate of the user vehicle as the first computing capacity, obtain a current CPU usage rate of the MEC server, and set the current CPU usage rate of the MEC server as the second computing capacity.
[0017] In a possible implementation manner of the first aspect, determining the current task processing time corresponding to the user vehicle according to a preset DDPG algorithm and the current state data includes:
[0018] Obtaining a policy network and a value network in the DDPG algorithm, inputting the current state data into the policy network, and obtaining the current number of offloaded tasks output by the policy network based on the current state data;
[0019] The current state data and the current number of offload tasks are input into the value network, a first reward value output by the value network is obtained, and the current task processing time corresponding to the first reward value is obtained.
[0020] In a possible implementation of the first aspect, determining the average reduced latency corresponding to different unloading strategies according to the current task processing time, the preset processing time, and the total number of the user vehicles corresponding to each of the user vehicles under different unloading strategies includes:
[0021] Obtaining the preset processing time sent by the user vehicle, and determining whether the current task processing time is lower than the preset processing time, wherein the preset processing time is the time it takes for the user vehicle to complete processing the number of tasks to be processed;
[0022] When the current task processing time is lower than the preset processing time, the user vehicle is added to the vehicle set. In the vehicle set, the average reduced delay corresponding to different unloading strategies is determined based on the current task processing time, the preset processing time and the total number of user vehicles corresponding to each user vehicle under different unloading strategies.
[0023] In a possible implementation manner of the first aspect, after sorting the average reduced delays corresponding to the offloading strategies and marking the offloading strategy corresponding to the smallest average reduced delay as the optimal offloading strategy, the task offloading method includes:
[0024] Acquire a target task according to the optimal offloading strategy, where the target task is the computing task offloaded from the user vehicle to the MEC server;
[0025] Obtain a calculation result generated by the MEC server based on the target task, and send the calculation result to the user vehicle.
[0026] In a possible implementation manner of the first aspect, after obtaining a calculation result generated by the MEC server based on the target task and sending the calculation result to the user vehicle, the task offloading method includes:
[0027] A preset storage area is obtained, and the calculation result is stored in the storage area.
[0028] In a second aspect, an embodiment of the present application provides a task offloading device based on edge computing, which is applied to a base station equipped with a MEC server, including:
[0029] A first acquisition module is used to acquire the number of pending tasks of the user's vehicle, where the number of pending tasks is the number of pending computing tasks;
[0030] A second acquisition module, used to acquire the network delay between the user vehicle and the base station;
[0031] A third acquisition module is used to acquire the first computing capacity of the user vehicle and the second computing capacity of the MEC server;
[0032] A composition module, configured to combine the number of tasks to be processed, the network delay, the first computing capability, and the second computing capability into current state data corresponding to the user vehicle;
[0033] A determination module, configured to determine a current task processing time corresponding to the user vehicle according to a preset DDPG algorithm and the current state data, wherein the current task processing time indicates a time for the user vehicle and the MEC server to jointly process the number of tasks to be processed;
[0034] A processing module, configured to determine an average reduced delay corresponding to different unloading strategies according to the current task processing time, the preset processing time and the total number of the user vehicles corresponding to each of the user vehicles under different unloading strategies;
[0035] The marking module is used to sort the average reduced delays corresponding to the various unloading strategies, and mark the unloading strategy corresponding to the smallest average reduced delay as the optimal unloading strategy.
[0036] In a third aspect, an embodiment of the present application provides a base station, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the task offloading methods in the first aspect when executing the computer program.
[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the task offloading method of any one of the above-mentioned first aspects is implemented.
[0038] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a base station, the base station executes the task offloading method described in any one of the above-mentioned first aspects.
[0039] The beneficial effects of the embodiments of the present application lie in two aspects. On the one hand, the average reduced delays corresponding to the various unloading strategies are sorted, and the unloading strategy corresponding to the smallest average reduced delay is marked as the optimal unloading strategy. No manual intervention is required, which can save a lot of human resources and time resources, thereby simplifying the process of obtaining the optimal unloading strategy, which is conducive to improving the efficiency of obtaining the optimal unloading strategy. On the other hand, through the optimal unloading strategy, the completion time of the computing task is reduced, which is conducive to improving the completion efficiency of the computing task. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0041] Figure 1 An application scenario diagram of the task offloading method provided in an embodiment of the present application;
[0042] Figure 2 It is a flowchart of a task offloading method provided in an embodiment of the present application;
[0043] Figure 3 A flowchart for obtaining the average reduced delay provided in an embodiment of the present application;
[0044] Figure 4 A schematic block diagram of a task offloading device provided in an embodiment of the present application;
[0045] Figure 5 A schematic diagram of the structure of a base station provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0047] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0048] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0049] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0050] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0051] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0052] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0053] In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0054] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0055] The task offloading method provided in the embodiment of the present application can be applied to a base station, and the embodiment of the present application does not impose any restrictions on the specific type of the base station.
[0056] See also Figure 1 , Figure 1The application scenario diagram of the task offloading method provided in the embodiment of the present application is described in detail as follows:
[0057] The base station is connected to the user's vehicle through the Internet of Vehicles, and the base station is equipped with a MEC server.
[0058] MEC server, the full name is Multi-access Edge Computing server, also known as edge computing server.
[0059] MEC servers are located at the edge of the network, that is, close to the end user. Compared with traditional cloud servers, they are deployed outside the remote data center. MEC servers realize the edge of computing tasks and data processing functions by deploying virtualization, distribution and containerization technologies at the edge of the network.
[0060] MEC servers provide low-latency computing services, quickly respond to user requests, and reduce delays caused by network transmission. They provide high-bandwidth computing services to meet the needs of applications that require large amounts of data transmission.
[0061] In an embodiment of the present application, the MEC server moves computing tasks and data processing functions to the edge of the network, quickly allocates computing resources according to the needs of user vehicles, and provides real-time data analysis and processing.
[0062] See also Figure 2 , Figure 2 It is a flow chart of the task offloading method provided in an embodiment of the present application, which can be applied to a base station equipped with an MEC server.
[0063] like Figure 2 As shown, the task offloading method provided in the embodiment of the present application includes the following steps, which are described in detail as follows:
[0064] S201, obtaining the number of pending tasks of the user's vehicle, where the number of pending tasks is the number of computing tasks to be processed;
[0065] Among them, there are dependencies between different computing tasks.
[0066] For the sake of illustration, an example is given below:
[0067] For example, there are computing tasks A and computing tasks B.
[0068] Computational task A must be completed before computational task B can be started.
[0069] In a directed acyclic graph, this dependency is represented by a directed edge from computing task A to computing task B.
[0070] The step of obtaining the number of pending tasks of the user's vehicle includes:
[0071] Connect to the user vehicle within the coverage area and obtain the number of tasks to be processed of the user vehicle.
[0072] S202, obtaining a network delay between the user vehicle and the base station;
[0073] S203, obtaining a first computing capability of the user vehicle, and obtaining a second computing capability of the MEC server;
[0074] The obtaining of the first computing capability of the user vehicle and the obtaining of the second computing capability of the MEC server include:
[0075] Obtain a current CPU usage rate of the user vehicle, set the current CPU usage rate of the user vehicle as the first computing capacity, obtain a current CPU usage rate of the MEC server, and set the current CPU usage rate of the MEC server as the second computing capacity.
[0076] The first computing capability of the user vehicle includes the first computing capability of the vehicle that generates the task and the first computing capability of the vehicle that does not generate the task.
[0077] S204, combining the number of tasks to be processed, the network delay, the first computing capability, and the second computing capability into current state data corresponding to the user vehicle;
[0078] Combining the four indicators of the number of pending tasks, the network delay, the first computing capability, and the second computing capability into current status data can comprehensively reflect the current operating status of the system. For example, a four-tuple can be defined to represent the current status data, and the four-tuple includes the number of pending tasks, the network delay, the first computing capability, and the first computing capability.
[0079] S205, determining the current task processing time corresponding to the user vehicle according to the preset DDPG algorithm and the current state data, wherein the current task processing time indicates the time required for the user vehicle and the MEC server to jointly process the number of tasks to be processed;
[0080] Wherein, determining the current task processing time corresponding to the user vehicle according to the preset DDPG algorithm and the current state data includes:
[0081] Obtaining a policy network and a value network in the DDPG algorithm, inputting the current state data into the policy network, and obtaining the current number of offloaded tasks output by the policy network based on the current state data;
[0082] The current state data and the current number of offload tasks are input into the value network, a first reward value output by the value network is obtained, and the current task processing time corresponding to the first reward value is obtained.
[0083] Exemplarily, inputting the current state data and the current number of unloading tasks into the value network, obtaining a first reward value output by the value network, and obtaining the current task processing time corresponding to the first reward value include:
[0084] Inputting the current state data and the current number of unloading tasks into the value network, obtaining a first reward value output by the value network, and determining whether the first reward value is a second reward value;
[0085] If the first reward value is the second reward value, based on the pre-established correspondence between the second reward value and the preset task processing time, obtain the preset task processing time corresponding to the second reward value, and set the preset task processing time corresponding to the second reward value to the current task processing time corresponding to the first reward value.
[0086] Among them, the DDPG algorithm achieves efficient learning in the continuous action space through the collaborative work of the policy network and the value network. The policy network is responsible for generating actions, while the value network is responsible for evaluating the value of these actions.
[0087] S206, determining the average reduced delay corresponding to different unloading strategies according to the current task processing time, the preset processing time and the total number of the user vehicles corresponding to each of the user vehicles under different unloading strategies; illustratively, determining the average reduced delay corresponding to different unloading strategies according to the current task processing time, the preset processing time and the total number of the user vehicles corresponding to each of the user vehicles under different unloading strategies includes:
[0088] The unloading decisions corresponding to each of the user vehicles are obtained, and multiple unloading decisions are combined into an unloading strategy. The reduced delays between the current task processing time and the preset processing time corresponding to each of the user vehicles under the unloading strategy are added to obtain the total reduced delay, and the total reduced delay is divided by the total number of the user vehicles to obtain the average reduced delay corresponding to the unloading strategy.
[0089] Each user vehicle has an optional offloading decision, which includes offloading all tasks to the edge server, offloading part of the tasks to the edge server, executing all tasks locally, or a combination thereof.
[0090] Wherein, based on the unloading decisions corresponding to each of the user vehicles according to the game theory algorithm, multiple unloading decisions are combined into an unloading strategy.
[0091] Among them, the game theory algorithm includes one or a combination of static game algorithms, dynamic game algorithms, and cooperative game algorithms.
[0092] Among them, the preset processing time corresponding to each of the user vehicles under different unloading strategies is subtracted from the current task processing time to obtain the reduced delay corresponding to each of the user vehicles, the reduced delays are added to obtain the total reduced delay, and the total reduced delay is divided by the total number of the user vehicles to obtain the average reduced delay corresponding to the different unloading strategies.
[0093] For the sake of illustration, an example is given below:
[0094] For example, if user vehicle A has 10 computing tasks, it takes 60 seconds for user vehicle A to process the 10 computing tasks; user vehicle B has 20 computing tasks, it takes 60 seconds for user vehicle B to process the 20 computing tasks, and it takes 10 seconds for the MEC server to process the 20 computing tasks;
[0095] Unloading strategy A, user vehicle A unloads 5 tasks to the MEC server, user vehicle B unloads 10 tasks to the MEC server, user vehicle A only needs to process 5 tasks, and the time for user vehicle A to complete the processing of 5 tasks is 30 seconds, user vehicle B only needs to process 10 tasks, and the calculation time of user vehicle B is 30 seconds. The reduced delay of user vehicle A and user vehicle B is 30 seconds respectively. The 30 seconds and 30 seconds are added together to obtain a total reduced delay of 60 seconds. Since there are only user vehicles A and B, the total number is 2, so the average reduced delay of unloading strategy B is 30 seconds.
[0096] Unloading strategy B, user vehicle A unloads 7 tasks to the MEC server, user vehicle B unloads 16 tasks to the MEC server, user vehicle A only needs to process 3 tasks, user vehicle B only needs to process 4 tasks, user vehicle A and user vehicle B each reduce the delay by 42 seconds and 48 seconds, add the 42 seconds and 48 seconds, and the total reduced delay is 90 seconds. Since there are only user vehicles A and B, the total number is 2, so the average reduced delay of unloading strategy B is 45 seconds.
[0097] S207 , sorting the average reduced delays corresponding to the offloading strategies, and marking the offloading strategy corresponding to the smallest average reduced delay as the optimal offloading strategy.
[0098] For the sake of illustration, an example is given below:
[0099] For example, the unloading strategies are unloading strategy A, unloading strategy B, and unloading strategy C; the average delay reduction corresponding to unloading strategy A is 20 seconds, the average delay reduction corresponding to unloading strategy B is 15 seconds, and the average delay reduction corresponding to unloading strategy C is 3 seconds. Therefore, unloading strategy C is marked as the optimal unloading strategy.
[0100] For example, the unloading strategies are unloading strategy A, unloading strategy B, unloading strategy C, and unloading strategy D; the average delay reduction corresponding to unloading strategy A is 10 seconds, the average delay reduction corresponding to unloading strategy B is 15 seconds, the average delay reduction corresponding to unloading strategy C is 30 seconds, and the average delay reduction corresponding to unloading strategy D is 35 seconds. Therefore, unloading strategy A is marked as the optimal unloading strategy.
[0101] Therefore, offloading strategy B is marked as the optimal offloading strategy.
[0102] Wherein, after the average reduced delays corresponding to the various offloading strategies are sorted and the offloading strategy corresponding to the smallest average reduced delay is marked as the optimal offloading strategy, the task offloading method includes:
[0103] Acquire a target task according to the optimal offloading strategy, where the target task is the computing task offloaded from the user vehicle to the MEC server;
[0104] Obtain a calculation result generated by the MEC server based on the target task, and send the calculation result to the user vehicle.
[0105] Among them, the user vehicle offloads the computing tasks to the MEC server, which can significantly reduce the computing time of the user vehicle and improve the overall response speed and performance of the user vehicle.
[0106] For the sake of illustration, an example is given below:
[0107] For example, user vehicle A has 10 computing tasks. It takes 60 seconds for user vehicle A to process the 10 computing tasks, and it takes 10 seconds for the MEC server to process the 10 computing tasks.
[0108] After user vehicle A unloads 3 tasks to the MEC server, user vehicle A only needs to process 7 tasks. The computing time of user vehicle A is 42 seconds, and it takes 3 seconds for the MEC server to process these 3 tasks.
[0109] Therefore, by offloading, the current task processing time is reduced from 60 seconds to 42 seconds.
[0110] For the sake of illustration, an example is given below:
[0111] For example, if user vehicle A has 10 computing tasks, it takes 60 seconds for user vehicle A to process the 10 computing tasks; user vehicle B has 20 computing tasks, it takes 60 seconds for user vehicle B to process the 20 computing tasks, and it takes 10 seconds for the MEC server to process the 20 computing tasks;
[0112] After user vehicle A unloads 5 tasks to the MEC server, user vehicle A only needs to process 5 tasks, and it takes 30 seconds for user vehicle A to process the 5 tasks. After user vehicle B unloads 10 tasks to the MEC server, user vehicle B only needs to process 10 tasks, and the computing time of user vehicle B is 30 seconds. It takes 7.5 seconds for the MEC server to process these 15 tasks.
[0113] Therefore, through offloading, the current task processing time is reduced from 60 seconds to 37.5 seconds, so the calculation time of user vehicle A and user vehicle B can be significantly reduced, thereby improving the overall response speed and performance of user vehicle A and user vehicle B.
[0114] Wherein, after obtaining the calculation result generated by the MEC server based on the target task and sending the calculation result to the user vehicle, the task offloading method includes:
[0115] A preset storage area is obtained, and the calculation result is stored in the storage area.
[0116] Wherein, after obtaining the calculation result generated by the MEC server based on the target task and sending the calculation result to the user vehicle, the task offloading method includes:
[0117] Read the preset upload time and determine whether the current time is the upload time;
[0118] If the current time is the upload time, the monitoring system is connected through the preset network to upload the calculation result to the monitoring system. The preset network includes one of the 3G network, 4G network, 5G network, and WIFI network, or a combination thereof.
[0119] In an embodiment of the present application, the monitoring system uploads the calculation results and can provide the monitoring system with the calculation results. The calculation results can help developers better understand the operating status of the MEC server, thereby formulating more effective task offloading strategies.
[0120] The beneficial effects of the embodiments of the present application lie in two aspects. On the one hand, the average reduced delays corresponding to the various unloading strategies are sorted, and the unloading strategy corresponding to the smallest average reduced delay is marked as the optimal unloading strategy. No manual intervention is required, which can save a lot of human resources and time resources, thereby simplifying the process of obtaining the optimal unloading strategy, which is conducive to improving the efficiency of obtaining the optimal unloading strategy. On the other hand, through the optimal unloading strategy, the completion time of the computing task is reduced, which is conducive to improving the completion efficiency of the computing task.
[0121] See also Figure 3 , Figure 3 The flowchart for obtaining the average reduced delay provided in the embodiment of the present application is described in detail as follows:
[0122] S301, obtaining a preset processing time sent by the user vehicle, and determining whether the current task processing time is lower than the preset processing time, wherein the preset processing time is the time required for the user vehicle to complete processing the number of tasks to be processed;
[0123] S302, when the current task processing time is lower than the preset processing time, the user vehicle is added to the vehicle set. In the vehicle set, the average reduced delay corresponding to different unloading strategies is determined according to the current task processing time, the preset processing time and the total number of user vehicles corresponding to each user vehicle under different unloading strategies.
[0124] Exemplarily, when the current task processing time is lower than the preset processing time, the user vehicle is added to a vehicle set, and in the vehicle set, according to the current task processing time, the preset processing time and the total number of the user vehicles corresponding to each of the user vehicles under different unloading strategies, the average reduced delay corresponding to different unloading strategies is determined, including:
[0125] When the current task processing time is lower than the preset processing time, the user vehicle is added to the vehicle set, and in the vehicle set, the unloading decision corresponding to each of the user vehicles is obtained, and multiple unloading decisions are combined into an unloading strategy, and the reduced delay between the current task processing time and the preset processing time corresponding to each of the user vehicles under the unloading strategy is added to obtain the total reduced delay, and the total reduced delay is divided by the total number of the user vehicles to obtain the average reduced delay corresponding to the unloading strategy.
[0126] In an embodiment of the present application, when the current task processing time is lower than the preset processing time, the user vehicle is added to the vehicle set, so that the vehicle set is all user vehicles that meet the optimization requirements.
[0127] For the task offloading method described in the above embodiment, please refer to Figure 4 , Figure 4 A schematic block diagram of a task offloading device provided in an embodiment of the present application, Figure 4 The task offloading device 400 shown can be applied to Figure 1 The base station in the application scenario diagram shown below takes the base station as an example. Figure 4 The task offloading device 400 shown in the figure is described in detail. The task offloading device 400 may include a first acquisition module 401, a second acquisition module 402, a third acquisition module 403, a composition module 404, a determination module 405, a processing module 406, and a marking module 407.
[0128] A first acquisition module 401 is used to acquire the number of pending tasks of the user's vehicle, where the number of pending tasks is the number of computing tasks to be processed;
[0129] A second acquisition module 402 is used to acquire a network delay between the user vehicle and the base station;
[0130] The third acquisition module 403 is used to acquire the first computing capability of the user vehicle and the second computing capability of the MEC server;
[0131] A composition module 404, configured to combine the number of tasks to be processed, the network delay, the first computing capability, and the second computing capability into current state data corresponding to the user vehicle;
[0132] A determination module 405 is used to determine the current task processing time corresponding to the user vehicle according to a preset DDPG algorithm and the current state data, wherein the current task processing time indicates the time required for the user vehicle and the MEC server to jointly process the number of tasks to be processed;
[0133] A processing module 406 is used to determine the average reduced delay corresponding to different unloading strategies according to the current task processing time, the preset processing time and the total number of the user vehicles corresponding to each of the user vehicles under different unloading strategies;
[0134] The marking module 407 is used to sort the average reduced delays corresponding to the offloading strategies, and mark the offloading strategy corresponding to the smallest average reduced delay as the optimal offloading strategy.
[0135] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0136] The beneficial effects of the embodiments of the present application lie in two aspects. On the one hand, the average reduced delays corresponding to the various unloading strategies are sorted, and the unloading strategy corresponding to the smallest average reduced delay is marked as the optimal unloading strategy. No manual intervention is required, which can save a lot of human resources and time resources, thereby simplifying the process of obtaining the optimal unloading strategy, which is conducive to improving the efficiency of obtaining the optimal unloading strategy. On the other hand, through the optimal unloading strategy, the completion time of the computing task is reduced, which is conducive to improving the completion efficiency of the computing task.
[0137] See also Figure 5 , Figure 5 A schematic diagram of the structure of a base station provided in an embodiment of the present application.
[0138] like Figure 5 As shown, Figure 5 The base station 2 includes: at least one processor 20, a memory 21, and a computer program 22 stored in the memory 21 and executable on the at least one processor 20, and when the processor 20 executes the computer program 22, the steps in any of the above-mentioned method embodiments are implemented.
[0139] The base station 2 may include, but is not limited to, a processor 20 and a memory 21. Those skilled in the art will appreciate that Figure 5 It is only an example of base station 2 and does not constitute a limitation on base station 2. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0140] The processor 20 is used to run the computer program 22 stored in the memory 21, and implement the following steps when executing the computer program 22:
[0141] Obtaining the number of pending tasks of the user's vehicle, where the number of pending tasks is the number of pending computing tasks;
[0142] Obtaining a network delay between the user vehicle and the base station;
[0143] Acquire a first computing capability of the user vehicle, and acquire a second computing capability of the MEC server;
[0144] The number of tasks to be processed, the network delay, the first computing capability, and the second computing capability form current state data corresponding to the user vehicle;
[0145] According to the preset DDPG algorithm and the current status data, the current task processing time corresponding to the user vehicle is determined, and the current task processing time represents the time required for the user vehicle and the MEC server to jointly process the number of tasks to be processed; according to the current task processing time corresponding to each of the user vehicles under different unloading strategies, the preset processing time and the total number of user vehicles, the average reduction delay corresponding to different unloading strategies is determined; the average reduction delay corresponding to each of the unloading strategies is sorted, and the unloading strategy corresponding to the smallest average reduction delay is marked as the optimal unloading strategy.
[0146] In some embodiments, the processor 20 is configured to implement:
[0147] Connect to the user vehicle within the coverage area and obtain the number of tasks to be processed of the user vehicle.
[0148] In some embodiments, the processor 20 is configured to implement:
[0149] Obtain a current CPU usage rate of the user vehicle, set the current CPU usage rate of the user vehicle as the first computing capacity, obtain a current CPU usage rate of the MEC server, and set the current CPU usage rate of the MEC server as the second computing capacity.
[0150] In some embodiments, the processor 20 is configured to implement:
[0151] Obtaining a policy network and a value network in the DDPG algorithm, inputting the current state data into the policy network, and obtaining the current number of offloaded tasks output by the policy network based on the current state data;
[0152] The current state data and the current number of offload tasks are input into the value network, a first reward value output by the value network is obtained, and the current task processing time corresponding to the first reward value is obtained.
[0153] In some embodiments, the processor 20 is configured to implement:
[0154] Obtaining the preset processing time sent by the user vehicle, and determining whether the current task processing time is lower than the preset processing time, wherein the preset processing time is the time it takes for the user vehicle to complete processing the number of tasks to be processed;
[0155] When the current task processing time is lower than the preset processing time, the user vehicle is added to the vehicle set. In the vehicle set, the average reduced delay corresponding to different unloading strategies is determined based on the current task processing time, the preset processing time and the total number of user vehicles corresponding to each user vehicle under different unloading strategies.
[0156] In some embodiments, the processor 20 is configured to implement:
[0157] Acquire a target task according to the optimal offloading strategy, where the target task is the computing task offloaded from the user vehicle to the MEC server;
[0158] Obtain a calculation result generated by the MEC server based on the target task, and send the calculation result to the user vehicle.
[0159] In some embodiments, the processor 20 is configured to implement:
[0160] A preset storage area is obtained, and the calculation result is stored in the storage area.
[0161] The processor 20 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0162] In some embodiments, the memory 21 may be an internal storage unit of the base station 2, such as a hard disk or memory of the base station 2. In other embodiments, the memory 21 may also be an external storage device of the base station 2, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the base station 2. Further, the memory 21 may also include both an internal storage unit of the base station 2 and an external storage device. The memory 21 is used to store an operating system, an application program, a boot loader, data, and other programs, such as the program code of the computer program. The memory 21 may also be used to temporarily store data that has been output or is to be output.
[0163] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0164] An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0165] The computer-readable storage medium stores program codes, which can be called by a processor to execute the task offloading method described in the above method embodiment.
[0166] The computer-readable storage medium has a storage space for program codes.
[0167] The program code includes the code of any step in the task offloading method described in the above method embodiment.
[0168] For example, the program code is called by the processor and can execute the following steps:
[0169] Obtaining the number of pending tasks of the user's vehicle, where the number of pending tasks is the number of pending computing tasks;
[0170] Obtaining a network delay between the user vehicle and the base station;
[0171] Acquire a first computing capability of the user vehicle, and acquire a second computing capability of the MEC server;
[0172] The number of tasks to be processed, the network delay, the first computing capability, and the second computing capability form current state data corresponding to the user vehicle;
[0173] Determine the current task processing time corresponding to the user vehicle according to the preset DDPG algorithm and the current state data, wherein the current task processing time indicates the time taken by the user vehicle and the MEC server to jointly process the number of tasks to be processed;
[0174] Determine the average reduced delay corresponding to different unloading strategies according to the current task processing time, the preset processing time and the total number of the user vehicles corresponding to each of the user vehicles under different unloading strategies;
[0175] The average reduced delays corresponding to the offloading strategies are sorted, and the offloading strategy corresponding to the smallest average reduced delay is marked as the optimal offloading strategy.
[0176] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0177] Among them, the computer-readable storage medium can also be an external storage device of the task offloading device or the base station, for example, a plug-in hard disk equipped on the task offloading device or the base station, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), a non-volatile computer-readable medium (non-transitory computer-readable storage medium), etc.
[0178] Since the computer program stored in the computer-readable storage medium can execute any one of the edge computing-based task offloading methods provided in the embodiments of the present application, the computer-readable storage medium can achieve the beneficial effects that can be achieved by any one of the edge computing-based task offloading methods provided in the embodiments of the present application. Please see the previous embodiments for details and will not be repeated here.
[0179] An embodiment of the present application provides a computer program product. When the computer program product runs on a base station, the base station executes the above-mentioned task offloading method.
[0180] The computer program product is loaded by the base station and can execute the following steps:
[0181] Obtaining the number of pending tasks of the user's vehicle, where the number of pending tasks is the number of pending computing tasks;
[0182] Obtaining a network delay between the user vehicle and the base station;
[0183] Acquire a first computing capability of the user vehicle, and acquire a second computing capability of the MEC server;
[0184] The number of tasks to be processed, the network delay, the first computing capability, and the second computing capability form current state data corresponding to the user vehicle;
[0185] Determine the current task processing time corresponding to the user vehicle according to the preset DDPG algorithm and the current state data, wherein the current task processing time indicates the time taken by the user vehicle and the MEC server to jointly process the number of tasks to be processed;
[0186] Determine the average reduced delay corresponding to different unloading strategies according to the current task processing time, the preset processing time and the total number of the user vehicles corresponding to each of the user vehicles under different unloading strategies;
[0187] The average reduced delays corresponding to the offloading strategies are sorted, and the offloading strategy corresponding to the smallest average reduced delay is marked as the optimal offloading strategy.
[0188] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0189] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0190] Based on such understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the base station, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0191] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0192] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A task offloading method based on edge computing, It is characterized in that Applied to a base station equipped with a MEC server, the task offloading method includes: Obtaining the number of pending tasks of the user's vehicle, where the number of pending tasks is the number of pending computing tasks; Obtaining a network delay between the user vehicle and the base station; Acquire a first computing capability of the user vehicle, and acquire a second computing capability of the MEC server; The number of tasks to be processed, the network delay, the first computing capability, and the second computing capability form current state data corresponding to the user vehicle; Determine the current task processing time corresponding to the user vehicle according to the preset DDPG algorithm and the current state data, wherein the current task processing time indicates the time taken by the user vehicle and the MEC server to jointly process the number of tasks to be processed; Determine the average reduced delay corresponding to different unloading strategies according to the current task processing time, the preset processing time and the total number of the user vehicles corresponding to each of the user vehicles under different unloading strategies; The average reduced delays corresponding to the offloading strategies are sorted, and the offloading strategy corresponding to the smallest average reduced delay is marked as the optimal offloading strategy.
2. The task offloading method according to claim 1, It is characterized in that The obtaining the number of pending tasks of the user's vehicle includes: Connect to the user vehicle within the coverage area and obtain the number of tasks to be processed of the user vehicle.
3. The task offloading method according to claim 1, It is characterized in that The obtaining the first computing capability of the user vehicle and the obtaining the second computing capability of the MEC server include: Obtain a current CPU usage rate of the user vehicle, set the current CPU usage rate of the user vehicle as the first computing capacity, obtain a current CPU usage rate of the MEC server, and set the current CPU usage rate of the MEC server as the second computing capacity.
4. The task offloading method according to claim 1, It is characterized in that The determining, according to the preset DDPG algorithm and the current state data, the current task processing time corresponding to the user vehicle includes: Obtaining a policy network and a value network in the DDPG algorithm, inputting the current state data into the policy network, and obtaining the current number of offloaded tasks output by the policy network based on the current state data; The current state data and the current number of offload tasks are input into the value network, a first reward value output by the value network is obtained, and the current task processing time corresponding to the first reward value is obtained.
5. The task offloading method according to claim 1, It is characterized in that Determining the average reduced delay corresponding to different unloading strategies according to the current task processing time, the preset processing time and the total number of the user vehicles corresponding to each of the user vehicles under different unloading strategies includes: Obtaining the preset processing time sent by the user vehicle, and determining whether the current task processing time is lower than the preset processing time, wherein the preset processing time is the time it takes for the user vehicle to complete processing the number of tasks to be processed; When the current task processing time is lower than the preset processing time, the user vehicle is added to the vehicle set. In the vehicle set, the average reduced delay corresponding to different unloading strategies is determined based on the current task processing time, the preset processing time and the total number of user vehicles corresponding to each user vehicle under different unloading strategies.
6. The task offloading method according to any one of claims 1 to 5, It is characterized in that After the average reduced delays corresponding to the offloading strategies are sorted and the offloading strategy corresponding to the smallest average reduced delay is marked as the optimal offloading strategy, the task offloading method includes: Acquire a target task according to the optimal offloading strategy, where the target task is the computing task offloaded from the user vehicle to the MEC server; Obtain a calculation result generated by the MEC server based on the target task, and send the calculation result to the user vehicle.
7. The task offloading method according to claim 6, It is characterized in that After obtaining the calculation result generated by the MEC server based on the target task and sending the calculation result to the user vehicle, the task offloading method includes: A preset storage area is obtained, and the calculation result is stored in the storage area.
8. A task offloading device based on edge computing, It is characterized in that Applicable to base stations equipped with MEC servers, including: A first acquisition module is used to acquire the number of pending tasks of the user's vehicle, where the number of pending tasks is the number of pending computing tasks; A second acquisition module, used to acquire the network delay between the user vehicle and the base station; A third acquisition module is used to acquire the first computing capacity of the user vehicle and the second computing capacity of the MEC server; A composition module, configured to combine the number of tasks to be processed, the network delay, the first computing capability, and the second computing capability into current state data corresponding to the user vehicle; A determination module, configured to determine a current task processing time corresponding to the user vehicle according to a preset DDPG algorithm and the current state data, wherein the current task processing time indicates a time for the user vehicle and the MEC server to jointly process the number of tasks to be processed; A processing module, configured to determine an average reduced delay corresponding to different unloading strategies according to the current task processing time, the preset processing time and the total number of the user vehicles corresponding to each of the user vehicles under different unloading strategies; The marking module is used to sort the average reduced delays corresponding to the various unloading strategies, and mark the unloading strategy corresponding to the smallest average reduced delay as the optimal unloading strategy.
9. A base station comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the task offloading method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the task offloading method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Joint optimization method and system for task unloading and service caching of Internet of Vehicles
CN114143346A
Vehicle-mounted task unloading method based on deep reinforcement learning in edge computing environment
CN114615265A
Vehicle-mounted computing task unloading method based on deep reinforcement learning strategy
CN115134242A
Edge computing task unloading method based on assistance of high-altitude communication platform
CN116489668A
Vehicle-mounted computing task unloading method and device, storage medium and electronic equipment
CN117768955A
