Method and device for identifying risk issues in batch job dependencies

By representing the dependencies of batch jobs as directed graph structures and identifying risk problems on this basis, the problem of difficulty in discovering risk problems in batch job dependencies in the prior art is solved, and timely identification and feedback on errors or risks in the dependencies are achieved.

CN113886839BActive Publication Date: 2025-02-28INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111226107.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-21
Publication Date
2025-02-28
Estimated Expiration
2041-10-21

AI Technical Summary

Technical Problem

It is difficult for the prior art to effectively identify and discover risk problems in batch job dependencies, resulting in timely detection and feedback of errors or risks in dependencies.

Method used

By representing the dependencies of batch jobs as directed graph structures, and performing multiple search steps on this basis, identifying and marking graph nodes and directed edges, corresponding risk problem information is generated.

Benefits of technology

It realizes effective identification of risk issues in batch job dependencies, timely discovers errors or risks in dependencies, and improves the correct handling ability of the workflow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113886839B_ABST
    Figure CN113886839B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a method and device for identifying risk problems in batch job dependencies, which can be used in the financial field or other technical fields. The method includes: obtaining a preset directed graph structure; searching for graph nodes that are not marked as traversed and whose corresponding job type is automatic from the directed graph structure, marking the found graph nodes as traversed and stacking them; performing multiple search steps until the stack is empty, each time the search step is performed, selecting a graph node from the stack as the current node, searching the target node corresponding to the current node in the directed graph structure until the target node cannot be found, and each time the target node is found, if the job type corresponding to the target node is not dependent, generating first risk problem information, and if the target node is already in the stack, generating second risk problem information. The present invention can timely discover risk problems contained in job dependencies, and provides a guarantee for the correct scheduling of batch jobs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of batch jobs, and in particular to a method and device for identifying risk issues in batch job dependencies. Background Art

[0002] At present, batch programs use jobs as units, and the dependent scheduling relationship between jobs is determined by configuring scheduling. Therefore, the accuracy of the dependent scheduling relationship between jobs plays a critical role in the correct handling of the job process. However, since job dependencies are often configured by manually writing SQL statements, not only are the writing complex, but the risk issues in job dependencies are also difficult to detect.

[0003] Therefore, the prior art urgently needs a solution that can effectively identify risk issues in batch job dependencies, timely discover errors or risks contained in the dependencies and feedback them to developers. Summary of the invention

[0004] In order to solve the technical problem that it is difficult to find risk problems in batch job dependencies in the prior art, the present invention proposes a method and device for identifying risk problems in batch job dependencies.

[0005] In order to achieve the above object, according to one aspect of the present invention, a method for identifying risk issues in batch job dependencies is provided, the method comprising:

[0006] Obtaining a preset directed graph structure, wherein the directed graph structure includes: graph nodes and directed edges connecting the graph nodes, the graph nodes correspond one-to-one to the jobs, and the directed edges are used to represent job dependencies;

[0007] Searching for a graph node that is not marked as traversed and whose corresponding job type is automatic from the directed graph structure, marking the found graph node as traversed and stacking it;

[0008] Execute multiple search steps until the stack is empty. Each time the search step is executed, select a graph node from the stack as the current node, and search for the target node corresponding to the current node in the directed graph structure. If the target node is found, update the target node to the current node and continue to search for the target node until the target node of the current node cannot be found, and end this search step. The target node is a graph node that is not marked as traversed and pointed to by the directed edge of the current node. Each time the target node is found, mark the target node as traversed and push the target node into the stack if the target node is not in the stack. Each time the target node is updated to the current node, pop the current node before the update from the stack, and pop the current node from the stack when the target node of the current node cannot be found. Each time the target node is found, if the job type corresponding to the target node is not dependent, generate the first risk problem information, and if the target node is already in the stack, generate the second risk problem information.

[0009] Optionally, the risk problem identification method in the batch job dependency relationship further includes:

[0010] If the stack is empty, and there is no graph node in the directed graph structure that is not marked as traversed and whose corresponding job type is automatic, then determining whether there is a graph node in the directed graph structure that is not marked as traversed;

[0011] If so, third risk issue information is generated.

[0012] Optionally, the risk problem identification method in the batch job dependency relationship further includes:

[0013] Obtain all job definition rule SQL statements and all job dependency rule SQL statements;

[0014] Parse the full job definition rule SQL statement to obtain full job definition information, where each job definition information includes: job ID and job type;

