Offloading method, system, medium and electronic terminal for offloading tasks in edge computing
By building a mobile blockchain network offload model in edge computing, the problems of mobile blockchain computing power and energy consumption limitations are solved, efficient resource utilization and delay reduction are achieved, and the performance of mobile edge computing is improved.
Patent Information
- Application Number
- CN202210483052.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-05
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-05-05
AI Technical Summary
Mobile blockchain has limitations in computing power and energy consumption, resulting in limited applications in mobile computing, and the increase in the number of mobile users has led to waste of resources and network congestion, reducing resource utilization and increasing latency.
Using mobile blockchain technology to build an edge computing network offload model, determine the offload proportion configuration through accident rate function and offload cost function, comprehensively analyze the delay, energy consumption and security requirements, and optimize the upload and unloading strategy and utility function of offload tasks. To improve the efficiency and resource utilization of uninstall tasks.
Effectively calling peripheral idle devices for collaborative uninstallation improves the efficiency and resource utilization of uninstallation tasks, reduces energy consumption and delays, and balances the performance and cost of the system.
Smart Images

Figure CN114880044B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to an offloading method, system, medium and electronic terminal for offloading tasks in edge computing. Background Art
[0002] Blockchain technology is predicted to be one of the key technologies for 6G cellular mobile communications due to its advantages such as decentralization, anonymity, openness, and immutability. Blockchain technology based on mobile communications can protect privacy and save costs. However, due to the problems of fixed scenarios and energy consumption of traditional blockchains, mobile blockchains generated by mobile computing may become mainstream technologies and be applied to various aspects in the future. However, the generation of mobile blockchains depends on wireless networks and mobile terminals. Since current mobile terminals are limited by power supply and computing power, it is often difficult to cope with the huge computing power and energy consumption required for blockchain computing, which limits the further development of mobile blockchains. The use of mobile edge computing (MEC) technology to offload the calculation process can effectively reduce the burden on mobile terminals.
[0003] Nowadays, the increasing number of mobile users brings huge data task processing volume, and the data types are also increasing. However, in the face of massive wireless access, a lot of resources are still wasted. According to data, in a typical data center, the average resource utilization rate is only 20%-30%. As far as current computers are concerned, even in idle state, the power consumption is 60% of the peak value. If idle devices are called, the increased energy consumption is only about 40%, but it greatly alleviates the pressure of data processing. At the same time, due to the low resource utilization rate and the increase in parallel tasks, the network is congested, which will lead to an increase in time delay.
[0004] Therefore, mobile blockchain technology can also be applied to mobile edge computing. Using mobile blockchain as an application, based on its decentralization and openness, it can call on surrounding idle devices for collaborative offloading to form computing diversion, which can effectively improve the offloading efficiency of offloading tasks in edge computing and the resource utilization rate of surrounding idle devices. Summary of the invention
[0005] In view of the shortcomings of the prior art mentioned above, the present invention provides a technical solution for offloading tasks in edge computing, which applies mobile blockchain to collaborative processing in offloading tasks, improves resource utilization, reduces latency, and balances energy consumption.
[0006] To achieve the above-mentioned purpose and other related purposes, the technical solution provided by the present invention is as follows.
[0007] A method for offloading tasks in edge computing, comprising:
[0008] Build a network offloading model based on mobile blockchain;
[0009] Constructing an accident rate function and an unloading cost function of the network unloading model, and determining an unloading ratio configuration of the unloading task according to the accident rate function and the unloading cost function;
[0010] Based on the offloading ratio configuration, comprehensively analyzing the requirements of latency, energy consumption, accident rate and safety, determining the upload offloading strategy of the offloading task in the network offloading model;
[0011] According to the offloading ratio configuration and the upload offloading strategy, the offloading task is offloaded through the network offloading model;
[0012] A utility function of the offloading task is constructed, and the utility function is optimized to improve the offloading efficiency of the offloading task.
[0013] Optionally, the step of constructing a network offloading model based on the mobile blockchain includes:
[0014] With the edge server as the center and covering a preset area, a coalition mobile blockchain is formed. The coalition mobile blockchain is controlled by the edge server, and all devices covered by the edge server reach a consensus and jointly follow the coalition mobile blockchain protocol; the edge server and multiple devices in the coalition mobile blockchain constitute the network offloading model.
[0015] Optionally, the blocks of the alliance mobile blockchain are divided into a primary domain, an information domain and a transaction domain, the primary domain is used to store a hash value, a computational difficulty, a timestamp and a nonce value, the information domain is used to store the computing memory of the edge server and the current state of the device, and the transaction domain is used to store transaction information.
[0016] Optionally, the step of constructing an accident rate function and an offloading cost function of the network offloading model, and determining the offloading ratio configuration of the offloading task according to the accident rate function and the offloading cost function includes:
[0017] Constructing an accident rate function and an offloading cost function of the network offloading model, and determining a constraint condition of an offloading ratio of the edge server according to the accident rate function and the offloading cost function;
[0018] The convex optimization algorithm is used to optimize and determine the offloading ratio of the edge server, and the number of the idle devices required to cooperate with the offloading task is determined, and then the offloading ratio of the idle devices is calculated to complete the offloading ratio configuration of the offloading task.
[0019] Optionally, the step of comprehensively analyzing the requirements of latency, energy consumption, accident rate and safety based on the offloading ratio configuration to determine the upload offloading strategy of the offloading task in the network offloading model includes:
[0020] Based on the network offloading model, a decentralized offloading strategy for overall upload and a decentralized no-offloading strategy for upload are proposed;
[0021] Based on the offloading ratio configuration, calculate the latency and energy consumption of the overall upload decentralized offloading strategy, and the latency and energy consumption of the decentralized upload non-offloading strategy;
[0022] Through comprehensive comparative analysis of latency, energy consumption, accident rate and safety requirements, one of the overall upload decentralized offloading strategy and the decentralized upload no offloading strategy is selected as the upload offloading strategy for the offloading task.
[0023] Optionally, the step of constructing a utility function of the offloading task and optimizing the utility function to improve the offloading efficiency of the offloading task includes:
[0024] Based on the time delay and the energy consumption, constructing a utility function of the offloading task;
[0025] The utility function is optimized by using an ε-greedy algorithm to improve the value of the utility function, thereby improving the offloading efficiency of the offloading task.
[0026] Optionally, the utility function of the offloading task is: Among them, G is the utility function, ε 1 , ε 2 is the trade-off factor, T begin and E begin They respectively represent the time delay and energy consumption required to complete the offloading task according to the original queuing theory strategy, and T and E respectively represent the time delay and energy consumption required to complete the offloading task according to one of the overall upload decentralized offloading strategy and the decentralized upload no offloading strategy.
[0027] An offloading system for offloading tasks in edge computing, comprising:
[0028] Model building module, used to build a network offloading model based on mobile blockchain;
[0029] A task analysis module, used to analyze and determine the offloading ratio configuration of the offloading task in the network offloading model and upload the offloading strategy;
[0030] A task execution module, used for executing the uninstallation task;
[0031] The task optimization module is used to optimize the offloading efficiency of the offloading task.
[0032] Optionally, the task optimization module includes a construction unit and an optimization unit, the construction unit is used to construct a utility function of the offloading task, and the optimization unit is used to optimize the utility function.
[0033] A computer-readable storage medium stores a computer program, which implements any of the above methods when executed by a processor.
[0034] An electronic terminal, comprising: a processor and a memory;
[0035] The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic terminal executes any one of the above methods.
[0036] As described above, the method, system, medium and electronic terminal for offloading tasks in edge computing provided by the present invention have at least the following beneficial effects:
[0037] A network offloading model is built based on mobile blockchain, and the offloading tasks are offloaded through the network offloading model. The mobile blockchain is applied to the offloading task processing of mobile edge computing, which can effectively call on the surrounding idle devices for collaborative offloading to form computing diversion, thereby improving the offloading efficiency of the offloading tasks and the resource utilization of the surrounding idle devices. In addition, the utility function of the offloading task is constructed and optimized, which further improves the offloading efficiency of the offloading task. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a schematic diagram of the steps of the offloading method of the edge computing in the present invention;
[0039] Figure 2 is a structural diagram of a network offloading model in an optional embodiment of the present invention;
[0040] Figure 3 It is a delay simulation curve diagram of an unloading task under three different unloading strategies in an optional embodiment of the present invention;
[0041] Figure 4 is a simulation curve diagram of the utility function of the offloading task under a plurality of different optimization algorithms in an optional embodiment of the present invention;
[0042] Figure 5 is a simulation curve diagram of a resource utilization function of an offload task under two different offload strategies in an optional embodiment of the present invention;
[0043] Figure 6 It is a structural diagram of an offloading system for offloading tasks in edge computing in the present invention. DETAILED DESCRIPTION
[0044] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention.
[0045] It should be noted that the diagrams provided in the present embodiment are only used to illustrate the basic concept of the present invention in a schematic manner, so the diagrams only show the components related to the present invention rather than being drawn according to the number, shape and size of the components in actual implementation. The type, quantity and proportion of each component in actual implementation can be changed at will, and the component layout type may also be more complicated. The structure, proportion, size, etc. shown in the drawings attached to this specification are only used to match the content disclosed in the specification for people familiar with this technology to understand and read, and are not used to limit the limiting conditions that the present invention can be implemented, so they have no technical substantive significance. Any modification of the structure, change of the proportional relationship or adjustment of the size should still fall within the scope of the technical content disclosed by the present invention without affecting the effect and purpose that can be achieved by the present invention.
[0046] As described in the background technology above, the inventors have found that: on the one hand, the computing power and energy consumption requirements of mobile blockchains are increasing, and on the other hand, the waste of resources caused by the massive access brought about by the increase in the number of mobile users. Based on this, this application applies mobile blockchain to the offload task processing of mobile edge computing to call surrounding idle devices for collaborative offloading to form computing diversion, thereby improving the offload efficiency of offload tasks and the resource utilization of surrounding idle devices.
[0047] like Figure 1 As shown, the present invention provides a method for offloading tasks in edge computing, which comprises the steps of:
[0048] S1. Build a network offloading model based on mobile blockchain;
[0049] S2. Construct an accident rate function and an unloading cost function of a network unloading model, and determine an unloading ratio configuration of an unloading task according to the accident rate function and the unloading cost function;
[0050] S3. Based on the offloading ratio configuration, comprehensively analyze the requirements of latency, energy consumption, accident rate and safety, and determine the upload offloading strategy of the offloading task in the network offloading model;
[0051] S4, according to the offloading ratio configuration and upload offloading strategy, offloading the offloading task through the network offloading model;
[0052] S5. Construct a utility function for the offloading task and optimize the utility function to improve the offloading efficiency of the offloading task.
[0053] In detail, based on the mobile blockchain, step S1 of constructing a network offloading model further includes:
[0054] With the edge server as the center and covering the preset area, a coalition mobile blockchain is formed. The coalition mobile blockchain is controlled by the edge server (MEC end), and all devices covered by the edge server reach a consensus and jointly follow the coalition mobile blockchain protocol; the edge server and multiple devices in the coalition mobile blockchain constitute a network offloading model.
[0055] In an optional embodiment of the present invention, Figure 2 As shown in the figure, the edge server and the six surrounding devices (device 1, device 2, device 3, device 4, device 5 and device 6) form a coalition mobile blockchain, forming an effective network offloading model based on mobile blockchain. Device 2 makes a task request for offloading tasks to the edge server, and the edge server responds to the request and calls the surrounding idle devices 1, device 3, device 4, device 5 and device 6 to collaboratively offload the offloading task.
[0056] It should be noted that the traditional blockchain has two parts: the block header and the block body. When the mobile blockchain generated by mobile edge computing is applied to network offloading, the block is divided into the first domain, the information domain and the transaction domain. The first domain is the same as the block header of the traditional blockchain and is used to store hash values, computational difficulty, timestamps, nonce values, etc. The information domain is used to store the computing memory C of the edge server. station and the current state of the device, which includes the execution frequency of the CPU in the device Equipment usage status i,j (used or idle), available memory when the device is idle C presonal and the rental price of the equipment when it is idle. i,j represents the jth device in the i-th region, when l i,j =1, indicating that the device resources have been used, and when l i,j =0 means that the device is not in use. When making an unloading request, the user can request the surrounding idle devices to assist in unloading. When users in the area request to unload tasks and use the surrounding idle resources or when a task that uses idle resources for collaborative unloading ends, the task information in the mobile blockchain will be updated in time to ensure the real-time nature of the information in the mobile blockchain. The openness of the mobile blockchain allows each user node to unconditionally access the information in the block, so as to know the status of the surrounding idle resources. The transaction domain is used to store transaction information. It can be the same as the traditional blockchain, using a tree structure to ensure that the transaction content is not tampered with, thereby ensuring the security of the transaction.
[0057] Assume that there are A edge servers in a certain area, A = {1, 2, ... A}, and the area is Q. The edge server covers a certain number of devices, among which idle devices can sign a lease agreement with the edge server. The lease agreement includes a confidentiality agreement, which prohibits the unloaded content from being transmitted or used for personal use. After that, the memory is handed over to the edge server for use, and the alliance blockchain will record the status of the device. The number of idle devices in each edge server is represented by the set Y, Y = {y 1 ,y 2 ,…y A}. User p i,j , (the jth user in the i-th base station) submits the total amount of unloading W i,j The offloading ratio to the edge server is α bs , the offloading ratio to the idle user end recorded in the alliance mobile blockchain is β θ .
[0058] The proportion of tasks occupied by idle devices should not be too large, because idle devices have more force majeure factors than edge servers, so the probability of accidents will increase. When power outages or network outages occur on idle devices, the progress of tasks may be suspended or terminated. Although backup resources can be used to make up for it in time, the proportion of tasks occupied by idle devices still needs to be limited. β lim The maximum task ratio of the idle device side. The edge server side also has a corresponding ratio with the idle device side to perform parallel processing of a task, improve the corresponding resource utilization and reduce latency. At the same time, handing over some tasks to the idle device side will also reduce the uninstallation cost of the uninstall user.
[0059] When performing task offloading, the user or edge server must first determine the number of idle devices to be used. Once the number of idle devices is determined, the multivariate problem can be transformed into a single variable problem. bs +nβ θ =1, n represents the number of idle devices for collaborative offloading. The specific offloading ratio of each idle device β θ , we can use α bs Indicates that at this time α bs is the only variable.
[0060] In a data center, resource utilization is only about 20%-30%, and for computer equipment, even if these devices are not used, the power consumption is only about 60% of the peak value. If idle resources are called upon, although energy consumption increases slightly, the limited capacity of computing resources is improved, which can handle more tasks and relieve network pressure.
[0061] In the present invention, Cpresonal Represents the available memory of each rental user (idle device), C station Represents the available memory of the edge server. Assuming that the memory of each user (device) is equal to the memory of each server, the available resource utilization function is equal to the ratio of the sum of the unloaded tasks to the sum of the idle device memory and the server memory of the alliance blockchain. Sum represents the total number of unloading tasks in each area, and the total number of tasks will be used to call idle devices for collaborative unloading under the application of blockchain technology. The value range has changed after calling the extra idle resources. From the previous: 0 <Sum i <μ 1 C station Now it becomes: 0 <Sum i <μ 1 C station +y n C presonal .
[0062] For idle devices during the rental period, although they are managed remotely by the edge server, there will be various emergencies after all, so the edge server will leave standby devices or spare memory in the area to prevent problems with task offloading and processing. Therefore, the edge server will not use up all the memory, but reserve a part to deal with emergencies, that is, the usage ratio is μ 1 of memory.
[0063] In detail, step S2 of constructing the accident rate function and the unloading cost function of the network unloading model and determining the unloading ratio configuration of the unloading task according to the accident rate function and the unloading cost function further includes:
[0064] S21, constructing an accident rate function and an unloading cost function of a network unloading model, and determining a constraint condition of an unloading ratio of an edge server according to the accident rate function and the unloading cost function;
[0065] S22: Use a convex optimization algorithm to optimize and determine the offloading ratio of the edge server, determine the number of idle devices required to implement the offloading task, and then calculate the offloading ratio of the idle devices to complete the offloading ratio configuration of the offloading task.
[0066] In more detail, for idle devices, the uncertainty factors are significantly increased compared to the edge server side, among which the most common ones are power failure and network disconnection. Therefore, when the edge server side and the idle side collaborate to unload tasks, the proportion and number of idle devices should not be too large. Therefore, in step S21, the accident rate function ACC is first constructed. i,j .
[0067] The ACCmax is the maximum acceptable accident rate, then k 1 is the accident rate parameter, which is generally a fixed value.
[0068] In more detail, in step S21, considering the offloading cost, the transaction unit price of the edge server is set to P b , the transaction unit price of the idle device is P b k 2 , k 2 is the discount coefficient. Then the unloading costs at the edge server and idle end are Pic 1 =P b α bs W i,j , Pic 2 =nk 2 P b β θ W i,j Indicates. max Indicates the highest reasonable price provided by the edge server, Pic 1 + Pic 2 ≤Pic max , then by α bs With β θ The relationship between and can be obtained as follows:
[0069] Therefore, in step S21, the offloading ratio α of the edge server is determined according to the accident rate function and the offloading cost function. bs The constraints are:
[0070]
[0071] In more detail, when determining the offloading ratio α of the edge server bs After the constraint conditions (range) are met, in step S22, a convex optimization algorithm is used to optimize and determine the offloading ratio α of the edge server. bs , and determine the number of idle devices n required for the collaborative offloading task, and then calculate the offloading ratio β of the idle devices θ , complete the unloading ratio configuration of the unloading task.
[0072] In detail, based on the offloading ratio configuration, the requirements of latency, energy consumption, accident rate and safety are comprehensively analyzed to determine the upload offloading strategy of the offloading task in the network offloading model, step S3 further includes:
[0073] S31. Based on the network offloading model, the overall upload decentralized offloading strategy and the decentralized upload no offloading strategy are proposed;
[0074] S32, based on the offloading ratio configuration, calculating the latency and energy consumption of the overall upload decentralized offloading strategy, as well as the latency and energy consumption of the decentralized upload non-offloading strategy;
[0075] S33. Comprehensively compare and analyze the requirements of latency, energy consumption, accident rate and safety, and select one of the overall upload decentralized offloading strategy and the decentralized upload no offloading strategy as the upload offloading strategy for the offloading task.
[0076] In more detail, in step S31, since the entire unloading task will eventually be dispersed to the edge server and multiple idle devices for collaborative unloading, the upload unloading strategy of the unloading task can be divided into two types: the overall upload dispersed unloading strategy and the dispersed upload no unloading strategy. Among them, the overall upload dispersed unloading strategy is: the task requesting user divides the unloading task and uploads it to the edge server end and puts forward his own requirements. The edge server end then unloads the divided small tasks to the relatively idle devices for parallel processing, and then transmits them back to the edge server end, and finally delivers the processed tasks to the requesting user. The dispersed upload no unloading strategy is: the tasks are dispersedly uploaded, and the user directly uploads the main task to the edge server end, and the sub-tasks are directly uploaded to each idle device.
[0077] In more detail, in step S32, based on the determined offloading ratio configuration, the delay and energy consumption calculation and analysis are performed on the above two upload offloading strategies respectively.
[0078] Furthermore, for the overall upload decentralized offloading strategy, when processing tasks on the edge server, the delays include the user uploading task delay, the edge server processing its own task delay, the edge server offloading small tasks to the idle device delay, and various queuing delays.
[0079] In the present invention, user p i,j,p The uplink rate is represented by r i,j,p , and if the edge server needs to issue tasks, the edge server p i,1,s The uplink rate is represented by r i,1,s . p i,j,p represents the jth mobile user in the i-th area, p represents the personal terminal, and p i,1,s It represents the only edge server in the i-th region, and s represents the server side. When the queuing delay is not considered, the delay on the edge server side is Time 1 , The first part on the right side of the formula represents the upload delay of the overall task on the edge server, the second part on the right side of the formula represents the processing delay of the unloaded task on the edge server, and the third part on the right side of the formula represents the unload delay of the remaining tasks. is the execution frequency of the i-th edge server.
[0080] In addition, queuing delay is also an indispensable part of delay analysis. Based on queuing theory, the M / M / 1 model is constructed. MI is the task size, V is the transmission speed of the router, and ZC is the router utilization. According to the formula analysis, the queuing delay is proportional to the size of the task package. When the task is small, the queuing delay will be reduced. Computational offload and task division are beneficial to reducing the queuing delay. At the same time, the queuing delay is also related to the transmission speed and the utilization rate of the router.
[0081] According to the network offloading model proposed in this invention, queuing delay will appear in three places: first, there will be queuing delay when the user submits the offloading task; second, there will be queuing delay when the idle resources after processing the small task are transmitted back; third, there will be queuing delay when sending the task. Delay 1 and delay 3 will appear on the edge server side, while delay 2 will appear on the idle device side. Finally, compared with the parallel upload of split tasks by the requesting user, the overall upload of large tasks will save a small amount of delay. s In other words, finally, the overall upload decentralized offloading strategy has a latency of:
[0082]
[0083] in, Indicates the queuing delay when the user submits an uninstallation task. Indicates the queuing delay when the edge server sends tasks.
[0084] For the overall upload decentralized offloading strategy, when an idle device receives a small task, the delay is only two stages, namely, the processing task delay and the return task delay. When multiple small tasks are executed in parallel, the delay is the maximum delay of one of them. Therefore, it is only necessary to perform delay analysis on one of the idle devices at the idle end. In order to calculate the delay T of a single mobile user end, presonal It is easier to analyze and calculate the average delay, so that β θ , The same. In addition, there is the queuing delay, which is the queuing delay for returning after processing the small task. Finally, the delay on the idle device side is:
[0085]
[0086] in, Indicates the queuing delay for idle resources to transmit back after processing a small task.
[0087] It should be noted that for the overall upload decentralized offloading strategy, due to the parallelization of multiple tasks, theoretically the total delay will be reduced when the queuing delay is not considered, but in fact the queuing delay cannot be omitted. When this strategy is adopted, there will be more queuing delays than before, so whether the delay is optimized relative to the original offloading strategy will be unknown. And the queuing delay is proportional to the task size. When the task is small, the queuing delay will be reduced. Therefore, the decentralized upload without offloading strategy of decentralized uploading of tasks can reduce the size of the task package, and unlike the overall upload decentralized offloading, there is no queuing delay when sending tasks and queuing delay when returning.
[0088] For the decentralized upload without offloading strategy, the latency at the edge server is composed of the user upload latency, edge server processing latency, and the queuing latency when the user submits the offloading task. Finally, the latency at the edge server is:
[0089]
[0090] However, the decentralized upload without offloading strategy will generate a fourth queuing delay, which is the queuing delay of uploading tasks to the user end. In addition, there is also the sum of the upload delays of uploading tasks directly to each idle device. i,j,u represents the file transfer rate between users. Finally, the latency at the idle device end is:
[0091]
[0092] It can be seen that the decentralized upload offloading strategy optimizes a lot of latency on the edge server side, but on the idle device side, although it optimizes the queuing delay for the idle resources to transmit back after processing small tasks, it introduces a fourth delay and increases the upload delay of n-1 small tasks.
[0093] When a task decision is issued, the edge server will process the task at the same time as multiple mobile idle devices. In actual situations, idle devices process tasks at different speeds. In this discussion, the processing frequency is averaged, so the processing delays of multiple mobile idle devices are the same. In the case of simultaneous processing, the processing delay of the offload task is:
[0094]
[0095] In an optional embodiment of the present invention, the overall upload decentralized unloading strategy is called Strategy 1, and the decentralized upload without unloading strategy is called Strategy 2. Experimental simulation is performed on the unloading delay of the two proposed strategies and the original queuing theory strategy, and the following results are obtained: Figure 3 The delay curve shown is Figure 3It can be seen that when most of the offload tasks are on the edge server side, Strategy 2 is better than Strategy 1 and the original queuing theory offload strategy in terms of latency, and the offload ratio α on the edge server side is bs The optimal delay can be obtained when the value of is 0.7.
[0096] From the perspective of latency, the decentralized upload without offloading strategy is better than the overall upload decentralized offloading strategy. For task offloading, not only latency but also energy consumption should be considered. In terms of energy consumption, latency optimization also affects energy consumption. Latency optimization omits multiple energy-consuming steps. Through analysis, it can be seen that the decentralized upload without offloading strategy is also better than the overall upload decentralized offloading strategy in terms of energy consumption.
[0097] Based on the research content of latency and energy consumption, the energy consumption of the decentralized upload without offloading strategy is analyzed. For the decentralized upload without offloading strategy, the energy consumption is divided into the energy consumption from the user transmission task to the edge server and the idle device. 1 , energy consumption required to process tasks 2 , queuing energy consumption when users submit unloading tasks e 3 And the energy consumption of uploading tasks directly to each idle device 4 , the total energy consumption E is expressed as: E = e 1 +e 2 +e 3 +e 4 .
[0098] in, p station It is represented as the task processing power of the edge server, p presonal It is expressed as the task processing power of the idle device.
[0099] From the perspective of latency and energy consumption, the decentralized upload without offloading strategy is obviously better than the overall upload decentralized offloading strategy; but from the perspective of the task upload process, the overall upload decentralized offloading strategy packages the task as a whole and transmits it to the edge server, while the decentralized upload without offloading strategy directly transmits small tasks to the leased idle devices. Compared with the overall upload decentralized offloading strategy, the decentralized upload without offloading strategy has the following shortcomings: first, it is more complex, and the requesting user needs to communicate with n idle devices and users; second, the decentralized transmission of multiple small tasks will lead to a higher accident rate, and there will be missed or repeated transmission events; finally, security and privacy cannot be well guaranteed. Although there is a confidentiality agreement in the lease agreement, the leased user updates it in real time, and there will be delays in information exchange in the mobile blockchain. When the task is offloaded to the user who has released the lease, its security and privacy will not be guaranteed.
[0100] Therefore, in step S33, it is necessary to comprehensively compare and analyze the requirements of latency, energy consumption, accident rate and safety, and select one of the overall upload decentralized unloading strategy and the decentralized upload no unloading strategy as the upload unloading strategy for the unloading task.
[0101] In detail, after determining the offloading ratio configuration and the upload offloading strategy, in step S4, the offloading tasks are offloaded and diverted through the network offloading model according to the offloading ratio configuration and the upload offloading strategy, and the surrounding idle devices are called to realize the collaborative offloading and computational diversion of the offloading tasks.
[0102] In detail, step S5 of constructing the utility function of the offloading task and optimizing the utility function to improve the offloading efficiency of the offloading task further includes:
[0103] S51. Constructing the utility function of the offloading task based on delay and energy consumption;
[0104] S52. Optimize the utility function using an ε-greedy algorithm to improve the value of the utility function, thereby improving the unloading efficiency of the unloading task.
[0105] In more detail, in step S51, according to the determined offloading ratio configuration and the uploaded offloading strategy, the delay and energy consumption of the offloading task are analyzed and calculated, and the utility function of the offloading task is constructed based on the delay and energy consumption:
[0106]
[0107] Among them, G is the utility function, ε 1 , ε 2 is the trade-off factor, T begin and E begin They represent the delay and energy consumption required to complete the offloading task according to the original queuing theory strategy, respectively. T and E represent the delay and energy consumption required to complete the offloading task according to one of the overall upload decentralized offloading strategy and the decentralized upload without offloading strategy, respectively.
[0108] For the decentralized upload without offloading strategy, the size of the task package is reduced in terms of latency and the queuing latency is optimized. However, the energy consumption of this strategy increases due to the increase in the offloading process. It can be seen that the utility function is negative in the latency part and positive in the energy consumption part. Therefore, the utility function value is called the equilibrium point value. If the equilibrium point value is larger, better performance can be obtained with lower loss, such as increasing a small amount of energy consumption to obtain lower latency, or giving up the optimal latency to obtain reduced energy consumption.
[0109] Based on this, in more detail, in step S52, the ε-greedy algorithm is used to optimize the utility function to improve the value of the utility function, thereby improving the offloading efficiency of the offloading task and obtaining better performance with lower loss. There are two layers of optimization inside the ε-greedy algorithm, namely the edge server and the user, which can comprehensively consider the user's offloading cost and the user's experience, and improve the offloading cost performance of the offloading task.
[0110] In an optional embodiment of the present invention, based on Python and MATLAB simulation platforms, the utility functions of all unloading tasks in the region are simulated and experimented, and the single variable principle is adopted to change the size of the unloading task, and the unloading task size is the average of all unloading tasks in the region.
[0111] In detail, the GBMS algorithm and the delay-based multi-node cooperative offloading algorithm are used as comparison algorithms for experiments. The corresponding simulation curve of the utility function is as follows: Figure 4 As shown in the figure, the performance of the ε-greedy algorithm is better than the comparison algorithm, and it increases as the ε value decreases. The GBMS algorithm is a collaborative offloading between MEC ends. Due to the limit of the offloading ratio, all tasks cannot be offloaded to the edge server, so its offloading ratio is set to the upper limit of the value. The algorithm does not consider the user cost, and its performance is poor after the cost limit. The multi-node collaborative offloading algorithm based on delay is actually a greedy algorithm with optimal delay, which does not comprehensively consider the energy consumption problem. After considering the energy consumption problem in this model, its performance is also lower than the ε-greedy algorithm. When the ε-greedy algorithm is used, its optimal ε value is 0.5, which is more appropriate. It is better than other algorithms in performance and balances the utility function values of users and providers. (Note: To balance users and improve the utility function value of providers, as mentioned earlier, the greedy value ratio of users and providers is 1:1, and the ε value is also the ratio value in the algorithm. Only when it is around 0.5 can both users and providers be satisfied)
[0112] In an optional embodiment of the present invention, based on Python and MATLAB simulation platform, a simulation experiment is conducted on the resource utilization function of executable offload tasks in the region, the number of regions A = 10, μ 1 =0.8, edge server memory value C station 1000-2000G, user available memory value C presonal The number of idle devices covered by each edge server is 50-100. Using the single variable principle, the total number of unloaded tasks in the Q area is changed, and the corresponding resource utilization curve is as follows: Figure 5 As shown. Figure 5It can be seen that in the region, the available resources including the edge server and the idle end are fixed values. When the blockchain is not used to call the surrounding idle resources for the application to perform task computing offload, the upper limit of the resource utilization is about 0.45, and after calling the idle device, the resource utilization in the system reaches about 0.87. Therefore, the computing offload algorithm for offloading tasks using mobile blockchain technology improves the resource utilization of the entire system.
[0113] At the same time, if Figure 6 As shown, based on the same inventive concept as the above method, the present invention also provides an offloading system for offloading tasks in edge computing, which includes:
[0114] Model building module, used to build a network offloading model based on mobile blockchain;
[0115] The task analysis module is used to analyze and determine the offloading ratio configuration of the offloading task in the network offloading model and upload the offloading strategy;
[0116] A task execution module, used to execute the uninstallation task;
[0117] The task optimization module is used to optimize the unloading efficiency of the unloading task.
[0118] In detail, Figure 6 As shown, the model construction module, the task analysis module and the task execution module are connected in sequence, and the task optimization module is connected between the task analysis module and the task execution module; the model construction module is used to construct a network unloading model based on mobile blockchain, and the network unloading model includes an edge server and multiple devices connected to the edge server, and the edge server and multiple idle devices around it perform collaborative unloading calculation and diversion on the unloading task; the task analysis module is used to analyze and determine the unloading ratio configuration and upload unloading strategy of the unloading task in the network unloading model; the task execution module is used to execute the unloading task; and the task optimization module is used to optimize the unloading efficiency of the unloading task. Among them, the task analysis module and the task optimization module can be processed by the same or different processors.
[0119] In more detail, Figure 6 As shown, the task optimization module includes a construction unit and an optimization unit. The construction unit is used to construct the utility function of the offloading task, and the optimization unit is used to optimize the utility function.
[0120] It should be noted that since the technical principles of the system embodiment are similar to those of the aforementioned method embodiment, the same technical details will not be repeated.
[0121] In addition, based on the same inventive concept as the above-mentioned method, the present invention also provides a computer-readable storage medium and an electronic terminal; the computer-readable storage medium stores a computer program, and the computer program implements any of the above-mentioned methods when executed by a processor; the electronic terminal includes a processor and a memory, the memory is used to store the computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic terminal executes any of the above-mentioned methods.
[0122] In detail, the computer-readable storage medium, a person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to the computer program. The computer program can be stored in the computer-readable storage medium, and when the computer program is executed, the steps of the above-mentioned method embodiments are executed; and the computer-readable storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
[0123] In detail, the electronic terminal includes a processor, a memory, a transceiver and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication with each other. The memory is used to store computer programs, the communication interface is used for communication, and the processor and the transceiver are used to run the computer program, so that the electronic terminal executes the various steps of the camera coordinate mapping method for unmanned driving scenarios as described above.
[0124] In more detail, the memory may include random access memory (RAM), read-only memory (ROM), and may also include non-volatile memory, such as at least one disk storage; the processor may be a general-purpose processor such as a central processing unit (CPU), a network processor (NP), etc., or it may be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0125] To summarize, in the offloading method, system, medium and electronic terminal for offloading tasks in edge computing provided by the present invention, a network offloading model is constructed based on the mobile blockchain, and the offloading tasks are offloaded through the network offloading model. The mobile blockchain is applied to the offloading task processing of mobile edge computing, which can effectively call on the surrounding idle devices for collaborative offloading to form computing diversion, thereby improving the offloading efficiency of the offloading tasks and the resource utilization of the surrounding idle devices. In addition, the utility function of the offloading task is constructed and optimized, which further improves the offloading efficiency of the offloading task, and can obtain better performance with lower energy consumption.
[0126] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A method for offloading tasks in edge computing, characterized in that: include: Build a network offloading model based on mobile blockchain; Constructing an accident rate function and an unloading cost function of the network unloading model, and determining an unloading ratio configuration of the unloading task according to the accident rate function and the unloading cost function; Based on the offloading ratio configuration, comprehensively analyzing the requirements of latency, energy consumption, accident rate and safety, determining the upload offloading strategy of the offloading task in the network offloading model; According to the offloading ratio configuration and the upload offloading strategy, the offloading task is offloaded through the network offloading model; Constructing a utility function of the offloading task and optimizing the utility function to improve the offloading efficiency of the offloading task; The steps of constructing a network offloading model include: With the edge server as the center, covering a preset area, a coalition mobile blockchain is formed, the coalition mobile blockchain is controlled by the edge server, and all devices covered by the edge server reach a consensus and jointly follow the coalition mobile blockchain protocol; the edge server and multiple devices in the coalition mobile blockchain constitute the network offloading model; The step of constructing the accident rate function and the unloading cost function of the network unloading model, and determining the unloading ratio configuration of the unloading task according to the accident rate function and the unloading cost function, comprises: Constructing an accident rate function and an offloading cost function of the network offloading model, and determining a constraint condition of an offloading ratio of the edge server according to the accident rate function and the offloading cost function; The convex optimization algorithm is used to optimize and determine the offloading ratio of the edge server, and the number of the idle devices required to cooperate with the offloading task is determined, and then the offloading ratio of the idle devices is calculated to complete the offloading ratio configuration of the offloading task; The step of constructing the utility function of the offloading task and optimizing the utility function to improve the offloading efficiency of the offloading task includes: Based on the time delay and the energy consumption, constructing a utility function of the offloading task; The utility function is optimized by using an ε-greedy algorithm to improve the value of the utility function, thereby improving the unloading efficiency of the unloading task; The utility function of the offloading task is: Among them, G is the utility function, ε1 and ε2 are trade-off factors, and T begin and E begin They respectively represent the time delay and energy consumption required to complete the offloading task according to the original queuing theory strategy, and T and E respectively represent the time delay and energy consumption required to complete the offloading task according to one of the overall upload decentralized offloading strategy and the decentralized upload no offloading strategy.
2. The method for offloading tasks in edge computing according to claim 1, characterized in that: The blocks of the alliance mobile blockchain are divided into a primary domain, an information domain and a transaction domain. The primary domain is used to store a hash value, a computational difficulty, a timestamp and a nonce value. The information domain is used to store the computing memory of the edge server and the current state of the device. The transaction domain is used to store transaction information.
3. The method for offloading tasks in edge computing according to claim 1, characterized in that: The step of comprehensively analyzing the requirements of latency, energy consumption, accident rate and safety based on the offloading ratio configuration to determine the upload offloading strategy of the offloading task in the network offloading model includes: Based on the network offloading model, a decentralized offloading strategy for overall upload and a decentralized no-offloading strategy for upload are proposed; Based on the offloading ratio configuration, calculate the latency and energy consumption of the overall upload decentralized offloading strategy, and the latency and energy consumption of the decentralized upload non-offloading strategy; Through comprehensive comparative analysis of latency, energy consumption, accident rate and safety requirements, one of the overall upload decentralized offloading strategy and the decentralized upload no offloading strategy is selected as the upload offloading strategy for the offloading task.
4. An offloading system for offloading tasks in edge computing, characterized in that: include: Model building module, used to build a network offloading model based on mobile blockchain; A task analysis module, used to analyze and determine the offloading ratio configuration of the offloading task in the network offloading model and upload the offloading strategy; A task execution module, used for executing the uninstallation task; A task optimization module, used to optimize the unloading efficiency of the unloading task; The steps of constructing a network offloading model include: With the edge server as the center, covering a preset area, a coalition mobile blockchain is formed, the coalition mobile blockchain is controlled by the edge server, and all devices covered by the edge server reach a consensus and jointly follow the coalition mobile blockchain protocol; the edge server and multiple devices in the coalition mobile blockchain constitute the network offloading model; The steps of constructing an accident rate function and an unloading cost function of the network unloading model, and determining the unloading ratio configuration of the unloading task according to the accident rate function and the unloading cost function include: Constructing an accident rate function and an offloading cost function of the network offloading model, and determining a constraint condition of an offloading ratio of the edge server according to the accident rate function and the offloading cost function; The convex optimization algorithm is used to optimize and determine the offloading ratio of the edge server, and the number of the idle devices required to cooperate with the offloading task is determined, and then the offloading ratio of the idle devices is calculated to complete the offloading ratio configuration of the offloading task; The step of constructing the utility function of the offloading task and optimizing the utility function to improve the offloading efficiency of the offloading task includes: Based on the delay and energy consumption, construct a utility function of the offloading task; The utility function is optimized by using an ε-greedy algorithm to improve the value of the utility function, thereby improving the unloading efficiency of the unloading task; The utility function of the offloading task is: Among them, G is the utility function, ε1 and ε2 are trade-off factors, and T begin and E begin They respectively represent the time delay and energy consumption required to complete the offloading task according to the original queuing theory strategy, and T and E respectively represent the time delay and energy consumption required to complete the offloading task according to one of the overall upload decentralized offloading strategy and the decentralized upload no offloading strategy.
5. The offloading system for offloading tasks in edge computing according to claim 4, characterized in that: The task optimization module includes a construction unit and an optimization unit. The construction unit is used to construct a utility function of the offloading task, and the optimization unit is used to optimize the utility function.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
7. An electronic terminal, characterized in that: include: Processor and memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic terminal executes the method according to any one of claims 1 to 3.
