CN112650569A - Timed task relation network graph generation method based on Oracle code and related equipment - Google Patents

Timed task relation network graph generation method based on Oracle code and related equipment Download PDF

Info

Publication number
CN112650569A
CN112650569A CN202011532336.4A CN202011532336A CN112650569A CN 112650569 A CN112650569 A CN 112650569A CN 202011532336 A CN202011532336 A CN 202011532336A CN 112650569 A CN112650569 A CN 112650569A
Authority
CN
China
Prior art keywords
timing
oracle
task
timing task
network graph
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011532336.4A
Other languages
Chinese (zh)
Inventor
童显耀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011532336.4A priority Critical patent/CN112650569A/en
Publication of CN112650569A publication Critical patent/CN112650569A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • G06F9/4825Interrupt from clock, e.g. time of day
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/26Visual data mining; Browsing structured data

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The method comprises the steps of generating a request for accessing an Oracle database according to a timing task relational network, and reading an Oracle script code in the Oracle database; analyzing the Oracle script code to obtain a plurality of timing tasks and data table information corresponding to the timing tasks; and obtaining the dependency relationship of each timing task according to the data table information, generating a dependency relationship table according to the dependency relationship, generating directed graphs of a plurality of timing tasks based on the table structure of the dependency relationship table, and generating a timing task relationship network graph according to the directed graphs. The application also relates to a block chain technology, and data determined as privacy information in the data table information can be stored in the block chain. The method and the device can automatically generate the dependent path of each timing task based on the codes in the Oracle database to form a graphical timing task relationship network diagram.

Description