[0015] The SQL statements of all job dependency rules are parsed to obtain job dependency information, where each job dependency information includes: the previous job ID and the next job ID;

[0016] If the preceding job ID and the succeeding job ID in the job dependency information obtained by parsing both have corresponding job definition information, the job dependency information obtained by parsing is recorded.

[0017] Optionally, the risk problem identification method in the batch job dependency relationship further includes:

[0018] A directed graph structure is established based on the full job definition information and the recorded job dependency information. When establishing the directed graph structure, each job ID is used as a graph node, the job type is used as an attribute of the graph node, and directed edges connecting the graph nodes are established based on the job dependency.

[0019] Optionally, the risk problem identification method in the batch job dependency relationship further includes:

[0020] If there is no corresponding job definition information for the preceding job ID and / or the succeeding job ID in the job dependency information obtained by parsing, fourth risk problem information is generated.

[0021] Optionally, selecting a graph node from the stack as the current node specifically includes:

[0022] Set the graph node at the top of the stack as the current node.

[0023] In order to achieve the above object, according to another aspect of the present invention, a device for identifying risk issues in batch job dependencies is provided, the device comprising:

[0024] A directed graph structure acquisition unit, used to acquire a preset directed graph structure, wherein the directed graph structure includes: graph nodes and directed edges connecting the graph nodes, the graph nodes correspond one-to-one to the jobs, and the directed edges are used to represent job dependencies;

[0025] A node stacking unit, used to search for graph nodes that are not marked as traversed and whose corresponding job type is automatic from the directed graph structure, mark the found graph nodes as traversed and stack them;

[0026] The first risk problem identification unit is used to execute multiple search steps until the stack is empty. Each time the search step is executed, a graph node is selected from the stack as the current node, and the target node corresponding to the current node is searched in the directed graph structure. If the target node is found, the target node is updated to the current node and the target node search is continued until the target node of the current node cannot be found, and the current search step is terminated. The target node is a graph node that is not marked as traversed in the directed edge pointing to the current node. Each time the target node is found, the target node is marked as traversed and if the target node is not in the stack, the target node is pushed into the stack. Each time the target node is updated to the current node, the current node before the update is popped out of the stack. When the target node of the current node cannot be found, the current node is popped out of the stack. Each time the target node is found, if the job type corresponding to the target node is not dependent, the first risk problem information is generated, and if the target node is already in the stack, the second risk problem information is generated.

[0027] Optionally, the risk problem identification device in the batch job dependency relationship further includes:

[0028] The second risk problem identification unit is used to determine whether there are graph nodes that are not marked as traversed in the directed graph structure when the stack is empty and there are no graph nodes that are not marked as traversed and the corresponding job type is automatic in the directed graph structure, and to generate third risk problem information when there are graph nodes that are not marked as traversed.

[0029] Optionally, the risk problem identification device in the batch job dependency relationship further includes:

[0030] A rule SQL statement acquisition unit is used to acquire all job definition rule SQL statements and all job dependency rule SQL statements;

[0031] A first parsing unit is used to parse the full-amount job definition rule SQL statement to obtain full-amount job definition information, wherein each job definition information includes: a job ID and a job type;

[0032] The second parsing unit is used to parse the SQL statement of the full-quantity job dependency rule to obtain job dependency information, wherein each job dependency information includes: a preceding job ID and a succeeding job ID;

[0033] The job dependency information recording unit is used to record the job dependency information obtained by parsing when the preceding job ID and the succeeding job ID in the job dependency information obtained by parsing both have corresponding job definition information.

[0034] Optionally, the risk problem identification device in the batch job dependency relationship further includes:

[0035] The directed graph structure establishment unit is used to establish a directed graph structure according to the full job definition information and the recorded job dependency information. When establishing the directed graph structure, each job ID is used as a graph node, the job type is used as an attribute of the graph node, and directed edges connecting the graph nodes are established according to the job dependency.

[0036] Optionally, the risk problem identification device in the batch job dependency relationship further includes:

[0037] The third risk problem identification unit is used to generate fourth risk problem information if there is no corresponding job definition information for the preceding job ID and / or the succeeding job ID in the job dependency information obtained by parsing.

[0038] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, a computer device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the above-mentioned method for identifying risk issues in batch job dependencies when executing the computer program.

[0039] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed in a computer processor, the steps in the above-mentioned method for identifying risk issues in batch job dependencies are implemented.

