Internet of things device-based task allocation method, network training method and device thereof
The method optimizes task allocation in edge deep learning systems by predicting performance using computation and resource graphs, enhancing resource utilization and adapting to dynamic environments in heterogeneous Internet of Things devices.
Patent Information
- Application Number
- JP2023548262
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-02-10
- Filing Date
- 2022-02-08
- Publication Date
- 2025-05-20
- Estimated Expiration
- 2042-02-08
AI Technical Summary
Current task allocation methods in edge deep learning systems do not effectively utilize the underlying deep learning algorithm, limiting resource optimization and scheduling effectiveness in heterogeneous Internet of Things devices, particularly in latency-sensitive applications like autonomous driving and augmented reality.
A method for training a network to predict the performance of task allocation policies based on computation and resource graphs, using feature extraction and prediction modules to optimize task allocation among heterogeneous Internet of Things devices, incorporating a continuous learning mechanism for self-adaptation.
Maximizes resource utilization and improves system performance by intelligently allocating tasks to available resources, adapting to dynamic environments and optimizing task scheduling in distributed edge computing systems.
Smart Images

Figure 0007680552000018 
Figure 0007680552000019 
Figure 0007680552000020
Abstract
Description
[Technical field]
[0001] (CROSS-REFERENCE TO RELATED APPLICATIONS) This application is filed based on a Chinese patent application bearing application number 202110184998.5, filed with the China Patent Office on February 10, 2021, and claims priority to the Chinese patent application, the entire contents of which are incorporated herein by reference.
[0002] The present disclosure relates to the field of Internet of Things (IoT), and in particular to a method for task allocation based on one or more Internet of Things devices, a network training method, and an apparatus thereof. [Background technology]
[0003] With the breakthrough of 5G mobile network and deep learning technology, artificial intelligence-based Internet of Things applications and services will also face new opportunities and challenges, and the Internet of All Things is undoubtedly a major related technology trend. Cloud computing can meet the computing power and storage resource requirements of computationally intensive deep learning tasks, but it cannot be applied to Internet of Things scenarios such as autonomous driving, virtual reality (VR), and augmented reality (AR) that are sensitive to latency, reliability, and privacy, and the resources on a single Internet of Things device are very limited. Therefore, distributed edge computing, which can perform inter-device cooperation on multiple interconnected heterogeneous Internet of Things devices, can be an effective solution, and an intelligent computing task allocation method among heterogeneous devices is the key to its realization.
[0004] Currently, in edge deep learning systems, distributed training and inference of deep learning models are mainly realized by a layer scheduling algorithm based on model partitioning, in which certain layers of the model are assigned to the edge side and the remaining layers are assigned to the cloud center, with the edge server being mainly used to process low-level data and the cloud server being mainly used to process high-level data. Such a task allocation policy does not involve the allocation of the underlying deep learning algorithm, which limits the effectiveness of task scheduling and resource optimization. Summary of the Invention [Means for solving the problem]
[0005] Embodiments of the present disclosure provide a task allocation method based on one or more Internet of Things devices, a network training method, and an apparatus therefor.
[0006] The technical solution of the embodiment of the present invention is realized as follows.
[0007] In a first aspect, an embodiment of the present disclosure provides a method for training one or more Internet of Things device-based networks, the method including: determining a training data set; and training a first network based on the training data set, the training data set including at least one task assignment policy and a corresponding actual performance, the one actual performance being obtained by actually executing based on the corresponding task assignment policy; and the first network being used to predict performance of the task assignment policy.
[0008] In some optional embodiments of the present disclosure, the method further includes determining a computation graph corresponding to a task to be processed and a resource graph corresponding to one or more Internet of Things devices, and generating at least one task allocation policy based on the computation graph and the resource graph.
[0009] In some optional embodiments of the present disclosure, generating at least one task allocation policy based on the computation graph and the resource graph includes generating at least one resource subgraph based on the computation graph and the resource graph; One A resource subgraph contains one task allocation policy. or represents one task assignment policy. The task allocation policy is used to assign at least one node of a corresponding resource graph to each node of the computation graph, and one node in the resource subgraph is assigned to one or more Internet of Things device capabilities. and / or resources , and an edge between two adjacent nodes in the resource subgraph represents at least a portion of the capabilities of one or more Internet of Things devices. and / or resources represents a relationship between at least a portion of
[0010] In some embodiments of the present disclosure, generating at least one resource subgraph based on the computation graph and the resource graph includes: determining a first node in the computation graph, the first node being the node with the highest resource demand; determining at least one second node in the resource graph, the at least one second node being a node that satisfies a resource demand of the first node; determining a resource subgraph based on each second node; One A resource subgraph contains one task assignment policy. or represents one task assignment policy. , and.
[0011] In some optional embodiments of the present disclosure, training the first network includes training the first network based on predicted performance and actual performance of at least one task allocation policy.
[0012] In some optional embodiments of the present disclosure, obtaining a predicted performance of at least one task allocation policy includes: Obtaining a predicted performance corresponding to each resource subgraph using the first network based on the computation graph and each resource subgraph.
[0013] In some embodiments of the present disclosure, obtaining a predicted performance corresponding to each resource subgraph using the first network includes: extracting features of the computation graph using a first network feature extraction module to obtain a first feature set; Using the feature extraction module, extract features of the at least one resource sub-graph respectively to obtain at least one second feature set; Obtaining a predicted performance corresponding to each resource subgraph based on the first feature set, each second feature set and a prediction module of the first network.
[0014] In some embodiments of the present disclosure, obtaining a predicted performance corresponding to each resource subgraph based on the first feature set, each second feature set, and a prediction module of the first network includes: Obtaining at least one third feature set based on the first feature set and each second feature set, each third feature set including the first feature set and each second feature set; obtaining predicted data corresponding to each resource sub-graph based on each third feature set and the prediction module; and obtaining predicted performance corresponding to each resource sub-graph based on the predicted data corresponding to each resource sub-graph.
[0015] In some optional embodiments of the present disclosure, the predictive data comprises: A predicted execution time length for executing the target task; A predicted energy consumption for executing the task to be processed; and and a predicted reliability for executing the target task.
[0016] In some optional embodiments of the present disclosure, obtaining a predicted performance corresponding to each resource subgraph based on the predicted data corresponding to each resource subgraph includes performing a weighting process on the predicted data corresponding to each resource subgraph according to a predetermined weight to obtain a predicted performance corresponding to each resource subgraph.
[0017] In some optional embodiments of the present disclosure, training the first network includes training the feature extraction module and the prediction module based on predicted performance and actual performance of each task allocation policy.
[0018] In some embodiments of the present disclosure, training the feature extraction module and the prediction module includes: The method includes backpropagating the error between the predicted performance and the actual performance of each task allocation policy, and updating network parameters of the feature extraction module and the prediction module of the first network using a gradient descent algorithm until the error between the predicted performance and the actual performance satisfies a predetermined condition.
[0019] In some optional embodiments of the present disclosure, the method further includes updating the training data set, and the updated training data set is used to update the first network.
[0020] In some embodiments of the present disclosure, updating the training data set comprises: Based on the computation graph and the resource graph, generate at least one resource subgraph by using at least one of a heuristic method, a graph search method, a graph optimization method, and a subgraph matching method, and after actually executing according to a task allocation policy corresponding to each resource subgraph, obtain actual performance corresponding to each resource subgraph, and add the computation graph, each resource subgraph, and the corresponding actual performance to the training data set; Based on the computation graph and the resource graph, generate at least one resource subgraph by using at least one of a heuristic method, a graph search method, a graph optimization method, and a subgraph matching method, obtain a predicted performance corresponding to each resource subgraph through a first network, select a resource subgraph with the best predicted performance from the at least one resource subgraph, obtain an actual performance after actually executing according to a task allocation policy corresponding to the resource subgraph with the best predicted performance, and add the computation graph, the resource subgraph with the best predicted performance, and the corresponding actual performance to the training data set; The method includes at least one of: generating at least one resource sub-graph based on the computation graph and the resource graph using a random walk method, obtaining actual performance after actually executing according to a task allocation policy corresponding to each resource sub-graph, and adding the computation graph, the at least one resource sub-graph, and the actual performance to the training data set.
[0021] In a second aspect, an embodiment of the present disclosure further provides an Internet of Things device-based task allocation method, the method including: determining a computation graph corresponding to the task to be processed and a resource graph corresponding to one or more Internet of Things devices; generating at least one task allocation policy based on the computation graph and the resource graph; inputting the at least one task allocation policy into a first network and obtaining a predicted performance corresponding to each task allocation policy; determining a task allocation policy that provides the best predicted performance; and performing task allocation based on the determined task allocation policy.
[0022] In some optional embodiments of the present disclosure, generating at least one task allocation policy based on the computation graph and the resource graph includes generating at least one resource subgraph based on the computation graph and the resource graph; One A resource subgraph contains one task allocation policy. or represents one task assignment policy. The task allocation policy is used to assign at least one node of a corresponding resource graph to each node of the computation graph, and one node in the resource subgraph is assigned to one or more Internet of Things device capabilities. and / or resources , and an edge between two adjacent nodes in the resource subgraph represents at least a portion of the capabilities of one or more Internet of Things devices. and / or resources represents a relationship between at least a portion of
[0023] In some optional embodiments of the present disclosure, generating at least one resource subgraph based on the computation graph and the resource graph comprises determining a first node in the computation graph, the first node being a node with the highest resource demand; and determining at least one second node in the resource graph, the at least one second node being a node that satisfies a resource demand of the first node; determining a resource subgraph based on each second node; One A resource subgraph contains one task assignment policy. or represents one task assignment policy. , and.
[0024] In some optional embodiments of the present disclosure, the first network is optimized by a method according to a first aspect of the embodiments of the present disclosure.
[0025] In some optional embodiments of the present disclosure, obtaining a predicted performance corresponding to each task allocation policy includes obtaining a predicted performance corresponding to each resource subgraph using a first network based on the computation graph and each resource subgraph.
[0026] In some embodiments of the present disclosure, obtaining a predicted performance corresponding to each resource subgraph using the first network includes: extracting features of the computation graph using a first network feature extraction module to obtain a first feature set; Using the feature extraction module, extract features of the at least one resource sub-graph respectively to obtain at least one second feature set; Obtaining a predicted performance corresponding to each resource subgraph based on the first feature set, each second feature set and a prediction module of the first network.
[0027] In some embodiments of the present disclosure, obtaining a predicted performance corresponding to each resource subgraph based on the first feature set, each second feature set, and a prediction module of the first network includes: Obtaining at least one third feature set based on the first feature set and each second feature set, each third feature set including the first feature set and each second feature set; obtaining predicted data corresponding to each resource sub-graph based on each third feature set and the prediction module; and obtaining predicted performance corresponding to each resource sub-graph based on the predicted data corresponding to each resource sub-graph.
[0028] In some optional embodiments of the present disclosure, the predictive data comprises: A predicted execution time length for executing the target task; A predicted energy consumption for executing the task to be processed; and and a predicted reliability for executing the target task.
[0029] In some optional embodiments of the present disclosure, obtaining a predicted performance corresponding to each resource subgraph based on the predicted data corresponding to each resource subgraph includes performing a weighting process on the predicted data corresponding to each resource subgraph according to a predetermined weight to obtain a predicted performance corresponding to each resource subgraph.
[0030] In some optional embodiments of the present disclosure, the method further includes: after performing task allocation, obtaining actual performance when the task to be processed is executed according to a corresponding task allocation policy, and storing the corresponding task allocation policy and the obtained actual performance in a training data set, and the training data set is used to update the first network.
[0031] In a third aspect, an embodiment of the present disclosure further provides an Internet of Things device-based network training apparatus, the apparatus comprising: a first determining unit and a training unit, wherein: The first determining unit is configured to determine a training data set, the training data set including at least one task allocation policy and a corresponding actual performance, the one actual performance being obtained by actually executing according to the corresponding task allocation policy; The training unit is configured to train a first network based on the training data set, and the first network is used to predict performance of a task allocation policy.
[0032] In some optional embodiments of the present disclosure, the apparatus further comprises a first generation unit configured to determine a computation graph corresponding to a task to be processed and a resource graph corresponding to one or more Internet of Things devices, and generate at least one task allocation policy based on the computation graph and the resource graph.
[0033] In some embodiments of the present disclosure, the first generating unit is configured to generate at least one resource sub-graph based on the computation graph and the resource graph; One A resource subgraph contains one task allocation policy. or represents one task assignment policy. The task allocation policy is used to assign at least one node of a corresponding resource graph to each node of the computation graph, and one node in the resource subgraph is assigned to one or more Internet of Things device capabilities. and / or resources , and an edge between two adjacent nodes in the resource subgraph represents at least a portion of the capabilities of one or more Internet of Things devices. and / or resources represents a relationship between at least a portion of
[0034] In some optional embodiments of the present disclosure, the first generation unit determines a first node in the computation graph, the first node being a node with the largest resource demand; determines at least one second node in the resource graph, the at least one second node being a node that satisfies the resource demand of the first node; and determines one resource subgraph based on each second node; One A resource subgraph contains one task assignment policy. or represents one task assignment policy. It is configured as follows.
[0035] In some optional embodiments of the present disclosure, the training unit is configured to train the first network based on predicted and actual performance of at least one task allocation policy.
[0036] In some optional embodiments of the present disclosure, the training unit is further configured to obtain, based on the computation graph and each resource subgraph, a predicted performance corresponding to each resource subgraph using the first network.
[0037] In some optional embodiments of the present disclosure, the training unit is configured to extract features of the computational graph using a feature extraction module of the first network to obtain a first feature set, extract features of the at least one resource subgraph using the feature extraction module respectively to obtain at least one second feature set, and obtain a prediction performance corresponding to each resource subgraph based on the first feature set, each second feature set, and a prediction module of the first network.
[0038] In some optional embodiments of the present disclosure, the training unit is configured to obtain at least one third feature set based on the first feature set and each second feature set, each third feature set including the first feature set and each second feature set, obtain prediction data corresponding to each resource subgraph based on each third feature set and the prediction module, and obtain prediction performance corresponding to each resource subgraph based on the prediction data corresponding to each resource subgraph.
[0039] In some optional embodiments of the present disclosure, the predictive data comprises: A predicted execution time length for executing the target task; A predicted energy consumption for executing the task to be processed; and and a predicted reliability for executing the target task.
[0040] In some optional embodiments of the present disclosure, the training unit is configured to weight the prediction data corresponding to each resource sub-graph according to a predetermined weight to obtain a prediction performance corresponding to each resource sub-graph.
[0041] In some optional embodiments of the present disclosure, the training unit is configured to train the feature extraction module and the prediction module based on predicted and actual performance of each task allocation policy.
[0042] In some optional embodiments of the present disclosure, the training unit is configured to back-propagate an error between the predicted performance and the actual performance of each task allocation policy, and update network parameters of the feature extraction module and the prediction module of the first network using a gradient descent algorithm until the error between the predicted performance and the actual performance satisfies a predetermined condition.
[0043] In some optional embodiments of the present disclosure, the apparatus further comprises an updating unit configured to update the training data set, and the updated training data set is used to update the first network.
[0044] In some optional embodiments of the present disclosure, the update unit comprises: According to the computation graph and the resource graph, at least one of a heuristic method, a graph search method, a graph optimization method, and a subgraph matching method is used to generate at least one resource subgraph, and after actually executing according to a task allocation policy corresponding to each resource subgraph, an actual performance corresponding to each resource subgraph is obtained, and the computation graph, each resource subgraph, and the corresponding actual performance are added to the training data set; According to the computation graph and the resource graph, at least one of a heuristic method, a graph search method, a graph optimization method, and a subgraph matching method is used to obtain at least one resource subgraph, and a predicted performance corresponding to each resource subgraph is obtained through a first network; a resource subgraph with the best predicted performance is selected from the at least one resource subgraph, and an actual performance is obtained after actually executing according to a task allocation policy corresponding to the resource subgraph with the best predicted performance; and the computation graph, the resource subgraph with the best predicted performance, and the corresponding actual performance are added to the training data set; The method is configured to update the training data set using at least one of the following methods: based on the computation graph and the resource graph, generate at least one resource sub-graph using a random walk method; after actually executing according to a task allocation policy corresponding to each resource sub-graph, obtain actual performance; and add the computation graph, the at least one resource sub-graph, and the actual performance to the training data set.
[0045] In a fourth aspect, an embodiment of the present disclosure further provides an Internet of Things device based task allocation apparatus, the apparatus comprising: a second determining unit, a second generating unit, a predicting unit and a task allocating unit, wherein: The second determination unit is configured to determine a computation graph corresponding to a task to be processed and a resource graph corresponding to one or more Internet of Things devices; The second generating unit is configured to generate at least one task allocation policy based on the computation graph and the resource graph; The prediction unit is configured to input the at least one task allocation policy into a first network and obtain a predicted performance corresponding to each task allocation policy; The task allocation unit is configured to determine a task allocation policy with the best predicted performance, and perform task allocation based on the determined task allocation policy.
[0046] In some optional embodiments of the present disclosure, the second generation unit is configured to generate at least one resource sub-graph based on the computation graph and the resource graph; One A resource subgraph contains one task allocation policy. or represents one task assignment policy. The task allocation policy is used to assign at least one node of a corresponding resource graph to each node of the computation graph, and one node in the resource subgraph is assigned to one or more Internet of Things device capabilities. and / or resources, and an edge between two adjacent nodes in the resource subgraph represents at least a portion of the capabilities of one or more Internet of Things devices. and / or resources represents a relationship between at least a portion of
[0047] In some optional embodiments of the present disclosure, the second generation unit determines a first node in the computation graph, the first node being a node with the largest resource demand; determines at least one second node in the resource graph, the at least one second node being a node that satisfies the resource demand of the first node; and determines one resource subgraph based on each second node; One A resource subgraph contains one task assignment policy. or represents one task assignment policy. It is configured as follows.
[0048] In some optional embodiments of the present disclosure, the first network is optimized by an apparatus according to a third aspect of the embodiments of the present disclosure.
[0049] In some optional embodiments of the present disclosure, the prediction unit is configured to obtain, based on the computation graph and each resource subgraph, a predicted performance corresponding to each resource subgraph using a first network.
[0050] In some optional embodiments of the present disclosure, the prediction unit is configured to extract features of the computation graph using a feature extraction module of the first network to obtain a first feature set, extract features of the at least one resource subgraph using the feature extraction module respectively to obtain at least one second feature set, and obtain predicted performance corresponding to each resource subgraph based on the first feature set, each second feature set, and the prediction module of the first network.
[0051] In some optional embodiments of the present disclosure, the prediction unit is configured to obtain at least one third feature set based on the first feature set and each second feature set, each third feature set including the first feature set and each second feature set, obtain prediction data corresponding to each resource subgraph based on each third feature set and the prediction module, and obtain predicted performance corresponding to each resource subgraph based on the prediction data corresponding to each resource subgraph.
[0052] In some optional embodiments of the present disclosure, the predictive data comprises: A predicted execution time length for executing the target task; A predicted energy consumption for executing the task to be processed; and and a predicted reliability for executing the target task.
[0053] In some optional embodiments of the present disclosure, the prediction unit is configured to perform a weighting process on the prediction data corresponding to each resource sub-graph according to a predefined weight, to obtain a prediction performance corresponding to each resource sub-graph.
[0054] In some optional embodiments of the present disclosure, the apparatus further comprises an acquisition unit configured to acquire actual performance when the task to be processed is executed according to a corresponding task allocation policy after performing task allocation, and store the corresponding task allocation policy and the acquired actual performance in a training data set, and the training data set is used to update the first network.
[0055] In a fifth aspect, an embodiment of the present disclosure further provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, causes the processor to implement a method according to the first or second aspect of the embodiment of the present disclosure.
[0056] In a sixth aspect, an embodiment of the present disclosure further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, the processor, when executing the program, realizing a method according to the first or second aspect of the embodiment of the present disclosure.
[0057] In the technical solution of an embodiment of the present disclosure, on the one hand, by determining a training data set, training a first network based on the training data set, the training data set including at least one task allocation policy and corresponding actual performance, where one actual performance is obtained by actually executing based on the corresponding task allocation policy, the actual performance is an actual value of performance, the first network is used to predict performance of the task allocation policy, and on the other hand, determining a computation graph corresponding to a task to be processed and a resource graph corresponding to one or more Internet of Things devices, generating at least one task allocation policy based on the computation graph and the resource graph, inputting the at least one task allocation policy into the first network, obtaining a predicted performance corresponding to each task allocation policy, the predicted performance is a predicted value of performance, determining a task allocation policy with the best predicted performance, and performing task allocation based on the determined task allocation policy. In this way, by training the first network, a prediction of system performance for executing the tasks to be processed using a specific task allocation policy is realized, thereby determining an optimal allocation policy and achieving an optimal matching between the tasks to be processed and the available resources of the equipment in the task allocation process, thereby maximizing resource utilization and improving system performance. The present invention provides, for example, the following: (Item 1) 1. A method for training an Internet of Things device-based network, comprising: 1. A network training method comprising: determining a training data set; and training a first network based on the training data set, the training data set including at least one task assignment policy and a corresponding actual performance, the one actual performance being obtained by actually executing based on the corresponding task assignment policy, and the first network being used to predict performance of the task assignment policy. (Item 2) The network training method comprises: determining a computation graph corresponding to the task to be processed and a resource graph corresponding to one or more Internet of Things devices, and generating at least one task allocation policy based on the computation graph and the resource graph; Item 1. A method for training a network according to item 1. (Item 3) generating at least one task allocation policy based on the computation graph and the resource graph, generating at least one resource subgraph based on the computation graph and the resource graph, each resource subgraph including a task assignment policy, the task assignment policy being used to assign at least one node of a corresponding resource graph to each node of the computation graph, a node in the resource subgraph representing at least a portion of capabilities of one or more Internet of Things devices, and an edge between two adjacent nodes in the resource subgraph representing a relationship between at least a portion of capabilities of one or more Internet of Things devices; Item 2. A method for training a network according to item 2. (Item 4) generating at least one resource subgraph based on the computation graph and the resource graph, determining a first node in the computation graph, the first node being the node with the highest resource demand; determining at least one second node in the resource graph, the at least one second node being a node that satisfies a resource demand of the first node; determining a resource subgraph based on each second node, each resource subgraph including a task allocation policy; Item 3. A method for training a network according to item 3. (Item 5) Training the first network includes: training the first network based on predicted and actual performance of at least one task allocation policy; obtaining a predicted performance corresponding to each resource subgraph using a first network based on the computation graph and each resource subgraph; Item 1. A method for training a network according to item 1. (Item 6) Obtaining a predicted performance corresponding to each resource subgraph using the first network includes: extracting features of the computation graph using a first network feature extraction module to obtain a first feature set; Using the feature extraction module, extract features of the at least one resource sub-graph respectively to obtain at least one second feature set; and obtaining a predicted performance corresponding to each resource subgraph based on the first feature set, each second feature set, and a prediction module of the first network. Item 5. A method for training a network according to item 5. (Item 7) Obtaining a predicted performance corresponding to each resource subgraph based on the first feature set, each second feature set, and a prediction module of the first network, Obtaining at least one third feature set based on the first feature set and each second feature set, each third feature set including the first feature set and each second feature set; Obtaining prediction data corresponding to each resource sub-graph according to each third feature set and the prediction module; and obtaining a prediction performance corresponding to each resource sub-graph according to the prediction data corresponding to each resource sub-graph. Item 6. A method for training a network according to item 6. (Item 8) Training the first network includes: training the feature extraction module and the prediction module based on predicted and actual performance of each task allocation policy; Item 8. A method for training a network according to item 7. (Item 9) Training the feature extraction module and the prediction module includes: backpropagating the error between the predicted performance and the actual performance of each task allocation policy, and updating network parameters of the feature extraction module and the prediction module of the first network using a gradient descent algorithm until the error between the predicted performance and the actual performance satisfies a predetermined condition; Item 9. A method for training a network according to item 8. (Item 10) The network training method further includes updating the training data set; Updating the training data set comprises: Based on the computation graph and the resource graph, generate at least one resource subgraph by using at least one of a heuristic method, a graph search method, a graph optimization method, and a subgraph matching method, and after actually executing according to a task allocation policy corresponding to each resource subgraph, obtain actual performance corresponding to each resource subgraph, and add the computation graph, each resource subgraph, and the corresponding actual performance to the training data set; Based on the computation graph and the resource graph, generate at least one resource subgraph by using at least one of a heuristic method, a graph search method, a graph optimization method, and a subgraph matching method, obtain a predicted performance corresponding to each resource subgraph through a first network, select a resource subgraph with the best predicted performance from the at least one resource subgraph, obtain an actual performance after actually executing according to a task allocation policy corresponding to the resource subgraph with the best predicted performance, and add the computation graph, the resource subgraph with the best predicted performance, and the corresponding actual performance to the training data set; Based on the computation graph and the resource graph, generate at least one resource sub-graph using a random walk method, and obtain actual performance after actually executing according to a task allocation policy corresponding to each resource sub-graph; and add the computation graph, the at least one resource sub-graph and the actual performance to the training data set. Item 1. A method for training a network according to item 1. (Item 11) 1. An Internet of Things device based task allocation method, comprising: determining a computation graph corresponding to the task to be processed and a resource graph corresponding to one or more Internet of Things devices; generating at least one task allocation policy based on the computation graph and the resource graph; inputting the at least one task allocation policy into a first network and obtaining a predicted performance corresponding to each task allocation policy; determining a task allocation policy that has the best predicted performance; and performing task allocation based on the determined task allocation policy. (Item 12) generating at least one task allocation policy based on the computation graph and the resource graph, generating at least one resource subgraph based on the computation graph and the resource graph, each resource subgraph including a task assignment policy, the task assignment policy being used to assign at least one node of a corresponding resource graph to each node of the computation graph, a node in the resource subgraph representing at least a portion of capabilities of one or more Internet of Things devices, and an edge between two adjacent nodes in the resource subgraph representing a relationship between at least a portion of capabilities of one or more Internet of Things devices; Item 12. The task allocation method according to item 11. (Item 13) generating at least one resource subgraph based on the computation graph and the resource graph, determining a first node in the computation graph, the first node being the node with the highest resource demand; determining at least one second node in the resource graph, the at least one second node being a node that satisfies a resource demand of the first node; determining a resource subgraph based on each second node, each resource subgraph including a task allocation policy; Item 13. The task allocation method according to item 12. (Item 14) Obtaining a predicted performance corresponding to each task allocation policy includes: obtaining a predicted performance corresponding to each resource subgraph using a first network based on the computation graph and each resource subgraph; Item 12. The task allocation method according to item 11. (Item 15) Obtaining a predicted performance corresponding to each resource subgraph using the first network includes: extracting features of the computation graph using a first network feature extraction module to obtain a first feature set; Using the feature extraction module, extract features of the at least one resource sub-graph respectively to obtain at least one second feature set; and obtaining a predicted performance corresponding to each resource subgraph based on the first feature set, each second feature set, and a prediction module of the first network. Item 15. The task allocation method according to item 14. (Item 16) Obtaining a predicted performance corresponding to each resource subgraph based on the first feature set, each second feature set, and a prediction module of the first network, Obtaining at least one third feature set based on the first feature set and each second feature set, each third feature set including the first feature set and each second feature set; Obtaining prediction data corresponding to each resource sub-graph according to each third feature set and the prediction module; and obtaining a prediction performance corresponding to each resource sub-graph according to the prediction data corresponding to each resource sub-graph. Item 16. The task allocation method according to item 15. (Item 17) The task allocation method includes: After performing task allocation, the method further includes obtaining an actual performance when the target task is executed according to a corresponding task allocation policy, and storing the corresponding task allocation policy and the obtained actual performance in a training data set, which is used to update the first network. Item 12. The task allocation method according to item 11. (Item 18) An internet of things device-based network training device, comprising: a first decision unit and a training unit; The first determining unit is configured to determine a training data set, the training data set including at least one task allocation policy and a corresponding actual performance, the one actual performance being obtained by actually executing according to the corresponding task allocation policy; The network training apparatus, wherein the training unit is configured to train a first network based on the training data set, the first network being used to predict performance of a task allocation policy. (Item 19) The network training apparatus further comprises a first generation unit configured to determine a computation graph corresponding to a task to be processed and a resource graph corresponding to one or more Internet of Things devices, and to generate at least one task allocation policy based on the computation graph and the resource graph. Item 19. A network training apparatus according to item 18. (Item 20) The first generation unit is configured to generate at least one resource subgraph based on the computation graph and the resource graph, each resource subgraph including a task assignment policy, the task assignment policy being used to assign at least one node of a corresponding resource graph to each node of the computation graph, a node in the resource subgraph representing at least a part of capabilities of one or more Internet of Things devices, and an edge between two adjacent nodes in the resource subgraph representing a relationship between at least a part of capabilities of one or more Internet of Things devices; 20. A network training apparatus according to item 19. (Item 21) The first generation unit determines a first node in the computation graph, the first node being a node with the largest resource demand; determines at least one second node in the resource graph, the at least one second node being a node that satisfies the resource demand of the first node; and determines a resource subgraph based on each second node, where each resource subgraph is configured to include a task allocation policy. 20. A network training apparatus according to item 19. (Item 22) An internet of things device-based task allocation device, comprising: a second determination unit, a second generation unit, a prediction unit and a task allocation unit; The second determination unit is configured to determine a computation graph corresponding to a task to be processed and a resource graph corresponding to one or more Internet of Things devices; The second generating unit is configured to generate at least one task allocation policy based on the computation graph and the resource graph; The prediction unit is configured to input the at least one task allocation policy into a first network and obtain a predicted performance corresponding to each task allocation policy; The task allocation unit is configured to determine a task allocation policy with the best predicted performance, and to perform task allocation based on the determined task allocation policy. (Item 23) A computer-readable storage medium having stored thereon a computer program that, when executed by a processor, causes the processor to realize the Internet of Things device-based network training method described in any one of items 1 to 10, or, when executed by a processor, causes the processor to realize the Internet of Things device-based task assignment method described in any one of items 11 to 17. (Item 24) An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, The processor executes the program to realize the Internet of Things device-based network training method described in any one of items 1 to 10, or the program, when executed by the processor, realizes the Internet of Things device-based task assignment method described in any one of items 11 to 17. [Brief description of the drawings]
[0058] [Figure 1] FIG. 2 is a schematic diagram of a selective scene applied to an embodiment of the present disclosure.
[0059] [Diagram 2] 1 is an exemplary flowchart of an Internet of Things device-based network training method according to an embodiment of the present disclosure.
[0060] [Diagram 3] 1 is an exemplary flowchart of a method for generating a resource sub-graph in an embodiment of the present disclosure.
[0061] [Figure 4] FIG. 2 is a schematic diagram of generating a resource subgraph in an embodiment of the present disclosure.
[0062] [Diagram 5] 1 is an exemplary flowchart of a method for obtaining predicted performance in an embodiment of the present disclosure.
[0063] [Figure 6a] FIG. 1 is a schematic diagram of feature extraction of a computation graph in an embodiment of the present disclosure.
[0064] [Figure 6b] FIG. 2 is a schematic diagram of feature extraction of a resource subgraph in an embodiment of the present disclosure;
[0065] [Figure 7] 1 is an exemplary flowchart of an Internet of Things appliance-based task allocation method according to an embodiment of the present disclosure.
[0066] [Figure 8] FIG. 1 is a schematic diagram of an Internet of Things appliance-based task allocation method according to an embodiment of the present disclosure.
[0067] [Figure 9] FIG. 1 is a schematic diagram of a configuration of a task allocation system according to an embodiment of the present disclosure.
[0068] [Figure 10] FIG. 1 is an exemplary structural diagram of the configuration of an Internet of Things device-based network training device according to an embodiment of the present disclosure.
[0069] [Figure 11] FIG. 2 is an exemplary structural diagram of the configuration of an Internet of Things device-based network training device according to an embodiment of the present disclosure.
[0070] [Figure 12]FIG. 3 is an exemplary structural diagram of the configuration of an Internet of Things device-based network training device according to an embodiment of the present disclosure.
[0071] [Figure 13] FIG. 2 is an exemplary structural diagram of an Internet of Things device-based task allocation device according to an embodiment of the present disclosure;
[0072] [Figure 14] FIG. 2 is an exemplary structural diagram of a hardware configuration of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0073] In the following, the present disclosure will be explained in more detail with reference to the drawings and specific embodiments.
[0074] On the one hand, with the breakthrough of deep learning technology and the promotion and popularization of 5G technology, more and more intelligent services will be provided in the fields of vehicle networking, smart elderly care, smart community, industrial Internet, etc., and the realization of these intelligent services often relies on artificial intelligence technology and deep learning models. On the other hand, with the rapid increase in the number and intelligence degree of one or more Internet of Things devices, in order to make full use of the resource-constrained and highly heterogeneous Internet of Things devices, it can be considered to utilize the idle resources (also called free resources, idle resources, available resources, idle capacity, free capacity, available capacity, and idle capacity) on the widely distributed Internet of Things devices to perform computation-intensive computation tasks in a distributed manner through resource sharing and device cooperation. In view of this, the embodiments of the present disclosure mainly aim to build a resource scheduling among heterogeneous Internet of Things devices, an end-to-end trainable network model, and a task allocation method that realizes automatic optimization and is high-performance and intelligently self-adaptive. This task allocation method can obtain optimal system performance by learning long-term optimized resource management and task scheduling policies. It allocates appropriate computing power, storage and communication resources to nodes in the computation graph, promotes the realization of distributed machine learning (e.g., deep model training and inference) in device-to-device collaboration, and further contributes to the realization of intelligent applications and services in the Internet of Things scene.
[0075] FIG. 1 is a schematic diagram of a selected scene applied to an embodiment of the present disclosure. As shown in FIG. 1, a smart home service may include, but is not limited to, services such as a home service robot, intelligent monitoring, virtual reality (VR), and intelligent control. The Internet of Things devices can be used to collect structured and unstructured data, including video, image, voice, text, and other data, and the collected data can be input into a designed network model, and the hardware resources on the Internet of Things devices can be used to perform corresponding computation tasks, thereby realizing various intelligent functions such as action recognition, natural language processing, image recognition, and face recognition in an AI application. Here, the above functions can be realized by computational tasks such as deep neural networks (DNN), convolutional neural networks (CNN), recurrent neural networks (RNN), long short-term memory (LSTM) networks, graph convolutional networks (GCN), graph neural networks (GNN), etc. The various abstract operations of the above networks for realizing computational tasks are divided to obtain a series of operators such as convolution (Conv) and pooling (Pooling), which represent specific types of operations in the task to be processed, and each operator can form an operator library.
[0076] The scene further includes a plurality of edge Internet of Things devices, each of which may have different capabilities. The capabilities may be embodied by computation resources, storage resources, and communication resources, where the computation resources may refer to available or idle computation resources, and the computation resources may include, for example, a central processing unit (CPU) resource, a graphics processing unit (GPU) resource, a field programmable gate array (FPGA) resource, a digital signal processor (DSP) resource, and the like, the storage resources may refer to available or idle storage resources, and the storage resources may include, for example, a memory resource, a cache memory (Cache) resource, a random access memory (RAM), and the like, and the communication resources may refer to available or idle communication resources. And different Internet of Things devices can provide at least one of different computational resources, storage resources, and communication resources, and the computational resources, storage resources, and communication resources of each Internet of Things device can form a forming resource pool.
[0077] In this embodiment, a computation graph is generated by abstracting each operator of a computation task into a corresponding node, and a resource graph is generated by abstracting the capabilities of each Internet of Things device into a corresponding node. Based on the computation graph and the resource graph, resource sub-graph construction is performed, feature extraction is performed on the computation graph and the resource sub-graph, and methods such as performance prediction are performed on the task allocation policy implicitly contained therein based on the extracted features, thereby realizing intelligent task allocation.
[0078] It should be noted that the smart home service scene shown in FIG. 1 above is merely an arbitrary application scene to which the technical solutions of the embodiments of the present disclosure are applied, and other application scenes may also be within the scope of protection of the embodiments of the present disclosure, and the embodiments of the present disclosure are not particularly limited.
[0079] The embodiments of the present disclosure provide one or more Internet of Things device-based network training methods, which are applicable to various electronic devices, including but not limited to fixed devices and / or mobile devices. For example, the fixed devices include but are not limited to personal computers (PCs) or servers, and the servers may be cloud servers or general servers. The mobile devices include but are not limited to one or more of mobile phones, tablet computers, or wearable devices.
[0080] FIG. 2 is an exemplary flowchart of an Internet of Things device-based network training method according to an embodiment of the present disclosure. As shown in FIG. 2, the method includes the following steps:
[0081] In step 101, a training data set is determined, the training data set including at least one task allocation policy and a corresponding actual performance, where the actual performance is obtained by actually executing according to the corresponding task allocation policy.
[0082] In step 102, a first network is trained based on the training data set, and the first network is used to predict the performance of a task allocation policy.
[0083] In this embodiment, the task allocation policy indicates allocating the task to be processed to a policy executed by at least one Internet of Things device, in other words, the task allocation policy can be used to determine at least one Internet of Things device, and the at least one Internet of Things device can be used to execute the task to be processed according to the instruction of the task allocation policy. Optionally, the task allocation policy is also referred to as one of a task allocation method, a task allocation scheme, a task scheduling policy, a task scheduling method, a task scheduling scheme, a task allocation policy, a task allocation method, a task allocation scheme, etc.
[0084] In this embodiment, the same or different system performances, i.e., the above-mentioned actual performances, can be obtained by actually executing the target tasks using different task allocation policies. The actual performances indicate the performances (e.g., execution time length, energy consumption, reliability, etc.) of the system when actually executing the target tasks. This embodiment trains the first network using each task allocation policy and the corresponding actual performances in the training data set.
[0085] In this embodiment, each Internet of Things device in the system may be a heterogeneous Internet of Things device. Here, the heterogeneous Internet of Things device refers to a network including a plurality of Internet of Things devices and a server, in which the hardware of one Internet of Things device is different from that of other Internet of Things devices and / or the server of one Internet of Things device is different from that of other Internet of Things devices. Here, the hardware of one Internet of Things device is different from that of other Internet of Things devices, which refers to a hardware model or type corresponding to at least one of the computing resources and storage resources of one Internet of Things device and the other Internet of Things devices being different. For example, taking hardware corresponding to computational resources as an example, the model of at least one of the CPU, GPU, bus interface chip (BIC), DSP, FPGA, application specific integrated circuit (ASIC), tensor processing unit (TPU), and artificial intelligence (AI) chip of one Internet of Things device is different from the corresponding hardware model of another Internet of Things device; and further, taking hardware corresponding to storage resources as an example, the model of at least one of the RAM, read only memory (ROM), and cache of one Internet of Things device is different from the corresponding hardware model of another Internet of Things device.The server of one Internet of Things device being different from the server of another Internet of Things device refers to the back-end program corresponding to one Internet of Things device being different from the back-end program corresponding to the other Internet of Things device, where the back-end program may include an operating system, that is, the operating system corresponding to one Internet of Things device is different from the operating system corresponding to the other Internet of Things device, in other words, there is a difference at the software level between the two Internet of Things devices.
[0086] For example, the Internet of Things devices may include mobile phones, PCs, wearable smart devices, smart gateways, computing boxes, etc., the PCs may include desktop computers, notebook computers, tablet computers, etc., and the wearable smart devices may include smart watches, smart glasses, etc.
[0087] In some optional embodiments of the present disclosure, the method further includes determining a computation graph corresponding to a task to be processed and a resource graph corresponding to one or more Internet of Things devices, and generating at least one task allocation policy based on the computation graph and the resource graph.
[0088] In this embodiment, the computation graph may include a task to be processed, and the computation graph may include at least one node, each node corresponds to a specific operation or operator in the task to be processed, and the edges between the nodes represent the relationship between adjacent nodes. For example, if the computation graph includes three nodes, and the three nodes are connected in sequence, it can indicate that the task to be processed is realized by the operators corresponding to the three nodes, and after the first node is processed through the corresponding first operator, the output data is sent to the second node, and further processed through the second operator corresponding to the second node, and the processed data is sent to the third node, and processed through the third operator corresponding to the third node, thereby realizing the task to be processed.
[0089] In this embodiment, the resource graph may include the capabilities (also referred to as resources) of each Internet of Things device in the system. The capabilities of the Internet of Things devices include at least one of computational capabilities, memory capabilities, and communication capabilities. Exemplarily, the resource graph may include at least one node, and each node may include the capabilities of one or more Internet of Things devices. and / or resources In one example, a node may represent all capabilities (e.g., computing capabilities, storage capabilities, and communication capabilities, etc.) of an Internet of Things device, and in another example, a node may represent a portion of the capabilities of an Internet of Things device, e.g., representing only the computing capabilities or the storage capabilities of an Internet of Things device, or representing only a portion of the computing capabilities and / or a portion of the storage capabilities of an Internet of Things device. Edges between the nodes represent the capabilities of one or more Internet of Things devices. and / or resources Illustrates relationships between at least some of the
[0090] In some alternative embodiments, generating at least one task allocation policy based on the computation graph and the resource graph includes generating at least one resource subgraph based on the computation graph and the resource graph; OneA resource subgraph contains one task allocation policy. or represents one task assignment policy. The task allocation policy is used to assign at least one node of a corresponding resource graph to each node of the computation graph, and one node in the resource subgraph is assigned to one or more Internet of Things device capabilities. and / or resources , and an edge between two adjacent nodes in the resource subgraph represents at least a portion of the capabilities of one or more Internet of Things devices. and / or resources represents a relationship between at least a portion of
[0091] In this embodiment, one task allocation policy is used to assign at least one node of a corresponding resource graph to each node in a computation graph, or to assign or map a task to be processed to at least one Internet of Things device, or for matching between a task to be processed and an Internet of Things device, or for matching between a task to be processed and a resource.
[0092] In practical application, at least one node of the resource graph assigned to each node of the computation graph may be the same or different, that is, an Internet of Things device may allocate resources according to its own capabilities. and / or resources can be used to realize a computation unit corresponding to multiple operators, and at the same time, multiple Internet of Things devices can cooperate to realize a computation unit corresponding to one operator. Furthermore, nodes (or operators) in a computation graph that do not have a computation dependency (i.e., a data dependency) may be executed (or operated, calculated) in parallel on the same or different Internet of Things devices.
[0093] For example, one task allocation policy can be embodied by one resource subgraph, in other words, the training data set may include a computation graph, at least one resource subgraph and corresponding actual performance. In this embodiment, based on the computation graph constructed by the task to be processed and the resource graph constructed by multiple heterogeneous Internet of Things devices including idle resources, at least one resource subgraph is generated from the complete resource graph based on the relationship between the demand of the task to be processed for computational resources, storage resources and communication resources and the available resources or capabilities on each Internet of Things device, that is, at least one task allocation policy is generated. The construction of the resource subgraph realizes the maximum utilization of the free resources on the Internet of Things devices and fine-grained task allocation and optimization.
[0094] Optionally, the resource graph in this embodiment is also called a resource knowledge graph or a resource knowledge atlas, and the resource sub-graph is also called a resource knowledge sub-graph or a resource knowledge sub-atlas, etc.
[0095] Optionally, FIG. 3 is an exemplary flowchart of a resource sub-graph generating method in an embodiment of the present disclosure. As shown in FIG. 3, the resource sub-graph generating method may include the following steps:
[0096] In step 201, a first node in the computation graph is determined, the first node being the node with the highest resource demand.
[0097] In step 202, at least one second node in the resource graph is determined, the at least one second node being a node that satisfies a resource demand of the first node.
[0098] In step 203, a resource subgraph is determined based on each second node; One A resource subgraph contains one task assignment policy. or represents one task assignment policy. .
[0099] Illustratively, FIG. 4 is a schematic diagram of generating a resource subgraph in an embodiment of the present disclosure. Referring to FIG. 4, firstly, each node in a computation graph is numbered.
[0100] Illustratively, the nodes in the computation graph are labeled based on a unified rule. For example, first, determine the branch with the largest number of nodes in the computation graph, and number each node in the branch in order of priority. For example, the branch with the largest number of nodes in FIG. 4 has 5 nodes, and the branch with 5 nodes is numbered in order of priority, and further, all nodes in the branch with the second largest number of nodes are numbered, and this work is repeated until all nodes in the computation graph are numbered.
[0101] Then, determine a first node among all nodes in the computation graph, the first node being the node with the largest resource demand, the first node also being called a bottleneck node. For example, the node with number 4 in the computation graph in FIG. 4 has the largest resource demand, and determine the node with number 4 as the first node or bottleneck node. Here, the node with the largest resource demand may be the node with the largest demand for at least one of computational resources, storage resources, and communication resources.
[0102] Furthermore, at least one second node in the resource graph is determined, i.e., an appropriate resource node (also called equipment node or capacity node) is allocated for the first node (or bottleneck node) to provide available resources for executing the target task. Exemplarily, any node in the resource graph that can satisfy the resource demand of the first node (or bottleneck node) is determined as the second node, for example, if all three nodes with number 4 in the resource graph of FIG. 4 can satisfy the resource demand of the first node (or bottleneck node), the three nodes with number 4 are determined as the second nodes. Usually, in a resource graph, the number of resource nodes that can satisfy the resource demand of the first node (or bottleneck node) is one or more, so the number of generated resource sub-graphs is not limited to one.
[0103] Also, next, each resource node corresponding to the first node (or bottleneck node) in the resource graph is taken as a starting point (start node), for example, the resource node numbered 4 on the right side of the resource graph in FIG. 4 (denoted as node V3) can be taken as a starting point to search for other resource nodes adjacent to the start node in the resource graph (for example, nodes V1, V4, and V5 in the resource graph in FIG. 4). In order to meet the resource demand of the corresponding workload, appropriate resource nodes may be assigned to nodes one hop away from the first node in the computation graph (for example, nodes numbered 3, 5, and 6 in the computation graph). For example, node V1 in the resource graph is assigned to node 3 in the computation graph, node V4 in the resource graph is assigned to node 6 in the computation graph, and node V5 in the resource graph is assigned to node 5 in the computation graph. Furthermore, resource nodes are assigned to nodes two hops away from the first node in the computation graph (for example, nodes numbered 2 in the computation graph). For example, node V2 in the resource graph is assigned to node 2 in the computation graph. This process is repeated until all nodes in the computation graph have been assigned a resource node in the resource graph.
[0104] Now, for each resource node in the resource graph that satisfies the resource demand of the first node (or the bottleneck node), the resource node allocation is performed according to the above steps, so that three task allocation policies shown on the right side of Fig. 4 can be obtained, that is, three resource subgraphs can be obtained. The construction of multiple task allocation policies (i.e., resource subgraphs) is convenient for subsequently selecting the optimal task allocation policy through feature extraction and performance prediction.
[0105] The above resource sub-graph construction process in this embodiment is merely an example, and other task allocation policy allocation methods may also fall within the protection scope of the embodiments of the present disclosure.
[0106] In some optional embodiments, training the first network includes training the first network based on predicted and actual performance of at least one task allocation policy.
[0107] In this embodiment, a first network is used to obtain the predicted performance of each task allocation policy, and the first network is trained according to the predicted performance, the actual performance, and the error backpropagation method.
[0108] In some optional embodiments, obtaining a predicted performance of the at least one task allocation policy includes obtaining a predicted performance corresponding to each resource subgraph using the first network based on the computation graph and each resource subgraph.
[0109] In this embodiment, a computation graph and one resource subgraph are input into a first network to obtain a predicted performance corresponding to the resource subgraph.
[0110] Illustratively, FIG. 5 is an exemplary flowchart of a method for obtaining predicted performance in an embodiment of the present disclosure. As shown in FIG. 5, the method for obtaining predicted performance may include the following steps:
[0111] In step 301, a feature extraction module of the first network is used to extract features of the computation graph to obtain a first feature set.
[0112] In step 302, the feature extraction module is used to extract features of the at least one resource sub-graph respectively to obtain at least one second feature set.
[0113] In step 303, a predicted performance corresponding to each resource sub-graph is obtained based on the first feature set, each second feature set and a prediction module of the first network.
[0114] In this embodiment, a feature extraction module is used to extract features of the computation graph to obtain a first feature set. The first feature set is also called a feature set, feature, or feature vector. In order to capture the graph dependencies through message passing between graph nodes, the feature extraction module is used to extract features of the computation graph and the resource subgraph, respectively, including CPU, GPU, FPGA, DSP, memory, etc., mainly including features of dimensions such as computing power, storage, and communication.
[0115] Exemplarily, an input feature set of a computation graph is determined, the input feature set also being referred to as an input feature, an input feature vector, or an input feature matrix, and including input feature information of each node in the computation graph; an adjacency matrix of the computation graph is determined, the adjacency matrix indicating topology information of the computation graph, or the adjacency matrix indicating a relationship between nodes in the computation graph; and features of the computation graph are extracted based on the combination of the input features, the adjacency matrix, and the feature extraction module to obtain a first feature set.
[0116] Optionally, the input feature set of the computation graph includes a feature vector of each node in the computation graph, and the feature vector of each node in the computation graph includes resource information required to execute an operator corresponding to each node, the required resource information including, for example, CPU, GPU, DSP, FPGA, memory occupancy, etc.
[0117] Optionally, an element in the adjacency matrix corresponding to the computation graph indicates the strength of the relationship between each two nodes, and the numerical value of the element is related to the transmitted data between the corresponding two nodes.
[0118] Illustratively, FIG. 6a is a schematic diagram of feature extraction of a computation graph in an embodiment of the present disclosure. As shown in FIG. 6a, the computation graph includes six nodes, and correspondingly, the input feature set includes six sets of feature vectors, for example, as follows:
number
[0119] Here, each set of feature vectors (each column in the above matrix) corresponds to one node on the computation graph, and each set of feature vectors includes the features of the usage (or resource demand) of each resource when the operator corresponding to the node is executed (or calculated), i.e., the hardware execution cost of the operator, or the hardware occupancy data of the operator, and may include features such as CPU occupancy, GPU occupancy, DSP occupancy, FPGA occupancy, storage occupancy, etc. The occupancy is also called occupancy, occupancy proportion, occupancy ratio, usage, usage rate, usage proportion, usage ... 12 , e 16 , e23 , e 34 , e 45 , e 64 ) has a specific value, and the values of other elements are 0, and the adjacency matrix is as shown below.
number
[0120] Here, the values of the above elements relate to the transmission data between the corresponding two nodes.
[0121] Illustratively, e=kd, where k denotes a predetermined coefficient and d denotes the size of the transmission data between two adjacent nodes.
[0122] For example, e 34 =kd 34 where d 34 denotes the size of the transmission data between node 3 and node 4 in the computation graph.
[0123] Then, for example, the input feature set and the adjacency matrix shown in the figure are input to the feature extraction module, thereby obtaining a first feature set.
[0124] Similarly, a feature extraction module is used to extract features of the resource subgraph to obtain a second set of features, also referred to as a feature set, features, or feature vector.
[0125] Exemplarily, an input feature set of a resource subgraph is determined, the input feature set including input feature information of each node in the resource subgraph; an adjacency matrix of the resource subgraph is determined, the adjacency matrix indicates topology information of the resource subgraph, or the adjacency matrix indicates a relationship between nodes in the resource subgraph; and features of the resource subgraph are extracted based on the combination of the input features, the adjacency matrix and the feature extraction module to obtain a second feature set.
[0126] Optionally, the input feature set of the resource subgraph includes a feature vector of each node in the resource subgraph, the feature vector of each node in the resource subgraph including at least a portion of resource information (also referred to as capability information) possessed by an Internet of Things device corresponding to each node, the at least a portion of the resource information including available resources such as, for example, a CPU, a GPU, a DSP, an FPGA, a memory, etc.
[0127] Optionally, an element in the adjacency matrix corresponding to a resource subgraph indicates the strength of the communication relationship between each two nodes, and the numerical value of the element relates to the transmission rate and / or delay between the corresponding two nodes, etc.
[0128] Illustratively, FIG. 6b is a schematic diagram of feature extraction of a resource subgraph in an embodiment of the present disclosure. As shown in FIG. 6b, a task allocation policy, i.e., a resource subgraph, includes six nodes in the drawing, and correspondingly, the input feature set includes six sets of feature vectors, for example, as follows:
number
[0129] Here, each set of feature vectors (each column in the above matrix) corresponds to one node on the resource subgraph, and each set of feature vectors includes the features of resources corresponding to each node, such as CPU resources, GPU resources, DSP resources, FPGA resources, storage resources, etc. Then, according to the connection relationships between the nodes in the computation graph, it can be determined that there is a connection relationship between node V2 and node V1, a connection relationship between node V1 and node V3, a connection relationship between node V3 and node V4, a connection relationship between node V3 and node V5, and a connection relationship between node V5 and node V6, so as to determine the corresponding elements in the adjacency matrix (i.e., e shown in the figure). 13 , e 21 , e 34 , e 35 , e 56) has a specific value, and the values of other elements are 0, and the adjacency matrix is as shown below.
number
[0130] Here, the values of the above elements relate to the transmission rate and / or delay between the two corresponding nodes.
[0131] For example, e=k 1 ts+k 2 l, where k 1 and k 2 respectively denote a predetermined coefficient, ts denotes a transmission rate between two adjacent nodes, and l denotes a transmission delay between two adjacent nodes.
[0132] For example, e 34 =k 1 ts 34 +k 2 l 34 where ts 34 denotes the transmission rate between node V3 and node V4 in the resource subgraph, and l 34 denotes the delay between node V3 and node V4 in the resource subgraph.
[0133] Then, for example, the input feature set and the adjacency matrix shown in the figure are input to a feature extraction module, thereby obtaining a second feature set.
[0134] In this embodiment, the input feature set and adjacency matrix corresponding to the above computation graph or resource subgraph are used as the input of the feature extraction module, and feature update is performed using the forward propagation algorithm of the following equation (5). Through forward propagation in the multi-layer network of the feature extraction module, a feature set (also called a feature vector) is obtained by fusing the features of all nodes and edges in the computation graph or resource subgraph, that is, a first feature set corresponding to the computation graph and a second feature set corresponding to the resource subgraph are obtained.
number
[0135] Where: [ka] denotes the adjacency matrix with self-connections added, I denotes the identity matrix, [ka] where i denotes the row number of the matrix, j denotes the column number of the matrix, and H (l) denotes all the node features of the l-th layer in the multilayer network of the feature extraction module, and H (0) denotes the features of all nodes in the input layer of the feature extraction module, W denotes the trainable weight matrix (i.e., network parameters) of the feature extraction module, and W (l) denotes the trainable weight matrix of the l-th layer in the multilayer network of the feature extraction module, [ka] denotes the activation function.
[0136] In some optional embodiments, obtaining a predicted performance corresponding to each resource subgraph based on the first feature set, each second feature set, and a prediction module of the first network includes obtaining at least one third feature set based on the first feature set and each second feature set, each third feature set including the first feature set and each second feature set; obtaining predicted data corresponding to each resource subgraph based on each third feature set and the prediction module; and obtaining a predicted performance corresponding to each resource subgraph based on the predicted data corresponding to each resource subgraph.
[0137] In this embodiment, in order to select an optimal task allocation policy from at least one task allocation policy, in this embodiment, a prediction module is used to predict the system performance of executing each task allocation policy. In order to learn the essential statistical laws of task scheduling and resource allocation in different operating systems to adapt to the dynamically changing Internet of Things edge computing environment, a prediction module is constructed to process nonlinear regression prediction of complex problems, and the statistical regularities can be learned from a large number of historical samples that implicitly contain the corresponding relationships between different task allocation policies and system performance.
[0138] In this embodiment, the input data of the prediction module is the fusion feature (i.e., the third feature set) of the first feature set and one of the second feature sets obtained by the feature extraction module respectively. Exemplarily, the first feature set and the second feature set can be concatenated to obtain the third feature set. Further, the third feature set is input to the prediction module, and prediction data corresponding to each resource subgraph is obtained by layer-by-layer iteration of the forward propagation algorithm of the multi-layer network in the prediction module.
[0139] In some optional embodiments, the prediction data may indicate a predicted value of a performance index (also called a key performance index, a system performance index, or a key system performance index), and includes at least one of a predicted execution time length for executing the task to be processed, a predicted energy consumption for executing the task to be processed, and a predicted reliability for executing the task to be processed. The predicted execution time length is a predicted value of execution time length, the predicted energy consumption is a predicted value of energy consumption, and the predicted reliability is a predicted value of reliability. Exemplarily, the prediction data may be a vector including three data or three components, where one data or component indicates a predicted execution time length for executing the task to be processed, for example: [ka] and one data or component indicates a predicted energy consumption for executing the target task, for example, [ka] and one data or component indicates a predicted reliability of executing the target task, for example, [ka] and determining a predicted performance corresponding to each resource sub-graph based on the predicted data, where the performance is also referred to as the overall system performance.
[0140] In some optional embodiments, obtaining a predicted performance corresponding to each resource subgraph based on the predicted data corresponding to each resource subgraph includes performing a weighting process on the predicted data corresponding to each resource subgraph according to a predetermined weight to obtain a predicted performance corresponding to each resource subgraph.
[0141] In this embodiment, for example, if the prediction data includes three components, the weighting process is performed according to a predetermined weight corresponding to each component, that is, the corresponding prediction performance is calculated according to Equation (6). [ka] where [ka] denotes a function, where it contains weighting information for each component or data or (key) performance indicator.
number
[0142] The specific form of the function formula in formula (6), i.e., the specific information of the predetermined weight, depends on the different requirements for delay, energy consumption, reliability, etc., or the importance or attention of different scenes, so that a specific function is used to weight different performance indicators, thereby realizing the trade-off between multiple performance indicators, and the weighted value of each key performance indicator is calculated according to the set formula, so that the performance of the entire system can be obtained. That is, the predicted performance obtained by formula (6) reflects the performance of the entire system related to Quality of Service (QoS).
[0143] In some optional embodiments, training the first network includes training the feature extraction module and the prediction module based on predicted and actual performance of each task allocation policy.
[0144] Specifically, in this embodiment, the network parameters of the feature extraction module and the prediction module are updated based on the predicted performance of each task allocation policy and the actual performance in the training data set, thereby training the feature extraction module and the prediction module.
[0145] In some optional embodiments, training the feature extraction module and the prediction module includes backpropagating an error between the predicted performance and actual performance of each task allocation policy, and updating network parameters of the feature extraction module and the prediction module of the first network using a gradient descent algorithm until the error between the predicted performance and the actual performance satisfies a predetermined condition.
[0146] For example, the error between the predicted performance and the actual performance satisfying the predetermined condition may be the error between the predicted performance and the actual performance being smaller than a predetermined threshold.
[0147] In this embodiment, based on the features extracted by the multi-layer network of the feature extraction module, the prediction module is used to learn the essential statistical regularity of task scheduling in different operating systems of multiple heterogeneous Internet of Things devices from the corresponding relationship between different task allocation policies and system performance (execution time, energy consumption, reliability), and realize the prediction of the system performance of a given task allocation policy before task execution, thereby facilitating the selection of a task allocation policy that can obtain optimal system performance from different task allocation policies included in multiple resource subgraphs. By realizing the optimal matching between the pending computation tasks and the available resources of the Internet of Things devices, the resource utilization is maximized and the performance of the entire system is improved.
[0148] In some optional embodiments of the present disclosure, the method further includes updating the training data set, and the updated training data set is used to update the first network. Updating the first network is training the first network or optimizing the first network (i.e., optimizing the first network). Here, updating the training data set may include updating a task allocation policy (e.g., a resource subgraph) and updating an actual performance, and optionally, the training data set may further include a computation graph, and then updating the training data set may further include updating the computation graph.
[0149] In some optional embodiments, updating the training data set comprises: Based on the computation graph and the resource graph, generate at least one resource subgraph by using at least one of a heuristic method, a graph search method, a graph optimization method, and a subgraph matching method, and after actually executing according to a task allocation policy corresponding to each resource subgraph, obtain actual performance corresponding to each resource subgraph, and add the computation graph, each resource subgraph, and the corresponding actual performance to the training data set; Based on the computation graph and the resource graph, generate at least one resource subgraph by using at least one of a heuristic method, a graph search method, a graph optimization method, and a subgraph matching method, obtain a predicted performance corresponding to each resource subgraph through a first network, select a resource subgraph with the best predicted performance from the at least one resource subgraph, obtain an actual performance after actually executing according to a task allocation policy corresponding to the resource subgraph with the best predicted performance, and add the computation graph, the resource subgraph with the best predicted performance, and the corresponding actual performance to the training data set; The method includes at least one of: generating at least one resource sub-graph based on the computation graph and the resource graph using a random walk method, obtaining actual performance after actually executing according to a task allocation policy corresponding to each resource sub-graph, and adding the computation graph, the at least one resource sub-graph, and the actual performance to the training data set.
[0150] In this embodiment, the first network is periodically trained using a continuously updated training data set, thereby making the first network-based task allocation system or platform have self-learning and self-adaptation capabilities, realize intelligent self-adaptation, and achieve the effect of "the more you use it, the smarter it gets".
[0151] Here, the training data set update includes at least some of the above-mentioned methods. In the first method, at least one of the heuristic method, the graph search method, the graph optimization method, and the subgraph matching method is adopted to obtain at least one task allocation policy, and after performing actual task execution according to the corresponding at least one task allocation policy, the corresponding actual performance is recorded, and the adopted at least one task allocation policy and the corresponding actual performance are added to the training data set as new sample data. In the second method, at least one of the heuristic method, the graph search method, the graph optimization method, and the subgraph matching method is adopted to obtain at least one task allocation policy, and the first network is used to determine the task allocation policy with the best predicted performance among them, and after actually performing task execution according to the task allocation policy with the best predicted performance, the obtained actual performance is recorded, and the task allocation policy with the best predicted performance and the corresponding actual performance are added to the training data set as new sample data. In the third method, when the system is not busy, a random walk is performed on the resource graph to allocate task operators to be processed, multiple resource subgraphs with different allocation policies are generated, and the actual performance is obtained after each resource subgraph is actually executed according to the task allocation policy corresponding to the resource subgraph, and the task allocation policy and the actual performance are added to the training data set, thereby overcoming the shortcoming of the simple fixed and mode-constrained resource subgraph construction method based on the greedy heuristic being prone to local optimum, and by increasing the diversity of task allocation policies, a task allocation policy that is more likely to obtain optimal system performance can be obtained.
[0152] Optionally, the above resource sub-graph generating method of the embodiment of the present disclosure (i.e., determining a first node in the computation graph, where the first node is a node with the largest resource demand; determining at least one second node in the resource graph, where the at least one second node is a node that satisfies the resource demand of the first node; and determining one resource sub-graph based on each second node; One A resource subgraph contains one task assignment policy. or represents one task assignment policy. The resource subgraph generation method) may be a heuristic method, or a graph search method, or a graph optimization method, or a subgraph matching method. The present embodiment is not limited to the above resource subgraph generation method, and can generate a task allocation policy. The task allocation policy can also be generated by adopting at least one of other heuristic methods, graph search methods, graph optimization methods, and subgraph matching methods.
[0153] An embodiment of the present disclosure further provides an Internet of Things device-based task allocation method. Figure 7 is an exemplary flowchart of an Internet of Things device-based task allocation method of an embodiment of the present disclosure. As shown in Figure 7, the method includes the following steps:
[0154] In step 401, a computation graph corresponding to a task to be processed and a resource graph corresponding to one or more Internet of Things devices are determined.
[0155] In step 402, at least one task allocation policy is generated based on the computation graph and the resource graph.
[0156] In step 403, the at least one task allocation policy is input to a first network, and a predicted performance corresponding to each task allocation policy is obtained.
[0157] In step 404, the task allocation policy with the best predicted performance is determined, and task allocation is performed based on the determined task allocation policy.
[0158] In this embodiment, the first network is optimized with reference to the detailed description in the embodiment of the network training method described above, to obtain an optimized first network.
[0159] In this embodiment, the task allocation policy indicates allocating the task to be processed to a policy executed by at least one Internet of Things device, in other words, the task allocation policy can be used to determine at least one Internet of Things device, and the at least one Internet of Things device can be used to execute the task to be processed according to the instruction of the task allocation policy. Optionally, the task allocation policy is also referred to as one of a task allocation method, a task allocation scheme, a task scheduling policy, a task scheduling method, a task scheduling scheme, a task allocation policy, a task allocation method, a task allocation scheme, etc.
[0160] For details of steps 401 to 404 in this embodiment, please refer to the detailed description of the embodiment of the network training method described above. The difference is that in this embodiment, for each task allocation policy, the first network is used to obtain the corresponding predicted performance, and then the task allocation policy with the best predicted performance is selected to perform task allocation. For example, the first network can be used to obtain the predicted value of the system performance corresponding to each task allocation policy, and the task allocation policy corresponding to the maximum predicted value is selected to perform task allocation.
[0161] In some optional embodiments of the present disclosure, generating at least one task allocation policy based on the computation graph and the resource graph includes generating at least one resource subgraph based on the computation graph and the resource graph; One A resource subgraph contains one task allocation policy. or represents one task assignment policy. The task allocation policy is used to assign at least one node of a corresponding resource graph to each node of the computation graph, and one node in the resource subgraph is assigned to one or more Internet of Things device capabilities. and / or resources , and an edge between two adjacent nodes in the resource subgraph represents at least a portion of the capabilities of one or more Internet of Things devices. and / or resources represents a relationship between at least a portion of
[0162] For details of this embodiment, please refer to the detailed description in the embodiment of the network training method described above, and the description will not be repeated here.
[0163] In some optional embodiments of the present disclosure, generating at least one resource subgraph based on the computation graph and the resource graph includes: determining a first node in the computation graph, the first node being a node with the highest resource demand; determining at least one second node in the resource graph, the at least one second node being a node that satisfies the resource demand of the first node; and determining one resource subgraph based on each second node; One A resource subgraph contains one task assignment policy. or represents one task assignment policy. , and.
[0164] For specific details of this embodiment, please refer to the specific descriptions in the embodiments of the network training method described above (for example, the detailed descriptions shown in Figures 3 and 4), and the description will not be repeated here.
[0165] In some optional embodiments of the present disclosure, obtaining a predicted performance corresponding to each task allocation policy includes obtaining a predicted performance corresponding to each resource subgraph using a first network based on the computation graph and each resource subgraph.
[0166] For details of this embodiment, please refer to the detailed description in the embodiment of the network training method described above, and the description will not be repeated here.
[0167] In some optional embodiments, obtaining a predicted performance corresponding to each resource subgraph using the first network includes: extracting features of the computation graph using a feature extraction module of the first network to obtain a first feature set; extracting features of each of the at least one resource subgraph using the feature extraction module to obtain at least one second feature set; and obtaining a predicted performance corresponding to each resource subgraph based on the first feature set, each second feature set, and a prediction module of the first network.
[0168] For specific details of this embodiment, please refer to the specific descriptions in the embodiments of the network training method described above (for example, the detailed descriptions shown in Figures 5, 6a and 6b), and the description will not be repeated here.
[0169] In some optional embodiments, obtaining a predicted performance corresponding to each resource subgraph based on the first feature set, each second feature set, and a prediction module of the first network includes obtaining at least one third feature set based on the first feature set and each second feature set, each third feature set including the first feature set and each second feature set; obtaining predicted data corresponding to each resource subgraph based on each third feature set and the prediction module; and obtaining a predicted performance corresponding to each resource subgraph based on the predicted data corresponding to each resource subgraph.
[0170] For details of this embodiment, please refer to the detailed description in the embodiment of the network training method described above, and the description will not be repeated here.
[0171] In some optional embodiments, the prediction data includes at least one of a predicted execution time length for executing the task to be processed, a predicted energy consumption for executing the task to be processed, and a predicted reliability for executing the task to be processed.
[0172] For details of this embodiment, please refer to the detailed description in the embodiment of the network training method described above, and the description will not be repeated here.
[0173] In some optional embodiments, obtaining a predicted performance corresponding to each resource subgraph based on the predicted data corresponding to each resource subgraph includes performing a weighting process on the predicted data corresponding to each resource subgraph according to a predetermined weight to obtain a predicted performance corresponding to each resource subgraph.
[0174] For details of this embodiment, please refer to the detailed description in the embodiment of the network training method described above, and the description will not be repeated here.
[0175] In some optional embodiments, determining the task allocation policy with the best predicted performance and allocating tasks based on the determined task allocation policy includes selecting a corresponding task allocation policy with the highest predicted performance (i.e., the predicted value of the performance index of the entire system) based on the predicted performance corresponding to each resource subgraph, and actually allocating tasks according to the selected policy.
[0176] In some optional embodiments of the present disclosure, the method further includes: after performing task allocation, obtaining an actual performance when the task to be processed is executed according to a corresponding task allocation policy, and storing the corresponding task allocation policy and the obtained actual performance in a training data set, and the training data set is used to update the first network.
[0177] In this embodiment, after performing task allocation according to the determined task allocation policy with the best predicted performance, the task to be processed is actually executed according to the task allocation policy to obtain actual performance (or actual performance of the entire system), and the corresponding task allocation policy and the obtained actual performance are stored in a training data set for updating the first network, so as to construct a training data set or update the training data set.
[0178] In the following, task allocation in an embodiment of the present disclosure will be described with reference to one specific example.
[0179] FIG. 8 is a schematic diagram of an Internet of Things device-based task allocation method of an embodiment of the present disclosure. As shown in FIG. 8, in step 1, for one task to be processed, a computation graph of the task to be processed is determined, and the computation graph can be optionally optimized, for example, by merging some nodes to obtain an optimized computation graph. It should be noted that the computation graph in the above embodiment of the present disclosure can refer to the optimized computation graph. Furthermore, each node in the computation graph is numbered according to a specific rule.
[0180] In step 2, generate at least one resource subgraph based on the computation graph and the resource graph constructed based on the resource and capability status of each Internet of Things device in the system. Here, the resource subgraph generating method can refer to the description in the above embodiment, and will not be described again here. And the resource subgraph shown in FIG. 8 can specifically refer to the resource subgraph in FIG. 4.
[0181] In step 3, the computation graph and the resource subgraphs are pre-processed, specifically, the input feature set (also called input feature or input feature matrix) and the adjacency matrix corresponding to the computation graph are determined, and the input feature set (also called input feature or input feature matrix) and the adjacency matrix corresponding to each resource subgraph are determined. Then, the input feature set (also called input feature or input feature matrix) and the adjacency matrix corresponding to the computation graph are input to a feature extraction module to perform feature extraction, and obtain a first feature set. The input feature set (also called input feature or input feature matrix) and the adjacency matrix corresponding to each resource subgraph are input to a feature extraction module to perform feature extraction, and obtain a second feature set. Here, for example, the feature extraction module can be realized by a graph convolutional neural network (GCN).
[0182] In step 4, the first feature set and the second feature set are fused into a third feature set, and the third feature set is input into a prediction module to predict system performance, and obtain predicted performance corresponding to each resource subgraph, where, for example, the prediction module can be realized by a deep neural network (DNN).
[0183] Here, using a prediction module, for example, at least a predicted execution time length for executing the task to be processed, a predicted energy consumption for executing the task to be processed, a predicted reliability for executing the task to be processed, [ka] Then, using a predetermined weight, weighting processing is performed on the predicted data to obtain predicted performance corresponding to each resource subgraph. [ka] Furthermore, from the predicted performance corresponding to each obtained resource subgraph, [ka] The resource subgraph with the largest value of is selected, and task allocation is performed based on the task allocation policy it indicates.
[0184] Optionally, the actual performance obtained each time the task is actually executed is recorded, the predicted performance is compared with the actual performance to determine an error between the predicted performance and the actual performance, and the network parameters of the feature extraction module and the prediction module included in the first network are updated using error backpropagation and gradient descent algorithms, thereby realizing training of the feature extraction module and the prediction module.
[0185] FIG. 9 is a schematic diagram of the configuration of a task allocation system or platform of an embodiment of the present disclosure. As shown in FIG. 9, the task allocation system of this embodiment includes several parts: building a training data set, a training phase, an inference phase, and continuous learning.
[0186] Construction of training data set: Taking the computation graphs constructed by different tasks to be processed and the resource graphs constructed by the resources and capacity statuses of multiple Internet of Things devices as input, a resource subgraph construction module is used to construct multiple resource subgraphs including different task allocation policies, which are actually deployed in the Internet of Things devices, and after the tasks are executed, the corresponding actual performance is recorded, and each set of task allocation policies (i.e., resource subgraphs) and the obtained actual performance are used as training data, thereby completing the construction of an initial training data set. In actual cases, the training data set further includes computation graphs corresponding to each task to be processed.
[0187] Training phase: The input is all the training data (also called training samples) in the training data set, where each training data includes a computation graph, a resource subgraph, and a corresponding actual system performance. The training data is input to the network model of the embodiment of the present disclosure, and the obtained system performance index prediction value η pand the actual value of the system performance, η t The error between the weights is back-propagated to update the network parameters (e.g., weights) of the feature extraction module and the prediction module in the network model until convergence occurs, and the final network parameters (also called model parameters) are within the allowable error range (which can be manually set in the algorithm) and can make the system performance index prediction value of the training sample closest to the actual value.
[0188] Inference stage: According to the trained network model, obtain the task allocation policy with the best prediction performance based on the resource demand of the task to be processed and the capacity or resource situation that can be provided by the Internet of Things device, and perform actual task allocation for the task to be processed in the Internet of Things device according to the policy. The input data are the computation graph constructed by the task to be executed and the resource graph constructed by the Internet of Things device with free resources. Two graph structures (i.e., computation graph and resource graph), which contain a large amount of implicit information on computational capacity, memory and communication, are input into the network model, and the system performance prediction value corresponding to each resource subgraph (i.e., different task allocation policies) is obtained using three modules, namely, resource subgraph construction, feature extraction and performance prediction. The system performance prediction value with the largest system performance prediction value (i.e., η p The task allocation policy with the largest task allocation policy is selected as the optimal task allocation policy, and according to this task allocation policy, in the actual execution process, the operators of the tasks to be processed are placed on the corresponding Internet of Things devices to complete the task placement and execution.
[0189] Continuous learning stage: The continuous learning mechanism is realized by periodically training the network parameters of the feature extraction module and the prediction module in the network model using the continuously updated training data set, so that the task allocation system, the platform has the ability of self-learning and self-adaptation, realizes intelligent self-adaptation, and realizes the effect of "the more you use it, the smarter it gets". Specifically, this is realized by accumulating historical samples and using a random walk method. The historical sample accumulation is achieved by recording the task allocation policy adopted and the actual system performance obtained every time a computing task is actually executed, and storing them in the training data set as new training samples. The specific implementation method of the random walk is as described above.
[0190] The above embodiments of the present disclosure propose an intelligent computing task allocation method (ICTA) that enables efficient deep learning in a distributed edge computing system of the Internet of Things, and build an intelligent allocation system and platform for deep learning tasks among heterogeneous Internet of Things devices based on ICTA. ICTA mainly includes resource subgraph construction, feature extraction, and performance prediction. The input is the computation graph currently constructed by the deep learning task and the resource graph constructed by the Internet of Things edge device with free resources. Based on both, a resource subgraph is constructed using methods such as graph search and subgraph matching to generate multiple resource subgraphs with different task allocation policies, thereby realizing the maximum utilization of available resources on the Internet of Things devices and the operator-level allocation and optimization of the tasks to be processed. A multi-layer neural network is used to perform feature extraction and performance prediction, respectively, and the resource subgraph and the computation graph are input into a feature extraction module, respectively, to perform feature extraction and fusion, and to maximize the exploration of the features related to dimensions such as computing power, storage, and communication hidden in the nodes and graph topology in the two types of graphs. The fused features are then input into a performance prediction module to predict system performance, and through end-to-end training of the feature extraction and performance prediction module, the corresponding relationships between different task allocation policies and system performance, as well as the inherent statistical regularities of task scheduling on different operating systems, are learned, and accurate system performance prediction for a given task allocation policy is realized before the tasks are actually executed, and an optimal allocation policy is selected from the alternatives, and an optimal matching between computational tasks and available resources is realized, thereby maximizing resource utilization and improving the overall system performance.A continuous learning mechanism is introduced to periodically train ICTA using a continuously updated training data set, further improving the system performance and adaptability to dynamically changing environments, making it have the ability of self-adaptation and self-learning, realizing intelligent self-adaptation, and realizing the effect of the task allocation system "becoming smarter the more it is used".
[0191] Specifically, the present disclosure and each of the above embodiments have the following technical points and advantages.
[0192] 1. Build an intelligent allocation system and platform for deep learning tasks among heterogeneous Internet of Things devices based on an intelligent task allocation method, including a training data set construction stage, a training stage, an inference stage, and a continuous learning stage. Provide a construction idea for distributed training and inference of deep learning models among heterogeneous Internet of Things devices, and facilitate the generation of an end-to-end automatically optimized distributed edge computing ecological mode of heterogeneous devices among the Internet of Things.
[0193] 2. An intelligent computation task allocation method (ICTA) is proposed to enable efficient deep learning in distributed edge computing systems of the Internet of Things, including resource subgraph construction, feature extraction, performance prediction, etc., to realize the optimal allocation of high-performance and intelligent self-adaptive deep learning computation tasks among heterogeneous Internet of Things devices.
[0194] 3. The feature extraction module extracts node and topology features of the resource subgraph and computation graph respectively, and performs feature fusion, realizing deep sensing, feature extraction and feature matching in dimensions such as computing power, memory and communication, which play an important role in the performance of deep learning computation tasks.
[0195] 4. Performance prediction: Based on the fusion features, a multi-layer neural network is used to learn the essential statistical regularities of task scheduling on different operating systems, and through end-to-end training of the feature extraction and performance prediction modules, the correspondence between different task allocation policies and system performance is explored, the system performance is predicted, and from the alternatives, a task allocation policy corresponding to the optimal system performance (prediction) is selected to facilitate the actual execution of deep learning tasks. An optimal matching between deep learning computational tasks and available resources on the Internet of Things devices is realized, thereby maximizing resource utilization and improving system performance.
[0196] 5. The realization of the continuous learning mechanism mainly includes two methods: historical sample accumulation and random walk. Based on these two methods, the training set is continuously updated, and the feature extraction module and prediction module are periodically trained to improve the system performance, adapt to the dynamic changes of the environment, and have the ability of self-adaptation and self-learning, so as to realize intelligent self-adaptation and the effect of "the more you use it, the smarter it becomes".
[0197] The embodiment of the present disclosure provides one or more Internet of Things device-based network training devices. Figure 10 is an exemplary structural diagram 1 of the configuration of the Internet of Things device-based network training device of the embodiment of the present disclosure. As shown in Figure 10, the device includes a first determining unit 11 and a training unit 12, where: The first determining unit 11 is configured to determine a training data set, the training data set including at least one task allocation policy and a corresponding actual performance, the one actual performance being obtained by actually executing according to the corresponding task allocation policy; The training unit 12 is configured to train a first network based on the training data set, the first network being used to predict the performance of a task allocation policy.
[0198] In some optional embodiments of the present disclosure, as shown in FIG. 11 , the apparatus further includes a first generation unit 13 configured to determine a computation graph corresponding to a task to be processed and a resource graph corresponding to one or more Internet of Things devices, and generate at least one task allocation policy based on the computation graph and the resource graph.
[0199] In some optional embodiments of the present disclosure, the first generation unit 13 is configured to generate at least one resource sub-graph based on the computation graph and the resource graph; One A resource subgraph contains one task allocation policy. or represents one task assignment policy. The task allocation policy is used to assign at least one node of a corresponding resource graph to each node of the computation graph, and one node in the resource subgraph is assigned to one or more Internet of Things device capabilities. and / or resources , and an edge between two adjacent nodes in the resource subgraph represents at least a portion of the capabilities of one or more Internet of Things devices. and / or resources represents a relationship between at least a portion of
[0200] In some optional embodiments of the present disclosure, the first generation unit 13 determines a first node in the computation graph, the first node being a node with the largest resource demand; determines at least one second node in the resource graph, the at least one second node being a node that satisfies the resource demand of the first node; and determines one resource subgraph based on each second node; One A resource subgraph contains one task assignment policy. or represents one task assignment policy. It is configured as follows.
[0201] In some optional embodiments of the present disclosure, the training unit 12 is configured to train the first network based on predicted and actual performance of at least one task allocation policy.
[0202] In some optional embodiments of the present disclosure, the training unit 12 is further configured to obtain, based on the computation graph and each resource subgraph, a predicted performance corresponding to each resource subgraph using the first network.
[0203] In some optional embodiments of the present disclosure, the training unit 12 is configured to extract features of the computational graph using a feature extraction module of the first network to obtain a first feature set, extract features of the at least one resource subgraph using the feature extraction module respectively to obtain at least one second feature set, and obtain a prediction performance corresponding to each resource subgraph based on the first feature set, each second feature set and a prediction module of the first network.
[0204] In some optional embodiments of the present disclosure, the training unit 12 is configured to obtain at least one third feature set based on the first feature set and each second feature set, each third feature set including the first feature set and each second feature set, obtain prediction data corresponding to each resource subgraph based on each third feature set and the prediction module, and obtain prediction performance corresponding to each resource subgraph based on the prediction data corresponding to each resource subgraph.
[0205] In some optional embodiments of the present disclosure, the predictive data comprises: A predicted execution time length for executing the target task; A predicted energy consumption for executing the task to be processed; and and a predicted reliability for executing the target task.
[0206] In some optional embodiments of the present disclosure, the training unit 12 is configured to weight the prediction data corresponding to each resource sub-graph according to a predetermined weight to obtain a prediction performance corresponding to each resource sub-graph.
[0207] In some optional embodiments of the present disclosure, the training unit 12 is configured to train the feature extraction module and the prediction module based on the predicted performance and actual performance of each task allocation policy.
[0208] In some optional embodiments of the present disclosure, the training unit 12 is configured to back-propagate the error between the predicted performance and the actual performance of each task allocation policy, and update network parameters of the feature extraction module and the prediction module of the first network using a gradient descent algorithm until the error between the predicted performance and the actual performance satisfies a predetermined condition.
[0209] In some optional embodiments of the present disclosure, as shown in FIG. 12, the apparatus further comprises an updating unit 14 configured to update the training data set, and the updated training data set is used to update (also referred to as training) the first network.
[0210] In some optional embodiments of the present disclosure, the update unit 14 includes: According to the computation graph and the resource graph, at least one of a heuristic method, a graph search method, a graph optimization method, and a subgraph matching method is used to generate at least one resource subgraph, and after actually executing according to a task allocation policy corresponding to each resource subgraph, an actual performance corresponding to each resource subgraph is obtained, and the computation graph, each resource subgraph, and the corresponding actual performance are added to the training data set; According to the computation graph and the resource graph, using at least one of a heuristic method, a graph search method, a graph optimization method, and a subgraph matching method to generate at least one resource subgraph, obtain a predicted performance corresponding to each resource subgraph through a first network, select a resource subgraph with the best predicted performance from the at least one resource subgraph, obtain an actual performance after actually executing according to a task allocation policy corresponding to the resource subgraph with the best predicted performance, and add the computation graph, the resource subgraph with the best predicted performance, and the corresponding actual performance to the training data set; The method is configured to update the training data set using at least one of the following methods: based on the computation graph and the resource graph, generate at least one resource sub-graph using a random walk method; after actually executing according to a task allocation policy corresponding to each resource sub-graph, obtain actual performance; and add the computation graph, the at least one resource sub-graph, and the actual performance to the training data set.
[0211] Here, in the embodiment of the present disclosure, the resource subgraph generation method may be a heuristic method, or a graph search method, or a subgraph matching method. This embodiment is not limited to the above resource subgraph generation method, and can generate a task allocation policy, and can also adopt at least one of other heuristic methods, graph search methods, and subgraph matching methods to generate a task allocation policy.
[0212] In the embodiment of the present disclosure, the first determination unit 11, the training unit 12, the first generation unit 13 and the update unit 14 in the apparatus can be realized by a CPU, a GPU, a DSP, a microcontroller unit (MCU) or an FPGA, a TPU, an ASIC, or an AI chip, etc. in practical applications.
[0213] It should be noted that, when the Internet of Things device-based network training device according to the above embodiment performs network training, only the division of each of the above program modules is taken as an example for description, but in actual application, the above processes may be assigned and completed by different program modules as necessary, that is, the internal structure of the device is divided into different program modules to complete all or part of the above processes. Furthermore, the Internet of Things device-based network training device according to the above embodiment belongs to the same concept as one or more Internet of Things device-based network training method embodiments, and the specific implementation process thereof is referred to the method embodiments, and will not be described again here.
[0214] An embodiment of the present disclosure further provides an Internet of Things device-based task allocation device. Figure 13 is an exemplary structural diagram of the configuration of an Internet of Things device-based task allocation device of an embodiment of the present disclosure. As shown in Figure 13, the device includes a second determination unit 21, a second generation unit 22, a prediction unit 23 and a task allocation unit 24, where: The second determination unit 21 is configured to determine a computation graph corresponding to a task to be processed and a resource graph corresponding to one or more Internet of Things devices; The second generation unit 22 is configured to generate at least one task allocation policy based on the computation graph and the resource graph; The prediction unit 23 is configured to input the at least one task allocation policy into a first network and obtain a predicted performance corresponding to each task allocation policy; The task allocation unit 24 is configured to determine a task allocation policy with the best predicted performance, and to perform task allocation based on the determined task allocation policy.
[0215] In some optional embodiments of the present disclosure, the second generation unit 22 is configured to generate at least one resource sub-graph based on the computation graph and the resource graph; One A resource subgraph contains one task allocation policy. or represents one task assignment policy. The task allocation policy is used to assign at least one node of a corresponding resource graph to each node of the computation graph, and one node in the resource subgraph is assigned to one or more Internet of Things device capabilities. and / or resources , and an edge between two adjacent nodes in the resource subgraph represents at least a portion of the capabilities of one or more Internet of Things devices. and / or resources represents a relationship between at least a portion of
[0216] In some optional embodiments of the present disclosure, the second generation unit 22 determines a first node in the computation graph, the first node being a node with the highest resource demand; determines at least one second node in the resource graph, the at least one second node being a node that satisfies the resource demand of the first node; and determines one resource subgraph based on each second node; One A resource subgraph contains one task assignment policy. or represents one task assignment policy. It is configured as follows.
[0217] In some optional embodiments of the present disclosure, the first network is optimized by a network trainer as described in any of the above embodiments of the present disclosure.
[0218] In some optional embodiments of the present disclosure, the prediction unit 23 is configured to obtain, based on the computation graph and each resource subgraph, a predicted performance corresponding to each resource subgraph using a first network.
[0219] In some optional embodiments of the present disclosure, the prediction unit 23 is configured to extract features of the computation graph using a feature extraction module of the first network to obtain a first feature set, extract features of the at least one resource subgraph using the feature extraction module respectively to obtain at least one second feature set, and obtain predicted performance corresponding to each resource subgraph based on the first feature set, each second feature set and the prediction module of the first network.
[0220] In some optional embodiments of the present disclosure, the prediction unit 23 is configured to obtain at least one third feature set based on the first feature set and each second feature set, each third feature set including the first feature set and each second feature set, obtain prediction data corresponding to each resource subgraph based on each third feature set and the prediction module, and obtain predicted performance corresponding to each resource subgraph based on the prediction data corresponding to each resource subgraph.
[0221] In some optional embodiments of the present disclosure, the predictive data comprises: A predicted execution time length for executing the target task; A predicted energy consumption for executing the task to be processed; and and a predicted reliability for executing the target task.
[0222] In some optional embodiments of the present disclosure, the prediction unit 23 is configured to perform a weighting process on the prediction data corresponding to each resource sub-graph according to a predetermined weight, to obtain a prediction performance corresponding to each resource sub-graph.
[0223] In some optional embodiments of the present disclosure, the task allocation unit 24 is configured to determine a task allocation policy that has the best predicted performance, and then perform actual task allocation based on the determined policy.
[0224] In some optional embodiments of the present disclosure, the apparatus further comprises an acquisition unit configured to acquire actual performance when the task to be processed is executed according to a corresponding task allocation policy after performing task allocation, and store the corresponding task allocation policy and the acquired actual performance in a training data set, and the training data set is used to update the first network.
[0225] In the embodiments of the present disclosure, the second determination unit 21, the second generation unit 22, the prediction unit 23, the task allocation unit 24 and the acquisition unit in the device can be realized by a CPU, a GPU, a DSP, an ASIC, an AI chip, an MCU or an FPGA, etc. in practical applications.
[0226] It should be noted that, when the Internet of Things device-based task allocation device according to the above embodiment performs task allocation, only the division of each of the above program modules is taken as an example for description, but in actual application, the above processes may be assigned and completed by different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the above processes. Furthermore, the Internet of Things device-based task allocation device according to the above embodiment belongs to the same concept as one or more Internet of Things device-based task allocation method embodiments, and the specific implementation process thereof is referred to the method embodiments and will not be repeated here.
[0227] The embodiment of the present disclosure further provides an electronic device. Fig. 14 is an exemplary structural diagram of a hardware configuration of the electronic device of the embodiment of the present disclosure. As shown in Fig. 14, the electronic device includes a memory 32, a processor 31, and a computer program stored in the memory 32 and executable by the processor 31, and the processor 31 realizes the network training method described in the above embodiment of the present disclosure when executing the program, or the processor realizes the task allocation method described in the above embodiment of the present disclosure when executing the program.
[0228] It can be understood that each component in the electronic device is coupled via a bus system 33. As can be understood, the bus system 33 is used to realize the connection communication between these components. In addition to a data bus, the bus system 33 includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the bus system 33 in FIG. 14 .
[0229] It can be understood that the memory 32 may be a volatile memory or a non-volatile memory, and may include both volatile and non-volatile memory. Here, the non-volatile memory may be a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a ferromagnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a read-only memory (CD-ROM), and the magnetic surface memory may be a magnetic disk memory or a magnetic tape memory. The volatile memory may be a random access memory (RAM) used as an external cache.By way of illustrative but non-limiting example, many forms of RAM are available, such as, for example, static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), SyncLink dynamic random access memory (SLDRAM), direct memory bus random access memory (DRRAM), etc. Memory 32 as described in the embodiments of the present disclosure is intended to include, but is not limited to, these and any other suitable types of memory.
[0230] The methods disclosed in the above embodiments of the present disclosure can be applied to or realized by the processor 31. The processor 31 can be an integrated circuit chip having the ability to process signals. In the realization process, each step of the above methods can be completed by an instruction in the form of an integrated logic circuit of hardware or software in the processor 31. The processor 31 can be a general-purpose processor, a DSP, or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc. The processor 31 can realize or execute each method, step, and logic block diagram disclosed in the embodiments of the present disclosure. The general-purpose processor can be a microprocessor, or any conventional processor, etc. The steps of the methods disclosed in the embodiments of the present disclosure can be directly performed by a hardware decoding processor, or can be performed by a combination of hardware and software modules in the decoding processor. The software modules can be located in a storage medium, which is located in the memory 32, and the processor 31 reads the information in the memory 32 and completes the steps of the above methods in combination with the hardware.
[0231] In an exemplary embodiment, the electronic device may be implemented with one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), FPGAs, general purpose processors, controllers, MCUs, microprocessors, or other electronic elements and may be used to perform the above methods.
[0232] In an exemplary embodiment, the embodiment of the present disclosure further provides a computer readable storage medium, such as a memory 32, containing a computer program, which can be executed by a processor 31 of an electronic device to complete the above method. The computer readable storage medium may be a memory, such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM, or may be various devices including one or any combination of the above memories.
[0233] An embodiment of the present disclosure further provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, causes the processor to realize the network training method described in the above embodiment of the present disclosure, or, when executed by a processor, causes the processor to realize the task allocation method described in the above embodiment of the present disclosure.
[0234] The methods disclosed in the several method embodiments according to the present invention can be arbitrarily combined without conflict to obtain new method embodiments.
[0235] Features disclosed in the several product embodiments provided by the present invention may be combined in any non-conflicting manner to obtain new product embodiments.
[0236] Features disclosed in several method or apparatus embodiments according to the present invention may be combined in any non-conflicting manner to obtain new method or apparatus embodiments.
[0237] It should be noted that the terms "first", "second" and "third" in the embodiments of the specification of the present disclosure, the claims and the above-mentioned attached drawings are not intended to limit a particular order or sequence, but are intended to distinguish similar objects. In addition, the terms "comprise", "have" and any variations thereof are intended to cover non-exclusive inclusions, for example, including a series of steps or units. Methods, systems, products or devices are not necessarily limited to those steps or units explicitly recited, and may include other steps or units not explicitly recited, or other steps or units inherent to these processes, methods, products or devices.
[0238] It should be understood that in some embodiments provided by the present invention, the disclosed devices and methods may be realized in other ways. The above-described device embodiments are merely illustrative, for example, the division of the units is merely a division of logical functions, and in actual implementation, other division methods may be adopted, for example, multiple units or components may be combined or integrated into another system, and some features may be ignored or not implemented. Furthermore, the mutual coupling or direct coupling or communication connection of each component shown or discussed may be realized using some interfaces, and the indirect coupling or communication connection between devices or units may be in an electrical or mechanical form, or in other forms.
[0239] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units, and some or all of the units may be selected according to actual needs to achieve the objective of the technical solution of this embodiment.
[0240] Furthermore, the functional units in each embodiment of the present invention may all be integrated into one processing unit, or each unit may be used as one independent unit, or two or more units may be integrated into one unit, and the above-mentioned integrated units may be realized in the form of hardware or in the form of a hardware and software functional unit.
[0241] Those skilled in the art will understand that all or part of the steps of the above-mentioned method embodiments can be completed by hardware associated with program instructions, and the program can be stored in a computer-readable storage medium, and when the program is executed, the steps of the above-mentioned method embodiments are performed, and the storage medium includes a medium capable of storing program code, such as a removable storage, a ROM, a RAM, a magnetic memory, or an optical disk.
[0242] Alternatively, the above-mentioned integrated units of the present invention may be realized in the form of a software functional module and stored in a computer-readable storage medium when sold or used as a standalone product. Based on this understanding, the technical solutions of the embodiments of the present invention, essentially or in part contributing to existing technology, may be embodied in the form of a software product, and the computer software product includes several instructions stored in one storage medium to cause one computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes various media capable of storing program codes, such as removable storage, ROM, RAM, magnetic memory, or optical disk.
[0243] The above are only specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto, and any modifications or replacements that a person skilled in the art can easily think of within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A method for training an Internet of Things device-based network, performed by an electronic device, comprising: The network training method includes: determining a training data set; and training a first network based on the training data set, the training data set including at least one task allocation policy and a corresponding actual system performance, the one actual system performance being obtained by actually executing based on the corresponding task allocation policy, and the first network is used to predict the system performance corresponding to the task allocation policy; The network training method comprises: determining a computation graph corresponding to the task to be processed and a resource graph corresponding to one or more Internet of Things devices; and generating at least one task allocation policy based on the computation graph and the resource graph; generating at least one task allocation policy based on the computation graph and the resource graph, A network training method comprising: generating at least one resource subgraph based on the computation graph and the resource graph, wherein the resource subgraph includes or represents a task assignment policy, the task assignment policy being used to assign at least one node of a corresponding resource graph to each node of the computation graph, wherein a node in the resource subgraph represents at least a portion of capabilities and / or resources of one or more Internet of Things devices, and an edge between two adjacent nodes in the resource subgraph represents a relationship between at least a portion of capabilities and / or resources of one or more Internet of Things devices.
2. generating at least one resource subgraph based on the computation graph and the resource graph, determining a first node in the computation graph, the first node being a node with the highest resource demand, the node with the highest resource demand being a node with the highest demand for at least one of computational resources, storage resources, and communication resources; determining at least one second node in the resource graph, the at least one second node being a node that satisfies a resource demand of the first node; determining a resource subgraph based on each second node; The method of claim 1 , comprising:
3. Training the first network comprises: training the first network based on predicted and actual system performance corresponding to at least one task allocation policy; The method for training a network according to claim 1 , further comprising: obtaining a predicted system performance corresponding to each resource subgraph using a first network based on the computation graph and each resource subgraph.
4. Obtaining a predicted system performance corresponding to each resource subgraph using the first network includes: extracting features of the computation graph using a first network feature extraction module to obtain a first feature set; Using the feature extraction module, extract features of the at least one resource sub-graph respectively to obtain at least one second feature set; obtaining a predicted system performance corresponding to each resource subgraph based on the first feature set, each second feature set, and a prediction module of the first network; The method of claim 3 , comprising:
5. Obtaining a predicted system performance corresponding to each resource subgraph based on the first feature set, each second feature set, and a prediction module of the first network, the prediction module comprising: obtaining at least one third feature set based on the first feature set and each second feature set, each third feature set including the first feature set and each second feature set; obtaining predicted data corresponding to each resource sub-graph based on each third feature set and the prediction module; and obtaining a predicted system performance corresponding to each resource sub-graph based on the predicted data corresponding to each resource sub-graph. The method of claim 4 , comprising:
6. Training the first network comprises: The method of claim 5 , further comprising training the feature extraction module and the prediction module based on predicted and actual system performance corresponding to each task allocation policy.
7. Training the feature extraction module and the prediction module includes:
7. The network training method of claim 6, further comprising: back-propagating an error between the predicted system performance and the actual system performance corresponding to each task allocation policy; and updating network parameters of the feature extraction module and the prediction module of the first network using a gradient descent algorithm until the error between the predicted system performance and the actual system performance satisfies a predetermined condition.
8. The network training method further includes updating the training data set; Updating the training data set comprises: Based on the computation graph and the resource graph, generate at least one resource subgraph using at least one of a heuristic method, a graph search method, a graph optimization method, and a subgraph matching method, and obtain an actual system performance corresponding to each resource subgraph after actually executing according to a task allocation policy corresponding to each resource subgraph, and add the computation graph, each resource subgraph, and the corresponding actual system performance to the training data set; Based on the computation graph and the resource graph, generate at least one resource subgraph using at least one of a heuristic method, a graph search method, a graph optimization method, and a subgraph matching method; obtain a predicted system performance corresponding to each resource subgraph through a first network; select a resource subgraph with the best predicted system performance from the at least one resource subgraph; obtain an actual system performance after actually executing according to a task allocation policy corresponding to the resource subgraph with the best predicted system performance; and add the computation graph, the resource subgraph with the best predicted system performance, and the corresponding actual system performance to the training data set; Based on the computation graph and the resource graph, generate at least one resource sub-graph using a random walk method, and obtain actual system performance after actually executing according to a task allocation policy corresponding to each resource sub-graph, and add the computation graph, the at least one resource sub-graph and the actual system performance to the training data set. The method of claim 1 , further comprising at least one of:
9. An Internet of Things device-based task allocation method performed by an electronic device, the task allocation method comprising: determining a computation graph corresponding to the task to be processed and a resource graph corresponding to one or more Internet of Things devices; generating at least one task allocation policy based on the computation graph and the resource graph; inputting the at least one task allocation policy into a first network and obtaining a predicted system performance corresponding to each task allocation policy; A task allocation policy that provides the best predicted system performance is determined, and task allocation is performed based on the determined task allocation policy. Including, generating at least one task allocation policy based on the computation graph and the resource graph, A task allocation method comprising: generating at least one resource subgraph based on the computation graph and the resource graph, wherein the resource subgraph includes or represents a task assignment policy, and the task assignment policy is used to assign at least one node of a corresponding resource graph to each node of the computation graph, wherein a node in the resource subgraph represents at least a portion of capabilities and / or resources of one or more Internet of Things devices, and an edge between two adjacent nodes in the resource subgraph represents a relationship between at least a portion of capabilities and / or resources of one or more Internet of Things devices.
10. generating at least one resource subgraph based on the computation graph and the resource graph, determining a first node in the computation graph, the first node being a node with the highest resource demand, the node with the highest resource demand being a node with the highest demand for at least one of computational resources, storage resources, and communication resources; determining at least one second node in the resource graph, the at least one second node being a node that satisfies a resource demand of the first node; determining a resource subgraph based on each second node; The method of claim 9 , comprising:
11. An internet of things device-based network training device, comprising: a first determining unit and a training unit; The first determining unit is configured to determine a training data set, the training data set including at least one task allocation policy and a corresponding actual system performance, the actual system performance being obtained by actually executing based on the corresponding task allocation policy; The training unit is configured to train a first network based on the training data set, the first network being used to predict performance of a task allocation policy; The first determination unit is further configured to determine a computation graph corresponding to a task to be processed and a resource graph corresponding to one or more Internet of Things devices, and generate at least one resource sub-graph based on the computation graph and the resource graph, wherein the one resource sub-graph includes or represents a task allocation policy, the task allocation policy is used to assign at least one node of a corresponding resource graph to each node of the computation graph, a node in the resource sub-graph represents at least a portion of the capabilities and / or resources of the one or more Internet of Things devices, and an edge between two adjacent nodes in the resource sub-graph represents a relationship between at least a portion of the capabilities and / or resources of the one or more Internet of Things devices.
12. An Internet of Things device-based task allocation apparatus, the task allocation apparatus comprising: a second determination unit, a second generation unit, a prediction unit and a task allocation unit; The second determination unit is configured to determine a computation graph corresponding to a task to be processed and a resource graph corresponding to one or more Internet of Things devices; The second generating unit is configured to generate at least one task allocation policy based on the computation graph and the resource graph; The prediction unit is configured to input the at least one task allocation policy into a first network and obtain a predicted system performance corresponding to each task allocation policy; The task allocation unit is configured to determine a task allocation policy that provides the best predicted system performance, and perform task allocation based on the determined task allocation policy; The second generation unit is further configured to generate at least one resource subgraph based on the computation graph and the resource graph, wherein one resource subgraph includes or represents a task assignment policy, the task assignment policy is used to assign at least one node of a corresponding resource graph to each node of the computation graph, a node in the resource subgraph represents at least a portion of capabilities and / or resources of one or more Internet of Things devices, and an edge between two adjacent nodes in the resource subgraph represents a relationship between at least a portion of capabilities and / or resources of one or more Internet of Things devices.