Timed task relation network graph generation method based on Oracle code and related equipment
Technical Field
The application relates to the technical field of big data, in particular to a method and a device for generating a timing task relationship network graph based on an Oracle code, computer equipment and a storage medium.
Background
At present, a database task scheduling tool on the market needs to manually set the sequence and the dependency relationship among timing tasks in advance, if the dependency relationship is complex, the timing tasks refer to a plurality of intermediate tables, errors are easy to occur due to manual setting, the set dependency relationship among the timing tasks cannot be verified and checked, and how to effectively obtain the dependency relationship among the timing tasks and show the dependency relationship becomes a technical problem to be solved urgently.
Disclosure of Invention
The embodiment of the application aims to provide a method and a device for generating a timing task relationship network diagram based on an Oracle code, a computer device and a storage medium, so as to solve the problem that the dependency relationship between set timing tasks cannot be verified and checked in the prior art, so that the dependency relationship of the timing tasks cannot be effectively obtained and displayed.
In order to solve the above technical problem, an embodiment of the present application provides a method for generating a timed task relationship network graph based on an Oracle code, and adopts the following technical solutions:
a method for generating a timed task relationship network graph based on Oracle codes comprises the following steps:
receiving a timed task relational network generation request, accessing an Oracle database according to the timed task relational network generation request, and reading an Oracle script code in the Oracle database;
analyzing the Oracle script code to obtain a plurality of timing tasks and data table information corresponding to the timing tasks;
and obtaining the dependency relationship of each timing task according to the data table information of each timing task, generating a dependency relationship table according to the dependency relationship, generating directed graphs of a plurality of timing tasks based on the table structure of the dependency relationship table, and generating a timing task relationship network graph according to the directed graphs, so that a target object end can execute target operation according to the timing task relationship network graph after receiving the timing task relationship network graph.
In order to solve the above technical problem, an embodiment of the present application further provides a device for generating a timed task relationship network graph based on Oracle code, and the following technical solutions are adopted:
an apparatus for generating a timed task relationship network graph based on Oracle code, comprising:
the code acquisition module is used for receiving a timed task relational network generation request, accessing an Oracle database according to the timed task relational network generation request and reading an Oracle script code in the Oracle database;
the analysis module is used for analyzing the Oracle script code to obtain a plurality of timing tasks and data table information corresponding to the timing tasks;
and the network graph generating module is used for obtaining the dependency relationship of each timing task according to the data table information of each timing task, generating a dependency relationship table according to the dependency relationship, generating directed graphs of a plurality of timing tasks based on the table structure of the dependency relationship table, and generating a timing task relationship network graph according to the directed graphs, so that a target object end can execute target operation according to the timing task relationship network graph after receiving the timing task relationship network graph.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
a computer device comprising a memory and a processor, wherein the memory stores computer readable instructions, and the processor implements the steps of the method for generating a timed task relationship network graph based on Oracle code when executing the computer readable instructions.
In order to solve the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
a computer readable storage medium having computer readable instructions stored thereon which, when executed by a processor, implement the steps of the Oracle code-based timed task relationship network graph generation method as described above.
Compared with the prior art, the method, the device, the computer equipment and the storage medium for generating the timed task relationship network graph based on the Oracle code have the following advantages that:
the method analyzes the data table information of each timing task based on the analysis result of the codes in the Oracle database, then matches the data table information, automatically generates the dependency path of each timing task, forms a graphical timing task relation network diagram, intuitively and efficiently reflects the network topology structure of the dependency relationship of the whole timing task, has high efficiency of the generation process and high accuracy, can provide the timing task with the reference before running, monitor in running and assist in the whole flow of analysis after running, and ensures the accuracy and reliability of the running of the timing task.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for the description of the embodiments of the present application will be briefly described below, and the drawings in the following description correspond to some embodiments of the present application, and it will be obvious to those skilled in the art that other drawings can be obtained from the drawings without inventive effort.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for timed task relationship network graph generation based on Oracle code according to the present application;
FIG. 3 is a schematic diagram illustrating an embodiment of a device for generating a network graph of timed task relationships based on Oracle code according to the present application;
FIG. 4 is a schematic block diagram of one embodiment of a computer device according to the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and in the claims of the present application or in the drawings described above, are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that the method for generating a timed task relationship network graph based on Oracle code provided in the embodiments of the present application is generally executed by a server, and accordingly, the apparatus for generating a timed task relationship network graph based on Oracle code is generally disposed in a server.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continuing reference to FIG. 2, a flowchart of one embodiment of a method for Oracle code based timed task relationship network graph generation in accordance with the present application is shown. The method for generating the timed task relationship network graph based on the Oracle code comprises the following steps:
s201, receiving a timed task relational network generation request, accessing an Oracle database according to the timed task relational network generation request, and reading an Oracle script code in the Oracle database;
s202, analyzing the Oracle script code to obtain a plurality of timing tasks and data table information corresponding to the timing tasks;
s203, obtaining the dependency relationship of each timing task according to the data table information of each timing task, generating a dependency relationship table according to the dependency relationship, generating directed graphs of a plurality of timing tasks based on the table structure of the dependency relationship table, and generating a timing task relationship network graph according to the directed graphs, so that a target object end can execute target operation according to the timing task relationship network graph after receiving the timing task relationship network graph.
The above steps are explained in the following.
For step S201, before the Oracle script code is executed, a target object side initiates a timed task relationship network generation request to the server system or the server system automatically triggers the timed task relationship network generation request at a fixed time, the task relationship network generation request includes information of the Oracle database to be accessed and information of a storage path of the Oracle script code in the Oracle database, and the Oracle database can be accessed and the Oracle script code therein can be read through the information.
For step S202, the present embodiment parses the Oracle script code including determining the timed task in the Oracle script and then identifying the spreadsheet information associated with the timed task. In some embodiments, the parsing the Oracle script code to obtain a plurality of timing tasks, and the step of obtaining the data table information corresponding to the plurality of timing tasks includes:
searching a timing task identifier in the Oracle script code, acquiring timing task scheduling information of Oracle from the Oracle database, and determining the number of timing tasks in the Oracle script code according to the timing task scheduling information; when the number of the timing tasks reaches a preset value, determining a plurality of timing task identifiers used as segmentation points according to the number of the timing tasks, segmenting the Oracle script code based on the segmentation points to obtain a plurality of code segments, and generating a plurality of analysis tasks corresponding to the number of the code segments after the Oracle script code is segmented; and simultaneously executing the plurality of analysis tasks to obtain a plurality of timing tasks and data table information corresponding to the plurality of timing tasks.
Specifically, the timed task identifier in this embodiment is specifically a task start-stop identifier, and may include a task start time identifier and a task end time identifier, the timed task scheduling information of Oracle is stored in an Oracle management view DBA _ job bs, and the Oracle management view DBA _ job bs may be stored in the Oracle database, so that the number of current timed tasks may be checked.
In the embodiment, a plurality of timing task identifiers used as segmentation points are obtained by performing equal segmentation according to the number of the timing tasks, so that the Oracle script code is subjected to equal segmentation to obtain at least two code segments, and therefore concurrent analysis can be performed, the analysis speed is increased, and the efficiency of obtaining a timing task relationship network graph is improved.
In this embodiment, the data table information includes an input data table and an output data table, and the process of executing the analysis task to obtain the input data table and the output data table of the timing task includes identifying, in the Oracle script code or code fragment, a position of a database table associated with the timing task in the Oracle script code or code fragment and a keyword of a context of the database table, and determining, based on the keyword, whether the database table associated with the timing task is the input data table or the output data table. Therefore, a plurality of timing tasks and corresponding input data table information and output data table information can be obtained, wherein the position of the database table is determined by searching the table name of the database table in the Oracle script code, and the keywords comprise output keywords and input keywords which are respectively used for determining the database table as the output data table and the input data table, the output keywords in the embodiment can be INSERT, UPDATE, DELETE, MERGE and the like, and the input keywords can comprise SLECT and the like.
In some embodiments, before the partitioning the Oracle script code into a plurality of code fragments based on the partitioning point, the method further includes: the method comprises the steps of obtaining system available resources, determining whether to segment the Oracle script codes according to whether the system available resources meet a preset threshold value, determining the number of segments of the codes according to the system available resources when determining the segments, adjusting segmentation points according to the number of the segments of the codes, and segmenting the Oracle script codes according to the adjusted segmentation points. It should be noted that, if the number of code segments obtained from the original segmentation point is the same as the number of code segments determined according to the available resources of the system, the segmentation point is not adjusted. And after the adjustment of the segmentation points is finished, subsequently executing the segmentation operation on the Oracle script codes according to the adjusted segmentation points.
And if the situation that the Oracle script codes are not cut is determined according to the available resources of the system, subsequently canceling the operation of cutting the Oracle script codes, generating a single analysis task aiming at all the Oracle script codes, monitoring the change of the available resources of the system in real time in the analysis process, suspending the current single analysis task when the available resources of the system meet a preset threshold value, cutting the remaining unanalyzed Oracle script codes, and then correspondingly generating a plurality of analysis tasks for concurrent analysis, thereby improving the analysis speed.
For step S203, in this embodiment, the data table information includes an input data table and an output data table, and the dependency relationship of each timing task obtained from the data table information of each timing task can be matched according to the table names of the input data table and the output data table, if the table name of the output data table of timing task a is T1, and the table name of the input data table of timing task B is also T1, then timing task B is started after timing task B, that is, timing task B depends on timing task a.
In this embodiment, the dependency relationship table adopts a table structure composed of two table fields of a timing task name and a dependency task name, all timing tasks with dependency relationships and dependency objects thereof are table-filled according to the table structure, a final dependency relationship table is obtained, when a directed graph of a plurality of timing tasks is generated according to the table structure of the dependency relationship table, the directed graph is specifically generated for the two timing tasks with dependency relationships, the two timing tasks are taken as nodes of the directed graph, the depended timing task node points to the depended timing task node, for example, the timing task B depends on the timing task a, and when the directed graph is constructed, the node of the timing task a points to the node of the timing task B.
After the directed graphs are constructed, nodes of the same timing task in each directed graph are merged to obtain a timing task relation network graph, the timing task relation network graph is visual and easy to understand and can be generated and sent to a target object side, the target object side can be a terminal where developers or maintainers are located, and the target object side can execute target operations such as trial calculation inspection, complex dependency checking, timing task operation progress monitoring, dependency optimization and the like based on the timing task relation network graph.
In the embodiment, before the timing task system is on line, the system can automatically calculate the timing task relationship network diagram, so that developers can check the dependency relationship of the timing task, check the dependency timing task with a complex relationship, and improve the accuracy of the system on line.
Specifically, in some embodiments, after the step of parsing the Oracle script code to obtain a plurality of timing tasks and data table information corresponding to the plurality of timing tasks, the method further includes: judging whether the data tables of the timing tasks are missing or not, if so, identifying the timing task nodes with the missing data tables in the generated timing task relationship network graph, outputting prompt information for adjusting the Oracle script codes, after the Oracle script codes are adjusted, re-triggering the step of analyzing the Oracle script codes to obtain a plurality of timing tasks and data table information corresponding to the timing tasks, and re-acquiring the dependency relationship; wherein the data table loss of the timed task comprises an input data table loss and/or an output data table loss. Thereby realizing the screening of the abnormal timing task before the Oracle script code is executed.
In some embodiments, there is a case of a dependency relationship anomaly, and specifically, after the step of generating a timing task relationship network graph according to the directed graph, the method further includes: and trial calculation is carried out on the timing task relation network graph, when the trial calculation determines that the timing task relation network graph has the condition that two timing tasks are mutually dependent, the timing task is judged to be abnormal in dependence, prompt information for adjusting the timing task dependence relation is output, and the timing task relation network graph is regenerated according to the adjusted dependence relation. Therefore, the method realizes the screening of abnormal dependency relationship of the timed task before the Oracle script code is executed.
In some embodiments, when the timed task runs, the running state of each timed task may be monitored based on the timed task relationship network graph, specifically, after the step of generating the timed task relationship network graph according to the directed graph, the method further includes: and when each timing task runs, acquiring the running state of each timing task from the target object end in real time, taking the timing task relation network graph as a picture base layer, identifying the running state of each timing task in the timing task relation network graph in a target mode, generating a second timing task relation network graph and outputting the second timing task relation network graph to the target object end. The running state of the timing task can be running, correct running ending, running abnormity and the like, and the target mode can be one or more of color identification, character identification, image identification and the like.
Further, for the timing task with abnormal operation, the influence range can be displayed in the timing task relation network diagram. Specifically, after the step of acquiring the running state of each timing task from the target object side in real time, the method further includes: when the running state of any timing task obtained from the target object terminal in real time is abnormal, determining other timing tasks influenced by the abnormal running timing task according to the dependency relationship table, taking the timing task relationship network graph as a picture base layer, identifying the abnormal running timing task and nodes corresponding to the influenced timing tasks on the timing task relationship network graph in a target mode, generating a third timing task relationship network graph and outputting the third timing task relationship network graph to the target object terminal. Therefore, the influence range of the abnormally-operated timing task can be visually displayed, and the abnormal-operation timing task is convenient to quickly start and operate again.
In some embodiments, parsing the Oracle script code further includes identifying periodically executed timed tasks, obtaining non-periodically executed timed tasks that are relied upon by the periodically executed timed tasks, and generating a time-based network graph timed task relationship network graph based on the dependencies between the periodically executed timed tasks and the dependencies of the periodically executed timed tasks and the obtained non-periodically executed timed tasks. Facilitating management of time-based timed tasks.
In some embodiments, the timing task relational network generation request may further include generation configuration information of a timing task relational network graph, and when the timing task relational network graph is generated according to a directed graph, timing task relational network graphs in different presentation forms, such as a network topology graph, a chain graph, a tree graph, and the like, may be generated based on the generation configuration information.
In some embodiments, the method further comprises: monitoring the update state of an Oracle script code in an Oracle database in real time, wherein the update state comprises modification, addition or deletion of the Oracle script code; and carrying out local analysis on the updated part of the Oracle script code, updating the dependency relationship table based on the local analysis result, and regenerating a new timing task relationship network diagram. Therefore, real-time updating of the timing task relation network graph can be realized.
The utility model provides a timing task relation network diagram generation method based on Oracle code, analysis is based on the analytic result to the code in the Oracle database, the data sheet information of every timing task, then data sheet information matches, the dependence route of every timing task of automatic generation, form graphical timing task relation network diagram, the network topology structure of whole timing task dependence of high efficiency reflection directly perceived, the generation process is efficient, and the degree of accuracy is high, can provide the timing task and move the preceding reference, the control in operation, the full flow of analysis provides the assistance after the operation, guarantee the accuracy and the reliability of timing task operation.
It should be emphasized that, in order to further ensure the privacy and security of information, after the Oracle script code is parsed to obtain a plurality of timing tasks and data table information corresponding to the timing tasks, data determined as privacy information in the data table information may also be stored in a node of a block chain.
The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware associated with computer readable instructions, which can be stored in a computer readable storage medium, and when executed, the processes of the embodiments of the methods described above can be included. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a device for generating a timed task relationship network graph based on Oracle code, where the embodiment of the device corresponds to the embodiment of the method shown in fig. 2, and the device may be specifically applied to various electronic devices.
As shown in fig. 3, the apparatus for generating a timed task relationship network graph based on Oracle code according to this embodiment includes: a code acquisition module 301, an analysis module 302 and a network map generation module 303. The code acquisition module is used for receiving a timing task relational network generation request, accessing an Oracle database according to the timing task relational network generation request and reading an Oracle script code in the Oracle database; the analysis module is used for analyzing the Oracle script code to obtain a plurality of timing tasks and data table information corresponding to the timing tasks; the network graph generating module is used for obtaining the dependency relationship of each timing task according to the data table information of each timing task, generating a dependency relationship table according to the dependency relationship, generating directed graphs of a plurality of timing tasks based on the table structure of the dependency relationship table, and generating a timing task relationship network graph according to the directed graphs, so that a target object end can execute target operation according to the directed graphs after receiving the timing task relationship network graph.
In this embodiment, before the Oracle script code is executed, a target object side initiates a timed task relationship network generation request to the server system or the server system automatically triggers at regular time, the task relationship network generation request includes information of an Oracle database to be accessed and information of a storage path of the Oracle script code in the Oracle database, and the code acquisition module 301 can access the Oracle database and read the Oracle script code therein through the information.
The embodiment parsing module 302 parses the Oracle script code including determining a timed task in the Oracle script and then identifying the spreadsheet information associated with the timed task. In some embodiments, when the parsing module 302 parses the Oracle script code to obtain a plurality of timing tasks and data table information corresponding to the timing tasks, the parsing module is specifically configured to: searching a timing task identifier in the Oracle script code, acquiring timing task scheduling information of Oracle from the Oracle database, and determining the number of timing tasks in the Oracle script code according to the timing task scheduling information; when the number of the timing tasks reaches a preset value, determining a plurality of timing task identifiers used as segmentation points according to the number of the timing tasks, segmenting the Oracle script code based on the segmentation points to obtain a plurality of code segments, and generating a plurality of analysis tasks corresponding to the number of the code segments after the Oracle script code is segmented; and simultaneously executing the plurality of analysis tasks to obtain a plurality of timing tasks and data table information corresponding to the plurality of timing tasks.
Specifically, in this embodiment, the timed task identifier is specifically a task start-stop identifier, and may include a task start time identifier and a task end time identifier, and the timed task scheduling information of Oracle is stored in an Oracle management view DBA _ job bs, so that the number of current tasks may be checked.
In the embodiment, a plurality of timing task identifiers used as segmentation points are obtained by performing equal segmentation according to the number of the timing tasks, so that the Oracle script code is subjected to equal segmentation to obtain at least two code segments, and therefore concurrent analysis can be performed, the analysis speed is increased, and the efficiency of obtaining a timing task relationship network graph is improved.
In this embodiment, the data table information includes an input data table and an output data table, and the process of executing the analysis task to obtain the input data table and the output data table of the timing task includes identifying, in the Oracle script code or code fragment, a position of a database table associated with the timing task in the Oracle script code or code fragment and a keyword of a context of the database table, and determining, based on the keyword, whether the database table associated with the timing task is the input data table or the output data table. Therefore, a plurality of timing tasks and corresponding input data table information and output data table information can be obtained, wherein the position of the database table is determined by searching the table name of the database table in the Oracle script code, and the keywords comprise output keywords and input keywords which are respectively used for determining the database table as the output data table and the input data table, the output keywords in the embodiment can be INSERT, UPDATE, DELETE, MERGE and the like, and the input keywords can comprise SLECT and the like.
In some embodiments, before the parsing module 302 parses the Oracle script code into a plurality of code fragments based on a parsing point, the parsing module is further configured to: the method comprises the steps of obtaining system available resources, determining whether to segment the Oracle script codes according to whether the system available resources meet a preset threshold value, determining the number of segments of the codes according to the system available resources when determining the segments, adjusting segmentation points according to the number of the segments of the codes, and segmenting the Oracle script codes according to the adjusted segmentation points. It should be noted that, if the number of code segments obtained from the original segmentation point is the same as the number of code segments determined according to the available resources of the system, the segmentation point is not adjusted. And after the adjustment of the segmentation points is finished, subsequently executing the segmentation operation on the Oracle script codes according to the adjusted segmentation points.
If the Oracle script codes are determined not to be cut according to the available resources of the system, the subsequent analysis module 302 cancels the operation of cutting the Oracle script codes, only generates a single analysis task for all the Oracle script codes, monitors the change of the available resources of the system in real time in the analysis process, pauses the current single analysis task when the available resources of the system meet a preset threshold value, cuts the remaining unresolved Oracle script codes, generates a plurality of analysis tasks correspondingly and performs concurrent analysis, and improves the analysis speed.
In step S203, in this embodiment, the data table information includes an input data table and an output data table, and the network diagram generating module 303 obtains the dependency relationship of each timing task according to the data table information of each timing task, and may perform matching according to the table names of the input data table and the output data table, where if the table name of the output data table of timing task a is T1, and the table name of the input data table of timing task B is also T1, then the timing task B is started after the timing task B, that is, the timing task B depends on the timing task a.
In this embodiment, the dependency relationship table has a table structure formed by two table fields of a timing task name and a dependency task name, the network graph generation module 303 performs table filling on all timing tasks with dependency relationships and dependency objects thereof according to the table structure, so as to obtain a final dependency relationship table, when the network graph generation module 303 generates a directed graph of a plurality of timing tasks according to the table structure of the dependency relationship table, the directed graph is specifically generated for the two timing tasks with dependency relationships, the two timing tasks are taken as nodes of the directed graph, and the dependent timing task nodes are directed from the dependent timing task nodes, for example, the timing task B depends on the timing task a, and when the directed graph is constructed, the nodes of the timing task a are directed to the nodes of the timing task B.
After the directed graphs are constructed, the network graph generation module 303 merges nodes of the same timing task in each directed graph to obtain a timing task relationship network graph, the timing task relationship network graph is intuitive and easy to understand, and can be generated after generation, the timing task relationship network graph can be a target object end, the target object end can be a terminal where developers or maintainers are located, and the target object end can execute target operations such as trial calculation check, complex dependency relationship troubleshooting, timing task operation progress monitoring, dependency relationship optimization and the like based on the timing task relationship network graph.
In the embodiment, before the timing task system is on line, the system can automatically calculate the timing task relationship network diagram, so that developers can check the dependency relationship of the timing task, check the dependency timing task with a complex relationship, and improve the accuracy of the system on line.
In some embodiments, the network graph generating module 303, after parsing the Oracle script code to obtain a plurality of timing tasks and data table information corresponding to the plurality of timing tasks, is further configured to: judging whether the data tables of the timing tasks are missing or not, if so, identifying the timing task nodes with the missing data tables in the generated timing task relationship network graph, outputting prompt information for adjusting the Oracle script codes, and after the Oracle script codes are adjusted, re-triggering and analyzing the Oracle script codes to obtain a plurality of timing tasks and data table information corresponding to the timing tasks and re-acquiring the dependency relationship; wherein the data table loss of the timed task comprises an input data table loss and/or an output data table loss. Thereby realizing the screening of the abnormal timing task before the Oracle script code is executed.
In some embodiments, when there is a dependency relationship anomaly, specifically, after the step of generating the timing task relationship network graph according to the directed graph, the network graph generating module 303 is further configured to: and trial calculation is carried out on the timing task relation network graph, when the trial calculation determines that the timing task relation network graph has the condition that two timing tasks are mutually dependent, the timing task is judged to be abnormal in dependence, prompt information for adjusting the timing task dependence relation is output, and the timing task relation network graph is regenerated according to the adjusted dependence relation. Therefore, the method realizes the screening of abnormal dependency relationship of the timed task before the Oracle script code is executed.
In some embodiments, the apparatus for generating a timed task relationship network graph based on Oracle code further includes a monitoring module (not shown) configured to monitor an operation state of each timed task based on the timed task relationship network graph when the timed task is running, specifically, the monitoring module is configured to: and when each timing task runs, acquiring the running state of each timing task from the target object end in real time. The network diagram generating module 303 uses the timing task relationship network diagram as a picture base layer, identifies the running state of each timing task in the timing task relationship network diagram in a target manner, generates a second timing task relationship network diagram, and outputs the second timing task relationship network diagram to the target object terminal. The running state of the timing task can be running, correct running ending, running abnormity and the like, and the target mode can be one or more of color identification, character identification, image identification and the like.
In some embodiments, the monitoring module method is further configured to: monitoring the update state of an Oracle script code in an Oracle database in real time, wherein the update state comprises modification, addition or deletion of the Oracle script code; the analysis module 302 performs local analysis on the updated part of the Oracle script code, and the network diagram generation module 303 updates the dependency relationship table based on the local analysis result to regenerate a new timing task relationship network diagram. Therefore, real-time updating of the timing task relation network graph can be realized.
Further, for the timing task with abnormal operation, the influence range can be displayed in the timing task relation network diagram. Specifically, the network map generating module 303 is further configured to: when the analysis module 302 acquires that the running state of any timing task from the target object terminal is abnormal, determining other timing tasks affected by the abnormal running timing task according to the dependency relationship table, taking the timing task relationship network graph as a picture base layer, identifying the abnormal running timing task and nodes corresponding to the affected timing tasks on the timing task relationship network graph in a target manner, generating a third timing task relationship network graph, and outputting the third timing task relationship network graph to the target object terminal. Therefore, the influence range of the abnormally-operated timing task can be visually displayed, and the abnormal-operation timing task is convenient to quickly start and operate again.
In some embodiments, parsing module 302 further identifies periodically executed timing tasks, acquires non-periodically executed timing tasks depended on by the periodically executed timing tasks, and generates a time-based network graph timing task relationship network graph by network graph generating module 303 according to the dependency relationship between the periodically executed timing tasks and the acquired non-periodically executed timing tasks. Facilitating management of time-based timed tasks.
In some embodiments, the timing task relational network generation request may further include generation configuration information of a timing task relational network graph, and when the timing task relational network graph is generated according to the directed graph, the network graph generation module 303 may generate timing task relational network graphs in different presentation forms, such as a network topology graph, a chain graph, a tree graph, and the like, based on the generation configuration information.
The application provides a timing task relation network diagram generation device based on Oracle code, analysis goes out the data sheet information of every timing task based on the analytic result to the code in the Oracle database, then data sheet information matches, the dependence route of every timing task of automatic generation, form graphical timing task relation network diagram, the network topology structure of whole timing task dependence of high efficiency reflection directly perceived, the process of generation is efficient, and the degree of accuracy is high, can provide the timing task and move the preceding reference, the control in service, the full flow of analysis provides the assistance after the service, guarantee the accuracy and the reliability of timing task operation.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 4, fig. 4 is a block diagram of a basic structure of a computer device according to the present embodiment. The computer device 4 includes a memory 41, a processor 42, and a network interface 43, which are connected to each other through a system bus in a communication manner, where the memory 41 stores computer readable instructions, and the processor 42 implements the steps of the method for generating a timed task relationship network diagram based on Oracle codes in the above method embodiment when executing the computer readable instructions, and has the beneficial effects corresponding to the method for generating a timed task relationship network diagram based on Oracle codes, which is not expanded herein.
It is noted that only computer device 4 having memory 41, processor 42, and network interface 43 is shown, but it is understood that not all of the illustrated components are required to be implemented, and that more or fewer components may alternatively be implemented. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
In the present embodiment, the memory 41 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 4. Of course, the memory 41 may also include both internal and external storage devices of the computer device 4. In this embodiment, the memory 41 is generally used for storing an operating system and various application software installed in the computer device 4, such as computer readable instructions corresponding to the above-mentioned method for generating a timed task relationship network diagram based on Oracle code. Further, the memory 41 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 42 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is configured to execute the computer readable instructions or processing data stored in the memory 41, for example, execute the computer readable instructions corresponding to the method for generating the timed task relationship network map based on the Oracle code.
The network interface 43 may comprise a wireless network interface or a wired network interface, and the network interface 43 is generally used for establishing communication connection between the computer device 4 and other electronic devices.
The present application further provides another embodiment, which is to provide a computer-readable storage medium, where computer-readable instructions are stored, and the computer-readable instructions can be executed by at least one processor, so that the at least one processor performs the steps of the above-mentioned method for generating a timed task relationship network map based on Oracle code, and has the corresponding advantages, which are not expanded herein, to the above-mentioned method for generating a timed task relationship network map based on Oracle code.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical embodiments of the present application may be essentially or partially implemented in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that various changes may be made and equivalents may be substituted for elements thereof. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.