[0040] The beneficial effects of the present invention are:

[0041] The present invention achieves the beneficial effect of effectively identifying risk issues in the dependency relationships of batch jobs by representing the dependency relationships of batch jobs with a directed graph structure, and helps to promptly discover errors or risks contained in the dependency relationships and feed them back to developers. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0043] Figure 1 This is a first flow chart of a method for identifying risk issues in batch job dependencies according to an embodiment of the present invention;

[0044] Figure 2 is a second flow chart of the method for identifying risk issues in batch job dependencies according to an embodiment of the present invention;

[0045] Figure 3 is a third flow chart of a method for identifying risk issues in batch job dependencies according to an embodiment of the present invention;

[0046] Figure 4 This is a flow chart of SQL statement parsing rules according to an embodiment of the present invention;

[0047] Figure 5 It is a schematic diagram of a directed graph structure search process traversal according to an embodiment of the present invention;

[0048] Figure 6 This is a first structural block diagram of a device for identifying risk issues in batch job dependencies according to an embodiment of the present invention;

[0049] Figure 7 It is a second structural block diagram of the device for identifying risk issues in batch job dependencies according to an embodiment of the present invention;

[0050] Figure 8 It is a schematic diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0051] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0052] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0053] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or apparatus.

[0054] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0055] It should be noted that the method and device for identifying risk issues in batch job dependencies in the following embodiments of the present invention can be applied to the financial field as well as other technical fields.

[0056] The present invention provides a method for real-time monitoring of dependencies of batch jobs. The present invention parses regular SQL statements, loads them into memory, obtains job definitions and job dependencies, and converts them into directed graph structures. By traversing and searching the directed graph, the state of the graph can be obtained, such as whether it contains isolated nodes, circular dependencies, etc., and finally outputs corresponding risk information.

[0057] Figure 1 is a first flow chart of a method for identifying risk issues in a batch job dependency relationship according to an embodiment of the present invention. Figure 1As shown, in one embodiment of the present invention, the method for identifying risk issues in batch job dependencies of the present invention includes steps S101 to S103.

[0058] Step S101, obtaining a preset directed graph structure, wherein the directed graph structure includes: graph nodes and directed edges connecting the graph nodes, the graph nodes correspond one-to-one to the jobs, and the directed edges are used to represent job dependencies.

[0059] In an embodiment of the present invention, the present invention establishes a directed graph structure of batch jobs based on the dependency relationship of batch jobs. The directed graph structure includes multiple graph nodes, each graph node corresponds to a job, and the directed graph structure also includes directed edges, which point from one graph node to another graph node to represent the dependency relationship between jobs.

[0060] Step S102 , searching the directed graph structure for graph nodes that are not marked as traversed and whose corresponding job type is automatic, marking the found graph nodes as traversed and stacking them.

[0061] In the embodiment of the present invention, each job has its own corresponding job type. In the present invention, the job type includes two types: automatic and dependent.

[0062] In an embodiment of the present invention, the present invention continuously searches for graph nodes that are not marked as traversed and whose corresponding job type is automatic from a directed graph structure, and each time a graph node is found, the found graph node is marked as traversed and pushed into a stack until there are no graph nodes that are not marked as traversed and whose corresponding job type is automatic in the directed graph structure.

[0063] Step S103, execute multiple search steps until the stack is empty. Each time the search step is executed, select a graph node from the stack as the current node, and search for the target node corresponding to the current node in the directed graph structure. If the target node is found, update the target node to the current node and continue to search for the target node until the target node of the current node cannot be found, and end this search step. The target node is a graph node that is not marked as traversed in the directed edge pointing to the current node. Each time the target node is found, mark the target node as traversed and push the target node into the stack if the target node is not in the stack. Each time the target node is updated to the current node, pop the current node before the update, and pop the current node when the target node cannot be found. Each time the target node is found, if the job type corresponding to the target node is not dependent, generate the first risk problem information, and if the target node is already in the stack, generate the second risk problem information.

[0064] In an embodiment of the present invention, the first risk problem information is used to indicate a node type error. In one embodiment of the present invention, each time a target node is found, if the job type corresponding to the target node is not dependent, the first risk problem information is generated according to the node ID of the target node.

[0065] In an embodiment of the present invention, the second risk problem information is used to indicate that there is a circular dependency in the job dependency. In one embodiment of the present invention, each time a target node is found, if the target node is already in the stack, the second risk problem information is generated according to the node ID of the target node.

