A task scheduling implementation method and device, electronic device, and storage medium
By using odd-numbered layers and even-numbered layers in the sequential data structure of task orders to represent the serial and parallel relationships of task nodes, combined with recursive analysis and preset connection principles, a node scheduling flow chart is generated, which solves task dependencies in the creation of a test environment management platform. Errors and inefficiencies caused by relationships are eliminated and automated task scheduling is implemented.
Patent Information
- Application Number
- CN202411045671.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-08-01
AI Technical Summary
When creating an integrated environment for the test environment management platform, there are dependencies between task processes, making human operations error-prone and inefficient.
By creating a sequential data structure of task orders, using odd-numbered layers to represent nodes for serial execution and even-numbered layers to represent nodes for parallel execution, recursive analysis and preset connection principles are used to generate a node scheduling flow chart, automatically scheduling task nodes and avoiding manual operations.
It improves the accuracy and efficiency of task execution, reduces human errors, and ensures that tasks are executed correctly according to dependencies.
Smart Images

Figure CN118567820B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of task scheduling, and in particular to a method and device for implementing task scheduling, an electronic device, and a storage medium. Background Art
[0002] In the integrated environment creation function of the test environment management platform, it is usually necessary to perform multiple tasks such as creating servers, installing middleware, creating Nebula clusters, building self-built Apollo clusters, server configuration files, creating pipelines, deploying databases, deploying versions, etc., that is, the integrated environment creation process of the test environment management platform includes multiple task flows.
[0003] Currently, when creating an integrated test environment management platform, staff members manually go to each corresponding platform in turn to perform corresponding operations to create a complete environment.
[0004] However, due to the dependencies between some task flows, they must be executed sequentially, and manual operations are prone to errors. Moreover, for task flows that do not have dependencies, they can be executed simultaneously. Manual and sequential operations will obviously seriously affect the efficiency of creation. Summary of the invention
[0005] Based on the above-mentioned deficiencies of the prior art, the present application provides a task scheduling implementation method and device, electronic device, and storage medium to solve the problems that the prior art is prone to errors and has low efficiency.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] The first aspect of the present application provides a method for implementing task scheduling, including:
[0008] Creating information of a sequential data structure of the current task order; wherein the information of the sequential data structure of the current task order is embedded with each node of the current task order, and the nodes that are executed serially are in the same odd-numbered layer, and the nodes that are executed in parallel are in the same even-numbered layer;
[0009] Recursively parsing the information of the sequential data structure of the current task order;
[0010] Whenever an atomic node is parsed, a flowchart node corresponding to each of the currently parsed atomic nodes is created; wherein the atomic node is a node having a corresponding string;
[0011] Based on the parsing layer number of each atomic node, the flowchart nodes corresponding to each atomic node are connected according to the preset connection principle, and the node scheduling flowchart of the current task order is obtained and output, so as to perform node scheduling according to the node scheduling flowchart of the current task order; wherein, the preset connection principle is that nodes at the same parsing layer with an odd number of parsing layers are connected in series, and nodes at the same sub-parsing layer with an even number of parsing layers are connected in parallel.
[0012] Optionally, in the above-mentioned task scheduling implementation method, the information of creating the sequential data structure of the current task order includes:
[0013] determining the type of the current task order;
[0014] Obtaining default complete information corresponding to the type of the current task order; wherein the default complete information is information of a pre-created sequential data structure and includes all nodes of tasks of the type of the current task order;
[0015] In response to a user's operation of removing a node in the default complete information corresponding to the type of the current task order, each node removed by the user operation is removed to obtain information of the sequential data structure of the current task order.
[0016] Optionally, in the above-mentioned task scheduling implementation method, the step of creating a flowchart node corresponding to each of the currently parsed atomic nodes includes:
[0017] A flowchart node corresponding to each of the atomic nodes is created according to the parsing layer number, node code and node order scheduling status of each of the atomic nodes.
[0018] Optionally, in the above-mentioned task scheduling implementation method, based on the parsing layer number of each atomic node, the flowchart nodes corresponding to each atomic node are connected according to a preset connection principle to obtain and output the node scheduling flowchart of the current task order, including:
[0019] Whenever a flowchart node corresponding to each of the currently parsed atomic nodes is created, if the parsing layer number of each of the currently parsed atomic nodes is an odd number, then the flowchart nodes corresponding to each of the atomic nodes are connected in series to the node scheduling flowchart of the current task order according to the parsing layer number of each of the atomic nodes;
[0020] If the parsing level number of each of the currently parsed atomic nodes is an even number, then the flowchart nodes corresponding to each of the atomic nodes are respectively connected in parallel to the node scheduling flowchart of the current task order according to the parsing level number of each of the atomic nodes;
[0021] After the information of the sequential data structure of the current task order is parsed, the node scheduling flowchart of the current task order is output.
[0022] Optionally, in the above-mentioned task scheduling implementation method, based on the parsing layer number of each atomic node, the flowchart nodes corresponding to each atomic node are connected according to a preset connection principle to obtain and output the node scheduling flowchart of the current task order, including:
[0023] After the information of the sequential data structure of the current task order is parsed, the flowchart nodes corresponding to the atomic nodes with odd parsing layers in the next parsing layer are connected in series in order from large to small, and the flowchart nodes corresponding to the atomic nodes in the previous parsing layer are connected, and the flowchart nodes corresponding to the atomic nodes with even parsing layers in the next parsing layer are connected to the flowchart nodes corresponding to the atomic nodes in the previous parsing layer, respectively, to obtain the node scheduling flowchart of the current task order and output it.
[0024] The second aspect of the present application provides a task scheduling implementation device, including:
[0025] An information creation unit, used to create information of a sequential data structure of a current task order; wherein the information of the sequential data structure of the current task order is embedded with each node of the current task order, and the nodes executed serially are in the same odd-numbered layer, and the nodes executed in parallel are in the same even-numbered layer;
[0026] A parsing unit, used for recursively parsing information of the sequential data structure of the current task order;
[0027] A node creation unit, used for creating a flowchart node corresponding to each of the currently parsed atomic nodes whenever an atomic node is parsed; wherein the atomic node is a node having a corresponding character string;
[0028] A node connection unit is used to connect the flowchart nodes corresponding to each of the atomic nodes according to a preset connection principle based on the number of parsing layers at which each of the atomic nodes is located, to obtain and output the node scheduling flowchart of the current task order, so as to perform node scheduling according to the node scheduling flowchart of the current task order; wherein the preset connection principle is that nodes at the same parsing layer with an odd number of parsing layers are connected in series, and nodes at the same sub-parsing layer with an even number of parsing layers are connected in parallel.
[0029] Optionally, in the above-mentioned task scheduling implementation device, the information creation unit includes:
[0030] A type determination unit, used to determine the type of the current task order;
[0031] An information acquisition unit, used to acquire default complete information corresponding to the type of the current task order; wherein the default complete information is information of a pre-created sequential data structure and includes all nodes of tasks of the type of the current task order;
[0032] The node removal unit is used to respond to the user's removal operation on the nodes in the default complete information corresponding to the type of the current task order, remove each node removed by the user operation, and obtain the information of the sequential data structure of the current task order.
[0033] Optionally, in the above-mentioned task scheduling implementation device, the node creation unit includes:
[0034] The node creation subunit is used to create a flowchart node corresponding to each of the atomic nodes according to the parsing layer number, node code and node order scheduling status of each of the atomic nodes.
[0035] Optionally, in the above-mentioned task scheduling implementation device, the node connection unit includes:
[0036] A series connection unit is used for connecting the flowchart nodes corresponding to the currently parsed atomic nodes to the current node scheduling flowchart of the current task order in series according to the parsing layers of the atomic nodes whenever creating flowchart nodes corresponding to the currently parsed atomic nodes. If the parsing layers of the currently parsed atomic nodes are odd, the flowchart nodes corresponding to the atomic nodes are connected to the current node scheduling flowchart of the current task order in series according to the parsing layers of the atomic nodes.
[0037] A parallel connection unit is used to connect the flowchart nodes corresponding to each of the atomic nodes in parallel to the node scheduling flowchart of the current task order according to the number of parsing layers at which each of the atomic nodes currently parsed is located, if the number of parsing layers at which each of the atomic nodes currently parsed is located is an even number;
[0038] The flowchart output unit is used to output the node scheduling flowchart of the current task order after the information of the sequential data structure of the current task order is parsed.
[0039] Optionally, in the above-mentioned task scheduling implementation device, the node connection unit includes:
[0040] The node connection subunit, after parsing the information of the sequential data structure of the current task order, connects in series the flowchart nodes corresponding to the atomic nodes with odd-numbered parsing layers in the next parsing layer in order from large to small, and connects the flowchart nodes corresponding to the atomic nodes in the previous parsing layer, and connects the flowchart nodes corresponding to the atomic nodes in the next parsing layer with even-numbered parsing layers, respectively, to the flowchart nodes corresponding to the atomic nodes in the previous parsing layer, so as to obtain the node scheduling flowchart of the current task order and output it.
[0041] A third aspect of the present application provides an electronic device, including:
[0042] Memory and processor;
[0043] Wherein, the memory is used to store programs;
[0044] The processor is used to execute the program. When the program is executed, it is specifically used to implement the task scheduling implementation method as described in any one of the above.
[0045] A fourth aspect of the present application provides a computer storage medium for storing a computer program, wherein when the computer program is executed, it is used to implement the task scheduling implementation method as described in any one of the above.
[0046] The present application provides a task scheduling implementation method, which creates the information of the sequential data structure of the current task order. Among them, the information of the sequential data structure of the current task order is nested with each node of the current task order, and the nodes that are executed serially are in the same odd layer, and the nodes that are executed in parallel are in the same even layer, so that the execution order of each process node can be represented by the sequential data structure and the nesting of the nodes, and the relationship between the serial and parallel nodes is represented by the storage method of the odd layer and the even layer. Subsequently, the information of the sequential data structure of the current task order can be parsed in a recursive manner, and whenever an atomic node is parsed, a flowchart node corresponding to each atomic node currently parsed is created. The atomic node is a node with a corresponding string. Finally, based on the parsing layer number of each atomic node, the flowchart nodes corresponding to each atomic node are connected according to the preset connection principle, and the node scheduling flowchart of the current task order is obtained and output, so as to perform node scheduling according to the node scheduling flowchart of the current task order. Among them, the preset connection principle is that the nodes in the same resolution layer with an odd number of resolution layers are connected in series, and the nodes in the same sub-resolution layer with an even number of resolution layers are connected in parallel. In this way, the nodes that need to be serial can be accurately connected in series, and the nodes that need to be parallel can be connected in parallel, ensuring the accuracy of the execution order of the nodes, and no manual operation is required, thereby effectively improving the efficiency of task execution. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, 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 embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0048] Figure 1 A flowchart of a method for implementing task scheduling provided in an embodiment of the present application;
[0049] Figure 2 A schematic diagram of an example of information of a sequential data structure provided in an embodiment of the present application;
[0050] Figure 3 A flowchart of a method for creating information of a sequential data structure of a current task order provided by an embodiment of the present application;
[0051] Figure 4 A schematic diagram of an example of information of another sequential data structure provided in an embodiment of the present application;
[0052] Figure 5 A schematic diagram of an example of a node scheduling flow chart provided in an embodiment of the present application;
[0053] Figure 6 A schematic diagram of the architecture of a task scheduling implementation device provided in an embodiment of the present application;
[0054] Figure 7 A schematic diagram of the architecture of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0056] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0057] The present application embodiment provides a method for implementing task scheduling, such as Figure 1 As shown, the following steps are included:
[0058] S101, creating information of the sequential data structure of the current task order.
[0059] The information of the sequential data structure of the current task order includes each node of the current task order, and the nodes that are executed serially are in the same odd layer, and the nodes that are executed in parallel are in the same even layer.
[0060] It should be noted that if Figure 2In the example shown, in the embodiment of the present application, the information of the sequential data structure created, that is, the information of the sequence data structure, is specifically a nested json array structure, so that the child nodes of each parent node can be stored in a nested manner. In addition, in the created information, the nodes that need to be executed serially in sequence are stored in the same odd-numbered layers, and the nodes that need to be executed in parallel at the same time are stored in the same even-numbered layers. Such a design can mainly solve the following three problems:
[0061] 1. The difference between the description of serial and parallel structures. If the symbol "{}" is used to represent serial and the symbol "[]" is used to represent parallel, it cannot be expressed in the standard JSON format, because the "{}" contains key-value pairs, while the "[]" contains a single element. Therefore, in the embodiments of the present application, "[]" is used, and the serial and parallel are divided by odd and even rows.
[0062] 2. The problem of completeness of definition. This definition should be able to express the semantics of any node order. Assuming that there are nodes in the odd-numbered layers that need to be executed in parallel, or nodes in the even-numbered layers that need to be executed in series, then it can be moved out to its previous or next adjacent structure. At this time, the number of layers is reduced by one, and the serial-parallel relationship will inevitably change. This structure can still meet our definition.
[0063] 3. The problem of a node having multiple parent nodes or multiple child nodes. Traditional relational databases cannot intuitively represent this many-to-many relationship, but the sequence string under this definition can, that is, a nested sequence string.
[0064] Optionally, the information of the sequential data structure of the current task order may be created from scratch, or may be created by modifying a template of the information of the sequential data structure, thereby improving the efficiency of information creation.
[0065] Optionally, in another embodiment of the present application, a specific implementation of step S101 is as follows: Figure 3 As shown, the following steps are included:
[0066] S301. Determine the type of the current task order.
[0067] The type of the current task order is the type of the current task, that is, tasks are divided by this type, such as creating an integrated environment of a test environment management platform.
[0068] S302: Obtain the default complete information corresponding to the type of the current task order.
[0069] The default complete information is information of a pre-created sequential data structure, and includes all nodes of tasks of the type of the current task order.
[0070] It should be noted that the task flow involved in a task is usually relatively fixed and will not change in a short period of time. However, some unnecessary task flows may be reduced according to demand. For example, for the task of creating an integrated environment for the test environment management platform, it currently mainly involves creating servers, installing middleware, creating nebula clusters, self-built apollo clusters, server configuration files, creating pipelines, deploying databases, and deploying versions. Therefore, in this application, a sequential data structure information including nodes of all task flows involved in the task is created in advance for multiple types of tasks, that is, the default complete information corresponding to the task is constructed, so that the required sequential data structure information can be quickly created by modifying the default complete information in the future.
[0071] S303, in response to the user's operation of removing nodes in the default complete information corresponding to the type of the current task order, each node removed by the user operation is removed to obtain information of the sequential data structure of the current task order.
[0072] Specifically, users can choose to remove unnecessary nodes in the structure according to actual needs. For example, for creating an integrated test environment management platform environment, if the microservice created by the order only has the nebula configuration, remove the self-built APOLLO node and the server configuration file node. If the microservice created by the order only has the self-built apollo, remove the nebula node and the server configuration file node.
[0073] S102: Recursively parse the information of the sequential data structure of the current task order.
[0074] Specifically, after obtaining the sequence order execution string, it is necessary to assemble it into a usable node scheduling flowchart, so as to connect each process node in series through task scheduling, so that the corresponding task can be implemented according to the node scheduling flowchart.
[0075] Since the information structure of the sequential data structure of the current task order is multi-layer nested, a recursive method is used to parse the information of the sequential data structure of the current task order to construct a node scheduling flowchart.
[0076] Specifically, the information of the sequential data structure of the current task order is parsed recursively until an atomic node is parsed, that is, a string is parsed, and step S103 is executed to construct the corresponding flowchart node. If a non-atomic node is recursively reached, its child node list is recursively continued to the next layer in sequence, and this cycle is repeated until the node scheduling flowchart is constructed. For example, Figure 4 The information of the sequential data structure shown in the figure is parsed into "CREATE_SERVER", "[]" and "DEPLOY_STANDARD" when parsing the first parsing layer. It can be seen that for the middle part parsed, that is, the "[]" in the middle of the layer, there is no corresponding node to be constructed, that is, it is uncertain what kind of nodes it is composed of. Therefore, it is necessary to further parse the next layer in a recursive way, and continue to parse out each node in this way.
[0077] S103. Whenever an atomic node is parsed, a flowchart node corresponding to each atomic node currently parsed is created.
[0078] Among them, an atomic node is a node that has a corresponding string.
[0079] It should be noted that in the embodiment of the present application, the nodes in the information of the sequential data structure of the task order are divided into two categories, one of which is the atomic node, which is the actual process node that needs to be executed, for example, Figure 4 The nodes such as "CREATE_SERVER", "DEPLOY_STANDARD" shown in the figure are nodes with strings. The other type is non-origin nodes, which are mainly used to nest multiple process nodes to be executed. For example, Figure 4 As shown, the "[]" that exists only in a certain layer is not the process node to be executed. Therefore, when parsing to this non-origin node, the process node to be executed cannot be determined and further parsing is required.
[0080] Therefore, when recursively parsing the information of the sequential data structure of the task order, every time an atomic node is parsed, it means that the process node to be executed has been parsed, so it is necessary to create a flowchart node corresponding to the currently parsed atomic node. When a non-atomic node is parsed, it is necessary to continue recursive parsing to determine the actual composition of the node. For example, Figure 4 When parsing the information of the sequential data structure shown in the figure, when parsing the first layer, "CREATE_SERVER" and "DEPLOY_STANDARD" are parsed as atomic nodes, so there is no need to continue recursive parsing, but the corresponding flowchart nodes of these two atomic nodes can be directly created, for example, Figure 5As shown, the flowchart nodes named "CREATE_SERVER" and "DEPLOY_STANDARD". As for the "[]" in the first layer parsed, it is a non-atomic node, and no node can be created based on it, so it is necessary to parse the next layer. And for the next layer of the non-atomic node, that is, the second parsing layer is parsed, a non-atomic node and two atomic nodes can be obtained, the set "INSTALL_MYSQL" and "DEPLOY_DB". Therefore, it can be determined that the non-atomic nodes of the previous layer are composed of one non-atomic node and two atomic nodes "INSTALL_MYSQL" and "DEPLOY_DB". At this time, the flowchart nodes corresponding to the two atomic nodes "INSTALL_MYSQL" and "DEPLOY_DB" can be created. For the non-atomic nodes of this layer, it is necessary to parse the next parsing layer, and continue to recursively until the information of the sequential data structure is parsed and the flowchart nodes corresponding to all the origin nodes are obtained.
[0081] Optionally, in another embodiment of the present application, a specific implementation method of creating a flowchart node corresponding to each atomic node currently parsed includes:
[0082] Create a flowchart node corresponding to each atomic node according to the parsing layer number, node code and node order scheduling status of each atomic node.
[0083] It should be noted that in order to obtain the relevant attribute information of each flowchart node from the node scheduling flowchart of the current task order, in the embodiment of the present application, the flowchart nodes corresponding to each atomic node are created according to the parsing layer number, node code and node order scheduling status of each atomic node. In addition, the node string parallel information, node description and node sub-node list are also set during creation. In other words, a flowchart node can include the parsing layer number, node code, node string parallel information, node description and node sub-node list.
[0084] S104. Based on the parsing layer number of each atomic node, the flowchart nodes corresponding to each atomic node are connected according to the preset connection principle to obtain the node scheduling flowchart of the current task order and output it to perform node scheduling according to the node scheduling flowchart of the current task order.
[0085] Among them, the preset connection principle is that nodes in the same resolution layer with an odd number of resolution layers are connected in series, and nodes in the same sub-resolution layer with an even number of resolution layers are connected in parallel.
[0086] It should be noted that after creating the flowchart nodes, the various flowchart nodes need to be connected to obtain a complete flowchart. Each flowchart node corresponds to an atomic node, and the number of parsing layers of the atomic node in the information of the sequential data structure of the current task order determines the order of its execution and whether it is serial execution or parallel execution. Therefore, it is necessary to realize the connection of the flowchart nodes corresponding to each atomic node based on the parsing layer number of each atomic node.
[0087] In addition, in order to be consistent with the node storage relationship in the information of the sequential data structure, that is, the nodes executed serially are in the same odd layer, and the nodes executed in parallel are in the same even layer, so it is necessary to follow the preset connection principle, that is, the nodes in the same parsing layer and the number of parsing layers is odd are connected in series, and the nodes in the same parsing layer and the number of parsing layers is even are connected in parallel.
[0088] It should also be noted that when connecting the nodes in series, the corresponding flowchart nodes are connected according to the order of the atomic nodes from top to bottom in the information of the sequential data structure.
[0089] For example, Figure 4 The information of the sequential data structure shown is parsed. When parsing the first parsing layer, "CREATE_SERVER", "[]" and "DEPLOY_STANDARD" are parsed. These three nodes are all in the first layer, and the number of layers in the first layer is an odd number, so these three nodes need to be serialized. The three nodes in the information of the sequential data structure are "CREATE_SERVER", "[]" and "DEPLOY_STANDARD" from top to bottom, so the three nodes need to be serialized in sequence. Only the middle non-origin node "[]" needs to be represented by the result obtained by further parsing, that is, "CREATE_SERVER" is concatenated with the result of recursive parsing of the middle non-atomic node, and finally the node of "DEPLOY_STANDARD" is concatenated. For example, Figure 5 As shown, the flowchart of "CREATE_SERVER" is in the first place, and the branches in the middle part of the series are the results of recursive parsing of the middle non-atomic node "[]", and the results of recursive parsing of the middle non-atomic node "[]" are finally connected to the node of "DEPLOY_STANDARD", that is, the branches in the middle part will eventually be connected to the node of "DEPLOY_STANDARD". As for the "INSTALL_JAVA" node and "INSTALL_MYSQL" node parsed and created in the second layer, since they are on an even layer, the two are parallel, and the parsing layer is the second, so the two are connected to the nodes of the first layer in parallel, as shown Figure 5As shown, connect the "CREATE_SERVER" nodes respectively.
[0090] Optionally, in another embodiment of the present application, a specific implementation of step S104 includes the following steps:
[0091] Whenever a flowchart node corresponding to each currently parsed atomic node is created, if the parsing layer number of each currently parsed atomic node is an odd number, the flowchart nodes corresponding to each atomic node are connected in series to the node scheduling flowchart of the current task order according to the parsing layer number of each atomic node.
[0092] If the parsing level number of each currently parsed atomic node is an even number, then the flowchart nodes corresponding to each atomic node are respectively connected in parallel to the node scheduling flowchart of the current task order according to the parsing level number of each atomic node.
[0093] After the information of the sequential data structure of the current task order is parsed, the node scheduling flow chart of the current task order is output.
[0094] That is to say, in the embodiment of the present application, each time parsing is performed, if an atomic node is parsed and a flowchart node corresponding to the atomic node is created, the currently created flowchart node is connected to the node scheduling flowchart of the current task order, thereby continuously improving the node scheduling flowchart of the current task order, and finally obtaining a complete node scheduling flowchart of the current task order.
[0095] Optionally, considering that the node to which the created flowchart node is to be connected has not yet been determined, that is, the non-atomic node parsed, a temporary node can be created for the node that has not yet been determined to connect all the currently created flow graph nodes to the node scheduling flowchart of the current task order. Later, after the specific composition of the temporary node is determined, the temporary node is replaced by its specific composition, that is, by creating a temporary node, the node connection is realized in a recursive manner.
[0096] For example, in Figure 4The information of the sequential data structure shown is parsed. When parsing the first parsing layer, "CREATE_SERVER", "[]" and "DEPLOY_STANDARD" are parsed. Since the intermediate parsed nodes are non-atomic nodes, the corresponding flowchart nodes cannot be created, so the two flowchart nodes "CREATE_SERVER" and "DEPLOY_STANDARD" created are connected to the node scheduling flowchart of the current task order and become part of the node scheduling flowchart of the current task order. Therefore, a temporary node of the intermediate non-atomic node is first created, and then the "CREATE_SERVER" node is connected to the temporary node, and the temporary node is connected to the "DEPLOY_STANDARD" node. Subsequently, the nodes are continuously parsed and connected in the same way, thereby continuously replacing the temporary node and improving it.
[0097] Optionally, in another embodiment of the present application, a specific implementation of step S104 includes:
[0098] After the information of the sequential data structure of the current task order is parsed, the flowchart nodes corresponding to the atomic nodes with odd-numbered parsing layers in the next parsing layer are connected in series in order from large to small, and the flowchart nodes corresponding to the atomic nodes in the previous parsing layer are connected, and the flowchart nodes corresponding to the atomic nodes with even-numbered parsing layers in the next parsing layer are connected to the flowchart nodes corresponding to the atomic nodes in the previous parsing layer, respectively, to obtain the node scheduling flowchart of the current task order and output it.
[0099] That is to say, in the embodiment of the present application, after constructing the flowchart nodes corresponding to all the atomic nodes, they are connected at once to directly obtain the complete node scheduling flowchart of the current task order. Since the atomic nodes in the information of the sequential data structure are continuously nested, and the child node with the largest number of parsing layers is the bottom-level child node, it is necessary to continuously connect from the bottom level, and through the connection of the nodes of the next parsing layer, determine the nodes of the previous parsing layer composed of it, and then connect the nodes of the previous parsing layer to determine the nodes of the previous parsing layer, until connecting to the nodes of the first parsing layer. For the node connection of a parsing layer, it is necessary to determine whether it is connected in series or in parallel according to whether the parsing layer is an odd or even layer. For example, Figure 5As shown, the bottom parsing layer has only one "CREATE_POLLO" node, so it is directly connected to the "CREATE_NEBULA" node of the previous layer, so the previous layer is the connection result of the "CREATE_POLLO" node and the "CREATE_NEBULA" node, as well as the "CREATE_PIPELINE" node. These two are on an even layer, so they need to be connected in series to the "INSTALL_JAVA" node of the previous layer. Therefore, the previous layer is equivalent to two nodes consisting of two branches starting with the "INSTALL_JAVA" node and the "INSTALL_MYSQL" node. These two nodes are on an even layer, so they need to be connected to the "CREATE_SERVER" node and the "DEPLOY_STANDARD" node respectively, and finally get the following Figure 5 The node scheduling flowchart shown.
[0100] The embodiment of the present application provides a method for implementing task scheduling, which creates information of a sequential data structure of a current task order. Among them, each node of the current task order is nested in the information of the sequential data structure of the current task order, and the nodes that are executed serially are in the same odd layer, and the nodes that are executed in parallel are in the same even layer, so that the execution order of each process node can be represented by the sequential data structure and the nesting of the nodes, and the relationship between the serial and parallel nodes is represented by the storage method of the odd layer and the even layer. Subsequently, the information of the sequential data structure of the current task order can be parsed in a recursive manner, and whenever an atomic node is parsed, a flowchart node corresponding to each atomic node currently parsed is created. An atomic node is a node with a corresponding string. Finally, based on the parsing layer number of each atomic node, the flowchart nodes corresponding to each atomic node are connected according to the preset connection principle, and the node scheduling flowchart of the current task order is obtained and output, so as to perform node scheduling according to the node scheduling flowchart of the current task order. Among them, the preset connection principle is that the nodes in the same resolution layer with an odd number of resolution layers are connected in series, and the nodes in the same sub-resolution layer with an even number of resolution layers are connected in parallel. In this way, the nodes that need to be serial can be accurately connected in series, and the nodes that need to be parallel can be connected in parallel, ensuring the accuracy of the execution order of the nodes, and no manual operation is required, thereby effectively improving the efficiency of task execution.
[0101] Another embodiment of the present application provides a task scheduling implementation device, such as Figure 6 As shown, including:
[0102] The information creation unit 601 is used to create information of the sequential data structure of the current task order.
[0103] Among them, each node of the current task order is nested in the information of the sequential data structure of the current task order, and the nodes that are executed serially are in the same odd layer, and the nodes that are executed in parallel are in the same even layer.
[0104] The parsing unit 602 is used to parse the information of the sequence data structure of the current task order in a recursive manner.
[0105] The node creation unit 603 is used to create a flowchart node corresponding to each currently parsed atomic node whenever an atomic node is parsed.
[0106] Among them, an atomic node is a node that has a corresponding string.
[0107] The node connection unit 604 is used to connect the flowchart nodes corresponding to each atomic node according to the preset connection principle based on the parsing layer number of each atomic node, obtain the node scheduling flowchart of the current task order and output it, so as to perform node scheduling according to the node scheduling flowchart of the current task order.
[0108] Among them, the preset connection principle is that nodes in the same resolution layer with an odd number of resolution layers are connected in series, and nodes in the same sub-resolution layer with an even number of resolution layers are connected in parallel.
[0109] Optionally, in the task scheduling implementation device provided in another embodiment of the present application, the information creation unit includes:
[0110] The type determination unit is used to determine the type of the current task order.
[0111] The information acquisition unit is used to acquire the default complete information corresponding to the type of the current task order, wherein the default complete information is information of a pre-created sequential data structure and includes the full nodes of the tasks of the type of the current task order.
[0112] The node removal unit is used to respond to the user's operation of removing nodes in the default complete information corresponding to the type of the current task order, remove each node removed by the user operation, and obtain the information of the sequential data structure of the current task order.
[0113] Optionally, in the task scheduling implementation device provided in another embodiment of the present application, the node creation unit includes:
[0114] The node creation subunit is used to create a flowchart node corresponding to each atomic node according to the parsing layer number, node code and node order scheduling status of each atomic node.
[0115] Optionally, in the task scheduling implementation device provided in another embodiment of the present application, the node connection unit includes:
[0116] The series connection unit is used to create a flowchart node corresponding to each currently parsed atomic node. If the parsing layer number of each currently parsed atomic node is an odd number, the flowchart node corresponding to each atomic node will be serially connected to the node scheduling flowchart of the current task order according to the parsing layer number of each atomic node.
[0117] The parallel unit is used to connect the flowchart nodes corresponding to each atomic node in parallel to the node scheduling flowchart of the current task order according to the parsing layer number of each atomic node when the parsing layer number of each atomic node currently parsed is an even number.
[0118] The flowchart output unit is used to output the node scheduling flowchart of the current task order after the information of the sequential data structure of the current task order is parsed.
[0119] Optionally, in the task scheduling implementation device provided in another embodiment of the present application, the node connection unit includes:
[0120] The node connection subunit, after parsing the information of the sequential data structure of the current task order, connects the flowchart nodes corresponding to the atomic nodes with odd parsing layers in the next parsing layer in sequence from large to small, and connects the flowchart nodes corresponding to the atomic nodes in the previous parsing layer, and connects the flowchart nodes corresponding to the atomic nodes in the next parsing layer with even parsing layers, respectively, to the flowchart nodes corresponding to the atomic nodes in the previous parsing layer, to obtain the node scheduling flowchart of the current task order and output it.
[0121] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can refer to the implementation process of the corresponding steps in the above method embodiments, and will not be repeated here.
[0122] Another embodiment of the present application provides an electronic device, such as Figure 7 As shown, including:
[0123] Memory 701 and processor 702 .
[0124] The memory 701 is used to store programs.
[0125] The processor 702 is used to execute the program stored in the memory 701. When the program is executed, it is specifically used to implement the task scheduling implementation method provided in any one of the above embodiments.
[0126] Another embodiment of the present application provides a computer storage medium for storing a computer program, which, when executed, is used to implement any of the above-mentioned task scheduling implementation methods.
[0127] Computer storage media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0128] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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 this application.
[0129] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A task scheduling implementation method, characterized in that: include: Creating information of a sequential data structure of the current task order; wherein the information of the sequential data structure of the current task order is embedded with each node of the current task order, and the nodes that are executed serially are in the same odd-numbered layer, and the nodes that are executed in parallel are in the same even-numbered layer; Recursively parsing the information of the sequential data structure of the current task order; Whenever an atomic node is parsed, a flowchart node corresponding to each of the currently parsed atomic nodes is created; wherein the atomic node is a node having a corresponding string; Based on the parsing layer number of each atomic node, the flowchart nodes corresponding to each atomic node are connected according to the preset connection principle, and the node scheduling flowchart of the current task order is obtained and output, so as to perform node scheduling according to the node scheduling flowchart of the current task order; wherein, the preset connection principle is that nodes at the same parsing layer with an odd number of parsing layers are connected in series, and nodes at the same sub-parsing layer with an even number of parsing layers are connected in parallel.
2. The method according to claim 1, characterized in that The information for creating the sequential data structure of the current task order includes: determining the type of the current task order; Obtaining default complete information corresponding to the type of the current task order; wherein the default complete information is information of a pre-created sequential data structure and includes all nodes of tasks of the type of the current task order; In response to a user's operation of removing a node in the default complete information corresponding to the type of the current task order, each node removed by the user operation is removed to obtain information of the sequential data structure of the current task order.
3. The method according to claim 1, characterized in that The step of creating a flowchart node corresponding to each of the currently parsed atomic nodes includes: A flowchart node corresponding to each of the atomic nodes is created according to the parsing layer number, node code and node order scheduling status of each of the atomic nodes.
4. The method according to claim 1, characterized in that: Based on the parsing layer number of each atomic node, the flowchart nodes corresponding to each atomic node are connected according to a preset connection principle to obtain and output the node scheduling flowchart of the current task order, including: Whenever a flowchart node corresponding to each of the currently parsed atomic nodes is created, if the parsing layer number of each of the currently parsed atomic nodes is an odd number, then the flowchart nodes corresponding to each of the atomic nodes are connected in series to the node scheduling flowchart of the current task order according to the parsing layer number of each of the atomic nodes; If the parsing level number of each of the currently parsed atomic nodes is an even number, then the flowchart nodes corresponding to each of the atomic nodes are respectively connected in parallel to the node scheduling flowchart of the current task order according to the parsing level number of each of the atomic nodes; After the information of the sequential data structure of the current task order is parsed, the node scheduling flowchart of the current task order is output.
5. The method according to claim 1, characterized in that Based on the parsing layer number of each atomic node, the flowchart nodes corresponding to each atomic node are connected according to a preset connection principle to obtain and output the node scheduling flowchart of the current task order, including: After the information of the sequential data structure of the current task order is parsed, the flowchart nodes corresponding to the atomic nodes with odd parsing layers in the next parsing layer are connected in series in order from large to small, and the flowchart nodes corresponding to the atomic nodes in the previous parsing layer are connected, and the flowchart nodes corresponding to the atomic nodes with even parsing layers in the next parsing layer are connected to the flowchart nodes corresponding to the atomic nodes in the previous parsing layer, respectively, to obtain the node scheduling flowchart of the current task order and output it.
6. A task scheduling implementation device, characterized in that: include: An information creation unit, used to create information of a sequential data structure of a current task order; wherein the information of the sequential data structure of the current task order is embedded with each node of the current task order, and the nodes executed serially are in the same odd-numbered layer, and the nodes executed in parallel are in the same even-numbered layer; A parsing unit, used for recursively parsing information of the sequential data structure of the current task order; A node creation unit, used for creating a flowchart node corresponding to each of the currently parsed atomic nodes whenever an atomic node is parsed; wherein the atomic node is a node having a corresponding character string; A node connection unit is used to connect the flowchart nodes corresponding to each of the atomic nodes according to a preset connection principle based on the number of parsing layers at which each of the atomic nodes is located, to obtain and output the node scheduling flowchart of the current task order, so as to perform node scheduling according to the node scheduling flowchart of the current task order; wherein the preset connection principle is that nodes at the same parsing layer with an odd number of parsing layers are connected in series, and nodes at the same sub-parsing layer with an even number of parsing layers are connected in parallel.
7. The device according to claim 6, characterized in that The information creation unit includes: A type determination unit, used to determine the type of the current task order; An information acquisition unit, used to acquire default complete information corresponding to the type of the current task order; wherein the default complete information is information of a pre-created sequential data structure and includes all nodes of tasks of the type of the current task order; The node removal unit is used to respond to the user's removal operation on the nodes in the default complete information corresponding to the type of the current task order, remove each node removed by the user operation, and obtain the information of the sequential data structure of the current task order.
8. The device according to claim 6, characterized in that The node creation unit includes: The node creation subunit is used to create a flowchart node corresponding to each of the atomic nodes according to the parsing layer number, node code and node order scheduling status of each of the atomic nodes.
9. An electronic device, characterized in that: include: Memory and processor; Wherein, the memory is used to store programs; The processor is used to execute the program, and when the program is executed, it is specifically used to implement the task scheduling implementation method as described in any one of claims 1 to 5.
10. A computer storage medium, characterized in that: Used to store a computer program, which, when executed, is used to implement the task scheduling implementation method as described in any one of claims 1 to 5.
