Allocation method and device of calculation unloading task and electronic equipment
By splitting the computing offloading tasks into task sub-items and classifying them, the problem of unreasonable computing resource allocation in the existing technology is solved, and more efficient computing resource utilization is achieved.
Patent Information
- Application Number
- CN202510932597.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-10-17
AI Technical Summary
In the prior art, when allocating computational offload tasks, the intelligent decision gateway usually directly allocates the tasks to available remote computing resources, resulting in irrational allocation of computing resources and low computing efficiency.
The computing offloading task is split into multiple task sub-items, and the control instructions of each task sub-item are classified. The appropriate computing node for offloading is determined according to its category, and fuzzy clustering or pre-trained classification model is used for classification.
By splitting and classifying tasks, the utilization of computing resources is improved, and the rationality of the allocation of computing offload tasks and the computing efficiency are improved.
Smart Images

Figure CN120803655A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and particularly relates to a method and device for allocating a computing offloading task and an electronic device. BACKGROUND
[0002] Computing offloading technology is an innovative computing paradigm designed to address the limited computing resources of computers, mobile devices, and Internet of Things terminals. This technology allows devices to offload computationally intensive tasks, such as complex algorithm execution, big data processing, or machine learning model inference, from local hardware to more powerful remote computing resources, such as the cloud or edge servers.
[0003] The process of computing offloading typically includes three key steps: 1. Task uploading, which involves sending data to be processed to edge or cloud servers via a wireless network; 2. Task processing, which involves executing computing tasks by remote computing resources; 3. Result returning, which involves transmitting processed data back to the original device.
[0004] However, different types of computing tasks require different computing resources. In existing technologies, intelligent decision gateways typically directly assign computing offloading tasks to available remote computing resources when allocating computing offloading tasks, which results in poor rationality of computing resource allocation and low computing efficiency. SUMMARY
[0005] Embodiments of the present application provide a method and device for allocating a computing offloading task and an electronic device to solve the problem that, in existing technologies, intelligent decision gateways typically directly assign computing offloading tasks to available remote computing resources when allocating computing offloading tasks, resulting in poor rationality of computing resource allocation and low computing efficiency.
[0006] In a first aspect, embodiments of the present application provide a method for allocating a computing offloading task, comprising:
[0007] splitting the computing offloading task into a plurality of task sub-items, each of which corresponds to at least one control instruction;
[0008] classifying the control instructions to obtain the category of each control instruction;
[0009] for each task sub-item, determining the category of the task sub-item based on the category of the control instruction corresponding to the task sub-item;
[0010] offloading the task sub-items to the computing nodes corresponding to the categories.
[0011] Optionally, the step of classifying the control instructions to obtain the category of each control instruction comprises:
[0012] a fuzzy clustering-based method is used to classify the control instructions to obtain a category of each control instruction;
[0013] Alternatively, the control instructions are input into a pre-trained classification model for classification processing to obtain a category of each control instruction.
[0014] Optionally, the fuzzy clustering-based method is used to classify the control instructions to obtain a category of each control instruction, including:
[0015] an instruction feature vector of the control instruction is obtained, and an initial center feature vector of the category is determined;
[0016] an initial membership degree of the control instruction to the category is determined based on the instruction feature vector and the initial center feature vector;
[0017] the initial center feature vector and the initial membership degree are iteratively updated to obtain a target center feature vector of the category;
[0018] a target membership degree of the control instruction to the category is determined based on the instruction feature vector and the target center feature vector;
[0019] the category of the control instruction is determined based on the target membership degree.
[0020] Optionally, the initial center feature vector and the initial membership degree are iteratively updated to obtain a target center feature vector of the category, including:
[0021] the initial center feature vector and the initial membership degree are iteratively updated for multiple times until a preset stop condition is met to obtain the target center feature vector of the category;
[0022] wherein, the rth iteration update includes:
[0023] a rth round center feature vector of a target category is calculated based on an (r-1)th round membership degree of all the control instructions to the target category and the instruction feature vector, the target category being any of the categories, and r being a positive integer;
[0024] a rth round membership degree of the control instruction to the target category is determined based on the instruction feature vector and the rth round center feature vector;
[0025] wherein, the 0th round membership degree is the initial membership degree, and the 0th round center feature vector is the initial center feature vector.
[0026] Optionally, the category is used to represent a resource type, and the initial center feature vector of the category is determined, including:
[0027] determining a target resource type corresponding to a target category, the target category being any one of the categories;
[0028] determining a target control instruction in the control instructions as the target control instruction, the target control instruction occupying the target resource type most;
[0029] determining an instruction feature vector of the target control instruction as an initial center feature vector of the target category.
[0030] Optionally, an initial membership degree of the i-th control instruction to the j-th category is :
[0031]
[0032] wherein, Noc is the number of the categories, fi is an instruction feature vector of the i-th control instruction, fj is an initial center feature vector of the j-th category, fp is an initial center feature vector of the p-th category, and μ is a preset fuzzy index. i
[0033] Optionally, before the splitting the computing offloading task into a plurality of task sub-items, the method further comprises:
[0034] receiving the computing offloading task sent by a client node in a case that a preset offloading condition is met, wherein the preset offloading condition is that a time required for completing the computing offloading task at the client node is greater than a preset waiting time.
[0035] Optionally, the categories include a central processing unit category and a graphics processing unit category, the control instructions of the central processing unit category occupy resources of a central processing unit, and the control instructions of the graphics processing unit category occupy resources of a graphics processing unit.
[0036] In a second aspect, an embodiment of the present application provides a computing offloading task allocation apparatus, comprising:
[0037] a splitting module configured to split a computing offloading task into a plurality of task sub-items, each of the task sub-items corresponding to at least one control instruction;
[0038] a classification module configured to classify the control instructions to obtain a category of each of the control instructions;
[0039] a determination module configured to determine, for each of the task sub-items, a category of the task sub-item based on a category of the control instruction corresponding to the task sub-item;
[0040] an offloading module configured to offload the task sub-items to computing nodes corresponding to the categories.
[0041] In a third aspect, the embodiments of the present application further provide an electronic device, comprising a memory, a processor, and a program stored in the memory and capable of running on the processor; the processor is configured to read the program in the memory to implement the steps in the allocation of the computing offloading task as described in the first aspect.
[0042] In a fourth aspect, the embodiments of the present application further provide a readable storage medium for storing a program, which, when executed by a processor, implements the steps in the allocation of the computing offloading task as described in the first aspect.
[0043] In the embodiments of the present application, the computing offloading task is split into a plurality of task sub-items, each of which corresponds to at least one control instruction; the control instructions are classified to obtain the category of each control instruction; for each task sub-item, the category of the task sub-item is determined based on the category of the control instruction corresponding to the task sub-item; and the task sub-item is offloaded to the computing node corresponding to the category. By splitting and classifying the computing offloading task, the allocation of the computing offloading task can be made more reasonable, the computing resources of the computing nodes can be maximized, and the computing efficiency can be improved. BRIEF DESCRIPTION OF DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the description of the embodiments of the present application will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0045] Figure 1 is a flowchart of the allocation method of the computing offloading task provided by the embodiments of the present application;
[0046] Figure 2 is a structural diagram of the allocation device of the computing offloading task provided by the embodiments of the present application;
[0047] Figure 3 is a structural diagram of the electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION
[0048] The technical solutions of the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0049] Embodiments of the present application provide a method and device for allocating a computing offloading task and an electronic device. The method can be applied in different scenarios to allocate a computing offloading task. For example, the method for allocating a computing offloading task provided by embodiments of the present application can be applied in a digital twin platform running scenario. The digital twin platform includes a client, an intelligent decision gateway, a server and an online computer. The intelligent decision gateway, the server and the online computer are in the same network. The method for allocating a computing offloading task provided by embodiments of the present application can be executed by the intelligent decision gateway.
[0050] For convenience of description, the method for allocating a computing offloading task provided by embodiments of the present application will be described by taking the application of the method in a digital twin platform as an example. As shown in Figure 1 The method for allocating a computing offloading task includes the following steps:
[0051] In step 101, the computing offloading task is split into a plurality of task sub-items. Each task sub-item corresponds to at least one control instruction.
[0052] It should be understood that the computing offloading task is sent by the client to the intelligent decision gateway. In the digital twin platform, the client is used to receive an operation instruction input by a user, so that the user can manage a digital twin application through the client and the client displays a management result corresponding to the operation instruction to the user. Specifically, the client can run on an online computer. The online computer is mainly a computer device configured with an integrated graphics card.
[0053] In a specific implementation, the intelligent decision gateway monitors the computing resources of all online computers in real time. For example, the computing resources of the online computer mainly include a central processing unit (CPU) occupancy rate, a memory, a graphics processing unit (GPU) occupancy rate and GPU display memory.
[0054] Optionally, in some embodiments, the categories include a central processing unit category and a graphics processing unit category. The control instruction of the central processing unit category occupies the resources of the central processing unit. The control instruction of the graphics processing unit category occupies the resources of the graphics processing unit.
[0055] Optionally, in some embodiments, before step 101, the method further includes:
[0056] receiving the computing offloading task sent by the client node under the condition that a preset offloading condition is met. The preset offloading condition is that the time required for the computing offloading task to be completed at the client node is greater than a preset waiting time.
[0057] In some embodiments, the client receives control commands input by the user, generates a computing task based on the control commands, and determines whether the computing task should be executed on the local computer or offloaded to another online computer. Specifically, the local computer is the computer device running the client, i.e., the client node. Whether the computing task is executed on the local computer or offloaded to another online computer depends primarily on the total time required for the local computer to complete the computing task. If this total time is too long, it indirectly increases the waiting time for the user to complete the control command, resulting in a poor user experience.
[0058] Therefore, in some embodiments, a preset waiting time wt is set. max , if the total time cct required for the client node to complete the computing task local >wt max , then the computing task needs to be offloaded to other computers on the network for execution; if cct local ≤wt max , the computing task can be executed on the local computer.
[0059] In some embodiments, the total time required for a computer to complete a computing task is composed of two parts: one part is the time required for the local computer to complete the previous computing task. The other part is the time required for the local computer to complete this calculation task Therefore, the total time cct required for the local computer to complete the calculation task local as follows:
[0060]
[0061] in, Indicates the time required to complete the calculation of the previous calculation task, Indicates the time required to wait for the result of the previous calculation task to be returned. Indicates the time required to wait for the computing task to start executing. Indicates the workload of the local computer, that is, the CPU or GPU clock cycles required to perform this computing task, cr local Represents the computing resources of the local computer.
[0062] When a client node needs to offload a computing task to another networked computer, it converts the computing task into a computational offload task and sends it to the intelligent decision-making gateway. The intelligent decision-making gateway receives the computational offload task. In step 101, the intelligent decision-making gateway parses the computational offload task and, based on the control instructions entered by the user, splits the computational offload task into multiple sub-task items, each of which corresponds to at least one control instruction.
[0063] Step 102, classifying the control instructions to obtain the category of each control instruction.
[0064] In practical applications, there are usually a variety of different user control instructions. For example, in digital twin applications, there are rendering generation of data twin scenes, monitoring and updating of entity states, sorting and searching of large-scale data, etc. Different control instructions require different types of resources. By classifying the task sub-items, the types of computing resources required to complete the task sub-items can be determined in advance, so as to facilitate the generation of unloading decision schemes by combining the real-time monitoring of available computing resources of the on-line computer.
[0065] Optionally, in some embodiments, the category is used to represent a resource type, and the category includes a CPU processing category and a GPU processing category. Since the design and architecture of CPU and GPU are different, CPU is good at processing complex logic and sequential tasks, and GPU is good at parallel computing and graphics processing. By classifying the task sub-items and determining the types of computing resources corresponding to the task sub-items, the advantages of CPU and GPU can be maximized, and the overall performance and efficiency can be improved.
[0066] As an optional implementation, the step 102 includes:
[0067] The control instructions are input into a pre-trained classification model for classification processing to obtain the category of each control instruction.
[0068] In this embodiment, the control instructions contained in the task sub-items are input into a pre-trained classification model to obtain the category of each control instruction. In specific implementation, the classification model can be obtained by training a deep learning model using paired sample control instructions and sample classification information, which is not limited here.
[0069] In practical applications, for a plurality of control instructions with strong dependencies, parallel computing is not possible, and they need to be combined into a task sub-item. Some of these control instructions may be suitable for CPU processing, and some may be suitable for GPU processing. Or in physical simulation, although physical simulation can be performed by GPU, in some cases, complex physical models and simulation logic are more suitable for running on CPU.
[0070] Therefore, in order to handle such uncertain situations and improve the accuracy of classification, as another optional implementation, the step 102 includes:
[0071] The control instructions are classified based on a fuzzy clustering method to obtain the category of each control instruction.
[0072] In the embodiment, the control instructions are classified by the fuzzy clustering-based method, each category is regarded as a fuzzy cluster, the membership function of each clustering category is derived by fuzzy clustering according to the number of fuzzy clusters (i.e. the number of categories), and the classification of the control instructions is determined according to the distance between the feature vector of the control instruction and the center feature vector of each clustering category.
[0073] Specifically, in some embodiments, the fuzzy clustering-based method classifies the control instructions to obtain the category of each control instruction, including:
[0074] obtaining the instruction feature vector of the control instruction, and determining the initial center feature vector of the category;
[0075] determining the initial membership of the control instruction to the category based on the instruction feature vector and the initial center feature vector;
[0076] iteratively updating the initial center feature vector and the initial membership to obtain the target center feature vector of the category;
[0077] determining the target membership of the control instruction to the category based on the instruction feature vector and the target center feature vector;
[0078] determining the category of the control instruction based on the target membership.
[0079] It should be understood that for each control instruction, its corresponding feature vector, i.e. the instruction feature vector, is obtained. For each category, the center feature vector based on the category, i.e. the initial center feature item, is initialized.
[0080] As an optional implementation, the initial center feature vector of the category is randomly initialized. As another optional implementation, the category is used to represent the resource type, and the initial center feature vector of the category is determined, including:
[0081] determining the target resource type corresponding to the target category, the target category being any of the categories;
[0082] determining the control instruction that occupies the target resource type the most in the control instructions as the target control instruction;
[0083] determining the instruction feature vector of the target control instruction as the initial center feature vector of the target category.
[0084] In the embodiment, for any category, the feature vector of the control instruction that occupies the resource type the most is selected as the initial center feature vector of the category based on the corresponding resource type of the category, so as to reduce the number of iterations and improve the convergence speed.
[0085] Optionally, in some embodiments, the iteratively updating the initial center feature vector and the initial membership degree, to obtain a target center feature vector of the category, comprises:
[0086] iteratively updating the initial center feature vector and the initial membership degree for multiple times until a preset stopping condition is met, to obtain a target center feature vector of the category;
[0087] wherein the rthiterative updating comprises:
[0088] based on the (r-1)thround membership degree of the target category for all the control instructions and the instruction feature vector, a rthround center feature vector of the target category is calculated, the target category is any one of the categories, and r is a positive integer;
[0089] based on the instruction feature vector and the rthround center feature vector, the rthround membership degree of the target category for the control instruction is determined;
[0090] wherein the 0thround membership degree is the initial membership degree, and the 0thround center feature vector is the initial center feature vector.
[0091] The following is described with reference to a specific embodiment. It is assumed that the number of control instructions is n, the number of categories is denoted as NOC, and in the embodiment in which the categories include CPU processing categories and GPU processing categories, the value of NOC is 2.
[0092] First, the instruction feature vectors of all control instructions are obtained, and the instruction feature vector of the ithcontrol instruction is denoted as f i . The initial center feature vector in the jthcategory is randomly initialized as For each control instruction, the initial membership degree of the control instruction for each category is calculated. Exemplarily, the initial membership degree of the ithcontrol instruction for the jthcategory is denoted as The calculation is as follows:
[0093]
[0094] wherein, is the initial center feature vector of the pthcategory, and μ is a preset fuzzy index.
[0095] In the process of the first iterative updating, the center feature vector of each category is updated. Exemplarily, the center feature vector of the jthcategory is updated to obtain the 1stround center feature vector of the jthcategory is as follows:
[0096]
[0097] wherein n is the number of control instructions.
[0098] Further, for each control instruction, the membership of the control instruction to each category is updated based on the updated center feature vector. For example, the first round membership of the ith control instruction to the jth category is:
[0099]
[0100] The center feature vector of each category obtained in the iteration is taken as the target center feature vector of the category. For example, in some embodiments, the preset stopping condition is:
[0101]
[0102] wherein r is the number of iterations, is the rth round membership of the ith control instruction to the jth category, is the (r-1)th round membership of the ith control instruction to the jth category, and η is an error threshold.
[0103] In this way, the membership of each control instruction in the task sub-item to a category (e.g., CPU processing category, GPU processing category) can be determined, and the control instruction can be further classified according to the membership of the control instruction to different categories. In this embodiment, the fuzzy relationship between different control instructions or task sub-items can be further determined by calculating the distance between them, so as to accurately describe the uncertainty information in the computing offloading task.
[0104] Step 103: For each task sub-item, the category of the task sub-item is determined based on the category of the control instruction corresponding to the task sub-item.
[0105] As an optional implementation, for each task sub-item, the number of control instructions corresponding to each category in the task sub-item is calculated, and the category with the largest number of corresponding control instructions is determined as the category of the task sub-item.
[0106] Step 104: The task sub-item is offloaded to the computing node corresponding to the category.
[0107] It should be understood that the category of the computing node can be determined according to the computing performance of the computing node. For example, the category of the computing node with rich CPU computing resources is the CPU processing category. In specific implementation, the computing node can be other in-network computer.
[0108] In some embodiments, the intelligent decision gateway offloads the task sub-items to the computing nodes corresponding to the categories, which can be directly transmitted to the corresponding computing nodes, referred to as target computing nodes. In other embodiments, the task sub-items can be first transmitted to other non-target computing nodes or other intelligent decision gateways (in specific implementations, there can be multiple intelligent decision gateways in the digital twin platform), and the task sub-items are forwarded to the target computing nodes by the other non-target computing nodes or the other intelligent decision gateways. In specific implementations, whether to use a certain way to send the task sub-items can be determined according to the transmission energy consumption generated by different ways and whether it meets the delay constraint. The time spent for the transmission of the task sub-items and the computing results should be minimized as much as possible to avoid generating too high waiting delay and affecting the user experience.
[0109] In some embodiments, there can be multiple available on-network computers (i.e., multiple computing nodes) around the local computer running the client. In this embodiment, when the local computer needs to offload the computing task to other on-network computers for execution, the computing offloading task is split into multiple task sub-items and distributed to the corresponding on-network computers for computing, which will inevitably lead to the selection of the optimal offloading strategy, and there will also be a problem of load balancing between multiple on-network computers.
[0110] Optionally, in some embodiments, the number of computing nodes is multiple, and when the computing performance of a single computing node is low, the computing burden of the single computing node can be reduced through the cooperation of multiple offloadable nodes, so that it can handle the computing task that the performance of a single device is difficult to cope with. Through the intelligent decision algorithm, the computing task can be offloaded to the computing node with better communication channel condition, thereby reducing the energy consumption caused by data transmission. By monitoring all the computing resources available to the computing nodes globally and generating an offloading decision scheme based thereon, the interference between different users and the competition for computing resources can be reduced, so as to improve the benefit of computing task offloading.
[0111] The selection of the computing node is expressed as an optimization problem that meets the constraints of computing resource occupation, delay, energy consumption, benefit, etc.
[0112] Specifically, the computing resource occupation constraint can be described as follows: in order to ensure that the computing resources and communication resources of the computing nodes are maximally utilized, it is stipulated that the computing offloading task of the same client in a certain time can only occupy q% of the available computing resources of all the computing nodes. The value of q can be set and updated according to the scale of the computing nodes and the real-time available computing resources of all the computing nodes monitored by the intelligent monitoring gateway.
[0113] The computing resource occupation constraint can be expressed as:
[0114]
[0115] where x denotes a computing node receiving a computation offloading task, X denotes a set of all computation offloading tasks, ch denotes a channel used by a client c to transmit a computation offloading task to a computing node x, denotes computation resources occupied by computation offloading tasks received by a computing node x through a channel ch, denotes available computation resources of a computing node monitored by an intelligent decision gateway at time t, C denotes a set of all clients.
[0116] Specifically, the latency constraint includes time spent on transmission and time spent on completing a computation offloading task which can be specifically denoted as follows:
[0117]
[0118] where ds tr denotes actual data volume transmitted when transmitting a computation offloading task, R cx denotes transmission rate between a client c and a computing node x, denotes time spent on completing a computation offloading task, wl c denotes computation amount of a computation offloading task issued by a client c, cr cx denotes computation resources allocated to a client c by a computing node x. On this basis, the latency constraint t c can be denoted as:
[0119]
[0120] Specifically, since the energy consumption of a client can be chosen to be ignored due to computation offloading tasks being allocated to computing nodes for completion, the energy consumption constraint of a computation offloading task can be denoted as follows:
[0121]
[0122] where EC x denotes energy consumption of a computing node x for completing a computation offloading task, P x denotes power of a computing node x, denotes time spent on completing a computation offloading task.
[0123] Specifically, the weighted sum of energy consumption reduction and latency reduction brought by computation task offloading of a client is taken as a standard for evaluating computation offloading benefits, and the computation offloading benefit constraint is denoted as:
[0124]
[0125] where Incomec denotes the benefit of the client c to perform computation offloading, t is a time weight, denotes the time spent by the client c to complete the computation offloading task locally, ec is an energy consumption weight, denotes the energy consumption of the client c to complete the computation offloading task locally. For example, for different clients, t and ec may be different, so as to reflect the importance of time and energy consumption to different users.
[0126] Based on the above constraints, the goal of the offloading decision in the present application is to maximize the total benefit of the system Income(D, P, S) under the condition of determining the offloading decision scheme D, the uploading power P and the computing resource allocation strategy S of the computing nodes, which is expressed as:
[0127]
[0128] wherein C1-C5 represent different constraint conditions respectively, C1 represents that the computation tasks offloaded by the same client within a certain time can only occupy q% of the available computing resources of all the computers in the network; C2 represents that the computation tasks can be executed locally by the client, and the computing resources occupied by the completion of the computation tasks do not exceed the upper limit of all computing resources of the computer device operated by the client; C3 represents that the energy consumption of the computation offloading task issued by the client c does not exceed the preset energy consumption threshold EC stand ; C4 represents that the computer in the network receiving the computation offloading task must allocate non-zero computing resources to it; and C5 represents that for each computer in the network, the computing resources allocated to all computation offloading tasks cannot exceed the upper limit of its own computing resources.
[0129] Taking any one category as an example, in the case where the number of computing nodes corresponding to the category is multiple, the task sub-item corresponding to the category can be allocated among the multiple computing nodes corresponding to the category according to the above constraint content. In some embodiments, a category constraint can also be added based on the category of the computing nodes and the task sub-items, which is not limited here.
[0130] The above optimization problem is a nonlinear programming problem, and the gradient descent method, the conjugate gradient method, the Lagrange multiplier method, the genetic algorithm, the particle swarm optimization algorithm, etc. can be used to solve it. Which method to choose depends on the specific situation of the nonlinear programming problem, such as the problem size, the constraint type, whether a global optimal solution is needed, and the availability of computing resources, etc., which is not limited in the present application.
[0131] Optionally, in some embodiments, after the step 104, the method further comprises:
[0132] receiving the calculation results sent by the plurality of computing nodes;
[0133] summarizing the plurality of calculation results to obtain a target calculation result;
[0134] sending the calculation results to a client, the client being a client that initiates the calculation offloading task.
[0135] It should be understood that for a certain period of channel, a plurality of task sub-items or calculation results may be involved in transmission within a certain period of time. The intelligent decision gateway can analyze the conflicts that may be caused by the transmission of different task sub-items or calculation results in different offloading decision schemes through the reachable set analysis algorithm, in combination with the existing offloading decision scheme of the platform, real-time transmission data, simulated transmission data, and the like, based on the transmission of the current task sub-item or calculation result, and continuously monitor the transmission progress of the offloading sub-task or calculation result, compare the simulated transmission data with the real-time transmission situation, and adjust the transmission path that the offloading sub-task or calculation result can reach within a certain time range according to the reachable set analysis algorithm in real time, so as to improve the prediction accuracy.
[0136] Optionally, in some embodiments, the A* search algorithm can be used to analyze all nodes (other in-network computers or intelligent decision gateways) of the future task sub-item or calculation result transmission path set, filter out transmission paths that do not meet the delay constraint or have excessively high energy consumption, and update the existing reachable data set, so as to realize gradual and progressive transmission path analysis optimization, explicitly define the transmission conflict events that may occur in the future, and timely adjust, further improve the transmission efficiency of the task sub-item or calculation result, and then improve the response speed of the control instruction, so as to ensure a smooth user experience.
[0137] The method provided in the present application is applied to a digital twin platform. By converting the digital twin application control instruction input by a user through a client into a calculation offloading task, and offloading the calculation offloading task to other computing nodes based on the calculation offloading technology, the calculation task that cannot be quickly completed by a single low-configuration computer is completed with the help of other computing nodes, so as to solve the problem that the low-configuration set display computer commonly used by the current operator cannot smoothly run the digital twin application due to the deficiency in computing performance. At the same time, in this process, the calculation offloading task is classified fuzzily to accurately describe the uncertainty information in the calculation offloading task, improve the rationality of the offloading decision scheme, and ultimately achieve the purpose of making the set display device smoothly run the digital twin application.
[0138] Please refer toFigure 2 The embodiment of the present application further provides a computing offloading task allocation device 200. Figure 2 FIG. 1 is a structural diagram of the computing offloading task allocation device 200 provided by the embodiment of the present application. Since the computing offloading task allocation device 200 solves the problem by the similar principle as the computing offloading task allocation method shown in the embodiment of the present application, the implementation of the computing offloading task allocation device 200 can be referred to the implementation of the method, and the repeated parts will not be described herein. Figure 1
[0139] As shown in FIG. 2, the computing offloading task allocation device 200 comprises: Figure 2 a splitting module 201, configured to split a computing offloading task into a plurality of task sub-items, each of the task sub-items corresponding to at least one control instruction;
[0140] a classification module 202, configured to classify the control instructions to obtain a category of each of the control instructions;
[0141] a determination module 203, configured to determine, for each of the task sub-items, a category of the task sub-item based on the category of the control instruction corresponding to the task sub-item;
[0142] an offloading module 204, configured to offload the task sub-items to a computing node corresponding to the category.
[0143] Optionally, the classification module 202 comprises:
[0144] a first classification unit, configured to classify the control instructions based on a fuzzy clustering method to obtain the category of each of the control instructions;
[0145] or a second classification unit, configured to input the control instructions into a pre-trained classification model for classification processing to obtain the category of each of the control instructions.
[0146] Optionally, the first classification unit is specifically configured to:
[0147] obtain an instruction feature vector of the control instruction, and determine an initial center feature vector of the category;
[0148] determine an initial membership degree of the control instruction to the category based on the instruction feature vector and the initial center feature vector;
[0149] iteratively update the initial center feature vector and the initial membership degree to obtain a target center feature vector of the category;
[0150]
[0151] determine a target membership degree of the control instruction to the category based on the instruction feature vector and the target center feature vector;
[0152] determine the category of the control instruction based on the target membership degree.
[0153] Optionally, the iterative updating of the initial center feature vector and the initial membership degree to obtain the target center feature vector of the category comprises:
[0154] iteratively updating the initial center feature vector and the initial membership degree for multiple times until a preset stop condition is met to obtain the target center feature vector of the category;
[0155] wherein the rthiterative updating comprises:
[0156] calculating the rthround center feature vector of the target category based on the (r-1)thround membership degree of the target category to all the control instructions and the instruction feature vector, the target category being any of the categories, and r being a positive integer;
[0157] determining the rthround membership degree of the control instruction to the target category based on the instruction feature vector and the rthround center feature vector;
[0158] wherein the 0thround membership degree is the initial membership degree, and the 0thround center feature vector is the initial center feature vector.
[0159] Optionally, the categories are used to represent resource types, and the determining of the initial center feature vector of the category comprises:
[0160] determining a target resource type corresponding to a target category, the target category being any of the categories;
[0161] determining a control instruction occupying the target resource type most in the control instructions as a target control instruction;
[0162] determining an instruction feature vector of the target control instruction as the initial center feature vector of the target category.
[0163] Optionally, the initial membership degree of the ithcontrol instruction to the jthcategory is
[0164]
[0165] wherein N0C is the number of the categories, f i is an instruction feature vector of the ithcontrol instruction, is an initial center feature vector of the jthcategory, The initial center feature vector of the pth category is μ, and μ is a preset fuzzy index.
[0166] Optionally, the computing offloading task allocation apparatus 200 further comprises:
[0167] The receiving module is configured to receive the computing offloading task sent by the client node when a preset offloading condition is met, wherein the preset offloading condition is that a time required for completing the computing offloading task at the client node is greater than a preset waiting time.
[0168] Optionally, the categories include a central processing unit category and a graphics processing unit category, control instructions of the central processing unit category occupy resources of a central processing unit, and control instructions of the graphics processing unit category occupy resources of a graphics processing unit.
[0169] In several embodiments provided in the present application, it should be understood that the disclosed method and device can be implemented in other manners. For example, the described device embodiments are merely schematic. For example, the division of the units is merely a logical function division. There can be another division manner for actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0170] In addition, each function unit in the embodiments of the present application can be integrated in a processing unit, or each unit can be physically separated, or two or more than two units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware, or in the form of hardware plus software function units.
[0171] The integrated unit implemented in the form of software function units can be stored in a computer readable storage medium. The above software function unit stored in a storage medium includes a plurality of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute part of steps of the transceiving method described in the embodiments of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.
[0172] As Figure 3As shown, the embodiments of the present application also provide an electronic device 300, which comprises a processor 301 configured to read a program in a memory 302 and perform the following steps:
[0173] The computing offloading task is split into a plurality of task sub-items, each of which corresponds to at least one control instruction;
[0174] The control instructions are classified to obtain the category of each control instruction;
[0175] For each task sub-item, the category of the task sub-item is determined based on the category of the control instruction corresponding to the task sub-item;
[0176] The task sub-items are offloaded to the computing node corresponding to the category.
[0177] Optionally, the processor 301 is further configured to read a program in the memory 302 and perform the following steps:
[0178] The control instructions are classified based on a fuzzy clustering method to obtain the category of each control instruction;
[0179] Alternatively, the control instructions are input into a pre-trained classification model for classification processing to obtain the category of each control instruction.
[0180] Optionally, the processor 301 is further configured to read a program in the memory 302 and perform the following steps:
[0181] An instruction feature vector of the control instruction is obtained, and an initial center feature vector of the category is determined;
[0182] An initial membership degree of the control instruction to the category is determined based on the instruction feature vector and the initial center feature vector;
[0183] The initial center feature vector and the initial membership degree are iteratively updated to obtain a target center feature vector of the category;
[0184] A target membership degree of the control instruction to the category is determined based on the instruction feature vector and the target center feature vector;
[0185] The category of the control instruction is determined based on the target membership degree.
[0186] Optionally, the processor 301 is further configured to read a program in the memory 302 and perform the following steps:
[0187] The initial center feature vector and the initial membership degree are iteratively updated for multiple times until a preset stopping condition is met, and a target center feature vector of the category is obtained.
[0188] wherein the rth iteration updates, including:
[0189] based on the (r-1)th round membership of the target category to all the control instructions and the instruction feature vector, a (rth round center feature vector of the target category is calculated, the target category being any of the categories, and r being a positive integer;
[0190] based on the instruction feature vector and the rth round center feature vector, a rth round membership of the control instruction to the target category is determined;
[0191] wherein the 0th round membership is the initial membership, and the 0th round center feature vector is the initial center feature vector.
[0192] Optionally, the processor 301 is further configured to read a program in the memory 302 and perform the following steps:
[0193] determining a target resource type corresponding to a target category, the target category being any of the categories;
[0194] determining a control instruction in the control instructions that occupies the target resource type the most as a target control instruction;
[0195] determining an instruction feature vector of the target control instruction as an initial center feature vector of the target category.
[0196] Optionally, the initial membership of the ith control instruction to the jth category is :
[0197]
[0198] wherein N0C is the number of the categories, f i is an instruction feature vector of the ith control instruction, is an initial center feature vector of the jth category, is an initial center feature vector of the pth category, and μ is a preset fuzzy index.
[0199] Optionally, the processor 301 is further configured to read a program in the memory 302 and perform the following steps:
[0200] receiving the computing offloading task sent by a client node in a case where a preset offloading condition is met, wherein the preset offloading condition is that a time required for the computing offloading task to be completed at the client node is greater than a preset waiting time.
[0201] Optionally, the categories include a central processing unit category and a graphics processing unit category, control instructions of the central processing unit category occupy resources of a central processing unit, and control instructions of the graphics processing unit category occupy resources of a graphics processing unit.
[0202] The electronic device 300 provided by the embodiment of the present application can execute the above-mentioned method for allocating a computing offloading task, and has similar implementation principles and technical effects, which will not be described here again.
[0203] The embodiment of the present application further provides a readable storage medium, and the readable storage medium stores a program, the program is executed by a processor to realize each process of the above-mentioned method for allocating a computing offloading task, and can achieve the same technical effects, and to avoid repetition, which will not be described here again.
[0204] The readable storage medium can be any available medium or data storage device accessible by the processor, including but not limited to a magnetic memory (for example, a floppy disk, a hard disk, a magnetic tape, a magneto-optical disk (Magneto-Optical Disk, MO), etc.), an optical memory (for example, a compact disk (Compact Disk, CD), a digital versatile disk (Digital Versatile Disc, DVD), a Blu-ray disc (Blu-ray Disc, BD), a high-definition versatile disk (High-Definition Versatile Disc, HVD), etc.), and a semiconductor memory (for example, a read-only memory (Read-Only Memory, ROM), an erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable read only memory, EEPROM), a non-volatile memory (NAND FLASH), a solid state disk (Solid State Disk or Solid State Drive, SSD), etc.
[0205] It should be noted that in this document, the term "comprising" or "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed, or include elements inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0206] Those skilled in the art can clearly understand the above-mentioned embodiment method can be realized by means of software and necessary general hardware platform, of course, also can be realized by hardware, but in many cases, the former is a better embodiment. According to such understanding, the technical scheme of the present application can be embodied in the form of software product, and the computer software product is stored in a storage medium (such as ROM / RAM, disk, optical disk), including a plurality of instructions to make a terminal (which can be a mobile phone, computer, server, air conditioner, or network equipment, etc.) execute the method described in various embodiments of the present application.
[0207] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative, not limiting, and those skilled in the art can make many forms without departing from the purpose of the present application and the scope protected by the claims under the inspiration of the present application, which all belong to the protection of the present application.
Claims
1. A method for allocating computing offloading tasks, characterized in that: include: Splitting the computation offloading task into a plurality of task sub-items, each of the task sub-items corresponding to at least one control instruction; Classifying the control instructions to obtain a category of each control instruction; For each of the task sub-items, determining a category of the task sub-item based on a category of a control instruction corresponding to the task sub-item; Unloading the task sub-item to a computing node corresponding to the category.
2. The method according to claim 1, characterized in that The classifying the control instructions to obtain a category of each control instruction includes: Classifying the control instructions based on a fuzzy clustering method to obtain a category of each control instruction; Alternatively, the control instructions are input into a pre-trained classification model for classification processing to obtain the category of each control instruction.
3. The method according to claim 2, characterized in that The fuzzy clustering-based method classifies the control instructions to obtain a category of each control instruction, including: Obtaining an instruction feature vector of the control instruction, and determining an initial central feature vector of the category; determining an initial membership of the control instruction to the category based on the instruction feature vector and the initial central feature vector; Iteratively updating the initial central feature vector and the initial membership degree to obtain a target central feature vector of the category; determining a target membership of the control instruction to the category based on the instruction feature vector and the target center feature vector; The category of the control instruction is determined based on the target membership.
4. The method according to claim 3, characterized in that The iterative updating of the initial central feature vector and the initial membership degree to obtain the target central feature vector of the category includes: Iteratively updating the initial central feature vector and the initial membership degree for multiple times until a preset stopping condition is met, thereby obtaining a target central feature vector of the category; Among them, the rth iteration update includes: Based on the r-1th round membership of all the control instructions to the target category and the instruction feature vector, calculate the rth round central feature vector of the target category, where the target category is any one of the categories and r is a positive integer; determining the r-th round membership of the control instruction to the target category based on the instruction feature vector and the r-th round center feature vector; The 0th round membership is the initial membership, and the 0th round central feature vector is the initial central feature vector.
5. The method according to claim 3, characterized in that The category is used to characterize the resource type, and determining the initial central feature vector of the category includes: Determining a target resource type corresponding to a target category, wherein the target category is any of the categories; Determine the control instruction that occupies the most target resource types among the control instructions as the target control instruction; The instruction feature vector of the target control instruction is determined as the initial central feature vector of the target category.
6. The method according to claim 3, characterized in that The initial membership of the control instruction of the i-th item to the category of the j-th item for: Where NOC is the number of categories, f i is the instruction feature vector of the control instruction of the i-th item, is the initial central feature vector of the jth category, is the initial central feature vector of the pth category, and μ is the preset fuzzy index.
7. The method according to claim 1, characterized in that Before splitting the computation offloading task into a plurality of task sub-items, the method further includes: The computing offloading task sent by the client node is received when a preset offloading condition is met, wherein the preset offloading condition is that the time required for the computing offloading task to be completed at the client node is greater than a preset waiting time.
8. The method according to claim 1, characterized in that The categories include: a central processing unit (CPU) category and a graphics processing unit (GPU) category. Control instructions of the CPU category occupy resources of the CPU, and control instructions of the graphics processing unit (GPU) category occupy resources of the graphics processing unit (GPU).
9. A device for allocating computing offloading tasks, characterized in that: include: A splitting module, configured to split the computation offloading task into a plurality of task sub-items, each of the task sub-items corresponding to at least one control instruction; A classification module, configured to classify the control instructions to obtain a category of each control instruction; a determination module, configured to determine, for each of the task sub-items, a category of the task sub-item based on a category of a control instruction corresponding to the task sub-item; The unloading module is used to unload the task sub-item to the computing node corresponding to the category.
10. An electronic device comprising: A memory, a processor, and a program stored in the memory and executable on the processor; characterized in that: The processor is configured to read a program in a memory to implement the steps in allocating computation offloading tasks according to any one of claims 1 to 8.
11. A readable storage medium for storing a program, characterized in that: When the program is executed by a processor, the program implements the steps in allocating computational offloading tasks according to any one of claims 1 to 8.