[0066] In one embodiment of the present invention, selecting a graph node from the stack as the current node specifically includes: selecting the graph node at the top of the stack as the current node.

[0067] It can be seen that the present invention achieves the beneficial effect of effectively identifying risk issues in the dependencies of batch jobs by representing the dependencies of batch jobs with a directed graph structure, and then identifying risk issues on the directed graph structure, which helps to promptly discover errors or risks contained in the dependencies and feed them back to developers.

[0068] Figure 2 is a second flow chart of the method for identifying risk issues in batch job dependencies according to an embodiment of the present invention. Figure 2 As shown, in one embodiment of the present invention, the method for identifying risk issues in batch job dependencies of the present invention further includes steps S201 to S202.

[0069] Step S201, if the stack is empty, and there are no graph nodes in the directed graph structure that are not marked as traversed and whose corresponding job type is automatic, then it is determined whether there are graph nodes in the directed graph structure that are not marked as traversed.

[0070] Step S202: if it exists, generate third risk problem information.

[0071] In the embodiment of the present invention, the third risk problem information is used to indicate an isolated operation. In this step, if there is a graph node not marked as traversed in the directed graph structure, the third risk problem information is generated according to the node ID of the graph node not marked as traversed.

[0072] Figure 3 is a third flow chart of the method for identifying risk issues in batch job dependencies according to an embodiment of the present invention. Figure 3 As shown, in one embodiment of the present invention, the method for identifying risk issues in batch job dependencies of the present invention further includes steps S301 to S304.

[0073] Step S301, obtaining a full set of job definition rule SQL statements and a full set of job dependency rule SQL statements.

[0074] Step S302: parse the full job definition rule SQL statement to obtain full job definition information, wherein each job definition information includes: a job ID and a job type.

[0075] Step S303: parse the SQL statements of all job dependency rules to obtain job dependency information, wherein each job dependency information includes: a preceding job ID and a succeeding job ID.

[0076] In the embodiment of the present invention, the present invention can simplify and abstract the job definition information and the job dependency information respectively for the regular SQL statements of the job definition and the job dependency.

[0077] Step S304: If the preceding job ID and the succeeding job ID in the job dependency information obtained by parsing both have corresponding job definition information, the job dependency information obtained by parsing is recorded.

[0078] In one embodiment of the present invention, the method for identifying risk issues in batch job dependencies of the present invention further includes:

[0079] If there is no corresponding job definition information for the preceding job ID and / or the succeeding job ID in the job dependency information obtained by parsing, fourth risk problem information is generated.

[0080] like Figure 4 As shown in the figure, during the parsing of the rule SQL statements of job definitions and job dependencies, the following risk issues can be found:

[0081] SQL statements are not standardized: SQL statements are not written strictly in accordance with the defined SQL statement form.

[0082] Job ID undefined: The job ID is used in a job dependency, but is not present in the job definition SQL statement.

[0083] In one embodiment of the present invention, the fourth risk problem information is used to indicate that the job definition does not exist. In one embodiment of the present invention, this step specifically generates the fourth risk problem information according to the job ID for which the corresponding job definition information does not exist.

[0084] In one embodiment of the present invention, the method for identifying risk issues in batch job dependencies of the present invention further includes:

[0085] A directed graph structure is established based on the full job definition information and the recorded job dependency information. When establishing the directed graph structure, each job ID is used as a graph node, the job type is used as an attribute of the graph node, and directed edges connecting the graph nodes are established based on the job dependency.

[0086] In one embodiment of the present invention, when newly generating a job definition rule SQL statement and a newly generating a job dependency rule SQL statement, the present invention can parse the newly generated rule SQL statement to obtain job definition information and job dependency information, and then directly add new nodes to the directed graph structure according to the job definition information, and add new directed edges to the directed graph structure when the preceding job ID and the succeeding job ID in the job dependency information both have corresponding job definition information.

[0087] Figure 5 Schematic diagram of the directed graph structure search process traversing in an embodiment of the present invention, such as Figure 5 As shown, in one embodiment of the present invention, the present invention traverses the directed graph structure search process as follows:

[0088] (1) Find an untraversed job ID with a job type of 0-automatic as the starting node, mark it as traversed, and push it into the stack. If there is no untraversed starting node, continue with step (5).

