A task offloading method, device, base station and medium based on edge computing
By automatically determining the optimal offloading strategy through edge computing and the DDPG algorithm, the problem of low efficiency in obtaining the optimal offloading strategy in the existing technology is solved, an efficient task offloading process is achieved, and the completion time of computing tasks is reduced.
Patent Information
- Application Number
- CN202411014902.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-07-26
AI Technical Summary
In existing task offloading methods, the process of obtaining the optimal offloading strategy is cumbersome, resulting in low acquisition efficiency and consuming a lot of manpower and time resources.
An edge computing-based task offloading method is adopted. By obtaining the status data of user vehicles and MEC servers, the DDPG algorithm is used to determine the optimal offloading strategy, automatically sorting and marking the offloading strategy with the minimum average delay reduction without manual intervention.
The process of obtaining the optimal offloading strategy is simplified, the acquisition efficiency is improved, and the completion time of the computing task is reduced through the optimal strategy, thereby improving the completion efficiency of the computing task.
Smart Images

Figure CN119012280B_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 connected vehicle technologies, a variety of in-vehicle applications, such as autonomous driving and automated navigation, have emerged in smart transportation scenarios. Cloud computing provides remote computing resources for these applications, but remote task offloading can lead to unpredictable transmission delays and severe degradation in service quality. Therefore, vehicle edge computing extends cloud computing to the edge of the network, aiming to perform computing close to the data source, thereby reducing data transmission latency and meeting the service quality required by users' vehicles.
[0003] However, in 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. This is because task offloading usually generates a large number of offloading strategies. If a manual method is used to obtain the optimal offloading strategy from a large number of offloading strategies, the workload will be enormous and the optimal offloading strategy will take a long time, thus consuming a lot of human resources and time resources. Therefore, the process of obtaining the optimal offloading strategy is cumbersome and 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 acquisition process of 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. The task offloading method includes:
[0006] Obtain the number of pending tasks for 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] Obtaining a first computing capability of the user vehicle and a second computing capability of the MEC server;
[0009] Combining the number of pending tasks, the network delay, the first computing capability, and the second computing capability into current state data corresponding to the user vehicle;
[0010] Determine, based on a preset DDPG algorithm and the current state data, a current task processing time corresponding to the user vehicle, where the current task processing time represents the time required for the user vehicle and the MEC server to jointly process the number of pending tasks;
[0011] Determining 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 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 for the user's vehicle includes:
[0014] Connect to the user vehicle within the coverage area and obtain the number of tasks to be processed for the user vehicle.
[0015] In a possible implementation of the first aspect, obtaining the first computing capability of the user vehicle and obtaining the second computing capability of the MEC server include:
[0016] Obtain the current CPU usage of the user vehicle, set the current CPU usage of the user vehicle as the first computing capacity, obtain the current CPU usage of the MEC server, and set the current CPU usage of the MEC server to the second computing capacity.
[0017] In a possible implementation 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, based on the current task processing time, the preset processing time, and the total number of user vehicles corresponding to each of the user vehicles under different offloading strategies, the average reduced latency corresponding to the different offloading strategies includes:
[0021] Obtaining a preset processing time sent by the user vehicle, and determining whether the current task processing time is less than the preset processing time, where the preset processing time is the time it takes for the user vehicle to complete processing the number of pending tasks;
[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, preset processing time and the total number of user vehicles corresponding to each user vehicle under different unloading strategies.
[0023] In a possible implementation of the first aspect, after sorting the average reduced latency corresponding to each of the offloading strategies and marking the offloading strategy corresponding to the smallest average reduced latency 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 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 an MEC server, including:
[0029] A first acquisition module is used to obtain 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 is used to obtain the network delay between the user vehicle and the base station;
[0031] A third acquisition module is configured to acquire the first computing capability of the user vehicle and the second computing capability of the MEC server;
[0032] a composition module, configured to combine the number of pending tasks, the network delay, the first computing capability, and the second computing capability into current status data corresponding to the user vehicle;
[0033] a determination module, configured to determine a current task processing time corresponding to the user vehicle based on a preset DDPG algorithm and the current state data, where the current task processing time represents the time required for the user vehicle and the MEC server to jointly process the number of pending tasks;
[0034] a processing module, configured to determine an average reduced delay corresponding to different unloading strategies based on the current task processing time, the preset processing time, and the total number of user vehicles corresponding to each of the user vehicles under different unloading strategies;
[0035] The marking module is configured 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.
[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 according to 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, it enables the base station to execute the task offloading method described in any one of the above-mentioned first aspects.
[0039] The beneficial effects of the embodiment of the present application lie in two aspects. On the one hand, the average reduced delay corresponding to each of the unloading strategies is 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 and helping to improve 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 following briefly introduces the drawings required for use in the description of the embodiments. 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 This 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 this application more clear, the present application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0047] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may 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 avoid obscuring the description of the present application with unnecessary detail.
[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, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0049] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0050] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" 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 "upon determination" or "in response to determining" or "upon detection of [described condition or event]" 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" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[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 ordinary technicians in this field can implement them. When the combination of technical solutions is mutually contradictory or cannot be implemented, it should be deemed that such a 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 for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.
[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 detailed 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, close to end users. Compared to traditional cloud servers, they are deployed outside of remote data centers. MEC servers achieve 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 also 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 This 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 detailed 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 pending computing tasks;
[0065] Among them, there are dependencies between different computing tasks.
[0066] For ease of explanation, the following examples are given:
[0067] For example, there are computing tasks A and computing tasks B.
[0068] Computational task A must be completed before computational task B can begin execution.
[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 for the user's vehicle includes:
[0071] Connect to the user vehicle within the coverage area and obtain the number of tasks to be processed for the user vehicle.
[0072] S202, obtaining a network delay between the user vehicle and the base station;
[0073] S203: Acquire the first computing capability of the user vehicle and acquire the 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 the current CPU usage of the user vehicle, set the current CPU usage of the user vehicle as the first computing capacity, obtain the current CPU usage of the MEC server, and set the current CPU usage of the MEC server to 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 pending tasks, the network delay, the first computing capability, and the second computing capability into current status data corresponding to the user vehicle;
[0078] Combining the four indicators (number of pending tasks, network latency, first computing capacity, and second computing capacity) 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, including the number of pending tasks, network latency, first computing capacity, and first computing capacity.
[0079] S205: Determine a current task processing time corresponding to the user vehicle based on a preset DDPG algorithm and the current state data, where the current task processing time represents the time required for the user vehicle and the MEC server to jointly process the number of pending tasks.
[0080] The determining of 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 offload 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 offloading tasks into the value network, obtaining a first reward value output by the value network, and determining whether the first reward value is the second reward value;
[0085] If the first reward value is the second reward value, the preset task processing time corresponding to the second reward value is obtained based on the pre-established correspondence between the second reward value and the preset task processing time, and the preset task processing time corresponding to the second reward value is set as the current task processing time corresponding to the first reward value.
[0086] The DDPG algorithm achieves efficient learning in a 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 latency corresponding to different offloading strategies based on the current task processing time, the preset processing time, and the total number of user vehicles corresponding to each of the user vehicles under different offloading strategies. Exemplarily, determining the average reduced latency corresponding to different offloading strategies based on the current task processing time, the preset processing time, and the total number of user vehicles corresponding to each of the user vehicles under different offloading strategies includes:
[0088] Obtain an unloading decision corresponding to each of the user vehicles, combine the multiple unloading decisions into an unloading strategy, add 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 to obtain a total reduced delay, and divide the total reduced delay by the total number of the user vehicles to obtain an 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, performing all tasks locally, or a combination thereof.
[0090] Wherein, based on the unloading decisions corresponding to each of the user vehicles in a 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 user vehicle under different unloading strategies is subtracted from the current task processing time to obtain the reduced delay corresponding to each user vehicle, the reduced delays are added to obtain the total reduced delay, and the total reduced delay is divided by the total number of user vehicles to obtain the average reduced delay corresponding to the different unloading strategies.
[0093] For ease of explanation, the following examples are given:
[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. The MEC server takes 10 seconds to process the 20 computing tasks.
[0095] Unloading strategy A: User vehicle A unloads 5 tasks to the MEC server, and user vehicle B unloads 10 tasks to the MEC server. User vehicle A only needs to process 5 tasks, and the time it takes for user vehicle A to complete the 5 tasks is 30 seconds. User vehicle B only needs to process 10 tasks, and the calculation time for user vehicle B is 30 seconds. The reduced delay of user vehicle A and user vehicle B is 30 seconds respectively. Adding the 30 seconds and 30 seconds together, the total reduced delay is 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] In offloading strategy B, user vehicle A offloads 7 tasks to the MEC server, and user vehicle B offloads 16 tasks to the MEC server. User vehicle A only needs to process 3 tasks, and user vehicle B only needs to process 4 tasks. The reduced latency for user vehicle A and user vehicle B is 42 seconds and 48 seconds respectively. Adding the 42 seconds and 48 seconds, the total reduced latency is 90 seconds. Since there are only user vehicles A and B, the total number is 2. Therefore, the average reduced latency for offloading 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 ease of explanation, the following examples are given:
[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 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:
[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 ease of explanation, the following examples are given:
[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 10 seconds for the MEC server to process the 10 computing tasks.
[0108] After user vehicle A offloads 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 the MEC server takes 3 seconds to process these 3 tasks.
[0109] Therefore, by offloading, the current task processing time is reduced from 60 seconds to 42 seconds.
[0110] For ease of explanation, the following examples are given:
[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. The MEC server takes 10 seconds 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] 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] 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, which can provide the monitoring system with 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 embodiment of the present application lie in two aspects. On the one hand, the average reduced delay corresponding to each of the unloading strategies is 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 and helping to improve 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 latency provided in the embodiment of the present application is detailed as follows:
[0122] S301, obtaining a preset processing time sent by the user vehicle, and determining whether the current task processing time is less than the preset processing time, where the preset processing time is the time it takes for the user vehicle to complete processing the number of pending tasks;
[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 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.
[0124] Exemplarily, when the current task processing time is lower than the preset processing time, the user vehicle is added to a vehicle set. In the vehicle set, 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 offloading strategies, the average reduced latency corresponding to different offloading 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. In the vehicle set, the unloading decision corresponding to each user vehicle is obtained, and multiple unloading decisions are combined into an unloading strategy. The reduced delay between the current task processing time and the preset processing time corresponding to each user vehicle under the unloading strategy is added to obtain a total reduced delay. The total reduced delay is divided by the total number of user vehicles to obtain an 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 is shown. 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 FIG. 4 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] The first acquisition module 401 is used to obtain the number of pending tasks of the user's vehicle, where the number of pending tasks is the number of pending computing tasks;
[0129] A second acquisition module 402 is configured to acquire a network delay between the user vehicle and the base station;
[0130] A third acquisition module 403 is configured to acquire the first computing capability of the user vehicle and the second computing capability of the MEC server;
[0131] A composition module 404 is configured to combine the number of pending tasks, 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 configured to determine a current task processing time corresponding to the user vehicle based on a preset DDPG algorithm and the current state data, where the current task processing time represents the time required for the user vehicle and the MEC server to jointly process the number of pending tasks.
[0133] A processing module 406 is configured to determine an average reduced latency corresponding to different unloading strategies based on the current task processing time, the preset processing time, and the total number of user vehicles corresponding to each of the user vehicles under different unloading strategies;
[0134] The marking module 407 is configured 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 and similar parts between the various embodiments can be referenced to each other.
[0136] The beneficial effects of the embodiment of the present application lie in two aspects. On the one hand, the average reduced delay corresponding to each of the unloading strategies is 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 and helping to improve 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. When the processor 20 executes the computer program 22, the steps in any of the above 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 This is merely an example of base station 2 and does not constitute a limitation on base station 2. Base station 2 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 configured to run a computer program 22 stored in the memory 21 and implement the following steps when executing the computer program 22:
[0141] Obtain the number of pending tasks for 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] Obtaining a first computing capability of the user vehicle and a second computing capability of the MEC server;
[0144] Combining the number of pending tasks, the network delay, the first computing capability, and the second computing capability into 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, where the current task processing time represents the time required for the user vehicle and the MEC server to jointly process the number of pending tasks. According to the current task processing time, preset processing time, and the total number of user vehicles corresponding to each user vehicle under different offloading strategies, the average reduction delay corresponding to different offloading strategies is determined. The average reduction delay corresponding to each offloading strategy is sorted, and the offloading strategy corresponding to the smallest average reduction delay is marked as the optimal offloading 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 for the user vehicle.
[0148] In some embodiments, the processor 20 is configured to implement:
[0149] Obtain the current CPU usage of the user vehicle, set the current CPU usage of the user vehicle as the first computing capacity, obtain the current CPU usage of the MEC server, and set the current CPU usage of the MEC server to 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 a preset processing time sent by the user vehicle, and determining whether the current task processing time is less than the preset processing time, where the preset processing time is the time it takes for the user vehicle to complete processing the number of pending tasks;
[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, 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, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor.
[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. Furthermore, the memory 21 may 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, application programs, 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 about 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 this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.
[0164] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. 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] Obtain the number of pending tasks for 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] Obtaining a first computing capability of the user vehicle and a second computing capability of the MEC server;
[0172] Combining the number of pending tasks, the network delay, the first computing capability, and the second computing capability into current state data corresponding to the user vehicle;
[0173] Determine, based on a preset DDPG algorithm and the current state data, a current task processing time corresponding to the user vehicle, where the current task processing time represents the time required for the user vehicle and the MEC server to jointly process the number of pending tasks;
[0174] Determining 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 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 and will not be repeated here.
[0177] The computer-readable storage medium may also be an external storage device of the task offloading device or the base station, for example, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), a non-transitory computer-readable storage medium (non-transitory computer-readable storage medium), etc., equipped on the task offloading device or the base station.
[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, it enables the base station to perform the above-mentioned task offloading method.
[0180] The computer program product is loaded into the base station and can execute the following steps:
[0181] Obtain the number of pending tasks for 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] Obtaining a first computing capability of the user vehicle and a second computing capability of the MEC server;
[0184] Combining the number of pending tasks, the network delay, the first computing capability, and the second computing capability into current state data corresponding to the user vehicle;
[0185] Determine, based on a preset DDPG algorithm and the current state data, a current task processing time corresponding to the user vehicle, where the current task processing time represents the time required for the user vehicle and the MEC server to jointly process the number of pending tasks;
[0186] Determining 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 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] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and 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 into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into 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, and will not be repeated here.
[0190] Based on this 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. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Wherein, 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 include at least: 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), a random access memory (RAM), 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 focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0192] The above are only preferred embodiments of the present application and do not 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, characterized in that: Applied to a base station equipped with an MEC server, the task offloading method includes: Obtain the number of pending tasks for 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; Obtaining a first computing capability of the user vehicle and a second computing capability of the MEC server; Combining the number of pending tasks, the network delay, the first computing capability, and the second computing capability into current state data corresponding to the user vehicle; Obtaining a policy network and a value network in the DDPG algorithm, inputting the current state data into the policy network, obtaining the current number of unloaded tasks output by the policy network based on the current state data, inputting the current state data and the current number of unloaded tasks into the value network, obtaining a first reward value output by the value network, determining whether the first reward value is the second reward value, and if the first reward value is the second reward value, obtaining the preset task processing time corresponding to the second reward value based on a pre-established correspondence between the second reward value and the preset task processing time, setting the preset task processing time corresponding to the second reward value to the current task processing time corresponding to the first reward value, where the current task processing time represents the time it takes for the user vehicle and the MEC server to jointly process the number of pending tasks; Obtaining a preset processing time sent by the user vehicle, and determining whether the current task processing time is less than the preset processing time, where the preset processing time is the time it takes for the user vehicle to complete processing the number of pending tasks; When the current task processing time is lower than the preset processing time, the user vehicle is added to a vehicle set. In the vehicle set, an unloading decision corresponding to each user vehicle is obtained. Multiple unloading decisions are combined into an unloading strategy. The reduced delay between the current task processing time and the preset processing time corresponding to each user vehicle under the unloading strategy is added to obtain a total reduced delay. The total reduced delay is divided by the total number of user vehicles to obtain an average reduced delay corresponding to the unloading strategy. 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, characterized in that: The step of obtaining the number of pending tasks for the user's vehicle includes: Connect to the user vehicle within the coverage area and obtain the number of tasks to be processed for the user vehicle.
3. The task offloading method according to claim 1, characterized in that: The obtaining of the first computing capability of the user vehicle and the obtaining of the second computing capability of the MEC server include: Obtain the current CPU usage of the user vehicle, set the current CPU usage of the user vehicle as the first computing capacity, obtain the current CPU usage of the MEC server, and set the current CPU usage of the MEC server to the second computing capacity.
4. The task offloading method according to any one of claims 1 to 3, characterized in that: 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: 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.
5. The task offloading method according to claim 4, 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.
6. A task offloading device based on edge computing, characterized in that: Applicable to base stations equipped with MEC servers, including: A first acquisition module is used to obtain 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 is used to obtain the network delay between the user vehicle and the base station; A third acquisition module is configured to acquire the first computing capability of the user vehicle and the second computing capability of the MEC server; a composition module, configured to combine the number of pending tasks, the network delay, the first computing capability, and the second computing capability into current status data corresponding to the user vehicle; a determination module, configured to obtain a policy network and a value network in the DDPG algorithm, input the current state data into the policy network, obtain the current number of unloaded tasks output by the policy network based on the current state data, input the current state data and the current number of unloaded tasks into the value network, obtain a first reward value output by the value network, determine whether the first reward value is a second reward value, and if the first reward value is the second reward value, obtain the preset task processing time corresponding to the second reward value based on a pre-established correspondence between the second reward value and the preset task processing time, 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, where the current task processing time represents the time it takes for the user vehicle and the MEC server to jointly process the number of pending tasks; a processing module configured to obtain a preset processing time sent by the user vehicle, determine whether the current task processing time is less than the preset processing time, the preset processing time being the time required for the user vehicle to complete processing the number of pending tasks, and when the current task processing time is less than the preset processing time, add the user vehicle to a vehicle set, obtain an unloading decision corresponding to each user vehicle in the vehicle set, combine multiple unloading decisions into an unloading strategy, add the reduced delays between the current task processing time and the preset processing time corresponding to each user vehicle under the unloading strategy to obtain a total reduced delay, and divide the total reduced delay by the total number of user vehicles to obtain an average reduced delay corresponding to the unloading strategy; The marking module is configured 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.
7. A base station comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the task offloading method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the task offloading method according to any one of claims 1 to 5 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
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