Automatic generation method, device, computer equipment and medium for task request information
By constructing task graph data and retraining the resource allocation network, the appropriate configuration request time point is determined, which solves the problem of low task process execution efficiency, achieves reasonable resource allocation and shortens the waiting time for configuration information, and improves the execution efficiency of the task process. .
Patent Information
- Application Number
- CN202210581587.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-26
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-05-26
AI Technical Summary
The task process execution efficiency in the existing technology is low, mainly due to the inappropriate timing of request information generation, which causes the process of waiting for users to upload configuration data, which affects efficiency, and pre-collection and storage of configuration data takes up computing resources, resulting in differences in parallel task completion times and redundant waiting. .
Use the tasks in the target task process as nodes, obtain the identification information, mark information and historical execution records of each node, construct the task graph data, use the pre-trained resource allocation network for retraining, and calculate the computing resource allocation of each node Measure and predict the execution time, determine the configuration request time point, and generate configuration request information to obtain configuration data.
Through reasonable resource allocation and determination of configuration request time points, redundant waiting time is reduced, task process execution efficiency is improved, unreasonable resource allocation is avoided, and configuration information is shortened while occupying as few storage resources as possible. Waiting time.
Smart Images

Figure CN114896067B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, device, computer equipment and medium for automatically generating task request information. Background Art
[0002] At present, with the development of artificial intelligence technology, data processing-related tasks have gradually changed from the original manual processing to the processing of machines with allocated computing resources to improve the efficiency of task execution. When the machine performs task processing, it needs to generate request information, use the request information to obtain the user's configuration data and perform subsequent data processing. Among them, the task that needs to interact with the user to obtain configuration data is called an interactive task. In the prior art, the timing of generating the request information is when the task flow reaches the interactive task execution time point.
[0003] However, after the request information is generated and sent to the user, it is necessary to wait for the user to manually upload the configuration data. The waiting process affects the efficiency of the task process execution. If the configuration data is collected in advance for storage, it will bring a large storage burden and occupy a certain amount of computing resources, thereby reducing the efficiency of the task process execution. In addition, the allocation of computing resources used for machine data processing is usually allocated according to preset values, which may lead to large differences in the completion time points between parallel tasks, and thus the need for redundant waiting time, which will also reduce the efficiency of the task process execution. Therefore, how to improve the efficiency of task process execution has become an urgent problem to be solved. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a method, apparatus, computer device and medium for automatically generating task request information to solve the problem of low efficiency in executing task processes.
[0005] In a first aspect, an embodiment of the present invention provides a method for automatically generating task request information, the method comprising:
[0006] Take the tasks in the target task flow as nodes, obtain the identification information, tag information and historical execution records of each node, and the degree of association between the tasks corresponding to any two adjacent nodes, the historical execution records include the task execution time and the amount of resources allocated for execution, and the tag information is used to indicate whether the task corresponding to the node needs configuration data;
[0007] The task execution time, the execution allocation resource amount and the marking information are used as the node information of the corresponding node, and edges are set between the nodes whose association degrees meet the preset conditions to obtain task graph data;
[0008] Retraining the pre-trained resource allocation network using the task graph data to obtain a retrained resource allocation network, inputting the task graph data into the retrained resource allocation network, and outputting the computing resource allocation amount corresponding to each node;
[0009] Calculate the predicted execution time of the corresponding node according to the computing resource allocation amount corresponding to each node, and determine the execution time point of each task according to the predicted execution time and the target task flow;
[0010] According to the execution time point of each task and the preset configuration reservation time, the configuration request time point of each task is determined, and when the current time reaches the configuration request time point, the corresponding task generates configuration request information, and the configuration request information is used to send to the user to obtain configuration data.
[0011] In a second aspect, an embodiment of the present invention provides an automatic generation device for task request information, the automatic generation device comprising:
[0012] The task information acquisition module is used to take the tasks in the target task flow as nodes, obtain the identification information, tag information and historical execution records of each node, and the degree of association between the tasks corresponding to any two adjacent nodes. The historical execution records include the task execution time and the amount of resources allocated for execution. The tag information is used to indicate whether the task corresponding to the node needs configuration data;
[0013] A graph data construction module, used to use the task execution time, the execution allocation resource amount and the marking information as the node information of the corresponding node, and to set edges between the nodes whose association degrees meet the preset conditions to obtain task graph data;
[0014] A resource allocation module, used to retrain the pre-trained resource allocation network using the task graph data to obtain a retrained resource allocation network, input the task graph data into the retrained resource allocation network, and output the computing resource allocation amount corresponding to each node;
[0015] An execution time determination module, used to calculate the predicted execution time of the corresponding node according to the computing resource allocation amount corresponding to each node, and determine the execution time point of each task according to the predicted execution time and the target task flow;
[0016] The request information generation module is used to determine the configuration request time point of each task according to the execution time point of each task and the preset configuration reservation time, and when the current time reaches the configuration request time point, the corresponding task generates configuration request information, and the configuration request information is used to be sent to the user to obtain configuration data.
[0017] In a third aspect, an embodiment of the present invention provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the automatic generation method as described in the first aspect when executing the computer program.
[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the automatic generation method as described in the first aspect is implemented.
[0019] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0020] Take the tasks in the target task flow as nodes, obtain the identification information, tag information and historical execution records of each node, and the degree of association between the corresponding tasks of any two adjacent nodes. The historical execution records include the task execution time and the amount of resources allocated for execution. The tag information is used to characterize whether the task corresponding to the node needs to be configured with data; take the task execution time, the amount of resources allocated for execution and the tag information as the node information of the corresponding node, and set edges between the nodes whose association degrees meet the preset conditions to obtain the task graph data, use the task graph data to retrain the pre-trained resource allocation network to obtain the retrained resource allocation network, input the task graph data into the retrained resource allocation network, output the computing resource allocation amount corresponding to each node, calculate the predicted execution time of the corresponding node based on the computing resource allocation amount corresponding to each node, and calculate the predicted execution time of the corresponding node based on the predicted execution time of the corresponding node. Predict the execution time and target task flow, determine the execution time point of each task, determine the configuration request time point of each task according to the execution time point of each task and the preset configuration reservation time, and when the current time reaches the configuration request time point, the corresponding task generates configuration request information, which is used to send to the user to obtain configuration data. The resource allocation network is used to allocate computing resources for each task to avoid unreasonable resource allocation, reduce redundant waiting time, and effectively improve the efficiency of task flow execution. After determining the computing resource allocation of each task, determine the appropriate time point to generate configuration request information according to the predicted execution time and task flow, obtain configuration request information in advance, shorten the configuration information waiting time while occupying as little storage resources as possible, thereby improving the efficiency of task flow execution. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0022] Figure 1 This is a schematic diagram of an application environment of a method for automatically generating task request information provided by the first embodiment of the present invention;
[0023] Figure 2 It is a flowchart of a method for automatically generating task request information provided by the first embodiment of the present invention;
[0024] Figure 3 It is a flowchart of a method for automatically generating task request information provided by Embodiment 2 of the present invention;
[0025] Figure 4 It is a structural diagram of a device for automatically generating task request information provided by Embodiment 3 of the present invention;
[0026] Figure 5 It is a structural diagram of a computer device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0027] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0028] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0029] It should also be understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0030] As used in the present specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]", depending on the context.
[0031] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0032] References to "one embodiment" or "some embodiments" etc. described in the present specification mean that one or more embodiments of the present invention include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0033] The embodiments of the present invention can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0034] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0035] It should be understood that the order of execution of the steps in the following embodiments does not imply a precedence of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0036] In order to illustrate the technical solution of the present invention, specific embodiments are provided below for illustration.
[0037] A method for automatically generating task request information provided by the first embodiment of the present invention can be applied in the following aspects: Figure 1In the application environment, the server can provide the corresponding execution environment, execution data recording service and statistical service for the target task process. Each task in the target task process corresponds to identification information, tag information and historical execution record. The server can be implemented by an independent server or a server cluster composed of multiple servers. The server communicates with the client corresponding to the user to obtain the user's configuration data. Among them, the client includes but is not limited to handheld computers, desktop computers, laptops, ultra-mobile personal computers (UMPC), netbooks, cloud terminal devices, personal digital assistants (PDA) and other computer devices.
[0038] See also Figure 2 , is a flow chart of a method for automatically generating task request information provided by the first embodiment of the present invention. The above automatic generation method can be applied to Figure 1 The server in the target task flow defines each task as a node. The server obtains the identification information, tag information and historical execution records of the node by accessing the record data and statistical data of the task corresponding to the node. During the execution of the target task flow, the server generates a request message and sends it to the client to obtain the client's configuration data. Figure 2 As shown, the automatic generation method may include the following steps:
[0039] Step S201, taking the tasks in the target task flow as nodes, obtaining the identification information, tag information and historical execution records of each node, as well as the degree of association between the corresponding tasks of any two adjacent nodes, the historical execution records including the task execution time and the amount of resources allocated for execution.
[0040] Among them, a task may refer to operations such as data collection, conversion, calculation and sorting to analyze and process data, and a task flow may refer to the process of task execution.
[0041] A node may refer to a graph node, usually represented by V. The identification information of a node may refer to a numerical serial number, a letter, or other symbol used to distinguish different nodes. The tag information of a node may refer to pre-acquired coding information. The tag information is used to indicate whether the task corresponding to the node requires configuration data, and is usually represented by 0 and 1.
[0042] The task execution duration may refer to the average, minimum and maximum execution durations of the tasks corresponding to the node during the historical execution process, and the execution allocation resource amount may refer to the average, minimum and maximum execution durations of the tasks corresponding to the node during the historical execution process.
[0043] Specifically, the degree of association between the tasks corresponding to any two adjacent nodes refers to the association index between two tasks with adjacent execution orders in the task flow. For example, if task one is adjacent to task two, and the execution order of task two is after task one, then the degree of association between task one and task two is obtained. If task one is adjacent to task two, and the execution order of task two is the same as that of task one, which is a parallel execution, then the degree of association between task one and task two is not obtained.
[0044] The above-mentioned step of taking the tasks in the target task flow as nodes, obtaining the identification information, tag information and historical execution records of each node, and the degree of association between the corresponding tasks of any two adjacent nodes, represents the tasks in the target task flow in the form of nodes, which is conducive to quantifying the relevant information of the tasks, simplifying the analysis process of the task flow, and improving the efficiency of the task flow analysis.
[0045] Step S202, taking the task execution time, execution allocation resource amount and marking information as the node information of the corresponding node, and setting edges between nodes whose association degrees meet preset conditions to obtain task graph data.
[0046] Among them, node information may refer to information used to represent node attributes, edges may refer to connection relationships between nodes, and task graph data may refer to graph data constructed with tasks as nodes, which is used to represent tasks in a structured manner.
[0047] The preset condition may refer to a condition artificially set based on the distribution of the degree of association. For example, when the degree of association is expressed by a numerical value, the preset condition may be a set threshold, and a case where the degree of association is greater than the set threshold is considered to satisfy the preset condition, and a case where the degree of association is less than or equal to the set threshold is considered to not satisfy the preset condition. The threshold may be 0.
[0048] Specifically, in this embodiment, the node information is represented by a one-dimensional vector, which contains three elements. The position of each element is fixed, and the elements in different positions represent different meanings, corresponding to the task execution time, the execution allocation resource amount and the marking information respectively.
[0049] In one implementation, the node information may also be represented by a matrix, a mapping point in a three-dimensional coordinate system, or the like.
[0050] In the above, the task execution time, the amount of allocated resources for execution and the marking information are used as the node information of the corresponding node, and edges are set between the nodes whose correlation degree meets the preset conditions to obtain the task graph data step. The task flow is represented in the form of graph data, which is convenient for adjusting the task information and analyzing the task flow, and can improve the efficiency of task flow analysis.
[0051] Step S203, using the task graph data to retrain the pre-trained resource allocation network to obtain a retrained resource allocation network, inputting the task graph data into the retrained resource allocation network, and outputting the computing resource allocation amount corresponding to each node.
[0052] Among them, the resource allocation network can refer to neural network models such as fully convolutional networks, autoencoders and adversarial generative networks.
[0053] Pre-training can refer to the process of preliminary training using a pre-training dataset and corresponding pre-training labels, which is used to enable the model to realize basic functions. Basic functions may refer to feature extraction and feature reconstruction, etc. Retraining can refer to the process of re-training based on a retraining dataset and corresponding retraining labels provided in real time, which is used to enable the model to train downstream tasks in a targeted manner according to real-time needs. Downstream tasks may refer to resource allocation tasks.
[0054] The amount of computing resources allocated can refer to the CPU usage, memory allocation space size, network bandwidth, etc.
[0055] Specifically, since pre-training can only ensure that the resource allocation network learns how to extract effective features, but cannot enable the pre-trained resource allocation network to output specific resource allocation results, it is necessary to retrain the pre-trained resource allocation network according to specific downstream tasks, namely resource allocation tasks. The purpose of retraining is to enable the retrained resource allocation network to reconstruct effective features into resource allocation results.
[0056] Optionally, the resource allocation network includes an encoder and a decoder, the pre-training sample of the resource allocation network is the training graph data, and the reconstruction loss is used as the pre-training loss function;
[0057] The pre-training process of the resource allocation network includes:
[0058] Input the pre-training sample into the encoder to obtain the sample feature tensor;
[0059] Use the decoder to reconstruct the sample feature tensor to obtain a sample reconstruction result;
[0060] The pre-training loss function is calculated according to the sample reconstruction results and the pre-training samples. The parameters of the encoder and decoder are updated through the back-propagation algorithm according to the calculation results until the pre-training loss function converges to obtain the pre-trained resource allocation network.
[0061] Among them, the resource allocation network adopts a fully convolutional network model. The network consists of an encoder and a decoder. The encoder is used to extract the features of the input quantity, and the decoder is used to reconstruct the features of the input quantity to obtain the output quantity.
[0062] The training graph data may refer to graph data constructed according to the historical task process, and the reconstruction loss may adopt similarity calculation methods such as cosine similarity and Euclidean distance.
[0063] Specifically, the pre-trained label is the input itself, and the pre-training loss function is used to measure the similarity between the input and output. The greater the similarity, the smaller the loss function, and the smaller the similarity, the larger the loss function. The input is the pre-training sample, and the output is the reconstructed image data. The downstream task of pre-training is the reconstruction task.
[0064] This embodiment sets the downstream task of pre-training as a reconstruction task rather than a resource allocation task, so as to avoid the network being unable to adapt to more difficult resource allocation tasks, resulting in difficulty in converging the pre-training process. In addition, the model can fully learn to extract effective features of the input quantity during the pre-training process, thereby providing effective features for subsequent retraining processes and improving the accuracy of resource allocation.
[0065] Optionally, the pre-trained resource allocation network includes a pre-trained encoder and a pre-trained decoder, and the resource allocation loss function is used as a retraining loss function;
[0066] Use the task graph data to retrain the pre-trained resource allocation network to obtain the retrained resource allocation network. Input the task graph data into the retrained resource allocation network, and output the computing resource allocation corresponding to each node, including:
[0067] Input the task graph data into the pre-trained encoder to obtain the feature tensor;
[0068] Use the pre-trained decoder to reconstruct the feature tensor and obtain the reconstruction result;
[0069] Calculate the retraining loss function according to the reconstruction result, and update the parameters of the pretrained encoder and the pretrained decoder through the back propagation algorithm according to the calculation result until the retraining loss function converges;
[0070] The task graph data is input into the resource allocation network after parameter update, and the output result of the resource allocation network after parameter update is determined to be the resource allocation result.
[0071] Among them, the pre-trained resource allocation network may refer to a resource allocation network with fixed network parameters after the pre-training process, and the resource allocation loss function may refer to a loss function used to measure the impact of resource allocation results on the execution efficiency of the task process.
[0072] Specifically, the training samples for retraining are task graph data. During the retraining process, since the loss function of retraining is changed to the resource allocation loss function, after the task graph data is input into the pre-trained resource allocation network, the initial output is the reconstructed task graph data. The value of the resource allocation loss function calculated by the initial output will be larger, so the parameters of the pre-trained encoder and pre-trained decoder are updated through the back propagation algorithm according to the resource allocation loss function until the resource allocation loss function calculated according to the output corresponding to the task graph data converges.
[0073] This embodiment uses task graph data as retraining samples, and can adjust network parameters in a targeted manner to adapt to the task graph data. At the same time, it sets the retraining loss function as a resource allocation loss function and changes downstream tasks to obtain reasonable resource allocation results, thereby improving the execution efficiency of the task process.
[0074] Optionally, if each task is divided into N execution sets according to the task execution order in the task flow, the resource allocation loss function is specifically:
[0075]
[0076] Where n is the sequence number of the execution set, n∈[1,2,…,N], N is the number of execution sets, i is the sequence number of the task in the execution set, i∈[1,2,…,I n ], I n is the number of tasks in the nth execution set, C is the resource reference value, is the predicted resource allocation for the ith task in the nth execution set, Allocate resources for the execution of the i-th task in the n-th execution set, is the task execution duration of the i-th task in the n-th execution set, and T is the time reference value.
[0077] The task execution order may refer to the order in which the tasks are executed, N is an integer greater than 0, and the tasks in each execution set are executed in parallel.
[0078] For example, task three needs to be executed after task one and task two are executed, and task one and task two are executed in parallel. Then the first execution set includes task one and task two, and the second execution set includes task three.
[0079] Specifically, the resource allocation loss function includes the resource allocation loss term and time loss It represents the sum of the predicted resource allocations of each task in the nth execution set. Since the tasks in the same execution set are executed in parallel and different execution sets are executed in sequence, it is only necessary to ensure that the predicted resource allocations allocated to each task in each execution set are reasonable. Reasonable means that the sum of the predicted resource allocations is as close as possible to the resource reference value. The resource reference value can refer to the total amount of allocable resources. Therefore That is, it is the difference between the sum of the predicted resource allocations of each task in the nth execution set and the resource reference value. If the sum of the predicted resource allocations is greater than the resource reference value, it will lead to the inability to allocate resources according to the resource allocation results, so the loss should be large. Therefore, an exponential function is used for mapping, and a -1 term is added to ensure that when the sum of the predicted resource allocations is the same as the resource reference value, the loss is 0. Since the -1 term is added, in order to avoid the loss function calculation result being a negative value, Take the absolute value.
[0080] The product of the amount of resources allocated for the i-th task in the n-th execution set during the historical execution and the task execution time is used to represent the corresponding task volume. Here, the idea of normalization is adopted, and the task volume is determined only by the amount of resources allocated for the execution and the task execution time. There is no need to consider the execution details such as the content and processing method of the task, which is convenient for quantifying the task volume. It is the predicted execution time of the ith task in the nth execution set. Since the next execution set will start only after all tasks in an execution set are completed, the execution time of the execution set is the maximum execution time of each task in the execution set. Indicates the maximum predicted execution time of each task in the nth execution set. is the total completion time of the target task process, It means that when the total completion time of the target task process is less than or equal to T, the loss is 0. Otherwise, the longer the excess time is, the greater the loss is.
[0081] This embodiment designs resource allocation loss according to the execution set, and designs the execution time loss of the task flow, which can effectively provide a learning direction for the resource allocation task, thereby enabling the retrained resource allocation network to output a reasonable resource allocation result.
[0082] Optionally, before retraining the pre-trained resource allocation network using the task graph data, the following is also included:
[0083] Obtain the preset completion time and real-time total computing resources corresponding to the target task process;
[0084] Update the corresponding resource reference value in the resource allocation loss function with the real-time total computing resource amount;
[0085] Update the corresponding time reference value in the resource allocation loss function with the preset completion time.
[0086] The preset completion time may refer to the completion time of the target task process. In this embodiment, the preset completion time is set manually. The real-time total computing resource amount may refer to the real-time obtainable allocable computing resource amount.
[0087] In one implementation, the preset completion time may also be set using an average or maximum value of historical task process completion times.
[0088] This embodiment uses preset completion time and real-time total computing resources to update corresponding parameters in the resource allocation loss function, thereby improving the generalization ability of the resource allocation network and enabling the resource allocation network to output reasonable resource allocation results for different target task processes.
[0089] Optionally, after updating the corresponding time reference value in the resource allocation loss function with the preset completion time, the method further includes:
[0090] Get the actual time taken for each completed task;
[0091] Delete the nodes and associated edges corresponding to each completed task from the task graph data, and update the task graph data;
[0092] Calculate the difference between the preset completion time and the sum of the actual times corresponding to all completed tasks, update the preset completion time with the difference, and adjust the corresponding time reference value in the resource allocation loss function.
[0093] Among them, the completed task can refer to the completed task obtained at any target time after the target task process starts to execute and before the execution is completed. The actual time can refer to the length of the time period actually used for the completed task from the start to the completion of the execution. The edge associated with the node can refer to the edge with the node as the vertex.
[0094] Specifically, if all tasks in the same execution set are completed tasks, then each completed task in the execution set is regarded as a single completed task, and the actual time is determined to be the longest execution time of each task in the execution set; if the tasks in the same execution set include unfinished tasks, then the actual time of the execution set is not determined for the time being.
[0095] This embodiment updates the task graph data and the preset completion time by acquiring the actual time taken to complete the task in real time, so as to facilitate the reallocation of resources during the execution of the target task flow. When the task execution time deviates from the prediction, the resource allocation result can be quickly adjusted to complete the target task flow within the preset completion time, thereby improving the robustness of the task flow execution.
[0096] The above-mentioned input of the task graph data into the pre-trained resource allocation network for retraining, and the determination of the computing resource allocation amount steps corresponding to each node based on the output obtained by inputting the task graph data into the retrained resource allocation network, can obtain reasonable resource allocation results, which is conducive to improving the execution efficiency of the target task process.
[0097] Step S204, calculate the predicted execution time of the corresponding node according to the computing resource allocation amount corresponding to each node, and determine the execution time point of each task according to the predicted execution time and the target task flow.
[0098] The predicted execution duration may refer to the predicted duration required for a node to execute a task according to the allocated computing resource configuration, and the execution time point may refer to the time point when the corresponding task starts to be executed.
[0099] Specifically, the product of the task execution time and the amount of allocated resources for the task corresponding to the node is calculated, and then the ratio of the above product to the amount of resource configuration is calculated to determine the ratio as the predicted execution time. The starting time of the entire target task process is known by default, so the execution time point of the next task can be obtained based on the predicted duration of the previous task.
[0100] The above method calculates the predicted execution time of the corresponding node according to the computing resource allocation amount corresponding to each node, and determines the execution time point step of each task according to the predicted execution time and the target task process. It can quantify the task amount corresponding to the task, facilitate the rapid calculation of the predicted execution time of each task, thereby obtaining the execution time point of each task, and improving the computing efficiency of subsequent configuration request information generation.
[0101] Step S205, determining the configuration request time point of each task according to the execution time point of each task and the preset configuration reservation time, and generating configuration request information by the corresponding task when the current time reaches the configuration request time point.
[0102] The configuration reservation time may refer to the waiting time of the corresponding node after sending the request information, the configuration request time point may refer to the time point when the node starts to request the configuration information, and the configuration request information is used to be sent to the user to obtain configuration data.
[0103] In this embodiment, the configuration reservation time adopts the historical configuration time average of the corresponding node, and the configuration request time point is determined by the configuration reservation time before the execution time point according to the execution time point of the task, so that the configuration data can be requested in advance, and there is no need to wait redundantly when the task starts to be executed. It should be noted that for nodes with marking information indicating that configuration data is not required, there is no need to determine the configuration request time point.
[0104] In one implementation, the configuration reservation time may also adopt the maximum value of the historical configuration time of the corresponding node or be manually set.
[0105] The above-mentioned step of determining the configuration request time point of each task according to the execution time point of each task and the preset configuration reservation time, and generating the configuration request information step by the corresponding task when the current time reaches the configuration request time point, can shorten the configuration information waiting time while occupying as few storage resources as possible, and improve the execution efficiency of the target task process.
[0106] This embodiment uses a resource allocation network to allocate computing resources for each task, avoids unreasonable resource allocation, reduces redundant waiting time, and can effectively improve the efficiency of task process execution. After determining the computing resource allocation for each task, the configuration request information is generated at an appropriate time point based on the predicted execution time and the task process, and the configuration request information is obtained in advance. While occupying as little storage resources as possible, the configuration information waiting time is shortened, thereby improving the efficiency of task process execution.
[0107] See also Figure 3 , is a flow chart of a method for automatically generating task request information provided in Embodiment 2 of the present invention. The task graph data analyzed in the automatic generation method may be an unweighted graph or a weighted graph.
[0108] When the task graph data is an unweighted graph, the implementer may construct the task graph data with reference to the graph data construction method of step S202 .
[0109] When the task graph data is a weighted graph, the task includes a task input component and a task output component, and the degree of association is the number of the same task input components of the subsequent task and the same task output components of the adjacent previous task in the task flow;
[0110] After obtaining the task graph data, it also includes:
[0111] Step S301, according to the degree of association, determine the weight corresponding to the degree of association according to a preset weight lookup table, determine the weight as the weight of the corresponding edge in the task graph data, and obtain weighted task graph data;
[0112] Step S302, performing second-order aggregation on the weighted task graph data, and determining a threshold value according to the average aggregation value of each node after the second-order aggregation;
[0113] Step S303: for any node, compare the aggregation value of the corresponding node with the threshold value. If the aggregation value of the corresponding node is greater than the threshold value, determine that the category of the corresponding node is a key node category. If the aggregation value of the corresponding node is less than or equal to the threshold value, determine that the category of the corresponding node is a non-key node category.
[0114] Step S304, adding the category of each node to the node information of the corresponding node in the task graph data.
[0115] Among them, the task output component may refer to the execution output during the task execution process, and the execution output may refer to data, judgment results or instructions, etc. The task input component may refer to the execution input required for task execution, and the execution input may refer to data, judgment results or instructions, etc.
[0116] Aggregation may refer to weighted summation. Second-order aggregation is to perform weighted summation twice. Neighbor nodes may refer to nodes connected to the target node through a single edge. The aggregation value is the node value corresponding to the node after the graph data is processed by weighted summation.
[0117] Specifically, an initial value is assigned to each node, and all nodes are assigned a value of F. It is recommended that F is an integer greater than 0 to facilitate calculation. In this embodiment, F is 1. The implementer can assign values to the nodes according to actual prior conditions.
[0118] For any neighbor node of the target node, obtain the weight of the edge between the neighbor node and the target node, calculate the product of the node value of the neighbor node and the weight, get the calculation result, add the calculation results of all neighbor nodes to the node value of the target node to get the aggregate value, use the aggregate value as the node value of the corresponding node, and then recalculate and add the calculation results of all neighbor nodes to the node value of the target node to get the second-order aggregate value.
[0119] This embodiment extracts key node categories and non-key node categories by aggregating graph data, which can enrich the features of task graph data and thus improve the accuracy of task graph data analysis.
[0120] Corresponding to the method for automatically generating task request information in the first embodiment above, Figure 4 The structural block diagram of the automatic generation device of task request information provided by the third embodiment of the present invention is shown. The above-mentioned automatic generation device is applied to the server side. The server side can provide the corresponding execution environment, execution data recording service and statistical service for the target task process. Each task in the target task process corresponds to identification information, tag information and historical execution record. The server side can be implemented by an independent server or a server cluster composed of multiple servers. The server side communicates with the client corresponding to the user to obtain the user's configuration data. For the convenience of explanation, only the part related to the embodiment of the present invention is shown.
[0121] See also Figure 4 , the automatic generation device comprises:
[0122] The task information acquisition module 41 is used to take the tasks in the target task flow as nodes, and obtain the identification information, tag information and historical execution records of each node, as well as the degree of association between the tasks corresponding to any two adjacent nodes. The historical execution records include the task execution time and the amount of resources allocated for execution. The tag information is used to indicate whether the task corresponding to the node needs configuration data;
[0123] A graph data construction module 42 is used to use the task execution time, execution allocation resource amount and marking information as the node information of the corresponding node, and to set edges between nodes whose association degree meets the preset conditions to obtain task graph data;
[0124] The resource allocation module 43 is used to retrain the pre-trained resource allocation network using the task graph data to obtain a retrained resource allocation network, input the task graph data into the retrained resource allocation network, and output the computing resource allocation amount corresponding to each node;
[0125] An execution time determination module 44 is used to calculate the predicted execution time of the corresponding node according to the computing resource allocation corresponding to each node, and determine the execution time point of each task according to the predicted execution time and the target task flow;
[0126] The request information generation module 45 is used to determine the configuration request time point of each task according to the execution time point of each task and the preset configuration reservation time, and when the current time reaches the configuration request time point, the corresponding task generates configuration request information, and the configuration request information is used to send to the user to obtain configuration data.
[0127] Optionally, the task includes a task input component and a task output component, and the degree of association is the number of task input components of a subsequent task and task output components of an adjacent preceding task in the task flow being the same;
[0128] The above-mentioned automatic generation device also includes:
[0129] A weight acquisition module is used to determine the weight corresponding to the degree of association according to a preset weight lookup table, and determine the weight as the weight of the corresponding edge in the task graph data to obtain weighted task graph data;
[0130] The graph aggregation module is used to perform second-order aggregation on the weighted task graph data and determine the threshold value based on the average aggregation value of each node after the second-order aggregation;
[0131] A category determination module is used to compare the aggregation value of the corresponding node with a threshold for any node. If the aggregation value of the corresponding node is greater than the threshold, the category of the corresponding node is determined to be a key node category; if the aggregation value of the corresponding node is less than or equal to the threshold, the category of the corresponding node is determined to be a non-key node category;
[0132] The category update module is used to add the category of each node to the node information of the corresponding node in the task graph data.
[0133] Optionally, the resource allocation network includes an encoder and a decoder, the pre-training sample of the resource allocation network is the training graph data, and the reconstruction loss is used as the pre-training loss function;
[0134] The above-mentioned automatic generation device also includes:
[0135] The sample feature extraction module is used to input the pre-training sample into the encoder to obtain the sample feature tensor;
[0136] A sample feature reconstruction module is used to use a decoder to reconstruct the sample feature tensor to obtain a sample reconstruction result;
[0137] The pre-training module is used to calculate the pre-training loss function according to the sample reconstruction results and the pre-training samples, and update the parameters of the encoder and decoder through the back-propagation algorithm according to the calculation results until the pre-training loss function converges to obtain a pre-trained resource allocation network.
[0138] Optionally, the pre-trained resource allocation network includes a pre-trained encoder and a pre-trained decoder, and the resource allocation loss function is used as a retraining loss function;
[0139] The resource allocation module 43 includes:
[0140] The feature extraction unit is used to input the task graph data into the pre-trained encoder to obtain the feature tensor;
[0141] A feature reconstruction unit is used to reconstruct the feature tensor using a pre-trained decoder to obtain a reconstruction result;
[0142] A retraining unit, used for calculating a retraining loss function according to the reconstruction result, and updating the parameters of the pretrained encoder and the pretrained decoder by a back propagation algorithm according to the calculation result until the retraining loss function converges;
[0143] The resource allocation unit is used to input the task graph data into the resource allocation network after parameter update, and determine the output result of the resource allocation network after parameter update as the resource allocation result.
[0144] Optionally, in the resource allocation module 43:
[0145] If each task is divided into N execution sets according to the task execution order in the task flow, N is an integer greater than 0, and the tasks in each execution set are executed in parallel, then the resource allocation loss function is specifically:
[0146]
[0147] Where n is the sequence number of the execution set, n∈[1,2,…,N], N is the number of execution sets, i is the sequence number of the task in the execution set, i∈[1,2,…,I n ], I n is the number of tasks in the nth execution set, C is the resource reference value, is the predicted resource allocation for the ith task in the nth execution set, Allocate resources for the execution of the i-th task in the n-th execution set, is the task execution duration of the i-th task in the n-th execution set, and T is the time reference value.
[0148] Optionally, the automatic generation device further comprises:
[0149] A real-time information acquisition module is used to obtain the preset completion time and real-time total computing resources corresponding to the target task process;
[0150] A resource parameter updating module is used to update the corresponding resource reference value in the resource allocation loss function with the real-time total computing resource amount;
[0151] The time parameter updating module is used to update the corresponding time reference value in the resource allocation loss function with the preset completion time.
[0152] Optionally, the automatic generation device further comprises:
[0153] The actual time acquisition module is used to obtain the actual time of each completed task;
[0154] A graph data update module is used to delete the nodes and associated edges corresponding to each completed task from the task graph data, and update the task graph data;
[0155] The parameter adjustment module is used to calculate the difference between the preset completion time and the sum of the actual times corresponding to all completed tasks, update the preset completion time with the difference, and adjust the corresponding time reference value in the resource allocation loss function.
[0156] It should be noted that the information interaction, execution process and other contents between the above-mentioned modules and units are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0157] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention. Figure 5 As shown, the computer device of this embodiment includes: at least one processor ( Figure 5Only one is shown), a memory, and a computer program stored in the memory and executable on at least one processor, wherein when the processor executes the computer program, the steps in any of the above-mentioned automatic updating method embodiments are implemented.
[0158] The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that Figure 5 This is merely an example of a computer device and does not constitute a limitation on the computer device. The computer device may include more or fewer components than those shown in the figure, or a combination of certain components, or different components. For example, it may also include a network interface, a display screen, and an input device.
[0159] The processor may be a CPU, or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0160] The memory includes a readable storage medium, an internal memory, etc., wherein the internal memory may be the memory of a computer device, and the internal memory provides an environment for the operation of an operating system and computer-readable instructions in the readable storage medium. The readable storage medium may be a hard disk of a computer device, and in other embodiments may also be an external storage device of a computer device, for example, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on a computer device. Further, the memory may also include both an internal storage unit of a computer device and an external storage device. The memory is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of computer programs, etc. The memory may also be used to temporarily store data that has been output or is to be output.
[0161] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the above-mentioned method embodiment, which will not be repeated here. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiment can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program code, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0162] The present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by a computer program product. When the computer program product runs on a computer device, the computer device can implement the steps in the above-mentioned method embodiment when executing.
[0163] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0164] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0165] In the embodiments provided by the present invention, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0166] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0167] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A method for automatically generating task request information, characterized in that: The method comprises: Take the tasks in the target task flow as nodes, obtain the identification information, tag information and historical execution records of each node, and the degree of association between the tasks corresponding to any two adjacent nodes, the historical execution records include the task execution time and the amount of resources allocated for execution, and the tag information is used to indicate whether the task corresponding to the node needs configuration data; The task execution time, the execution allocation resource amount and the marking information are used as the node information of the corresponding node, and edges are set between the nodes whose association degrees meet the preset conditions to obtain task graph data; Retraining the pre-trained resource allocation network using the task graph data to obtain a retrained resource allocation network, inputting the task graph data into the retrained resource allocation network, and outputting the computing resource allocation amount corresponding to each node; Calculate the predicted execution time of the corresponding node according to the computing resource allocation amount corresponding to each node, and determine the execution time point of each task according to the predicted execution time and the target task flow; According to the execution time point of each task and the preset configuration reservation time, the configuration request time point of each task is determined, and when the current time reaches the configuration request time point, the corresponding task generates configuration request information, and the configuration request information is used to send to the user to obtain configuration data.
2. The automatic generation method according to claim 1, characterized in that: The task includes a task input component and a task output component, and the association degree is the number of the task input components of the subsequent task and the task output components of the adjacent previous task in the task flow that are the same; After obtaining the task graph data, the method further includes: According to the degree of association, a weight corresponding to the degree of association is determined according to a preset weight lookup table, and the weight is determined as the weight of the corresponding edge in the task graph data to obtain weighted task graph data; For any node, the aggregation value of the corresponding node is compared with a threshold value. If the aggregation value of the corresponding node is greater than the threshold value, the category of the corresponding node is determined to be a key node category. If the aggregation value of the corresponding node is less than or equal to the threshold value, the category of the corresponding node is determined to be a non-key node category. The category of each node is added to the node information of the corresponding node in the task graph data.
3. The automatic generation method according to claim 1, characterized in that: The resource allocation network includes an encoder and a decoder, the pre-training sample of the resource allocation network is training graph data, and the reconstruction loss is used as the pre-training loss function; The pre-training process of the resource allocation network includes: Inputting the pre-training sample into the encoder to obtain a sample feature tensor; Using the decoder to perform feature reconstruction on the sample feature tensor to obtain a sample reconstruction result; The pre-training loss function is calculated according to the sample reconstruction result and the pre-training sample, and the parameters of the encoder and the decoder are updated through a back propagation algorithm according to the calculation result until the pre-training loss function converges to obtain a pre-trained resource allocation network.
4. The automatic generation method according to any one of claims 1 to 3, characterized in that: The pre-trained resource allocation network includes a pre-trained encoder and a pre-trained decoder, and uses a resource allocation loss function as a re-training loss function; The retraining of the pre-trained resource allocation network using the task graph data to obtain a retrained resource allocation network, inputting the task graph data into the retrained resource allocation network, and outputting the computing resource allocation amount corresponding to each node includes: Inputting the task graph data into the pre-trained encoder to obtain a feature tensor; Using the pre-trained decoder to perform feature reconstruction on the feature tensor to obtain a reconstruction result; Calculating the retrained loss function according to the reconstruction result, and updating the parameters of the pretrained encoder and the pretrained decoder by a back propagation algorithm according to the calculation result until the retrained loss function converges; The task graph data is input into a resource allocation network after parameter update, and an output result of the resource allocation network after parameter update is determined as a resource allocation result.
5. The automatic generation method according to claim 4, characterized in that: If each task is divided into N execution sets according to the task execution order in the task flow, N is an integer greater than 0, and the tasks in each execution set are executed in parallel, then the resource allocation loss function is specifically: Where n is the sequence number of the execution set, n∈[1,2,…,N], N is the number of execution sets, i is the sequence number of the task in the execution set, i∈[1,2,…,I n ], I n is the number of tasks in the nth execution set, C is the resource reference value, is the predicted resource allocation for the ith task in the nth execution set, Allocate resources for the execution of the i-th task in the n-th execution set, is the task execution duration of the i-th task in the n-th execution set, and T is the time reference value.
6. The automatic generation method according to claim 5, characterized in that: Before retraining the pre-trained resource allocation network using the task graph data, the method further includes: Obtaining the preset completion time and real-time total computing resources corresponding to the target task process; Using the real-time total computing resource amount, updating the corresponding resource reference value in the resource allocation loss function; The corresponding time reference value in the resource allocation loss function is updated with the preset completion time.
7. The automatic generation method according to claim 6, characterized in that: After updating the corresponding time reference value in the resource allocation loss function with the preset completion time, the method further includes: Get the actual time taken for each completed task; Deleting the nodes and associated edges corresponding to each completed task from the task graph data, and updating the task graph data; The difference between the preset completion time and the sum of the actual times corresponding to all completed tasks is calculated, the preset completion time is updated with the difference, and the corresponding time reference value in the resource allocation loss function is adjusted.
8. An automatic generation device for task request information, characterized in that: The automatic generation device comprises: The task information acquisition module is used to take the tasks in the target task flow as nodes, obtain the identification information, tag information and historical execution records of each node, and the degree of association between the tasks corresponding to any two adjacent nodes. The historical execution records include the task execution time and the amount of resources allocated for execution. The tag information is used to indicate whether the task corresponding to the node needs configuration data; A graph data construction module, used to use the task execution time, the execution allocation resource amount and the marking information as the node information of the corresponding node, and to set edges between the nodes whose association degrees meet the preset conditions to obtain task graph data; A resource allocation module, used to retrain the pre-trained resource allocation network using the task graph data to obtain a retrained resource allocation network, input the task graph data into the retrained resource allocation network, and output the computing resource allocation amount corresponding to each node; An execution time determination module, used to calculate the predicted execution time of the corresponding node according to the computing resource allocation amount corresponding to each node, and determine the execution time point of each task according to the predicted execution time and the target task flow; The request information generation module is used to determine the configuration request time point of each task according to the execution time point of each task and the preset configuration reservation time, and when the current time reaches the configuration request time point, the corresponding task generates configuration request information, and the configuration request information is used to be sent to the user to obtain configuration data.
9. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the automatic generation method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the automatic generation method according to any one of claims 1 to 7 is implemented.