[0089] (2) Find the next untraversed node based on the directed edge of the current node,

[0090] If there is no next untraversed node, pop the current node from the stack. If the stack is empty, continue with step (1). Otherwise, take the top node of the stack as the current node and continue with step (2).

[0091] If there is a next untraversed node, take the next node as the current node and continue with step (3).

[0092] (3) Check the job type corresponding to the current node,

[0093] If the operation type is 0-automatic, the risk problem is recorded (the first risk problem information is generated). The operation type of the node does not match, and the process continues to step (4).

[0094] If the job type is 1-Dependency, continue with step (4).

[0095] (4) Check whether the current node is in the stack,

[0096] In the stack, the risk problem is recorded (generating the second risk problem information). The node job dependency relationship has a circular dependency, and the process continues to step (2).

[0097] If it is not in the stack, the mark has been traversed and pushed into the stack, and continue with step (2).

[0098] (5) Traverse all nodes one by one, and record the risk issues of nodes that do not have traversed marks (generate third risk issue information). These nodes are isolated nodes.

[0099] (6) Output risk problem information and end the search process.

[0100] It can be seen from the above embodiments that the present invention realizes a feasible method for real-time detection of batch job dependencies by simplifying and abstracting regular SQL statements of batch job dependencies and parsing the SQL statements into a directed graph structure. The method can timely discover risk issues contained in job dependencies and provide a guarantee for the correct scheduling of batch jobs.

[0101] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0102] Based on the same inventive concept, an embodiment of the present invention also provides a device for identifying risk issues in batch job dependencies, which can be used to implement the method for identifying risk issues in batch job dependencies described in the above embodiments, as described in the following embodiments. Since the principle of solving the problem by the device for identifying risk issues in batch job dependencies is similar to that of the method for identifying risk issues in batch job dependencies, the embodiment of the device for identifying risk issues in batch job dependencies can refer to the embodiment of the method for identifying risk issues in batch job dependencies, and the repeated parts will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0103] Figure 6 is a first structural block diagram of a device for identifying risk issues in a batch job dependency relationship according to an embodiment of the present invention, such as Figure 6 As shown, in one embodiment of the present invention, the risk problem identification device in the batch job dependency relationship of the present invention includes:

[0104] A directed graph structure acquisition unit 1 is used to acquire a preset directed graph structure, wherein the directed graph structure includes: graph nodes and directed edges connecting the graph nodes, the graph nodes correspond to jobs one by one, and the directed edges are used to represent job dependencies;

[0105] A node stacking unit 2 is used to search for graph nodes that are not marked as traversed and whose corresponding job type is automatic from the directed graph structure, mark the found graph nodes as traversed and stack them;

[0106] The first risk problem identification unit 3 is used to execute multiple search steps until the stack is empty. Each time the search step is executed, a graph node is selected from the stack as the current node, and the target node corresponding to the current node is searched in the directed graph structure. If the target node is found, the target node is updated to the current node and the target node search is continued until the target node of the current node cannot be found, and the current search step is terminated. The target node is a graph node that is not marked as traversed in the directed edge pointing to the current node. Each time the target node is found, the target node is marked as traversed and if the target node is not in the stack, the target node is pushed into the stack. Each time the target node is updated to the current node, the current node before the update is popped out of the stack. When the target node of the current node cannot be found, the current node is popped out of the stack. Each time the target node is found, if the job type corresponding to the target node is not dependent, the first risk problem information is generated. If the target node is already in the stack, the second risk problem information is generated.

[0107] In one embodiment of the present invention, the risk problem identification device in the batch job dependency relationship of the present invention further includes:

[0108] The second risk problem identification unit is used to determine whether there are graph nodes that are not marked as traversed in the directed graph structure when the stack is empty and there are no graph nodes that are not marked as traversed and the corresponding job type is automatic in the directed graph structure, and to generate third risk problem information when there are graph nodes that are not marked as traversed.

[0109] Figure 7 is a first structural block diagram of a device for identifying risk issues in a batch job dependency relationship according to an embodiment of the present invention, such as Figure 7 As shown, in one embodiment of the present invention, the risk problem identification device in the batch job dependency relationship of the present invention further includes:

[0110] A rule SQL statement acquisition unit 4 is used to acquire a full set of job definition rule SQL statements and a full set of job dependency rule SQL statements;

[0111] The first parsing unit 5 is used to parse the full-amount job definition rule SQL statement to obtain the full-amount job definition information, wherein each job definition information includes: a job ID and a job type;

