Task decomposition method and system for a collaborative task system
By calculating the relative attractiveness and resource requirements between task elements, a multi-granularity task decomposition scheme is formed, which solves the problem of task decomposition applicability caused by differences in node capabilities and realizes flexible resource allocation and efficient utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-10
- Publication Date
- 2026-04-07
AI Technical Summary
Existing task decomposition techniques fail to effectively consider the differences in capabilities among different nodes, making it difficult to apply the task decomposition results to collaborative task systems that include different network resources.
By acquiring the dependency relationships and resource requirements between task elements, calculating the relative attractiveness, forming a set of reference points and clustering them, and allocating clusters according to node resources, multi-granularity task decomposition is achieved.
It enables flexible resource allocation across different network resource nodes, reduces the complexity of task decomposition, and improves resource utilization efficiency.
Smart Images

Figure CN116107732B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The embodiment of the application relates to the technical field of networks, in particular to a task decomposition method and system for a collaborative task system. BACKGROUND
[0002] With the development of network technology, the demand of users for network computing power presents an explosive growth, which promotes the formation of a three-level computing power deployment architecture of cloud, edge and terminal in the network. The terminal and edge computing power resources are limited, while the cloud computing power is rich but has high latency, so that the computing power at each level needs to be effectively coordinated to meet the quality of service requirements of various ubiquitous computing services. In the prior art, an application task with high computing power requirements can be decomposed into some independently executable subtasks, which is helpful to realize the multi-node distributed deployment and parallel execution of ubiquitous computing services and the improvement of resource allocation freedom.
[0003] In the existing technical solution of task decomposition, the complete application code is mainly split and packaged into microservices at the code level, but such a technical solution currently mainly considers the decomposition feasibility of module functions and code implementation, and does not consider the difference in the capabilities of each computing node. Since the ubiquitous computing service is scheduled among nodes with different performances at the edge and cloud, it is necessary to solve the influence of the difference in the capabilities of nodes on task decomposition.
[0004] In addition, in addition to the collaborative task system for providing network computing power services, the collaborative task system for providing other network resources also has the problem that the result of task decomposition is difficult to apply due to the difference in the capabilities of different nodes. SUMMARY
[0005] The embodiment of the application provides a task decomposition method and system for a collaborative task system, which is used for solving the problem that the result of the existing task decomposition is difficult to apply to the collaborative task system including nodes with different network resources.
[0006] In order to solve the above technical problems, the application is implemented as follows:
[0007] In a first aspect, the embodiment of the application provides a task decomposition method for a collaborative task system, comprising:
[0008] obtaining a plurality of task elements of a target application;
[0009] obtaining distance relationship information between the task elements according to the dependency relationship information between the task elements;
[0010] obtaining a weight coefficient of each task element according to self-resource demand information of each task element;
[0011] determine relative attraction degrees between the task elements according to the distance relationship information between the task elements and the weight coefficients of each of the task elements;
[0012] obtain two of the task elements with the smallest relative attraction degrees as reference points to form a reference point set, and other task elements as non-reference points;
[0013] repeat the following steps until the number of clusters reaches a specified maximum number of clusters: cluster each of the non-reference points with the reference point with which the non-reference point has the largest relative attraction degree to form a cluster; and obtain a sum of relative attraction degrees between each of the non-reference points and each of the reference points, and add the non-reference point with the smallest sum of relative attraction degrees to the reference point set as a new reference point;
[0014] allocate the finally obtained clusters to nodes of the cooperative task system according to network resources that the nodes can provide.
[0015] Optionally, the dependency relationship information includes at least one of the following: total communication interaction between the task elements, communication resource demand between the task elements, data dependency between the task elements, and special demand information between the task elements.
[0016] Optionally, obtaining the distance relationship information between the task elements according to the dependency relationship information between the task elements includes:
[0017] convert the dependency relationship information between the task elements into the distance relationship information between the task elements by using the following formula:
[0018]
[0019] wherein j and k are task element serial numbers, the task element set is denoted as Ω, the number of task elements is N, task elements j and k are in {1,..., N}, j≠k, d jk is the distance relationship information between the task elements, J jk is total communication interaction between the task elements, J min and J max are minimum and maximum values of the total communication interaction, respectively, X jk is communication resource demand between the task elements, X min and X max are minimum and maximum values of the communication resource demand, respectively, Y jk is data dependency between the task elements, Y min and Y max are minimum and maximum values of the data dependency, respectively, and T jkFor the special requirement information between the task elements, a, b, and c respectively represent the weight of the total communication interaction, the communication resource requirement, and the data dependency.
[0020] Optionally, the weight coefficient of each task element is obtained according to the self-resource requirement information of each task element, and the weight coefficient of each task element comprises:
[0021] The weight coefficient of the task element is calculated according to the following formula:
[0022]
[0023] Wherein, W i is the weight coefficient of the i th task element, C i is the self-resource requirement information of the i th task element, is the average resource requirement information of all task elements.
[0024] Optionally, the relative attraction degree between the task elements is determined according to the distance relationship information between the task elements and the weight coefficient of each task element, and the relative attraction degree between the task elements comprises:
[0025] The relative attraction degree between the task elements is calculated according to the following formula:
[0026]
[0027] Wherein, F ij is the relative attraction degree between the i th and j th task elements, W i and W j are the weight coefficients of the i th and j th task elements, respectively, and d ij is the distance relationship information between the i th and j th task elements.
[0028] Optionally, the maximum cluster number is the same as the number of nodes of the network resource.
[0029] Optionally, the final obtained clusters are distributed to the nodes according to the network resources provided by the nodes of the cooperative task system, and the distribution comprises:
[0030] All the final obtained clusters are sorted according to the number of task elements in each cluster;
[0031] All the nodes are sorted according to the network resources provided by each node in the network resource;
[0032] The clusters are distributed to the nodes according to the sorting results of the clusters and the sorting results of the nodes, wherein the cluster with the largest number of task elements corresponds to the node with the largest network resource provided.
[0033] In a second aspect, the embodiments of the present application provide a task decomposition device for a collaborative task system, comprising:
[0034] a task element acquisition module, configured to acquire a plurality of task elements of a target application;
[0035] a distance relationship information acquisition module, configured to acquire distance relationship information between the task elements according to dependency relationship information between the task elements;
[0036] a weight coefficient acquisition module, configured to acquire a weight coefficient of each of the task elements according to self-resource requirement information of each of the task elements;
[0037] a relative attraction degree determination module, configured to determine a relative attraction degree between the task elements according to the distance relationship information between the task elements and the weight coefficient of each of the task elements;
[0038] a sorting module, configured to acquire two of the task elements with the smallest relative attraction degrees as reference points to form a reference point set, and other of the task elements as non-reference points;
[0039] a clustering module, configured to repeatedly perform the following steps until the number of clusters reaches a specified maximum cluster number: clustering each of the non-reference points with a reference point with the largest relative attraction degree to form a cluster; and acquiring a sum of the relative attraction degrees of each of the non-reference points and each of the reference points, and adding a non-reference point with the smallest sum of relative attraction degrees to the reference point set as a new reference point;
[0040] a distribution module, configured to distribute the finally obtained clusters to nodes of the collaborative task system according to network resources that can be provided by the nodes.
[0041] Optionally, the dependency relationship information comprises at least one of the following: total communication interaction amount between the task elements, communication resource requirement between the task elements, data dependency between the task elements, and special requirement information between the task elements.
[0042] Optionally, the distance relationship information acquisition module is configured to convert the dependency relationship information between the task elements into the distance relationship information between the task elements by using the following formula:
[0043]
[0044] wherein j and k are task element serial numbers, the task element set is denoted as Ω, the number of task elements is denoted as N, the task element j and k are in {1, …, N}, j≠k, d jk is the distance relationship information between the task elements, J jk is the total communication interaction amount between the task elements, J min and Jmax respectively are the minimum and maximum values of the total communication interaction, X jk is the communication resource requirement between the task elements, X min and X max respectively are the minimum and maximum values of the communication resource requirement, Y jk is the data dependency between the task elements, Y min and Y max respectively are the minimum and maximum values of the data dependency, T jk is the special requirement information between the task elements, a, b and c respectively represent the weights of the total communication interaction, the communication resource requirement and the data dependency.
[0045] Optionally, the weight coefficient obtaining module is configured to calculate the weight coefficient of the task element according to the following formula:
[0046]
[0047] wherein, W i is the weight coefficient of the i-th task element, C i is the self resource requirement information of the i-th task element, is the average resource requirement information of all the task elements.
[0048] Optionally, the relative attraction degree determining module is configured to calculate the relative attraction degree between the task elements according to the following formula:
[0049]
[0050] wherein, F ij is the relative attraction degree between the i-th and j-th task elements, W i and W j respectively are the weight coefficients of the i-th and j-th task elements, d ij is the distance relationship information between the i-th and j-th task elements.
[0051] Optionally, the maximum cluster number is the same as the number of nodes of the network resource.
[0052] Optionally, the distribution module is configured to sort all the clusters according to the number of task elements in each cluster, sort all the nodes according to the network resource that each node can provide, and distribute each cluster to each node according to the sorting results of the clusters and the sorting results of the nodes, wherein the cluster with the largest number of task elements corresponds to the node that can provide the largest network resource.
[0053] In a third aspect, an electronic device is provided, which comprises a processor, a memory, and a program stored in the memory and capable of running on the processor. When the program is executed by the processor, the steps of the task decomposition method for a collaborative task system according to the first aspect are implemented.
[0054] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps of the task decomposition method for a collaborative task system according to the first aspect are implemented.
[0055] In the embodiments of the present application, when decomposing a target application of a collaborative task system, a multi-granularity task decomposition result of different levels can be obtained according to the number of iterations (i.e., the number of executions of clustering) and the order, and the multi-granularity task decomposition scheme of different levels can make the subsequent resource allocation more flexible and suitable for a collaborative task system including nodes containing different network resources. BRIEF DESCRIPTION OF DRAWINGS
[0056] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The accompanying drawings are included to provide a description of the preferred embodiments, and are not intended to limit the scope of the application. Moreover, like reference numerals designate like parts throughout the several views. In the drawings:
[0057] Figure 1 A flowchart of the task decomposition method for a collaborative task system according to the embodiments of the present application;
[0058] Figure 2 A task decomposition diagram of the intelligent security application according to the embodiments of the present application;
[0059] Figure 3 A dependency diagram of the intelligent security application according to the embodiments of the present application, as well as a diagram of the distance relationship of task elements and the weight coefficients of the task elements;
[0060] Figure 4 A task decomposition result of setting the number of clusters to 2 according to the embodiments of the present application;
[0061] Figure 5 A task decomposition result of setting the number of clusters to 6 according to the embodiments of the present application
[0062] Figure 6 A structural diagram of the task decomposition device for a collaborative task system according to the embodiments of the present application;
[0063] Figure 7 A structural diagram of the electronic device according to the embodiments of the present application. DETAILED DESCRIPTION
[0064] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0065] Please refer to Figure 1 The embodiment of the present application provides a task decomposition method for a collaborative task system, comprising:
[0066] Step 11: obtaining a plurality of task elements of a target application;
[0067] In the embodiment of the present application, the componentized task is faced, that is, the code divisibility is taken as a precondition, and the minimum software function component of the code of the target application is regarded as a basic unit of task decomposition, which is called a task element. The task element has a logical inheritance relationship, and the relationship between a plurality of task elements and the task elements can be abstracted as a dependency graph of the task elements. In the embodiment of the present application, the task elements are aggregated on the basis of the dependency graph of the task elements.
[0068] Step 12: obtaining distance relationship information between the task elements according to the dependency relationship information between the task elements;
[0069] Step 13: obtaining a weight coefficient of each task element according to self-resource demand information of each task element;
[0070] In the embodiment of the present application, the resource demand (for example, the calculation amount) of the task element is taken into account to affect the task decomposition effect, the resource demand of the task element is expressed in the form of a weight, and finally the complex task parameter is converted into a single optimal problem by taking the relative attraction degree as the clustering basis.
[0071] Step 14: determining a relative attraction degree between the task elements according to the distance relationship information between the task elements and the weight coefficient of each task element;
[0072] Step 15: obtaining two task elements with the minimum relative attraction degree as reference points to form a reference point set, and other task elements as non-reference points;
[0073] In the embodiment of the present application, the corresponding relative attraction degrees (each two task elements have a relative attraction degree) of all the task elements can be sorted in ascending order, and the two task elements with the minimum relative attraction degree are selected as the reference points.
[0074] The reference point set Ψ can be expressed in the following manner: Ψ = {i, j | F i,j = min i′,j′∈Ω / Ψ F i′,j′}, i, j represent the serial numbers of two task elements with the minimum relative attraction degree, F i,j represents the relative attraction degree between the two task elements with the minimum relative attraction degree, Ω represents the task element set, and i', j' represent any two task elements.
[0075] Step 16: Clustering each non-reference point with a reference point with the maximum relative attraction degree of the non-reference point, to form a cluster.
[0076] Step 17: Obtaining the sum of the relative attraction degrees between each non-reference point and each reference point, and adding the non-reference point with the minimum sum of relative attraction degrees to the reference point set as a new reference point.
[0077] Step 18: Determining whether the number of clusters reaches a specified maximum cluster number, if yes, proceeding to step 19, otherwise returning to step 15 and repeating the clustering until the number of clusters reaches the specified maximum cluster number.
[0078] Step 19: Distributing the finally obtained clusters to nodes of the collaborative task system according to the network resources provided by the nodes.
[0079] That is, in the embodiment of the present application, the distance between task elements is defined according to the dependency relationship between the task elements, and then the weight coefficient is defined according to the resource requirement of the task element itself, and then the distance between the task elements is equivalent to the distance between particles, and the weight of the task element is abstracted as the mass of the particle, and the relative attraction degree between the task elements is constructed by using the idea of the universal gravitation model, and further iteration clustering is performed according to the size of the relative attraction degree, and the above steps are repeated to form a multi-granularity task decomposition scheme for the collaborative task system.
[0080] In the embodiment of the present application, the number of task elements in the finally obtained clusters can be different, that is, clusters with different granularities can be obtained. Most of the existing researches adopt a single-granularity task decomposition method, and do not fully consider the differentiated resource characteristics of the nodes providing network resources, which is not conducive to the reasonable allocation of resources. In the embodiment of the present application, when the target application is decomposed, different levels of multi-granularity task decomposition results can be obtained according to the iteration number (i.e., the number of execution times of clustering) and the order, and the generated multi-granularity task decomposition schemes of different levels can make the subsequent resource allocation more flexible.
[0081] In addition, in the embodiment of the present application, the task decomposition is not only affected by the relationship between the task elements of the composed application, but also affected by the attribute of the task element itself. The lack of consideration of the attribute of the task element itself can make the multiple sub-tasks obtained by the task decomposition unable to effectively adapt to the resource differentiation of the nodes, and when the granularity is small, the task allocation complexity is high; when the granularity is large, the computing resource overhead of the sub-tasks is too large, and the resources of the nodes with small resources cannot be effectively utilized. In the embodiment of the present application, when the task decomposition is performed, the attribute of the task element itself is considered, which can effectively reduce the complexity of the task allocation, and is suitable for a diversified network service environment including network resources with multiple levels of different characteristics and magnitudes.
[0082] In the embodiment of the present application, optionally, the dependency relationship information includes at least one of the following: total communication interaction amount between the task elements, communication resource requirement between the task elements, data dependency between the task elements, and special requirement information between the task elements.
[0083] The above dependency relationships are described below.
[0084] 1) Total communication interaction amount
[0085] The task elements with a series relationship decomposed from the same application need to communicate and cooperate, and there is a data transmission and communication relationship. In addition to paying attention to the communication amount, the frequency and complexity in information transmission also need to be paid attention to. For example, between two task elements, periodic signals or updated data need to be provided to the other to continue to complete the task. At this time, although the communication amount is not necessarily large, the frequency and complexity of information transmission between tasks greatly affect the task completion delay and the performance of the application. Therefore, the concept of total communication interaction amount between task elements is proposed, and the dependency relationship between task elements with larger total communication amount is stronger.
[0086] 2) Communication resource requirement
[0087] In the process of data communication, different task elements have different bandwidth requirements. Some task elements need to have low latency and fast response requirements, for example, one of the two task elements needs to make the next calculation immediately after the previous task element sends a signal. At this time, a large bandwidth is needed to improve the transmission speed. In order to reduce resource overhead, task elements with large communication resource requirements are clustered and placed together to effectively save the overhead.
[0088] 3) Data dependency
[0089] Two task elements have no communication with each other, but share the same data block, and such task elements are called data dependent. When task decomposition is performed, the data block that needs to be read and written during calculation is decomposed into subtasks. If different task elements with data dependency are divided into the same subtask set, the data copy amount and transmission amount will be reduced, and the task cost will be reduced.
[0090] 4) Special requirements
[0091] From the user's point of view, two task elements must be placed together or cannot be placed together, which is a relationship constraint caused by subjective or objective factors. For example, for the consideration of data privacy, business rapid processing, etc., industrial users may require that industrial site data not be out of the park, and require processing on the terminal or edge computing server to meet the demand of data not going to the cloud; therefore, special dependencies in task decomposition also need to be considered.
[0092] By mapping the above dependency relationship to the spatial distance, the distance of the task elements in space is calculated.
[0093] In the embodiment of the application, optionally, the distance relationship information between the task elements is obtained according to the dependency relationship information between the task elements, and the distance relationship information between the task elements includes:
[0094] The dependency relationship information between the task elements is converted into the distance relationship information between the task elements by using the following formula:
[0095]
[0096] Wherein, j, k are task element serial numbers, denoted as task element set Ω, task element number N, task element j, k ∈ {1,..., N}, j ≠ k, d jk is the distance relationship information between the task elements, J jk is the total communication interaction amount between the task elements, J min and J max are the minimum value and the maximum value of the total communication interaction amount, X jk is the communication resource requirement between the task elements, X min and X max are the minimum value and the maximum value of the communication resource requirement, Y jk is the data dependency between the task elements, Y min and Y max are the minimum value and the maximum value of the data dependency, T jk is the special requirement information between the task elements, a, b, and c represent the weights of the total communication interaction amount, the communication resource requirement, and the data dependency.
[0097] In this embodiment of the application, optionally, obtaining the weight coefficient of each task element based on its own resource requirement information includes:
[0098] The weight coefficient of the task element is calculated according to the following formula:
[0099]
[0100] Among them, W i C represents the weight coefficient of the i-th task element. i This provides the resource requirements for the i-th task element. This provides information on the average resource requirements for all task elements.
[0101] In this embodiment of the invention, optionally, the resource requirement information may be, for example, computational requirements.
[0102] In this embodiment of the application, optionally, determining the relative attraction between the task elements based on the distance relationship information between the task elements and the weight coefficient of each task element includes:
[0103] The relative attraction between the task elements is calculated using the following formula:
[0104]
[0105] Among them, F ij W represents the relative attractiveness between the i-th and j-th task elements. i and W j The weight coefficients for the i-th and j-th task elements are d and d, respectively. ij This refers to the distance relationship information between the i-th and j-th task elements.
[0106] In this embodiment of the invention, the sum of the relative attractiveness G between the non-reference point s∈Ω / Ψ and all reference points k∈Ψ is calculated using the following formula. s :
[0107] G s =∑ k∈Ψ F sk ……(4)
[0108] Where Ω / Ψ is the set of non-reference points, F sk Let be the relative attraction between the non-reference point s and the reference point k.
[0109] Then, G s The smallest task element s = argmin s∈Ω / Ψ {G s It is added as a new reference point to the reference point set Ψ.
[0110] Optionally, the maximum number of clusters is the same as the number of nodes of the network resource.
[0111] Optionally, the final obtained clusters are assigned to the nodes according to the network resources provided by the nodes of the cooperative task system.
[0112] Step 171: all the final obtained clusters are sorted according to the number of task elements in each cluster.
[0113] For example, the clusters are sorted from small to large according to the number of task elements in each cluster.
[0114] Step 172: all the nodes are sorted according to the network resources provided by each node.
[0115] For example, the nodes are sorted from small to large according to the network resources provided by each node.
[0116] Step 173: each cluster is assigned to each node according to the sorting result of the cluster and the sorting result of the node, wherein the cluster with the maximum number of task elements corresponds to the node with the maximum network resource provided.
[0117] The network resource in the above embodiment can be a computing resource or other resource, which is not limited by the present application.
[0118] The task decomposition method for the cooperative task system of the present application will be described below in combination with a specific application scenario.
[0119] Please refer to Figure 2 , Figure 2 for the task decomposition of the intelligent security application. Figure 2 The dependency relationship diagram of the task elements of the intelligent security application and the task decomposition result are shown, and each obtained cluster is assigned to each node capable of providing network resources according to the task decomposition result.
[0120] Please refer to Figure 3 , Figure 3 for the dependency relationship diagram of the intelligent security application, the distance relationship of the task elements, and the weight coefficient of each task element. Figure 3 As can be seen from the figure, each circle represents a task element, and the weight coefficient of the task element is marked in the circle. The distance relationship between the task elements is marked on the connection line between the circles. In the embodiment of the present application, the task elements of the intelligent security application include: audio and video collection, audio processing, sound feature extraction, identity recognition, behavior recognition, face feature extraction, task recognition, motion monitoring, and motion recognition.
[0121] In the embodiment of the present application, the relative attraction degrees between the task elements can be calculated according to the above formula (3), and the relative attraction degrees between the task elements are arranged from small to large, two task elements corresponding to the smallest relative attraction degree are obtained, and the two task elements are selected as reference points, and the rest of the reference points are selected as non-reference points.
[0122] The relative attraction degrees of the non-reference points and the two reference points are compared, the non-reference points are classified, and the non-reference points are clustered into the reference point cluster with a larger relative attraction degree.
[0123] According to the above formula (4), the relative attraction degrees of each non-reference point and each reference point are summed, and the task element with the smallest sum value is added to the reference point set Ψ as a new reference point.
[0124] The relative attraction degrees of the non-reference points (updated non-reference points) and the reference points (updated reference points) are compared again, the non-reference points are classified, the non-reference points are clustered into the reference point cluster with a larger relative attraction degree, and a new cluster result is obtained. The above operation is repeated until a preset number of clusters is obtained.
[0125] Finally, the decomposition scheme under different granularities can be obtained, please refer to Figure 4 and Figure 5 , Figure 4 the task decomposition result with the cluster number set to 2, Figure 4 the task decomposition result with the cluster number set to 3. Since the correlation coefficient is based on the total communication interaction, data dependency, communication resource demand and special demand, and the relative attraction degree also comprehensively considers the resource demand of the task element itself, it is ensured that the division scheme under each level of granularity is the optimal division scheme that meets the dependency relationship in the same granularity scheme.
[0126] The above embodiment of the present application has the following advantages:
[0127] 1) The relationship between abstract task elements and their own resource demand and other factors are materialized, and the task decomposition problem is converted into a graph clustering problem, reducing the complexity of solving;
[0128] 2) The influence of the resource demand attribute of the task element itself and the relationship attribute between the task elements on the task decomposition is comprehensively considered, the weight coefficient is proposed to measure the influence of the task element weight on the task decomposition, the task elements are clustered and divided by comparing the relative attraction degrees, and a low-overhead and high-efficiency decomposition scheme is obtained;
[0129] 3) According to the iteration number and order, the task decomposition results of different levels of multi-granularity are obtained, and the generated multi-granularity task decomposition schemes of different levels can make the subsequent resource allocation more flexible, so that the nodes with different network resources can be fully utilized.
[0130] Please refer to Figure 6 The embodiment of the present application also provides a task decomposition device 60 for a collaborative task system, comprising:
[0131] A task element acquisition module 61 is configured to acquire a plurality of task elements of a target application.
[0132] A distance relationship information acquisition module 62 is configured to acquire distance relationship information between the task elements according to dependency relationship information between the task elements.
[0133] A weight coefficient acquisition module 63 is configured to acquire a weight coefficient of each of the task elements according to self-resource requirement information of each of the task elements.
[0134] A relative attraction degree determination module 64 is configured to determine a relative attraction degree between the task elements according to the distance relationship information between the task elements and the weight coefficient of each of the task elements.
[0135] An ordering module 65 is configured to acquire two of the task elements with the smallest relative attraction degrees as reference points to form a reference point set, and other of the task elements as non-reference points.
[0136] A clustering module 66 is configured to repeatedly execute the following steps until the number of clusters reaches a specified maximum cluster number: clustering each of the non-reference points with a reference point with the largest relative attraction degree to form a cluster; and acquiring a sum of the relative attraction degrees between each of the non-reference points and each of the reference points, and adding a non-reference point with the smallest sum of relative attraction degrees to the reference point set as a new reference point.
[0137] A distribution module 67 is configured to distribute the finally obtained clusters to nodes of the collaborative task system according to network resources that can be provided by the nodes.
[0138] In the embodiment of the present application, the number of task elements in the finally obtained clusters can be different, that is, clusters with different granularities can be obtained. Most of the existing researches adopt a single-granularity task decomposition mode, and do not fully consider the differentiated resource characteristics of the nodes providing network resources, which is not conducive to the reasonable distribution of resources. In the embodiment of the present application, when the target application is decomposed, different levels of multi-granularity task decomposition results can be obtained according to the number of iterations (i.e., the number of execution of clustering) and the order, and the different levels of multi-granularity task decomposition schemes generated can make the subsequent resource distribution more flexible.
[0139] Optionally, the dependency relationship information comprises at least one of the following: a total interaction amount of communication between the task elements, communication resource requirements between the task elements, data dependency between the task elements, and special requirement information between the task elements.
[0140] Optionally, the distance relationship information acquisition module 62 is configured to convert the dependency relationship information between the task elements into the distance relationship information between the task elements by using the following formula:
[0141]
[0142] wherein j and k are task element serial numbers, the task element set is denoted as Ω, the number of task elements is N, the task element j and k are in {1, …, N}, j≠k, d jk is the distance relationship information between the task elements, J jk is the total communication interaction amount between the task elements, J min and J max are the minimum value and the maximum value of the total communication interaction amount respectively, X jk is the communication resource requirement between the task elements, X min and X max are the minimum value and the maximum value of the communication resource requirement respectively, Y jk is the data dependency between the task elements, Y min and Y max are the minimum value and the maximum value of the data dependency respectively, T jk is the special requirement information between the task elements, a, b and c respectively represent the weight of the total communication interaction amount, the communication resource requirement and the data dependency.
[0143] Optionally, the weight coefficient acquisition module 63 is configured to calculate the weight coefficient of the task element according to the following formula:
[0144]
[0145] wherein W i is the weight coefficient of the i-th task element, C i is the self resource requirement information of the i-th task element, is the average resource requirement information of all the task elements.
[0146] Optionally, the relative attraction degree determination module 64 is configured to calculate the relative attraction degree between the task elements according to the following formula:
[0147]
[0148] wherein F ij is the relative attraction degree between the i-th and j-th task elements, W i and W j are the weight coefficients of the i-th and j-th task elements respectively, d ij is the distance relationship information between the i-th and j-th task elements.
[0149] Optionally, the maximum number of clusters is the same as the number of nodes of the network resource.
[0150] Optionally, the distribution module 67 is configured to sort all the final clusters according to the number of task elements in each cluster, sort all the nodes in the network resource according to the network resource provided by each node, and distribute each cluster to each node according to the sorting results of the clusters and the sorting results of the nodes, wherein the cluster with the maximum number of task elements corresponds to the node with the maximum network resource.
[0151] Please refer to Figure 7 The embodiment of the application further provides an electronic device 70, which comprises a processor 71, a memory 72, and a computer program stored in the memory 72 and capable of running on the processor 71. When the computer program is executed by the processor 71, each process of the task decomposition method for a collaborative task system is implemented, and the same technical effects are achieved. To avoid repetition, details are not described herein.
[0152] The embodiment of the application further provides a computer readable storage medium, which stores a computer program. When the computer program is executed by a processor, each process of the task decomposition method for a collaborative task system is implemented, and the same technical effects are achieved. To avoid repetition, details are not described herein. The computer readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0153] It should be noted that, in this document, the terms "comprising", "including", or any other variant thereof are intended to cover a non-exclusive inclusion, so that processes, methods, articles, or apparatuses that include a series of elements not only include those elements, but also include other elements not explicitly listed, or inherent to such processes, methods, articles, or apparatuses. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0154] Those skilled in the art can clearly understand the above-mentioned embodiment method can be realized by means of software and necessary general hardware platform, of course, also can be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application essentially or say the part of contribution to the prior art can be embodied in the form of software product, the computer software product is stored in a storage medium (such as ROM / RAM, disk, optical disk), including a number of instructions to make a terminal (may be a mobile phone, computer, server, air conditioner, or network equipment, etc.) executes the method described in various embodiments of the present application.
[0155] The embodiments of the present application are described above in conjunction with the drawings, but the present application is not limited to the above-mentioned specific embodiments, the above-mentioned specific embodiments are only illustrative, but not restrictive, those skilled in the art can make many forms under the inspiration of the present application without departing from the purpose of the present application and the scope protected by the claims, all of which belong to the protection of the present application.
Claims
1. A task decomposition method for collaborative task systems, characterized in that, include: Obtain multiple task elements of the target application; Based on the dependency information between the task elements, obtain the distance relationship information between the task elements; Based on the resource requirement information of each task element, obtain the weight coefficient of each task element; The relative attraction between the task elements is determined based on the distance relationship information between the task elements and the weight coefficient of each task element; The two task elements with the lowest relative attraction are selected as reference points to form a set of reference points, and the other task elements are selected as non-reference points. Repeat the following steps until the number of clusters reaches the specified maximum number of clusters: cluster each non-reference point with the reference point with the highest relative attraction to form a cluster; obtain the sum of the relative attraction between each non-reference point and each reference point, and add the non-reference point with the smallest sum of relative attraction as a new reference point to the reference point set; the maximum number of clusters is the same as the number of nodes in the network resource. Based on the network resources available to each node in the collaborative task system, the resulting clusters are assigned to each of the nodes. The allocation of the final clusters to the nodes based on the network resources available to each node in the collaborative task system includes: Sort all the resulting clusters according to the number of task elements in each cluster; Sort all the nodes according to the network resources that each node in the network resources can provide; Based on the sorting results of the clusters and the sorting results of the nodes, each cluster is assigned to each node, wherein the cluster with the largest task element corresponds to the node that can provide the largest amount of network resources.
2. The method according to claim 1, characterized in that, The dependency information includes at least one of the following: the total amount of communication interaction between the task elements, the communication resource requirements between the task elements, the data dependencies between the task elements, and the special requirement information between the task elements.
3. The method according to claim 2, characterized in that, Obtaining the distance relationship information between the task elements based on the dependency relationship information includes: The dependency information between the task elements is converted into distance relationship information between the task elements using the following formula: ; in, Let be the task element index, and let the task element set be denoted as . The number of task elements is N, and the number of task elements is... , This refers to the distance relationship information between the task elements. This represents the total amount of communication interaction between the task elements. and These are the minimum and maximum values of the total communication interaction, respectively. The communication resource requirements between the task elements. and These are the minimum and maximum values of communication resource requirements, respectively. For the data dependencies between the task elements, and These are the minimum and maximum values of the data dependency, respectively. This refers to the specific requirements information between the task elements. These represent the weights of the total communication interaction volume, communication resource requirements, and data dependencies, respectively.
4. The method according to claim 1, characterized in that, Based on the resource requirement information of each task element, the weight coefficient of each task element is obtained, including: The weight coefficient of the task element is calculated according to the following formula: ; in, Let be the weight coefficient of the i-th task element. This provides the resource requirements for the i-th task element. This provides information on the average resource requirements for all task elements.
5. The method according to claim 1, characterized in that, Determining the relative attraction between the task elements based on the distance relationship information between them and the weight coefficient of each task element includes: The relative attraction between the task elements is calculated using the following formula: ; in, The relative attraction between the i-th and j-th task elements. and These are the weight coefficients for the i-th and j-th task elements, respectively. This refers to the distance relationship information between the i-th and j-th task elements.
6. A task decomposition device for a collaborative task system, characterized in that, include: The task element acquisition module is used to acquire multiple task elements of the target application; The distance relationship information acquisition module is used to acquire the distance relationship information between the task elements based on the dependency relationship information between the task elements; The weight coefficient acquisition module is used to acquire the weight coefficient of each task element based on the resource requirement information of each task element. The relative attraction determination module is used to determine the relative attraction between the task elements based on the distance relationship information between the task elements and the weight coefficient of each task element; The sorting module is used to obtain the two task elements with the lowest relative attractiveness as reference points to form a set of reference points, and the other task elements as non-reference points. The clustering module is used to repeatedly perform the following steps until the number of clusters reaches a specified maximum number of clusters: clustering each non-reference point with the reference point with the highest relative attraction to form a cluster; obtaining the sum of the relative attraction between each non-reference point and each reference point, and adding the non-reference point with the smallest sum of relative attraction as a new reference point to the reference point set; the maximum number of clusters is the same as the number of nodes in the network resource; The allocation module is used to allocate the final clusters to each node according to the network resources that each node of the collaborative task system can provide; The allocation of the final clusters to the nodes based on the network resources available to each node in the collaborative task system includes: Sort all the resulting clusters according to the number of task elements in each cluster; Sort all the nodes according to the network resources that each node in the network resources can provide; Based on the sorting results of the clusters and the sorting results of the nodes, each cluster is assigned to each node, wherein the cluster with the largest task element corresponds to the node that can provide the largest amount of network resources.
7. An electronic device, characterized in that, include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the task decomposition method for a cooperative task system as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the task decomposition method for a cooperative task system as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Gravitational search-based cloud computing task scheduling method
CN107562537A
Energy-saving task allocation method for cloud data center
CN111431961A