Batch job processing method and apparatus
By parsing batch job XML files using the ET package, a job list and information are obtained, and a difference file is generated. This solves the problem of unintuitive job information in the Control-M tool, enabling rapid location and accurate comparison, and ensuring version correctness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA CONSTRUCTION BANK
- Filing Date
- 2021-03-31
- Publication Date
- 2026-07-10
AI Technical Summary
When using the Control-M tool for batch operations in banks, the display of job information and dependencies is not intuitive, making error tracking difficult. Version comparison is also time-consuming and resource-intensive, and its correctness is hard to guarantee.
The batch job XML file is parsed using the ET package to obtain the job list and information, the job list is traversed to determine the job information, and a difference file is generated. The list and flowchart interfaces are provided for display, and the search function is supported to accurately compare job differences.
It enables rapid location of job errors, accurate comparison of differences between batch jobs of different versions, ensures version correctness, and avoids the problem of large workload and easy errors in manual merging.
Smart Images

Figure CN113076183B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a batch processing method and apparatus. Background Technology
[0002] This section is intended to provide background or context for the embodiments of the invention set forth in the claims. The description herein is not an admission that it is prior art simply because it is included in this section.
[0003] Currently, most batch jobs in banks are scheduled and managed using the Control-M tool. However, this tool's display of job information and dependencies is not intuitive. When a job encounters an error, tracing its context information is nearly impossible within Control-M. Furthermore, when a new version is released, ensuring version correctness requires manual comparison to list the changes made in the new batch job version compared to the old version. However, manual comparison and analysis are resource-intensive and cannot guarantee accuracy.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This invention provides a batch job processing method for intuitively viewing job information, quickly locating errors when errors occur, and accurately comparing job differences between two different versions of batch images to ensure version correctness. This avoids the problems of large workload and high error rates associated with manual merging. The method includes:
[0006] Obtain multiple batch job XML files, wherein the multiple batch job XML files contain at least one set of batch job XML files to be compared;
[0007] The ET package is called to parse the multiple batch job XML files to obtain the job list JOB_LIST corresponding to each batch job XML file;
[0008] Iterate through the job list JOB_LIST to determine the job information corresponding to the job list JOB_LIST;
[0009] For each batch of job XML files to be compared, the job information corresponding to the batch job XML files is compared.
[0010] Based on the comparison results, generate the difference file corresponding to the batch job XML files to be compared in this group;
[0011] Batch processing is performed based on the aforementioned difference files.
[0012] Furthermore, in the plurality of batch job XML files, each batch job XML file contains one or more tags;
[0013] The process of calling the ET package to parse the multiple batch job XML files and obtaining the job list JOB_LIST corresponding to each batch job XML file includes: calling the ET package to parse the multiple batch job XML files, determining the JOB node corresponding to each tag, and obtaining the job list JOB_LIST corresponding to each batch job XML file based on the JOB node.
[0014] Further, the job list JOB_LIST is traversed to determine the job information corresponding to the job list JOB_LIST, including:
[0015] Traverse the job list JOB_LIST to obtain job name information, parent node information, execution script information, and input / output conditions;
[0016] The execution script information is analyzed to determine the JAVA class information;
[0017] Based on the Java class information, determine the comment information and input / output information;
[0018] Based on the input and output conditions, determine the job execution dependency information.
[0019] Furthermore, the batch job processing method further includes storing the job information corresponding to the job list JOB_LIST in a database.
[0020] Furthermore, the batch job processing method further includes: displaying the job information on an interface using lists and / or flow graphs.
[0021] Furthermore, each set of batch job XML files to be compared includes: a first batch job XML file and a second batch job XML file;
[0022] For each batch of job XML files to be compared, the job information corresponding to the batch job XML files is compared, including: obtaining the first job information JOB_A corresponding to the first batch job XML file and the second job information JOB_B corresponding to the second batch job XML file; iterating through the first job information JOB_A, if the first job information JOB_A exists in the second job information JOB_B, then comparing whether there is a difference between the first job information JOB_A and the second job information JOB_B;
[0023] Based on the comparison results, generate the difference file corresponding to the batch job XML files to be compared in this group, including: if there is a difference between the first job information JOB_A and the second job information JOB_B, obtain the difference information and job name; based on the difference information and job name, generate the difference file DIFF_JOBS corresponding to the batch job XML files to be compared in this group.
[0024] Further, based on the aforementioned difference file, batch processing is performed, including:
[0025] The difference files are parsed to obtain a list of jobs to be merged, TO_MERGE_JOBS.
[0026] Based on the job list TO_MERGE_JOBS containing the difference information to be merged, determine the job information to be merged, which includes: the job name and difference attribute information;
[0027] Batch processing is performed based on the information of the jobs to be merged.
[0028] Further, based on the aforementioned difference file, batch processing is performed, including:
[0029] The difference file is parsed to obtain the list of newly added jobs to be merged, TO_ADD_JOBS;
[0030] Based on the list of jobs to be merged and added, TO_ADD_JOBS, determine the parent nodes at each level of the jobs to be added;
[0031] Batch processing is performed based on the parent nodes at each level of the jobs to be added.
[0032] This invention provides a batch job processing device for intuitively viewing job information, quickly locating errors when errors occur, and accurately comparing job differences between two different versions of batch images to ensure version correctness. This avoids the problem of large workload and high error rates associated with manual merging. The device includes:
[0033] The file acquisition module is used to acquire multiple batch job XML files, wherein the multiple batch job XML files contain at least one set of batch job XML files to be compared;
[0034] The file parsing module is used to call the ET package to parse the multiple batch job XML files and obtain the job list JOB_LIST corresponding to each batch job XML file.
[0035] The information determination module is used to traverse the job list JOB_LIST and determine the job information corresponding to the job list JOB_LIST.
[0036] The information comparison module is used to compare the job information corresponding to each batch job XML file to be compared.
[0037] The difference generation module is used to generate the difference file corresponding to the batch job XML files to be compared based on the comparison results;
[0038] The job processing module is used to perform batch job processing based on the difference files.
[0039] Furthermore, in the plurality of batch job XML files, each batch job XML file contains one or more tags;
[0040] The file parsing module is further used to: call the ET package to parse the multiple batch job XML files, determine the JOB node corresponding to each tag, and obtain the job list JOB_LIST corresponding to each batch job XML file based on the JOB node.
[0041] Furthermore, the information determination module is further used for:
[0042] Traverse the job list JOB_LIST to obtain job name information, parent node information, execution script information, and input / output conditions;
[0043] The execution script information is analyzed to determine the JAVA class information;
[0044] Based on the Java class information, determine the comment information and input / output information;
[0045] Based on the input and output conditions, determine the job execution dependency information.
[0046] Furthermore, the batch job processing device also includes an information storage module, used to store the job information corresponding to the job list JOB_LIST into a database.
[0047] Furthermore, the batch job processing device also includes: an interface display module, used to display the job information using a list and / or a flowchart.
[0048] Furthermore, each set of batch job XML files to be compared includes: a first batch job XML file and a second batch job XML file;
[0049] The information comparison module is further used to: obtain the first job information JOB_A corresponding to the first batch job XML file and the second job information JOB_B corresponding to the second batch job XML file; traverse the first job information JOB_A, and if the first job information JOB_A exists in the second job information JOB_B, compare whether there is a difference between the first job information JOB_A and the second job information JOB_B;
[0050] The difference generation module is further used to: if there is a difference between the first job information JOB_A and the second job information JOB_B, obtain the difference information and job name; and generate the difference file DIFF_JOBS corresponding to the batch job xml files to be compared based on the difference information and job name.
[0051] Furthermore, the job processing module is further used for:
[0052] The difference files are parsed to obtain a list of jobs to be merged, TO_MERGE_JOBS.
[0053] Based on the job list TO_MERGE_JOBS containing the difference information to be merged, determine the job information to be merged, which includes: the job name and difference attribute information;
[0054] Batch processing is performed based on the information of the jobs to be merged.
[0055] Furthermore, the job processing module is further used for:
[0056] The difference file is parsed to obtain the list of newly added jobs to be merged, TO_ADD_JOBS;
[0057] Based on the list of jobs to be merged and added, TO_ADD_JOBS, determine the parent nodes at each level of the jobs to be added;
[0058] Batch processing is performed based on the parent nodes at each level of the jobs to be added.
[0059] This invention also provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the above-described batch job processing method.
[0060] This invention also provides a computer-readable storage medium storing a computer program that performs the above-described batch job processing method.
[0061] This invention provides an embodiment that obtains multiple batch job XML files, each containing at least one set of batch job XML files to be compared. It then uses the ET package to parse these files, obtaining a job list (JOB_LIST) for each file. The JOB_LIST is traversed to determine the corresponding job information. For each set of batch job XML files to be compared, the job information is compared. Based on the comparison results, a difference file is generated for that set of batch job XML files. Finally, batch job processing is performed based on the difference file. Compared to existing solutions that rely on Control-M for scheduling and management of batch job processing, this invention allows for a more intuitive view of job information, precise comparison of job differences between two different versions of batch images, ensuring version correctness and avoiding the problems of large workload and high error rates associated with manual merging. Attached Figure Description
[0062] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0063] Figure 1 This is a flowchart of a batch job processing method provided in an embodiment of the present invention;
[0064] Figure 2 This is a schematic diagram of a batch processing device provided in an embodiment of the present invention;
[0065] Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0067] First, the technologies involved in the embodiments of this invention will be explained:
[0068] ET: an abbreviation for ElementTree, is a Python package for processing tree structures. It can handle any tree-structured data, but it is most commonly used for processing XML documents.
[0069] Control-M is a cross-platform batch job scheduling and management software.
[0070] As mentioned earlier, Control-M's display of batch job information and dependencies is not very intuitive. When it's necessary to view the predecessor or successor nodes of a specific job, it's almost impossible to distinguish them from the flow diagram. Batch job information is stored in XML files. Because the jobs in the XML may be unordered, it's difficult to identify the differences between two different versions of the XML files using ordinary text comparison tools.
[0071] Currently, most batch jobs in the industry are scheduled and managed using Control-M. However, this tool is not intuitive in displaying job information and dependencies. When a job encounters an error, tracing its context information is almost impossible within Control-M. Furthermore, when a new version is released, it is essential to list the changes made in the new batch job version compared to the older version to ensure version correctness. This involves comparing batch images, but Control-M and common text comparison tools do not support this, and the accuracy of manual comparison cannot be guaranteed. Moreover, no publicly available documents or tools similar to this invention have been found.
[0072] When dealing with a large workload, simply displaying job dependencies as a flowchart without supporting search by specific job makes visual identification extremely difficult. Therefore, Control-M's job display format is insufficient for most projects. Ordinary text comparison tools only support line-by-line comparison of ordered text, and do not support batch jobs stored unordered as XML files.
[0073] To provide a clear view of job information, enable quick location of errors when errors occur, accurately compare job differences between two different versions of batch images, ensure version correctness, and avoid the problems of large workload and high error rates associated with manual merging, this embodiment of the invention provides a batch job processing method. Figure 1 This invention provides a flowchart of a batch job processing method, as shown in the embodiment of the invention. Figure 1 As shown, it includes the following steps:
[0074] Step 101: Obtain multiple batch job XML files, wherein the multiple batch job XML files contain at least one set of batch job XML files to be compared;
[0075] Step 102: Use the ET package to parse the multiple batch job XML files to obtain the job list JOB_LIST corresponding to each batch job XML file;
[0076] Step 103: Traverse the job list JOB_LIST to determine the job information corresponding to the job list JOB_LIST;
[0077] Step 104: For each batch of job XML files to be compared, compare the job information corresponding to the batch job XML files;
[0078] Step 105: Based on the comparison results, generate the difference file corresponding to the batch job XML files to be compared in this group;
[0079] Step 106: Perform batch processing based on the difference files.
[0080] Depend on Figure 1 As shown, this embodiment of the invention obtains multiple batch job XML files, each containing at least one set of batch job XML files to be compared; it calls the ET package to parse the multiple batch job XML files, obtaining a job list JOB_LIST corresponding to each batch job XML file; it iterates through the job list JOB_LIST to determine the job information corresponding to the job list JOB_LIST; for each set of batch job XML files to be compared, it compares the job information corresponding to the batch job XML files; based on the comparison results, it generates a difference file corresponding to the set of batch job XML files to be compared; and it performs batch job processing based on the difference file. Compared with existing solutions that rely on tools like Control-M for scheduling and management of batch job processing, this embodiment of the invention allows for intuitive viewing of job information, accurate comparison of job differences between two different versions of batch images, ensuring version correctness, and avoiding the problems of large workload and high error rates associated with manual merging.
[0081] In this embodiment, multiple batch job XML files are obtained, each containing at least one set of batch job XML files to be compared. The ET package is called to parse the multiple batch job XML files to obtain a job list JOB_LIST corresponding to each batch job XML file. The job list JOB_LIST is traversed to determine the job information corresponding to the job list JOB_LIST.
[0082] In this embodiment, each of the multiple batch job XML files contains one or more tags;
[0083] The process of calling the ET package to parse the multiple batch job XML files and obtaining the job list JOB_LIST corresponding to each batch job XML file includes: calling the ET package to parse the multiple batch job XML files, determining the JOB node corresponding to each tag, and obtaining the job list JOB_LIST corresponding to each batch job XML file based on the JOB node.
[0084] In this embodiment, the job list JOB_LIST is traversed to determine the job information corresponding to the job list JOB_LIST, including:
[0085] Traverse the job list JOB_LIST to obtain job name information, parent node information, execution script information, and input / output conditions;
[0086] The execution script information is analyzed to determine the JAVA class information;
[0087] Based on the Java class information, determine the comment information and input / output information;
[0088] Based on the input and output conditions, determine the job execution dependency information.
[0089] In this embodiment, the batch job processing method further includes storing the job information corresponding to the job list JOB_LIST into a database.
[0090] In this embodiment, the batch job processing method further includes: displaying the job information on an interface using a list and / or a flow graph.
[0091] In practice, the ET package is used to parse the XML file of the batch jobs, obtaining all nodes tagged with "JOB" and defining them as JOB_LIST. The JOB_LIST is traversed to obtain key information such as job name, parent node information, execution script information, and input / output conditions. By analyzing the execution script, the called Java classes are obtained, and further, the comments and input / output information of these Java classes are obtained by parsing the project. By analyzing the input / output conditions, the dependencies between job executions are obtained. The job information is stored in the database, and the traversal of JOB_LIST ends, allowing for interface display. Both list and flowchart display methods are provided for job information, and both support searching by job name, input conditions, and output conditions.
[0092] In this embodiment, for each group of batch job XML files to be compared, the job information corresponding to the batch job XML files is compared, and based on the comparison results, a difference file corresponding to the batch job XML files to be compared is generated.
[0093] In this embodiment, each batch of job XML files to be compared includes: a first batch job XML file and a second batch job XML file;
[0094] For each batch of job XML files to be compared, the job information corresponding to the batch job XML files is compared, including: obtaining the first job information JOB_A corresponding to the first batch job XML file and the second job information JOB_B corresponding to the second batch job XML file; iterating through the first job information JOB_A, if the first job information JOB_A exists in the second job information JOB_B, then comparing whether there is a difference between the first job information JOB_A and the second job information JOB_B;
[0095] Based on the comparison results, generate the difference file corresponding to the batch job XML files to be compared in this group, including: if there is a difference between the first job information JOB_A and the second job information JOB_B, obtain the difference information and job name; based on the difference information and job name, generate the difference file DIFF_JOBS corresponding to the batch job XML files to be compared in this group.
[0096] In practice, the ET package is called to parse the two batch job XML files to be compared, obtaining job information lists defined as JOB_LIST_A and JOB_LIST_B. Three variables are defined: A_NOTIN_B, JOB_LIST_B, and DIFF_JOBS, to store jobs that exist in file A but not in file B, jobs that exist in file B but not in file A, and jobs that exist in both files but have different information. JOB_LIST_A is iterated to obtain JOB_A. It is then checked whether JOB_A exists in JOB_LIST_B: if it exists, it is recorded as JOB_B, and the job information of JOB_A and JOB_B is compared for differences: if there are differences, the job name and difference information are added to DIFF_JOBS. Regardless of whether there are differences in the job information, after the comparison is completed, JOB_B is removed from JOB_LIST_B; if it does not exist, the job name is added to A_NOTIN_B. End the iteration of JOB_LIST_A; generate the difference file RESULT.XLSX in EXCEL format, and write the comparison results A_NOTIN_B, JOB_LIST_B, and DIFF_JOBS into different sheets of the result file respectively.
[0097] In this embodiment, batch processing is performed based on the difference file.
[0098] In this embodiment, batch processing is performed based on the difference file, including:
[0099] The difference files are parsed to obtain a list of jobs to be merged, TO_MERGE_JOBS.
[0100] Based on the job list TO_MERGE_JOBS containing the difference information to be merged, determine the job information to be merged, which includes: the job name and difference attribute information;
[0101] Batch processing is performed based on the information of the jobs to be merged.
[0102] In this embodiment, batch processing is performed based on the difference file, including:
[0103] The difference file is parsed to obtain the list of newly added jobs to be merged, TO_ADD_JOBS;
[0104] Based on the list of jobs to be merged and added, TO_ADD_JOBS, determine the parent nodes at each level of the jobs to be added;
[0105] Batch processing is performed based on the parent nodes at each level of the jobs to be added.
[0106] In practice, users can mark the jobs to be merged as needed and use the marked difference file as the input parameter DIFF_FILE. The source file to be merged is defined as A, and the target file is defined as B. The execution steps are as follows:
[0107] 1. Parse DIFF_FILE to obtain the list of newly added jobs to be merged (TO_ADD_JOBS) and the list of jobs with differences to be merged (TO_MERGE_JOBS);
[0108] 2. Traverse TO_ADD_JOBS to obtain ADD_JOB, which stores the complete path of the tree nodes, such as a / b / c / d;
[0109] 3. Separate each parent node of the job to be added by using " / ". Starting from the top-level parent node, determine whether it exists in the target file B: if it exists, recursively process the next level of parent nodes; if it does not exist, write the entire tree from the parent node to the leaf node to the corresponding node in file B.
[0110] Let's illustrate this step with an example: Suppose the jobs to be merged are a / b / c / d. If node a exists in file B, then continue searching for node b. If node b does not exist in file B, then the entire tree of b / c / d should be written to file B, rather than simply writing the leaf node d.
[0111] 4. End the iteration of TO_ADD_JOBS;
[0112] 5. Iterate through TO_MERGE_JOBS to obtain MERGE_JOB;
[0113] 6. Obtain information such as the job name and difference attributes to be merged, and update the corresponding attributes of the corresponding jobs in the file;
[0114] 7. End the traversal of TO_MERGE_JOBS.
[0115] This invention parses the called Java classes, their comments, input / output parameters, and other information from the script content of batch job execution. Based on the job execution order, it determines the calling order of the Java classes. It provides job information in both list and flowchart formats and supports search functionality. It also supports difference comparison for unordered batch job XML. This invention implements batch job parsing, comparison, and merging functions, essentially covering the entire process of daily batch job operations. It provides a more intuitive way to view job information, a more accurate way to compare job differences, and a more efficient way to merge differing jobs between two versions.
[0116] Based on the same inventive concept, this invention also provides a batch processing device, as described in the following embodiments. Since the principle by which this device solves the problem is similar to that of the batch processing method, the implementation of this device can be referred to the implementation of the method, and repeated details will not be elaborated further.
[0117] Figure 2 This is a schematic diagram of a batch job processing device provided in an embodiment of the present invention, as shown below. Figure 2 As shown, the batch job processing device provided in this embodiment of the invention may include:
[0118] The file acquisition module 201 is used to acquire multiple batch job XML files, wherein the multiple batch job XML files contain at least one set of batch job XML files to be compared;
[0119] The file parsing module 202 is used to call the ET package to parse the multiple batch job XML files and obtain the job list JOB_LIST corresponding to each batch job XML file.
[0120] Information determination module 203 is used to traverse the job list JOB_LIST and determine the job information corresponding to the job list JOB_LIST;
[0121] The information comparison module 204 is used to compare the job information corresponding to each batch job XML file to be compared.
[0122] The difference generation module 205 is used to generate the difference file corresponding to the batch job XML files to be compared based on the comparison results;
[0123] The job processing module 206 is used to perform batch job processing based on the difference file.
[0124] In one embodiment, each of the plurality of batch job XML files contains one or more tags;
[0125] The file parsing module 202 is further used to: call the ET package to parse the multiple batch job XML files, determine the JOB node corresponding to each tag, and obtain the job list JOB_LIST corresponding to each batch job XML file based on the JOB node.
[0126] In one embodiment, the information determination module 203 is further configured to:
[0127] Traverse the job list JOB_LIST to obtain job name information, parent node information, execution script information, and input / output conditions;
[0128] The execution script information is analyzed to determine the JAVA class information;
[0129] Based on the Java class information, determine the comment information and input / output information;
[0130] Based on the input and output conditions, determine the job execution dependency information.
[0131] In one embodiment, the batch job processing device further includes an information storage module for storing job information corresponding to the job list JOB_LIST in a database.
[0132] In one embodiment, the batch job processing device further includes: an interface display module, used to display the job information using a list and / or a flowchart.
[0133] In one embodiment, each set of batch job XML files to be compared includes: a first batch job XML file and a second batch job XML file;
[0134] The information comparison module 204 is further used to: obtain the first job information JOB_A corresponding to the first batch job xml file and the second job information JOB_B corresponding to the second batch job xml file; traverse the first job information JOB_A, and if the first job information JOB_A exists in the second job information JOB_B, compare whether there is a difference between the first job information JOB_A and the second job information JOB_B;
[0135] The difference generation module 205 is further configured to: if there is a difference between the first job information JOB_A and the second job information JOB_B, obtain the difference information and job name; and generate the difference file DIFF_JOBS corresponding to the batch job xml files to be compared based on the difference information and job name.
[0136] In one embodiment, the job processing module 206 is further configured to:
[0137] The difference files are parsed to obtain a list of jobs to be merged, TO_MERGE_JOBS.
[0138] Based on the job list TO_MERGE_JOBS containing the difference information to be merged, determine the job information to be merged, which includes: the job name and difference attribute information;
[0139] Batch processing is performed based on the information of the jobs to be merged.
[0140] In one embodiment, the job processing module 206 is further configured to:
[0141] The difference file is parsed to obtain the list of newly added jobs to be merged, TO_ADD_JOBS;
[0142] Based on the list of jobs to be merged and added, TO_ADD_JOBS, determine the parent nodes at each level of the jobs to be added;
[0143] Batch processing is performed based on the parent nodes at each level of the jobs to be added.
[0144] In summary, this embodiment of the invention obtains multiple batch job XML files, each containing at least one set of batch job XML files to be compared; it calls the ET package to parse these multiple batch job XML files, obtaining a job list (JOB_LIST) corresponding to each batch job XML file; it iterates through the job list (JOB_LIST) to determine the job information corresponding to each job list (JOB_LIST); for each set of batch job XML files to be compared, it compares the job information corresponding to each batch job XML file; based on the comparison results, it generates a difference file corresponding to the set of batch job XML files to be compared; and it performs batch job processing based on the difference file. Compared with existing solutions that rely on tools like Control-M for scheduling and management of batch job processing, this embodiment of the invention allows for intuitive viewing of job information, accurate comparison of job differences between two different versions of batch images, ensuring version correctness, and avoiding the problems of large workload and high error rates associated with manual merging.
[0145] Based on the same inventive concept, this invention also provides an embodiment of an electronic device for implementing all or part of the above-described batch job processing method. This electronic device specifically includes the following:
[0146] The device comprises a processor, memory, a communications interface, and a bus; wherein the processor, memory, and communications interface communicate with each other via the bus; the communications interface is used to realize information transmission between related devices; the electronic device can be a desktop computer, tablet computer, or mobile terminal, etc., and this embodiment is not limited to these. In this embodiment, the electronic device can be implemented with reference to the embodiments for implementing the above-described batch job processing method and the embodiments for implementing the above-described batch job processing device, the contents of which are incorporated herein by reference, and repeated details will not be described again.
[0147] Figure 3 This is a schematic diagram of the system composition structure of an electronic device provided in an embodiment of the present invention. Figure 3 As shown, the electronic device 30 may include a processor 301 and a memory 302; the memory 302 is coupled to the processor 301. It is worth noting that... Figure 3 This is an example; other types of structures can also be used to supplement or replace this structure to achieve telecommunications functions or other functions.
[0148] In one embodiment, the functionality implemented by the batch job processing method can be integrated into the processor 301. The processor 301 can be configured to perform the following control: obtain multiple batch job XML files, each containing at least one set of batch job XML files to be compared; call the ET package to parse the multiple batch job XML files, obtaining a job list JOB_LIST corresponding to each batch job XML file; traverse the job list JOB_LIST to determine the job information corresponding to the job list JOB_LIST; for each set of batch job XML files to be compared, compare the job information corresponding to the batch job XML files; based on the comparison result, generate a difference file corresponding to the set of batch job XML files to be compared; and perform batch job processing based on the difference file.
[0149] As can be seen from the above, the electronic device provided in the embodiments of the present invention obtains multiple batch job XML files, wherein the multiple batch job XML files contain at least one set of batch job XML files to be compared; calls the ET package to parse the multiple batch job XML files to obtain a job list JOB_LIST corresponding to each batch job XML file; iterates through the job list JOB_LIST to determine the job information corresponding to the job list JOB_LIST; compares the job information corresponding to each set of batch job XML files to be compared; generates a difference file corresponding to the set of batch job XML files to be compared based on the comparison result; and performs batch job processing based on the difference file.
[0150] The electronic device provided in this embodiment of the invention allows for intuitive viewing of job information, rapid location of errors when errors occur, and accurate comparison of job differences between two different versions of batch drawings to ensure version correctness and avoid the problem of large workload and easy errors in manual merging.
[0151] In another embodiment, the batch job processing device can be configured separately from the processor 301. For example, the batch job processing device can be configured as a chip connected to the processor 301, and the batch job processing method can be implemented through the control of the processor.
[0152] like Figure 3 As shown, the electronic device 30 may further include: a communication module 303, an input unit 304, an audio processing unit 305, a display 306, and a power supply 303. It is worth noting that the electronic device 30 does not necessarily need to include these components. Figure 3 All components shown; in addition, electronic device 30 may also include Figure 3 For components not shown, please refer to existing technologies.
[0153] like Figure 3 As shown, processor 301, sometimes also referred to as controller or operation control, may include a microprocessor or other processor device and / or logic device, which receives input and controls the operation of various components of electronic device 30.
[0154] The memory 302 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information, and also store a program for executing that information. The processor 301 may execute the program stored in the memory 302 to perform information storage or processing, etc.
[0155] Input unit 304 provides input to processor 301. This input unit 304 may be, for example, a button or touch input device. Power supply 303 provides power to electronic device 30. Display 306 displays images and text, etc. This display may be, for example, an LCD display, but is not limited thereto.
[0156] The memory 302 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs. The memory 302 can also be some other type of device. The memory 302 includes a buffer memory 3021 (sometimes referred to as a buffer). The memory 302 may include an application / function storage unit 3022 for storing application programs and function programs or processes for executing the operation of the electronic device 30 via the processor 301.
[0157] The memory 302 may also include a data storage unit 3023 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 3024 of the memory 302 may include various drivers for the electronic device for communication functions and / or for performing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0158] The communication module 303 is a transmitter / receiver that transmits and receives signals via the antenna 308. The communication module (transmitter / receiver) 303 is coupled to the processor 301 to provide input signals and receive output signals, which is the same as in a conventional mobile communication terminal.
[0159] Based on different communication technologies, multiple communication modules 303 can be configured in the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) 303 is also coupled to a speaker 309 and a microphone 310 via an audio processing unit 305 to provide audio output via the speaker 309 and receive audio input from the microphone 310, thereby realizing typical telecommunications functions. The audio processing unit 305 may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processing unit 305 is also coupled to a processor 301, enabling on-device recording via the microphone 310 and on-device playback of stored audio via the speaker 309.
[0160] In embodiments of the present invention, a computer-readable storage medium is also provided for implementing all steps of the batch job processing method in the above embodiments. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements all steps of the batch job processing method in the above embodiments. For example, when the processor executes the computer program, it implements the following steps: obtaining multiple batch job XML files, wherein the multiple batch job XML files contain at least one set of batch job XML files to be compared; calling the ET package to parse the multiple batch job XML files to obtain a job list JOB_LIST corresponding to each batch job XML file; traversing the job list JOB_LIST to determine the job information corresponding to the job list JOB_LIST; comparing the job information corresponding to each set of batch job XML files to be compared; generating a difference file corresponding to the set of batch job XML files to be compared based on the comparison result; and performing batch job processing based on the difference file.
[0161] As can be seen from the above, the computer-readable storage medium provided in the embodiments of the present invention obtains multiple batch job XML files, wherein the multiple batch job XML files contain at least one set of batch job XML files to be compared; calls the ET package to parse the multiple batch job XML files to obtain a job list JOB_LIST corresponding to each batch job XML file; traverses the job list JOB_LIST to determine the job information corresponding to the job list JOB_LIST; compares the job information corresponding to each set of batch job XML files to be compared; generates a difference file corresponding to the set of batch job XML files to be compared based on the comparison result; and performs batch job processing based on the difference file.
[0162] The computer-readable storage medium provided in this embodiment of the invention allows for intuitive viewing of job information, rapid location of errors when a job is reported, and accurate comparison of job differences between two different versions of batch drawings to ensure version correctness and avoid the problem of large workload and easy errors in manual merging.
[0163] While this invention provides the method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive labor. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual device or client product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).
[0164] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, apparatus (systems), or computer program products. Therefore, the embodiments of this specification can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, the invention can take the form of a computer program product embodied 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.
[0165] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0166] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0167] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0168] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, the system embodiments are relatively simple in description because they are fundamentally similar to the method embodiments; relevant parts can be referred to the descriptions in the method embodiments. In this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "upper," "lower," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as limiting the invention. Unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; and internal connections between two components. Those skilled in the art can understand the specific meaning of these terms in this invention according to the specific circumstances. It should be noted that, without conflict, the embodiments and features in the embodiments of this invention can be combined with each other. This invention is not limited to any single aspect, nor to any single embodiment, nor to any combination and / or substitution of these aspects and / or embodiments. Each aspect and / or embodiment of this invention can be used alone, or in combination with one or more other aspects and / or other embodiments.
[0169] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.
Claims
1. A batch job processing method, characterized in that, include: Obtain multiple batch job XML files, wherein the multiple batch job XML files contain at least one set of batch job XML files to be compared; Each of the multiple batch job XML files contains one or more tags; The process of calling the ET package to parse the multiple batch job XML files and obtaining the job list JOB_LIST corresponding to each batch job XML file includes: calling the ET package to parse the multiple batch job XML files, determining the JOB node corresponding to each tag, and obtaining the job list JOB_LIST corresponding to each batch job XML file based on the JOB node; Iterate through the job list JOB_LIST to determine the job information corresponding to the job list JOB_LIST; The job information corresponding to the JOB_LIST is stored in the database, and the job information is displayed on the interface using lists and / or flow graphs. Both display methods support the function of searching by job name, input conditions, and output conditions. For each batch of job XML files to be compared, the job information corresponding to the batch job XML files is compared. Based on the comparison results, generate the difference file corresponding to the batch job XML files to be compared in this group; Based on the aforementioned difference files, perform batch processing; Iterate through the job list JOB_LIST to determine the job information corresponding to the job list JOB_LIST, including: Traverse the job list JOB_LIST to obtain job name information, parent node information, execution script information, and input / output conditions; The execution script information is analyzed to determine the JAVA class information; By analyzing the execution script information, the Java class being called is obtained, and further by parsing the project, the comment information and input / output information of the Java class are obtained. Based on the execution order of the job, the calling order of the Java class is determined. Based on the input and output conditions, determine the job execution dependency information; Each set of batch job XML files to be compared includes: a first batch job XML file and a second batch job XML file. For each set of batch job XML files to be compared, the job information corresponding to the batch job XML files is compared, including: Obtain the first job information list JOB_LIST_A corresponding to the first batch job XML file and the second job information list JOB_LIST_B corresponding to the second batch job XML file; define three variables: A_NOTIN_B, B_NOTIN_A, and DIFF_JOBS, to store jobs that exist in the first batch job XML file but not in the second batch job XML file, jobs that exist in the second batch job XML file but not in the first batch job XML file, and jobs that exist in both files but have different job information; iterate through JOB_LIST_A. ST_A obtains JOB_A and checks if JOB_A exists in JOB_LIST_B. If it exists, it is denoted as JOB_B. The job information of JOB_A and JOB_B is compared for differences. If there are differences, the job name and difference information are added to DIFF_JOBS. Regardless of whether the job information is different, JOB_B is removed from JOB_LIST_B after the comparison is completed. If it does not exist, the job name is added to A_NOTIN_B. After finishing traversing JOB_LIST_A, the remaining JOB_LIST_B is assigned to B_NOTIN_A. Based on the comparison results, generate the difference file corresponding to the batch job XML files to be compared. Specifically, this includes generating the EXCEL format difference file RESULT.XLSX and writing the comparison result information A_NOTIN_B, JOB_LIST_B, and DIFF_JOBS into different sheets of the result file. The difference file is parsed to obtain the job list TO_MERGE_JOBS to be merged and the newly added job list TO_ADD_JOBS to be merged. Traversing TO_ADD_JOBS yields ADD_JOB, which stores the complete path of the tree nodes; Obtain the parent nodes of each level of the job to be added. Starting from the top-level parent node, determine whether it exists in the target file: if it exists, recursively go to the next level of parent nodes; if it does not exist, write the entire tree from the parent node to the leaf node to the corresponding node in the target file. Iterate through TO_MERGE_JOBS to get MERGE_JOB; Obtain the job names and difference attribute information to be merged, and update the corresponding attributes of the jobs in the file.
2. The batch processing method as described in claim 1, characterized in that, Each batch job XML file to be compared includes: the first batch job XML file and the second batch job XML file; For each batch of job XML files to be compared, the job information corresponding to the batch job XML files is compared, including: obtaining the first job information JOB_A corresponding to the first batch job XML file and the second job information JOB_B corresponding to the second batch job XML file; iterating through the first job information JOB_A, if the first job information JOB_A exists in the second job information JOB_B, then comparing whether there is a difference between the first job information JOB_A and the second job information JOB_B; Based on the comparison results, generate the difference file corresponding to the batch job XML files to be compared in this group, including: if there is a difference between the first job information JOB_A and the second job information JOB_B, obtain the difference information and job name; based on the difference information and job name, generate the difference file DIFF_JOBS corresponding to the batch job XML files to be compared in this group.
3. The batch processing method as described in claim 1, characterized in that, Based on the aforementioned difference file, perform batch job processing, including: The difference files are parsed to obtain a list of jobs to be merged, TO_MERGE_JOBS. Based on the job list TO_MERGE_JOBS containing the difference information to be merged, determine the job information to be merged, which includes: the job name and difference attribute information; Batch processing is performed based on the information of the jobs to be merged.
4. The batch processing method as described in claim 1, characterized in that, Based on the aforementioned difference file, perform batch job processing, including: The difference file is parsed to obtain the list of newly added jobs to be merged, TO_ADD_JOBS; Based on the list of jobs to be merged and added, TO_ADD_JOBS, determine the parent nodes at each level of the jobs to be added; Batch processing is performed based on the parent nodes at each level of the jobs to be added.
5. A batch processing device, characterized in that, include: The file acquisition module is used to acquire multiple batch job XML files, wherein the multiple batch job XML files contain at least one set of batch job XML files to be compared; each batch job XML file contains one or more tags. The file parsing module is used to call the ET package to parse the multiple batch job XML files and obtain the job list JOB_LIST corresponding to each batch job XML file. The module includes: calling the ET package to parse the multiple batch job XML files, determining the JOB node corresponding to each tag, and obtaining the job list JOB_LIST corresponding to each batch job XML file based on the JOB node. The information determination module is used to traverse the job list JOB_LIST and determine the job information corresponding to the job list JOB_LIST. It also includes: an information storage module, used to store the job information corresponding to the job list JOB_LIST into a database; and an interface display module, used to display the job information using a list and / or a flowchart, and both display methods support the function of searching by job name, input conditions, and output conditions; wherein, the list and flowchart display methods support the function of searching by job name, input conditions, and output conditions. The information comparison module is used to compare the job information corresponding to each batch job XML file to be compared. The difference generation module is used to generate the difference file corresponding to the batch job XML files to be compared based on the comparison results; The job processing module is used to perform batch job processing based on the difference files; The information determination module is further used for: Traverse the job list JOB_LIST to obtain job name information, parent node information, execution script information, and input / output conditions; The execution script information is analyzed to determine the JAVA class information; By analyzing the execution script information, the Java class being called is obtained, and further by parsing the project, the comment information and input / output information of the Java class are obtained. Based on the execution order of the job, the calling order of the Java class is determined. Based on the input and output conditions, determine the job execution dependency information; Each set of batch job XML files to be compared includes: a first batch job XML file and a second batch job XML file. For each set of batch job XML files to be compared, the job information corresponding to the batch job XML files is compared, including: Obtain the first job information list JOB_LIST_A corresponding to the first batch job XML file and the second job information list JOB_LIST_B corresponding to the second batch job XML file; define three variables: A_NOTIN_B, B_NOTIN_A, and DIFF_JOBS, to store jobs that exist in the first batch job XML file but not in the second batch job XML file, jobs that exist in the second batch job XML file but not in the first batch job XML file, and jobs that exist in both files but have different job information; iterate through JOB_LIST_A. ST_A obtains JOB_A and checks if JOB_A exists in JOB_LIST_B. If it exists, it is denoted as JOB_B. The job information of JOB_A and JOB_B is compared for differences. If there are differences, the job name and difference information are added to DIFF_JOBS. Regardless of whether the job information is different, JOB_B is removed from JOB_LIST_B after the comparison is completed. If it does not exist, the job name is added to A_NOTIN_B. After finishing traversing JOB_LIST_A, the remaining JOB_LIST_B is assigned to B_NOTIN_A. Based on the comparison results, generate the difference file corresponding to the batch job XML files to be compared. Specifically, this includes generating the EXCEL format difference file RESULT.XLSX and writing the comparison result information A_NOTIN_B, JOB_LIST_B, and DIFF_JOBS into different sheets of the result file. The job processing module is further used for: The difference file is parsed to obtain the job list TO_MERGE_JOBS to be merged and the newly added job list TO_ADD_JOBS to be merged. Traversing TO_ADD_JOBS yields ADD_JOB, which stores the complete path of the tree nodes; Obtain the parent nodes of each level of the job to be added. Starting from the top-level parent node, determine whether it exists in the target file: if it exists, recursively go to the next level of parent nodes; if it does not exist, write the entire tree from the parent node to the leaf node to the corresponding node in the target file. Iterate through TO_MERGE_JOBS to get MERGE_JOB; Obtain the job names and difference attribute information to be merged, and update the corresponding attributes of the jobs in the file.
6. The batch processing device as described in claim 5, characterized in that, Each batch job XML file to be compared includes: the first batch job XML file and the second batch job XML file; The information comparison module is further used to: obtain the first job information JOB_A corresponding to the first batch job XML file and the second job information JOB_B corresponding to the second batch job XML file; traverse the first job information JOB_A, and if the first job information JOB_A exists in the second job information JOB_B, compare whether there is a difference between the first job information JOB_A and the second job information JOB_B; The difference generation module is further used to: if there is a difference between the first job information JOB_A and the second job information JOB_B, obtain the difference information and job name; and generate the difference file DIFF_JOBS corresponding to the batch job xml files to be compared based on the difference information and job name.
7. The batch processing device as described in claim 5, characterized in that, The job processing module is further used for: The difference files are parsed to obtain a list of jobs to be merged, TO_MERGE_JOBS. Based on the job list TO_MERGE_JOBS containing the difference information to be merged, determine the job information to be merged, which includes: the job name and difference attribute information; Batch processing is performed based on the information of the jobs to be merged.
8. The batch processing device as described in claim 5, characterized in that, The job processing module is further used for: The difference file is parsed to obtain the list of newly added jobs to be merged, TO_ADD_JOBS; Based on the list of jobs to be merged and added, TO_ADD_JOBS, determine the parent nodes at each level of the jobs to be added; Batch processing is performed based on the parent nodes at each level of the jobs to be added.
9. An electronic 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, it implements the batch job processing method according to any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that performs the batch job processing method according to any one of claims 1 to 4.