[0112] The second parsing unit 6 is used to parse the full-volume job dependency rule SQL statement to obtain job dependency information, wherein each job dependency information includes: a preceding job ID and a succeeding job ID;

[0113] The job dependency information recording unit 7 is used to record the job dependency information obtained by parsing when both the preceding job ID and the succeeding job ID in the job dependency information obtained by parsing have corresponding job definition information;

[0114] The directed graph structure establishing unit 8 is used to establish a directed graph structure based on the full job definition information and the recorded job dependency information. When establishing the directed graph structure, each job ID is used as a graph node, the job type is used as the attribute of the graph node, and directed edges connecting the graph nodes are established according to the job dependency.

[0115] In one embodiment of the present invention, the risk problem identification device in the batch job dependency relationship of the present invention further includes:

[0116] The third risk problem identification unit is used to generate fourth risk problem information if there is no corresponding job definition information for the preceding job ID and / or the succeeding job ID in the job dependency information obtained by parsing.

[0117] In order to achieve the above object, according to another aspect of the present application, a computer device is also provided. Figure 8 As shown, the computer device includes a memory, a processor, a communication interface and a communication bus. A computer program that can be executed on the processor is stored in the memory. When the processor executes the computer program, the steps in the above-mentioned embodiment method are implemented.

[0118] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0119] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and units, such as the corresponding program units in the above method embodiments of the present invention. The processor executes various functional applications of the processor and works data processing by running the non-transitory software programs, instructions and modules stored in the memory, that is, implementing the method in the above method embodiments.

[0120] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0121] The one or more units are stored in the memory, and when executed by the processor, the method in the above embodiment is performed.

[0122] The specific details of the above-mentioned computer device can be understood by referring to the corresponding related descriptions and effects in the above-mentioned embodiments, and will not be repeated here.

[0123] In order to achieve the above purpose, according to another aspect of the present application, a computer-readable storage medium is also provided, wherein the computer-readable storage medium stores a computer program, and the computer program implements the steps in the risk problem identification method in the above batch job dependency when executed in a computer processor. Those skilled in the art can understand that the implementation of all or part of the process in the above embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and the program can include the process of the embodiment of each method as described above when executed. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, abbreviated: HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memory.

[0124] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0125] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for identifying risk issues in batch job dependencies, characterized in that: include: Obtaining a preset directed graph structure, wherein the directed graph structure includes: graph nodes and directed edges connecting the graph nodes, the graph nodes correspond one-to-one to the jobs, and the directed edges are used to represent job dependencies; Searching for a graph node that is not marked as traversed and whose corresponding job type is automatic from the directed graph structure, marking the found graph node as traversed and stacking it; Execute multiple search steps until the stack is empty. Each time the search step is executed, select a graph node from the stack as the current node, search the target node corresponding to the current node in the directed graph structure, if the target node is found, update the target node to the current node and continue to search for the target node until the target node of the current node cannot be found, and end this search step. The target node is a graph node that is not marked as traversed in the directed edge pointing to the current node. Each time the target node is found, mark the target node as traversed, and push the target node into the stack if the target node is not in the stack. Each time the target node is updated to the current node, pop the current node before the update, and pop the current node when the target node cannot be found. Each time the target node is found, if the job type corresponding to the target node is not dependent, generate first risk problem information, if the target node is already in the stack, generate second risk problem information, wherein the first risk problem information is used to indicate that the node type is wrong, and the second risk problem information is used to indicate that there is a circular dependency in the job dependency relationship.

2. The method for identifying risk issues in batch job dependencies according to claim 1, characterized in that: Also includes: If the stack is empty, and there is no graph node in the directed graph structure that is not marked as traversed and whose corresponding job type is automatic, then determining whether there is a graph node in the directed graph structure that is not marked as traversed; If so, third risk problem information is generated, wherein the third risk problem information is used to indicate that there is an isolated operation.

3. The method for identifying risk issues in batch job dependencies according to claim 1, characterized in that: Also includes: Obtain all job definition rule SQL statements and all job dependency rule SQL statements; Parse the full job definition rule SQL statement to obtain full job definition information, where each job definition information includes: job ID and job type; The SQL statements of all job dependency rules are parsed to obtain job dependency information, where each job dependency information includes: the previous job ID and the next job ID; If the preceding job ID and the succeeding job ID in the job dependency information obtained by parsing both have corresponding job definition information, the job dependency information obtained by parsing is recorded.

