Job dependency relationship query method and device, equipment and medium
By importing the basic dependency information table into the Luban scheduling platform and judging query requirements based on the number of cycles, the problem of low efficiency in querying job dependencies is solved and a more efficient query process is achieved.
Patent Information
- Application Number
- CN202410800126.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-18
AI Technical Summary
In the Luban scheduling platform, the job dependency query method will unconditionally access the database multiple times in series, resulting in low query efficiency. Especially when multiple jobs are changed, the delay is large and the efficiency is affected.
By importing the job ID, target job ID and dependency relationship into the basic dependency information table, and judging whether to perform a loop query based on the number of loops in the query request, this avoids unconditional multiple accesses to the database and improves query efficiency.
It improves the accuracy and efficiency of job dependency query, reduces the number of database accesses, and improves query efficiency.
Smart Images

Figure CN118796891A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data management technology, and in particular to a method, device, equipment and medium for querying job dependencies. Background Art
[0002] With the rapid development of big data platforms, more and more scheduling platforms with more complete functions are being put into production. For example, the Luban Scheduling Platform is an enterprise-level job management and scheduling platform that can trigger, start, and synchronize batch jobs according to the application project configuration. Therefore, the Luban Scheduling Platform includes a large number of jobs, job flows, and job dependencies.
[0003] When a job in the Luban Scheduling Platform changes, it is necessary to query all jobs that have a dependency relationship with a job from the database of the Luban Scheduling Platform. First, the first directly dependent job corresponding to the job is queried in the database, and then the second directly dependent job corresponding to the first directly dependent job is queried in the database, and so on, until the directly dependent job corresponding to the current directly dependent job cannot be queried from the database. However, this method of querying job dependencies will unconditionally access the database multiple times in serial, which will cause a large delay when multiple jobs are changed, resulting in low query efficiency. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, device and medium for querying job dependency, which are used to solve the problem of low efficiency of current job dependency query.
[0005] In a first aspect, the present application provides a method for querying job dependencies, the method comprising:
[0006] In response to receiving the query request, parsing the job identifier and the number of cycles from the query request;
[0007] When the number of cycles is equal to a preset value, a basic dependency information table is queried based on the job identifier to obtain a target query result; wherein the basic dependency information table includes at least a job identifier, a target job identifier, and a dependency relationship between the job identifier and the target job identifier;
[0008] When the number of cycles is greater than a preset value, a loop query is performed on the basic dependency information table based on the job identifier to obtain a target loop query result.
[0009] Through the above method, the job identifier, the target job identifier, and the dependency relationship between the job identifier and the target job identifier are imported into the basic dependency information table, so that when a query request is received, the basic dependency information table is queried according to the job identifier in the query request, without the need to compare one by one in the database, thereby improving the query efficiency. At the same time, based on the number of loops in the query request, it is determined whether it is necessary to perform a loop query on the basic dependency information table based on the job identifier, thereby avoiding unconditional multiple accesses to the basic dependency information table, further improving the query efficiency.
[0010] In a possible embodiment, the job identifier at least includes a job name and a job flow name, the target job identifier at least includes a target job name and a target job flow name, and the job identifier and the target job identifier are unified format data.
[0011] Through the above method, the target job identifier corresponding to the job identifier can be accurately queried in the basic dependency information table, thereby improving the accuracy of job dependency query.
[0012] In a possible embodiment, querying the basic dependency information table based on the job identifier to obtain a target query result includes:
[0013] Based on the job identifier, query the basic dependency information table to find the target job identifier that is directly dependent on the job identifier;
[0014] The job identifier is associated with the target job identifier to obtain the target query result.
[0015] Through the above method, based on the job identifier, the corresponding job can be queried from the basic dependency information table, and then the target job that is directly dependent on the job can be queried.
[0016] In a possible embodiment, performing a loop query on the basic dependency information table based on the job identifier to obtain a target loop query result includes:
[0017] Performing a loop query on the basic dependency information table based on the job identifier to obtain a loop query result, and updating the loop count to obtain an updated loop count;
[0018] Determine whether the updated number of cycles is equal to the preset value;
[0019] If yes, then perform a loop query on the basic dependency information table based on the previous loop query result to obtain a current loop query result, and use the current loop query result and the loop query result before the current loop query result as the target loop query result;
[0020] If not, a loop query is performed on the basic dependency information table based on the last loop query result until the updated loop number is less than the preset value, and all loop query results are used as the target loop query results.
[0021] Through the above method, when performing each loop query, it is first determined whether a loop query is needed based on the updated loop number, thereby avoiding repeated access to the basic dependency information table and further improving query efficiency.
[0022] In a possible embodiment, the loop querying the basic dependency information table based on the last loop query result until the updated loop number is less than the preset value, and taking all loop query results as the target loop query result, includes:
[0023] Store the query results of the previous loop in a temporary table;
[0024] Based on the Mth loop query result in the temporary table, the basic dependency information table is cyclically queried to obtain the M+1th loop query result; wherein M is an integer greater than 0;
[0025] The temporary table is updated based on the M+1th loop query result until the updated loop number is less than the preset value, and all loop query results are used as the target loop query results.
[0026] Through the above method, during the loop query process, the result of the previous loop query is stored in a temporary table, and only the result of the previous loop query is stored in the temporary table. Therefore, when a loop query is performed based on the result of the previous query, it is possible to avoid using the loop query result before the previous loop query result as a query condition for query, thereby ensuring the accuracy of the query. At the same time, when there are multiple target jobs in the result of the previous loop query, data omission can be prevented.
[0027] In a possible embodiment, updating the temporary table based on the M+1th loop query result further includes:
[0028] When the query result of the M+1th loop is a null value, the temporary table is not updated.
[0029] Through the above method, when the query result of the M+1th loop is null, the temporary table is not updated, and the basic dependency information table is still cyclically queried based on the query result of the Mth loop, which can prevent missed queries.
[0030] In a possible embodiment, the method further includes:
[0031] The target query result or the target loop query result is stored in a result table according to preset rules, wherein the field information of the result table includes at least a job identifier, a target job identifier and a level, the target query result belongs to the first level, and the result of the Mth loop query in the target loop query result belongs to the Mth level.
[0032] Through the above method, the target query results or loop query results are stored in the result table according to the preset rules for users to view.
[0033] In a second aspect, the present application provides a job dependency query device, the device comprising:
[0034] A parsing module, configured to parse the job identifier and the number of cycles from the query request in response to receiving the query request;
[0035] A query module, used for querying the basic dependency information table based on the job identifier to obtain a target query result when the number of cycles is equal to a preset value; wherein the basic dependency information table at least includes a job identifier, a target job identifier, and a dependency relationship between the job identifier and the target job identifier;
[0036] A loop query module is used to perform a loop query on the basic dependency information table based on the job identifier when the number of loops is greater than a preset value to obtain a target loop query result.
[0037] In a possible embodiment, the job identifier at least includes a job name and a job flow name, the target job identifier at least includes a target job name and a target job flow name, and the job identifier and the target job identifier are unified format data.
[0038] In a possible embodiment, the query module is specifically used to:
[0039] Based on the job identifier, query the basic dependency information table to find the target job identifier that is directly dependent on the job identifier;
[0040] The job identifier is associated with the target job identifier to obtain the target query result.
[0041] In a possible embodiment, the loop query module is specifically used for:
[0042] Performing a loop query on the basic dependency information table based on the job identifier to obtain a loop query result, and updating the loop count to obtain an updated loop count;
[0043] Determine whether the updated number of cycles is equal to the preset value;
[0044] If yes, then perform a loop query on the basic dependency information table based on the previous loop query result to obtain a current loop query result, and use the current loop query result and the loop query result before the current loop query result as the target loop query result;
[0045] If not, a loop query is performed on the basic dependency information table based on the last loop query result until the updated loop number is less than the preset value, and all loop query results are used as the target loop query results.
[0046] In a possible embodiment, the loop query module is further used for:
[0047] Store the query results of the previous loop in a temporary table;
[0048] Based on the Mth loop query result in the temporary table, the basic dependency information table is cyclically queried to obtain the M+1th loop query result; wherein M is an integer greater than 0;
[0049] The temporary table is updated based on the M+1th loop query result until the updated loop number is less than the preset value, and all loop query results are used as the target loop query results.
[0050] In a possible embodiment, the loop query module is further used for:
[0051] When the query result of the M+1th loop is a null value, the temporary table is not updated.
[0052] In a possible embodiment, the device further includes:
[0053] A storage module is used to store the target query result or the target loop query result into a result table according to preset rules, wherein the field information of the result table includes at least a job identifier, a target job identifier and a level, the target query result belongs to the first level, and the result of the Mth loop query in the target loop query result belongs to the Mth level.
[0054] In a third aspect, the present application provides an electronic device, including:
[0055] A memory for storing program instructions;
[0056] The processor is used to call the program instructions stored in the memory, and execute any one of the methods in the first aspect according to the obtained program instructions.
[0057] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes any one of the methods described in the first aspect.
[0058] In a fifth aspect, the present application provides a computer program product, comprising: a computer program code, when the computer program code is run on a computer, the computer executes any one of the methods described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 A flowchart of a method for querying job dependencies provided in an embodiment of the present application;
[0060] Figure 2 A schematic diagram of the structure of a job dependency query device provided in an embodiment of the present application;
[0061] Figure 3 A schematic diagram of the structure of another job dependency query device provided in an embodiment of the present application;
[0062] Figure 4 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.
[0064] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.
[0065] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0066] In the technical solution of this application, the acquisition, transmission, storage, and use of data are in compliance with the requirements of relevant national laws and regulations.
[0067] Before introducing the job dependency query method provided in the embodiment of the present application, for ease of understanding, the technical background of the embodiment of the present application is first introduced in detail below.
[0068] When a job in the Luban Scheduling Platform changes, it is necessary to query all jobs that have a dependency relationship with a job from the database of the Luban Scheduling Platform. First, the first directly dependent job corresponding to the job is queried in the database, and then the second directly dependent job corresponding to the first directly dependent job is queried in the database, and so on, until the directly dependent job corresponding to the current directly dependent job cannot be queried from the database. However, this method of querying job dependencies will unconditionally access the database multiple times in serial, which will cause a large delay when multiple jobs are changed, resulting in low query efficiency.
[0069] In order to solve the above problems, the embodiments of the present application provide a method, device, equipment and medium for querying job dependencies, by importing the dependency relationship between the job identifier, the target job identifier, and the job identifier and the target job identifier into the basic dependency information table, so that when a query request is received, the basic dependency information table is queried according to the job identifier in the query request, without the need to compare one by one in the database, thereby improving the query efficiency. At the same time, based on the number of loops in the query request, it is determined whether it is necessary to perform a loop query on the basic dependency information table based on the job identifier, thereby avoiding unconditional multiple accesses to the basic dependency information table, further improving the query efficiency. Among them, the method and device described in the embodiments of the present application are based on the same technical concept. Since the principles of the problems solved by the method and the device are similar, the embodiments of the device and the method can refer to each other, and the repeated parts will not be repeated.
[0070] To further illustrate the technical solution provided by the embodiment of the present application, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present application provides the method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiment of the present application. The method may be executed or executed in parallel in the actual processing process or when the device is executed in accordance with the method sequence shown in the embodiment or drawings.
[0071] Figure 1 The flowchart of a method for querying job dependencies provided by an embodiment of the present application is shown in FIG. The flowchart can be executed by a job dependency query device, which can be implemented by software or by a combination of software and hardware. Figure 1 As shown, the process includes the following steps:
[0072] 101: In response to receiving a query request, a job identifier and a cycle number are parsed from the query request.
[0073] In the embodiment of the present application, in order to facilitate query, a basic dependency information table is established in the database, and all dependency information of the job is exported in the Luban scheduling platform, and imported according to the format of the basic dependency information table. Among them, the basic dependency information table at least includes the job identification, the target job identification, and the dependency relationship between the job identification and the target job identification. Therefore, the field information of the basic dependency information table should at least include the job identification and the target job identification.
[0074] Optionally, the job identifier includes at least the job name and the job flow name, and the target job identifier includes at least the target job name and the target job flow name, so as to facilitate accurate query of the target job identifier corresponding to the job identifier. At the same time, the imported job identifier and the target job identifier are unified format data, for example, the job identifier and the target job identifier are both character data, and are both uppercase. As shown in Table 1, a basic dependency information table provided for an embodiment of the present application is:
[0075]
[0076]
[0077] Table 1 A basic dependency information table
[0078] In Table 1, there is a direct dependency relationship between the job name, the job flow name, the target job name, and the target job flow name.
[0079] It should be noted that the above identification may further include a job number, a server identification, etc. The specific identification depends on the situation and is not limited here. In addition, developers can also correct errors in the basic dependency information table at any time by checking the basic dependency information table. Developers can also add new job data to the basic dependency information table at any time. Therefore, the basic dependency information table greatly improves the convenience of developers to modify and add data.
[0080] 102: When the number of cycles is equal to a preset value, the basic dependency information table is queried based on the job identifier to obtain a target query result.
[0081] In the embodiment of the present application, the preset value is 1. When the number of cycles is equal to 1, the basic dependency information table is queried based on the job identifier to obtain the target query result. The specific query method may be:
[0082] Based on the job identifier, the target job identifier that is directly dependent on the job identifier is queried in the basic dependency information table, and the job identifier is associated with the target job identifier to obtain a target query result.
[0083] For example, as shown in Table 1, the job identifier is job 1, job flow A. Based on job 1, job flow A, the target job identifiers that are directly dependent on it are queried in the basic dependency information table as job 2, job flow A and job 3, job flow B. The target query results obtained include: (job 1, job flow A corresponds to job 2, job flow A) and (job 1, job flow A corresponds to job 3, job flow B).
[0084] 103: When the number of loops is greater than a preset value, a loop query is performed on the basic dependency information table based on the job identifier to obtain a target loop query result.
[0085] In the embodiment of the present application, the specific loop query method may be:
[0086] A loop query is performed on the basic dependency information table based on the job identifier to obtain a loop query result, and the loop count is updated (for example, the loop count is reduced by 1) to obtain an updated loop count.
[0087] Determine whether the updated number of loops is equal to the preset value; if so, perform a loop query on the basic dependency information table based on the result of the previous loop query to obtain the current loop query result, and use the current loop query result and the loop query result before the current loop query result as the target loop query result; if not, perform a loop query on the basic dependency information table based on the result of the previous loop query until the updated number of loops is less than the preset value, and use all loop query results as the target loop query results.
[0088] In a possible embodiment, the method for performing a loop query on the basic dependency information table based on the last loop query result may specifically be:
[0089] The last loop query result is stored in a temporary table. Then, based on the Mth loop query result in the temporary table, a loop query is performed on the basic dependency information table to obtain the M+1th loop query result; where M is an integer greater than 0. At the same time, the temporary table is updated based on the M+1th loop query result until the updated loop number is less than the preset value, and all loop query results are used as the target loop query results.
[0090] For example, the updated number of loops is 2. In the temporary table, the last loop query result includes target job identifier 1: job 2, job flow A, and target job identifier 2: job 3, job flow B. Use job 2, job flow A and job 3, job flow B as query conditions, perform loop query on the basic dependency information table, and get the current loop query result: (job 2, job flow A corresponds to job 4, job flow B), (job 3, job flow B corresponds to job 5, job flow C). At this time, job 2 and job flow A in the temporary table are updated to job 4, job flow B, and job 3 and job flow B in the temporary table are updated to job 5, job flow C. At the same time, the updated number of loops is 1.
[0091] If the updated number of loops is equal to the preset value 1, then Job 4, Job Flow B and Job 5, Job Flow C in the temporary table are used as query conditions, and the basic dependency information table is cyclically queried to obtain the current cyclic query results: (Job 4, Job Flow B corresponds to Job 6, Job Flow C), (Job 5, Job Flow C corresponds to Job 7, Job Flow D). At this time, Job 4, Job Flow B in the temporary table is updated to Job 6, Job Flow C, and Job 5, Job Flow C in the temporary table is updated to Job 7, Job Flow D. At the same time, the updated number of loops is 0. Since the updated number of loops is less than 1, the cyclic query is stopped, and all cyclic query results are used as the target cyclic query results.
[0092] In a possible embodiment, when the temporary table is updated based on the M+1th loop query result, if the M+1th loop query result is a null value, the temporary table is not updated. At this time, if the updated number of loops is greater than or equal to the preset value, the basic dependency information table is cyclically queried again based on the Mth loop query result to obtain the M+2th loop query result, thereby avoiding the situation of missing queries.
[0093] Optionally, if the query result of the M+2th loop is still null, the temporary table is updated with the query result of the M+2th loop, thereby avoiding multiple queries.
[0094] After obtaining the target query result or the target loop query result through the above method, the target query result or the target loop query result is stored in the result table according to the preset rules, wherein the field information of the result table includes at least the job identifier, the target job identifier and the level, the target query result belongs to the first level, and the result of the Mth loop query in the target loop query result belongs to the Mth level, so that the user can view it. As shown in Table 2, a result table provided in an embodiment of the present application is:
[0095]
[0096] Table 2 A result table
[0097] It should be noted that before executing the next query request for job dependencies, the above result table needs to be cleared to reduce the storage pressure of the result table.
[0098] Through the above method, the job identifier, the target job identifier, and the dependency relationship between the job identifier and the target job identifier are imported into the basic dependency information table, so that when a query request is received, the basic dependency information table is queried according to the job identifier in the query request, without the need to compare one by one in the database, thereby improving the query efficiency. At the same time, based on the number of loops in the query request, it is determined whether it is necessary to perform a loop query on the basic dependency information table based on the job identifier, thereby avoiding unconditional multiple accesses to the basic dependency information table, further improving the query efficiency.
[0099] Based on the same inventive concept, an embodiment of the present application provides a job dependency query device, which can implement the process of the above-mentioned job dependency query method in the embodiment of the present application.
[0100] Figure 2 A schematic diagram of a job dependency query device provided in an embodiment of the present application is shown in the figure. The device includes:
[0101] The parsing module 201 is used for parsing the job identifier and the number of cycles from the query request in response to receiving the query request;
[0102] A query module 202 is used to query the basic dependency information table based on the job identifier to obtain a target query result when the number of cycles is equal to a preset value; wherein the basic dependency information table at least includes the job identifier, the target job identifier, and the dependency relationship between the job identifier and the target job identifier;
[0103] The loop query module 203 is used to perform a loop query on the basic dependency information table based on the job identifier to obtain a target loop query result when the number of loops is greater than a preset value.
[0104] In a possible embodiment, the job identifier at least includes a job name and a job flow name, the target job identifier at least includes a target job name and a target job flow name, and the job identifier and the target job identifier are unified format data.
[0105] In a possible embodiment, the query module 202 is specifically used for:
[0106] Based on the job identifier, query the target job identifier that is directly dependent on the job identifier in the basic dependency information table;
[0107] The job ID is associated with the target job ID to obtain the target query result.
[0108] In a possible embodiment, the loop query module 203 is specifically used for:
[0109] Perform a loop query on the basic dependency information table based on the job identifier to obtain a loop query result, and update the loop count to obtain an updated loop count;
[0110] Determine whether the updated number of cycles is equal to the preset value;
[0111] If yes, then perform a loop query on the basic dependency information table based on the previous loop query result to obtain the current loop query result, and use the current loop query result and the loop query result before the current loop query result as the target loop query result;
[0112] If not, a loop query is performed on the basic dependency information table based on the last loop query result until the updated loop number is less than a preset value, and all loop query results are used as target loop query results.
[0113] In a possible embodiment, the cyclic query module 203 is further used for:
[0114] Store the query results of the previous loop in a temporary table;
[0115] Based on the Mth loop query result in the temporary table, a loop query is performed on the basic dependency information table to obtain the M+1th loop query result; wherein M is an integer greater than 0;
[0116] The temporary table is updated based on the M+1th loop query result until the updated loop number is less than a preset value, and all loop query results are used as target loop query results.
[0117] In a possible embodiment, the cyclic query module 203 is further used for:
[0118] When the query result in the M+1th loop is null, the temporary table is not updated.
[0119] In other embodiments, in addition to the above Figure 2 In addition to the modules shown in FIG. 1 , a storage module may be further included, such as Figure 3 , which is a schematic diagram of another job dependency query device provided by an embodiment of the present application. The device comprises: a parsing module 201 , a query module 202 , a loop query module 203 and a storage module 301 .
[0120] The storage module 301 is used to store the target query result or the target loop query result into a result table according to preset rules, wherein the field information of the result table includes at least a job identifier, a target job identifier and a level, the target query result belongs to the first level, and the result of the Mth loop query in the target loop query result belongs to the Mth level.
[0121] It should be noted here that the above-mentioned device provided in the embodiment of the present application can implement all the method steps in the above-mentioned job dependency query embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.
[0122] Based on the same inventive concept, an embodiment of the present application provides an electronic device, which can implement the functions of the aforementioned job dependency query device, referring to Figure 4 , the electronic device comprises:
[0123] At least one processor 401, and a memory 402 connected to the at least one processor 401. The specific connection medium between the processor 401 and the memory 402 is not limited in the embodiment of the present application. Figure 4 In the example, the processor 401 and the memory 402 are connected via the bus 400. The bus 400 is Figure 4 The connection between other components is shown by bold lines, and is not intended to be limiting. The bus 400 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 401 can also be called a controller, and there is no limitation on the name.
[0124] In the embodiment of the present application, the memory 402 stores instructions that can be executed by at least one processor 401. The at least one processor 401 can execute a method for querying job dependencies discussed above by executing the instructions stored in the memory 402. The processor 401 can implement Figure 2 Or the functions of each module in the device shown in 3.
[0125] Among them, the processor 401 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 402 and calling the data stored in the memory 402, the various functions of the device and process data, the device can be monitored as a whole.
[0126] In one possible design, the processor 401 may include one or more processing units, and the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a driver interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 401. In some embodiments, the processor 401 and the memory 402 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.
[0127] Processor 401 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of a method for querying job dependencies disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0128] The memory 402 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 402 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 402 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 402 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0129] By programming the processor 401, the code corresponding to the method for querying the job dependency relationship described in the above embodiment can be fixed into the chip, so that the chip can execute the code when running. Figure 1 The embodiment shown is a method for querying job dependency. How to design and program the processor 401 is a technique known to those skilled in the art and will not be described in detail here.
[0130] It should be noted here that the above-mentioned electronic device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.
[0131] It should be noted here that the above-mentioned electronic device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.
[0132] Based on the same inventive concept, the embodiment of the present application provides a computer-readable storage medium, and the computer program product includes: computer program code, when the computer program code is executed on a computer, the computer executes any of the job dependency query methods discussed above. Since the principle of solving the problem by the above-mentioned computer-readable storage medium is similar to that of the job dependency query method, the implementation of the above-mentioned computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.
[0133] Based on the same inventive concept, the embodiment of the present application also provides a computer program product, which includes: computer program code, when the computer program code is executed on a computer, the computer executes any of the job dependency query methods discussed above. Since the principle of solving the problem by the above computer program product is similar to that of the job dependency query method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.
[0134] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0135] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0136] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0137] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of user-operated steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0138] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for querying job dependency, characterized in that: The method comprises: In response to receiving the query request, parsing the job identifier and the number of cycles from the query request; When the number of cycles is equal to a preset value, a basic dependency information table is queried based on the job identifier to obtain a target query result; wherein the basic dependency information table includes at least a job identifier, a target job identifier, and a dependency relationship between the job identifier and the target job identifier; When the number of cycles is greater than a preset value, a loop query is performed on the basic dependency information table based on the job identifier to obtain a target loop query result.
2. The method according to claim 1, characterized in that The job identifier at least includes a job name and a job flow name, and the target job identifier at least includes a target job name and a target job flow name. The job identifier and the target job identifier are unified format data.
3. The method according to claim 1, characterized in that The querying of the basic dependency information table based on the job identifier to obtain a target query result includes: Based on the job identifier, query the basic dependency information table to find the target job identifier that is directly dependent on the job identifier; The job identifier is associated with the target job identifier to obtain the target query result.
4. The method according to claim 1, characterized in that The loop querying the basic dependency information table based on the job identifier to obtain a target loop query result includes: Performing a loop query on the basic dependency information table based on the job identifier to obtain a loop query result, and updating the loop count to obtain an updated loop count; Determine whether the updated number of cycles is equal to the preset value; If yes, then perform a loop query on the basic dependency information table based on the previous loop query result to obtain a current loop query result, and use the current loop query result and the loop query result before the current loop query result as the target loop query result; If not, a loop query is performed on the basic dependency information table based on the last loop query result until the updated loop number is less than the preset value, and all loop query results are used as the target loop query results.
5. The method according to claim 4, characterized in that The step of performing a loop query on the basic dependency information table based on the last loop query result until the updated loop number is less than the preset value, and taking all loop query results as the target loop query result, includes: Store the query results of the previous loop in a temporary table; Based on the Mth loop query result in the temporary table, the basic dependency information table is cyclically queried to obtain the M+1th loop query result; wherein M is an integer greater than 0; The temporary table is updated based on the M+1th loop query result until the updated loop number is less than the preset value, and all loop query results are used as the target loop query results.
6. The method according to claim 5, characterized in that The updating of the temporary table based on the M+1th loop query result also includes: When the query result of the M+1th loop is a null value, the temporary table is not updated.
7. The method according to claim 1, characterized in that The method further comprises: The target query result or the target loop query result is stored in a result table according to preset rules, wherein the field information of the result table includes at least a job identifier, a target job identifier and a level, the target query result belongs to the first level, and the result of the Mth loop query in the target loop query result belongs to the Mth level.
8. A job dependency query device, characterized in that: The device comprises: A parsing module, configured to parse the job identifier and the number of cycles from the query request in response to receiving the query request; A query module, used for querying the basic dependency information table based on the job identifier to obtain a target query result when the number of cycles is equal to a preset value; wherein the basic dependency information table at least includes a job identifier, a target job identifier, and a dependency relationship between the job identifier and the target job identifier; A loop query module is used to perform a loop query on the basic dependency information table based on the job identifier when the number of loops is greater than a preset value to obtain a target loop query result.
9. The device according to claim 8, characterized in that The job identifier at least includes a job name and a job flow name, and the target job identifier at least includes a target job name and a target job flow name. The job identifier and the target job identifier are unified format data.
10. The device according to claim 8, characterized in that The query module is specifically used for: Based on the job identifier, query the basic dependency information table to find the target job identifier that is directly dependent on the job identifier; The job identifier is associated with the target job identifier to obtain the target query result.
11. The device according to claim 8, characterized in that The loop query module is specifically used for: Performing a loop query on the basic dependency information table based on the job identifier to obtain a loop query result, and updating the loop count to obtain an updated loop count; Determine whether the updated number of cycles is equal to the preset value; If yes, then perform a loop query on the basic dependency information table based on the previous loop query result to obtain a current loop query result, and use the current loop query result and the loop query result before the current loop query result as the target loop query result; If not, a loop query is performed on the basic dependency information table based on the last loop query result until the updated loop number is less than the preset value, and all loop query results are used as the target loop query results.
12. The device according to claim 11, characterized in that The loop query module is also used for: Store the query results of the previous loop in a temporary table; Based on the Mth loop query result in the temporary table, the basic dependency information table is cyclically queried to obtain the M+1th loop query result; wherein M is an integer greater than 0; The temporary table is updated based on the M+1th loop query result until the updated loop number is less than the preset value, and all loop query results are used as the target loop query results.
13. The device according to claim 12, characterized in that The loop query module is also used for: When the query result of the M+1th loop is a null value, the temporary table is not updated.
14. The device according to claim 8, characterized in that The device also includes: A storage module is used to store the target query result or the target loop query result into a result table according to preset rules, wherein the field information of the result table includes at least a job identifier, a target job identifier and a level, the target query result belongs to the first level, and the result of the Mth loop query in the target loop query result belongs to the Mth level.
15. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 7 according to the obtained program instructions.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 7.
17. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Batch job dependency analysis method and device
CN111949832A
Data blood relationship analysis method and device
CN115062049A
Segmentation of interleaved query missions into query chains
US20100161643A1