Claims (10)

1. A method for generating a timed task relationship network graph based on Oracle codes is characterized by comprising the following steps:
receiving a timed task relational network generation request, accessing an Oracle database according to the timed task relational network generation request, and reading an Oracle script code in the Oracle database;
analyzing the Oracle script code to obtain a plurality of timing tasks and data table information corresponding to the timing tasks;
and obtaining the dependency relationship of each timing task according to the data table information of each timing task, generating a dependency relationship table according to the dependency relationship, generating directed graphs of a plurality of timing tasks based on the table structure of the dependency relationship table, and generating a timing task relationship network graph according to the directed graphs, so that a target object end can execute target operation according to the timing task relationship network graph after receiving the timing task relationship network graph.
2. The method for generating the timed task relational network graph based on the Oracle code according to claim 1, wherein the step of analyzing the Oracle script code to obtain a plurality of timed tasks and data table information corresponding to the timed tasks comprises:
searching a timing task identifier in the Oracle script code, acquiring timing task scheduling information of Oracle from the Oracle database, and determining the number of timing tasks in the Oracle script code according to the timing task scheduling information;
when the number of the timing tasks reaches a preset value, determining a plurality of timing task identifiers used as segmentation points according to the number of the timing tasks, segmenting the Oracle script code based on the segmentation points to obtain a plurality of code segments, and generating a plurality of analysis tasks corresponding to the number of the code segments after the Oracle script code is segmented;
and simultaneously executing the plurality of analysis tasks to obtain a plurality of timing tasks and data table information corresponding to the plurality of timing tasks.
3. The method for generating the timed task relationship network graph based on the Oracle code as claimed in claim 2, wherein before the step of partitioning the Oracle script code based on the partitioning point to obtain a plurality of code fragments, the method further comprises: the method comprises the steps of obtaining system available resources, determining whether to segment the Oracle script codes according to whether the system available resources meet a preset threshold value, determining the number of segments of the codes according to the system available resources when determining the segments, adjusting segmentation points according to the number of the segments of the codes, and segmenting the Oracle script codes according to the adjusted segmentation points.
4. The method for generating the timed task relationship network graph based on the Oracle code according to any one of claims 1 to 3, wherein after the step of parsing the Oracle script code to obtain a plurality of timed tasks and data table information corresponding to the plurality of timed tasks, the method further comprises: judging whether the data tables of the timing tasks are missing or not, if so, identifying the timing task nodes with the missing data tables in the generated timing task relationship network graph, outputting prompt information for adjusting the Oracle script codes, after the Oracle script codes are adjusted, re-triggering the step of analyzing the Oracle script codes to obtain a plurality of timing tasks and data table information corresponding to the timing tasks, and re-acquiring the dependency relationship;
wherein the data table loss of the timed task comprises an input data table loss and/or an output data table loss.
5. The method for generating the timed task relationship network graph based on Oracle code according to any one of claims 1 to 3, wherein after the step of generating the timed task relationship network graph according to the directed graph, the method further comprises: and trial calculation is carried out on the timing task relation network graph, when the trial calculation determines that the timing task relation network graph has the condition that two timing tasks are mutually dependent, the timing task is judged to be abnormal in dependence, prompt information for adjusting the timing task dependence relation is output, and the timing task relation network graph is regenerated according to the adjusted dependence relation.
6. The method for generating the timed task relationship network graph based on Oracle code according to any one of claims 1 to 3, wherein after the step of generating the timed task relationship network graph according to the directed graph, the method further comprises: and when each timing task runs, acquiring the running state of each timing task from the target object end in real time, taking the timing task relation network graph as a picture base layer, identifying the running state of each timing task in the timing task relation network graph in a target mode, generating a second timing task relation network graph and outputting the second timing task relation network graph to the target object end.
7. The method for generating the timed task relationship network graph based on the Oracle code as claimed in claim 6, wherein after the step of obtaining the running state of each timed task from the target object side in real time, the method further comprises: when the running state of any timing task obtained from the target object terminal in real time is abnormal, determining other timing tasks influenced by the abnormal running timing task according to the dependency relationship table, taking the timing task relationship network graph as a picture base layer, identifying the abnormal running timing task and nodes corresponding to the influenced timing tasks on the timing task relationship network graph in a target mode, generating a third timing task relationship network graph and outputting the third timing task relationship network graph to the target object terminal.
8. An apparatus for generating a timed task relationship network graph based on Oracle code, comprising:
the code acquisition module is used for receiving a timed task relational network generation request, accessing an Oracle database according to the timed task relational network generation request and reading an Oracle script code in the Oracle database;
the analysis module is used for analyzing the Oracle script code to obtain a plurality of timing tasks and data table information corresponding to the timing tasks;
and the network graph generating module is used for obtaining the dependency relationship of each timing task according to the data table information of each timing task, generating a dependency relationship table according to the dependency relationship, generating directed graphs of a plurality of timing tasks based on the table structure of the dependency relationship table, and generating a timing task relationship network graph according to the directed graphs, so that a target object end can execute target operation according to the timing task relationship network graph after receiving the timing task relationship network graph.
9. A computer device comprising a memory having computer readable instructions stored therein and a processor that when executed implements the steps of the Oracle code based timed task relationship network graph generation method of any of claims 1 to 7.
10. A computer readable storage medium, characterized in that, the computer readable storage medium stores thereon computer readable instructions, which when executed by a processor, implement the steps of the Oracle code based timed task relationship network graph generation method according to any one of claims 1 to 7.
CN202011532336.4A 2020-12-22 2020-12-22 Timed task relation network graph generation method based on Oracle code and related equipment Pending CN112650569A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011532336.4A CN112650569A (en) 2020-12-22 2020-12-22 Timed task relation network graph generation method based on Oracle code and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011532336.4A CN112650569A (en) 2020-12-22 2020-12-22 Timed task relation network graph generation method based on Oracle code and related equipment