4. The method for identifying risk issues in batch job dependencies according to claim 3, characterized in that: Also includes: A directed graph structure is established based on the full job definition information and the recorded job dependency information. When establishing the directed graph structure, each job ID is used as a graph node, the job type is used as an attribute of the graph node, and directed edges connecting the graph nodes are established based on the job dependency.

5. The method for identifying risk issues in batch job dependencies according to claim 3, characterized in that: Also includes: If the preceding job ID and / or succeeding job ID in the parsed job dependency information does not have corresponding job definition information, fourth risk problem information is generated, wherein the fourth risk problem information is used to indicate that the job definition does not exist.

6. The method for identifying risk issues in batch job dependencies according to claim 1, characterized in that: The step of selecting a graph node from the stack as the current node specifically includes: Set the graph node at the top of the stack as the current node.

7. A device for identifying risk issues in batch job dependencies, characterized in that: include: A directed graph structure acquisition unit, used to acquire a preset directed graph structure, wherein the directed graph structure includes: graph nodes and directed edges connecting the graph nodes, the graph nodes correspond one-to-one to the jobs, and the directed edges are used to represent job dependencies; A node stacking unit, used to search for graph nodes that are not marked as traversed and whose corresponding job type is automatic from the directed graph structure, mark the found graph nodes as traversed and stack them; The first risk problem identification unit is used to execute multiple search steps until the stack is empty. Each time the search step is executed, a graph node is selected from the stack as the current node, and the target node corresponding to the current node is searched in the directed graph structure. If the target node is found, the target node is updated to the current node and the target node search is continued until the target node of the current node cannot be found, and the current search step is terminated. The target node is a graph node that is not marked as traversed in the directed edge pointing to the current node. Each time the target node is found, the target node is marked as traversed and pushed into the stack if the target node is not in the stack. Each time the target node is updated to the current node, the current node before the update is popped out of the stack, and the current node is popped out of the stack when the target node of the current node cannot be found. Each time the target node is found, if the job type corresponding to the target node is not dependent, the first risk problem information is generated, and if the target node is already in the stack, the second risk problem information is generated, wherein the first risk problem information is used to indicate that the node type is wrong, and the second risk problem information is used to indicate that there is a circular dependency in the job dependency relationship.

8. The device for identifying risk issues in batch job dependencies according to claim 7, characterized in that: Also includes: The second risk problem identification unit is used to determine whether there are graph nodes that are not marked as traversed in the directed graph structure when the stack is empty and there are no graph nodes that are not marked as traversed and the corresponding job type is automatic in the directed graph structure, and to generate third risk problem information when there are graph nodes that are not marked as traversed, wherein the third risk problem information is used to indicate that there are isolated jobs.

9. The device for identifying risk issues in batch job dependencies according to claim 7, characterized in that: Also includes: A rule SQL statement acquisition unit is used to acquire all job definition rule SQL statements and all job dependency rule SQL statements; A first parsing unit is used to parse the full-amount job definition rule SQL statement to obtain full-amount job definition information, wherein each job definition information includes: a job ID and a job type; The second parsing unit is used to parse the SQL statement of the full-quantity job dependency rule to obtain job dependency information, wherein each job dependency information includes: a preceding job ID and a succeeding job ID; The job dependency information recording unit is used to record the job dependency information obtained by parsing when the preceding job ID and the succeeding job ID in the job dependency information obtained by parsing both have corresponding job definition information.

10. The device for identifying risk issues in batch job dependencies according to claim 9, characterized in that: Also includes: The directed graph structure establishment unit is used to establish a directed graph structure according to the full job definition information and the recorded job dependency information. When establishing the directed graph structure, each job ID is used as a graph node, the job type is used as an attribute of the graph node, and directed edges connecting the graph nodes are established according to the job dependency.

11. The device for identifying risk issues in batch job dependencies according to claim 9, characterized in that: Also includes: The third risk problem identification unit is used to generate fourth risk problem information if there is no corresponding job definition information for the preceding job ID and / or the succeeding job ID in the parsed job dependency information, wherein the fourth risk problem information is used to indicate that the job definition does not exist.

12. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.

13. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed in a computer processor, the computer program implements the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • ETL scheduling method and device

    CN111666326A

  • Batch job dependency analysis method and device

    CN111949832A