Publications (1)

Publication Number Publication Date
CN112650569A true CN112650569A (en) 2021-04-13

Family

ID=75359584

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011532336.4A Pending CN112650569A (en) 2020-12-22 2020-12-22 Timed task relation network graph generation method based on Oracle code and related equipment

Country Status (1)

Country Link
CN (1) CN112650569A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114968725A (en) * 2022-06-23 2022-08-30 中国平安财产保险股份有限公司 Task dependency relationship correction method and device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114968725A (en) * 2022-06-23 2022-08-30 中国平安财产保险股份有限公司 Task dependency relationship correction method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108427705B (en) Electronic device, distributed system log query method and storage medium
CN112491602B (en) Behavior data monitoring method and device, computer equipment and medium
CN112394908A (en) Method and device for automatically generating embedded point page, computer equipment and storage medium
CN113254445B (en) Real-time data storage method, device, computer equipment and storage medium
CN114116065A (en) Method and device for acquiring topological graph data object and electronic equipment
CN112416458A (en) Preloading method and device based on ReactNative, computer equipment and storage medium
CN112181477A (en) Complex event processing method and device and terminal equipment
CN112363814A (en) Task scheduling method and device, computer equipment and storage medium
CN112817935A (en) Data processing method, device and equipment based on field type and storage medium
CN113377372A (en) Business rule analysis method and device, computer equipment and storage medium
CN109460363B (en) Automatic testing method and device, electronic equipment and computer readable medium
CN113434254B (en) Client deployment method, client deployment apparatus, computer device, and storage medium
CN114969443A (en) Quantum computation visual debugging method and system, computer equipment and storage medium
CN112650569A (en) Timed task relation network graph generation method based on Oracle code and related equipment
CN112559131A (en) Method, device and equipment for updating container mirror image and computer readable storage medium
CN113297028A (en) Script execution method and device, computer equipment and storage medium
CN111552663A (en) File consistency verification method and device, computer equipment and storage medium
CN111415683A (en) Method and device for alarming abnormality in voice recognition, computer equipment and storage medium
CN115086047B (en) Interface authentication method and device, electronic equipment and storage medium
CN114968725A (en) Task dependency relationship correction method and device, computer equipment and storage medium
CN112416875B (en) Log management method, device, computer equipment and storage medium
CN114912003A (en) Document searching method and device, computer equipment and storage medium
CN115328764A (en) Test code optimization method based on automatic test and related equipment thereof
CN114371886A (en) Front-end frame assembly conversion method and device, computer equipment and storage medium
CN114143308A (en) File uploading information processing method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination