CN112667630B - Method, device, equipment and storage medium for integrating business report - Google Patents
Method, device, equipment and storage medium for integrating business report Download PDFInfo
- Publication number
- CN112667630B CN112667630B CN202011549416.0A CN202011549416A CN112667630B CN 112667630 B CN112667630 B CN 112667630B CN 202011549416 A CN202011549416 A CN 202011549416A CN 112667630 B CN112667630 B CN 112667630B
- Authority
- CN
- China
- Prior art keywords
- business
- report
- reports
- script
- business report
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000013515 script Methods 0.000 claims abstract description 127
- 230000008878 coupling Effects 0.000 claims abstract description 70
- 238000010168 coupling process Methods 0.000 claims abstract description 70
- 238000005859 coupling reaction Methods 0.000 claims abstract description 70
- 238000004458 analytical method Methods 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 13
- RUPBZQFQVRMKDG-UHFFFAOYSA-M Didecyldimethylammonium chloride Chemical compound [Cl-].CCCCCCCCCC[N+](C)(C)CCCCCCCCCC RUPBZQFQVRMKDG-UHFFFAOYSA-M 0.000 claims description 11
- 238000001514 detection method Methods 0.000 claims description 11
- 230000006870 function Effects 0.000 claims description 11
- 238000004364 calculation method Methods 0.000 claims description 6
- 238000007621 cluster analysis Methods 0.000 claims description 3
- 230000009286 beneficial effect Effects 0.000 abstract description 3
- 238000004422 calculation algorithm Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 3
- 239000008280 blood Substances 0.000 description 2
- 210000004369 blood Anatomy 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000013139 quantization Methods 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000002411 adverse Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000008094 contradictory effect Effects 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a method, a device, equipment and a storage medium for integrating business reports, wherein the method comprises the following steps: searching a source database storing a business report; reading the library table information in each source database, and generating a data dictionary according to each library table information; generating acquisition scripts respectively corresponding to each business report according to the data dictionary, and acquiring task scripts for operating each business report according to each acquisition script; recursively analyzing each task script to obtain a coupling relation between each business report; and acquiring the business reports in each source database, and storing each business report and the coupling relation between each business report to obtain the target database. The invention has the beneficial effects that: the method ensures that all the business reports in each source database exist in the target database, and the coupling relation among the business reports in the source database is reserved.
Description
Technical Field
The present invention relates to the field of data processing, and in particular, to a method, an apparatus, a device, and a storage medium for integrating a business report.
Background
Databases, also known as data management systems, are data sets in which processed data are stored together in a manner that enables multiple users to share, minimizing redundancy. When the service data is stored, the same kind of service data may be stored in a plurality of databases respectively due to the limitation of the databases or when a developer develops different functions, and each database needs to be traversed during searching, so that the searching process is very complicated. Even some business data can be repeatedly saved, and save space is wasted, so a method for integrating business reports is needed.
Disclosure of Invention
The invention mainly aims to provide a method, a device, equipment and a storage medium for integrating business reports, which aim to solve the problem that each database needs to be traversed during retrieval, so that the retrieval process is very complicated.
The invention provides a method for integrating business reports, which comprises the following steps:
searching a source database storing a business report;
reading the library table information in each source database, and generating a data dictionary according to each library table information, wherein the data dictionary records the position information of each business report;
generating acquisition scripts respectively corresponding to each business report according to the data dictionary, and acquiring task scripts for operating each business report according to each acquisition script;
recursively analyzing each task script to obtain a coupling relation between each business report;
and acquiring the business reports in each source database, and storing each business report and the coupling relation between each business report to a target database.
Further, the step of recursively parsing each task script to obtain a coupling relationship between each business report includes:
acquiring one or more SQL sentences involved in a task script;
detecting the business report executed in each SQL statement and whether the SQL statement is executable or not;
performing executable processing on the SQL statement which is not executable to obtain a target task script of the executable processing;
analyzing the target task script, and building a work stack based on the analyzed content; wherein the work stack comprises various steps executed by the target task script;
and recursively analyzing the computing functions in each step of the working stack to obtain the coupling relation between the business reports.
Further, the step of storing each business report and the coupling relation between each business report to a target database includes:
acquiring form information of each business report;
sorting out a hierarchical rule according to the table information;
dividing each business report to different levels according to the level rules;
performing cluster analysis on the business reports of the same level, and giving the same label to the business reports of the same type according to analysis results;
and storing the business reports to the target database in a classified manner according to the labels of the business reports, and storing the coupling relation among the business reports.
Further, the step of storing each business report and the coupling relation between each business report to a target database further includes:
acquiring script information of the task script; the script information at least comprises a script path, an operation type and related business reports;
analyzing the script information to obtain the occurrence times and vertex information of each associated business report;
setting corresponding weights for each associated business report according to the occurrence times of each associated business report;
and setting the vertex information as a main key of the associated business report, setting the weight as a vertex attribute of the associated business report, storing the vertex attribute, and storing the coupling relation between the business reports.
Further, after the step of obtaining the business report in each source database and storing each business report and the coupling relation between each business report in the target database, the method further includes:
detecting an intermediate temporary table in each business report according to a set detection rule;
acquiring a first report with a blood-edge relation with the intermediate temporary table and a second report with an association relation with the intermediate temporary table; the first report and the second report are both business reports;
directly establishing a coupling relation between the first report and the second report according to the coupling relation between the intermediate temporary table and the second report;
and deleting the intermediate temporary table to establish a knowledge graph of the target database.
Further, the step of parsing the target task script and building a work stack includes:
converting the target task script into an ASTODE abstract syntax tree;
traversing the depth of the ASTOP abstract syntax tree, and analyzing an output-input table and a condition judgment statement of the ASTOP abstract syntax tree;
setting an execution scheme of an ASTOP abstract syntax tree according to the output and input table and the condition judgment statement to obtain the work stack.
The invention also provides a device for integrating the business report, which comprises:
the searching module is used for searching a source database which stores the business report;
the reading module is used for reading the library table information in each source database and generating a data dictionary according to each library table information, wherein the data dictionary records the position information of each business report;
the generation module is used for generating acquisition scripts respectively corresponding to the business reports according to the data dictionary, and acquiring task scripts for operating the business reports according to the acquisition scripts;
the acquisition module is used for recursively analyzing each task script to acquire the coupling relation between each business report;
the storage module is used for acquiring the business reports in each source database, storing each business report and the coupling relation between each business report, and obtaining the target database.
Further, the acquisition module includes:
the acquisition sub-module is used for acquiring one or more SQL sentences involved in the task script;
the detection sub-module is used for detecting the business report contained in each SQL statement and whether the SQL statement is executable or not;
the processing sub-module is used for performing executable processing on the SQL statement which is not executable to obtain a target task script of the executable processing;
the building sub-module is used for analyzing the target task script and building a work stack based on the analyzed content; wherein the work stack comprises various steps executed by the target task script;
and the analysis sub-module is used for recursively calling the calculation functions of each step according to the work stack to analyze, so as to obtain the coupling relation between the business reports.
The invention also provides a computer device comprising a memory storing a computer program and a processor implementing the steps of any of the methods described above when the processor executes the computer program.
The invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method of any of the preceding claims.
The invention has the beneficial effects that: and acquiring the corresponding task script through setting the acquisition script, analyzing the coupling relation among the business reports, and acquiring and storing the business reports in each source database and the coupling relation among the business reports. The method ensures that all the business reports in each source database exist in the target database, and the coupling relation among the business reports in the source databases is reserved, so that when related personnel search in the target database, the search result in the source databases can be obtained without traversing the source databases.
Drawings
FIG. 1 is a flow chart of a method for integrating business reports according to an embodiment of the invention;
FIG. 2 is a schematic block diagram illustrating an apparatus for integrating business reports according to an embodiment of the present invention;
fig. 3 is a block diagram schematically illustrating a structure of a computer device according to an embodiment of the present application.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that, in the embodiments of the present invention, all directional indicators (such as up, down, left, right, front, and back) are merely used to explain the relative positional relationship, movement conditions, and the like between the components in a specific posture (as shown in the drawings), if the specific posture is changed, the directional indicators correspondingly change, and the connection may be a direct connection or an indirect connection.
The term "and/or" is herein merely an association relation describing an associated object, meaning that there may be three relations, e.g., a and B, may represent: a exists alone, A and B exist together, and B exists alone.
Furthermore, descriptions such as those referred to as "first," "second," and the like, are provided for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implying an order of magnitude of the indicated technical features in the present disclosure. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be considered to be absent and not within the scope of protection claimed in the present invention.
Referring to fig. 1, the present invention proposes a method for integrating business reports, including:
s1: searching a source database storing a business report;
s2: reading the library table information in each source database, and generating a data dictionary according to each library table information; the data dictionary records the position information of each business report;
s3: generating acquisition scripts respectively corresponding to each business report according to the data dictionary, and acquiring task scripts for operating each business report according to each acquisition script;
s4: recursively analyzing each task script to obtain a coupling relation between each business report;
s5: and acquiring the business reports in each source database, and storing each business report and the coupling relation between each business report to a target database.
As described in step S1, a source database storing the business report is searched. The method for acquiring the header information of the service report can firstly acquire the header information of the required service report, and corresponding automation scripts are set according to the header information to read the library table information in each initial database, and it should be understood that the header information generally refers to the head-up of the service report, and the set automation scripts can be only the header information or can also comprise the near-meaning information of the header information so as to enable the acquired service data report to be more comprehensive. The setting of the automation script can be set according to the header information, and can also be set by a developer.
As described in step S2, the library table information in each source database is read, and a data dictionary is generated according to each library table information. The reading mode may be to read the library table information in the initial database according to the automation script, screen the source database with the business report, and obtain the library table information in the source database, wherein the library table information is a catalog of different data tables. The database generally establishes the database table information so as to conveniently inquire the corresponding data, if the database table information is not available, the database table information can be acquired in a traversing mode, and then a corresponding data dictionary is generated according to the database table information, wherein the data dictionary comprises the position of the database stored in each business report and the position information in the database. In some embodiments, a certain business table may exist in two source databases at the same time, so that before a data dictionary is built according to inventory information of each source database, duplicate checking can be performed, that is, whether the same head-up business report exists or not is detected, if so, only one business report can be obtained, so that the problem of data repetition is avoided.
And step S3, generating acquisition scripts corresponding to the business reports respectively according to the data dictionary, and acquiring task scripts for operating the business reports according to the acquisition scripts. The task script can exist in a source database or in a third-party channel such as a third client, and the task script can be obtained by obtaining the position set by the script. And setting a plurality of corresponding acquisition scripts according to the data dictionary, wherein the acquisition scripts are required to acquire task scripts related to the business report in addition to the corresponding business report. The task scripts are task scripts for operating the business report, namely the situation that the business report is used can be obtained by acquiring the business report of the operation business report, and the situation that each business report is called in the source database, namely the coupling relation with other business reports can be known.
And as described in the step S4, recursively analyzing each task script to obtain the coupling relation between each business report. Because the execution process of the task script may be very complex, the direct analysis may be difficult to obtain a final result, so that the execution step of each task script may be obtained, and the final result is obtained by a reverse recurrence mode, that is, the recursive analysis of each task script.
And (5) acquiring the business reports in each source database, and storing the business reports and the coupling relations among the business reports to obtain the target database. And storing the acquired business reports in each source database and the coupling relation among the analyzed business reports. Therefore, the obtained target database not only contains all the business reports in each source database, but also maintains the coupling relation among the business reports in the active database, so that when related personnel search in the target database, the related personnel do not need to traverse a plurality of source databases, and search results in the plurality of source databases can be obtained.
In one embodiment, the step S4 of recursively parsing each task script to obtain the coupling relationship between each business report includes:
s401: acquiring one or more SQL sentences involved in a task script;
s402: detecting the business report executed in each SQL statement and whether the SQL statement is executable or not;
s403: performing executable processing on the SQL statement which is not executable to obtain a target task script of the executable processing;
s404: analyzing the target task script, and building a work stack based on the analyzed content; wherein the work stack comprises various steps executed by the target task script;
s405: and recursively analyzing the computing functions in each step of the working stack to obtain the coupling relation between the business reports.
As described in the above steps S401 to S405, recursive parsing of the task script is achieved. The task script comprises at least one SQL (Structured Query Language ) statement, and the corresponding task in the task script is completed, and the coupling relation among the business reports is mainly obtained in the application, namely the number of times the business report is called, the called sequence, the association degree and the like in the task script. Specifically, the service report executed in the SQL statement is detected (it should be noted that the SQL does not include a service report, and only includes an execution command for processing each service report, calling, etc.), and since the obtained SQL statement often includes an instruction, a special function, a custom function, a dynamic parameter, etc. to make the SQL statement unexecutable, the unexecutable statement needs to be changed into an executable statement through an operation such as a substitution function or a parameter constant quantization, etc., the above operation can be automatically completed by setting a corresponding program, and if the unexecutable statement incapable of being automatically processed is encountered, the unexecutable statement can be extracted individually, and the unexecutable statement is subjected to executable processing (generally, also is processed through an operation such as a substitution function or a parameter constant quantization) by a corresponding technician. Therefore, SQL sentences in the task script can be executed to obtain the target task script. Analyzing the target task script and establishing a working stack, wherein the mode of establishing the working stack can be to combine the condition judgment in the target task script with the node setting the abstract syntax tree by establishing the abstract syntax tree, and then reversely deducing the result of the abstract syntax tree, namely the calling sequence of each business report and how to be executed by SQL according to the execution step of the target task script. The recursive calculation method can convert a large and complex problem layer by layer into a problem with smaller scale similar to the original problem to solve the problem, and the operation difficulty is simplified.
In one embodiment, the step S404 of parsing the target task script and building a work stack includes:
s4041: converting the target task script into an ASTODE abstract syntax tree;
s4042: traversing the depth of the ASTOP abstract syntax tree, and analyzing an output-input table and a condition judgment statement of the ASTOP abstract syntax tree;
s4043: setting an execution scheme of an ASTOP abstract syntax tree according to the output and input table and the condition judgment statement to obtain the work stack.
The resume of the work stack is implemented as described in steps S4041-S4043 above. The target task script is firstly converted into an ASTOC abstract syntax tree, wherein the ASTOC abstract syntax tree is independent of specific grammar and independent of language details, and can solve the problem that excessive components brought by grammar analysis can cause adverse effects on subsequent stages, and the target task script is a step which is sequentially executed through condition judgment and can influence the subsequent steps if equivalent exchange of the grammar is carried out before. Therefore, the technical problem brought by grammar can be solved by adopting an ASTODE abstract grammar tree. Specifically, the target task script is firstly converted into the ASTOC abstract syntax tree, the node of the tree is judged and set according to the condition in the target task script, and the branch of the tree is set according to the relation among the steps, so that the corresponding ASTOC abstract syntax tree is obtained. Traversing the depth of the ASTOP abstract syntax tree, and analyzing an output-input table and a condition judgment statement of the ASTOP abstract syntax tree, wherein the depth refers to the complexity degree of the tree trunk, namely the number of steps required to be performed, and then analyzing the output-input table and the condition judgment statement. And then setting a corresponding execution scheme, namely, firstly calculating the result which can be calculated, then returning the calculated result to the previous node for continuous calculation, and obtaining the corresponding execution scheme by adopting the calculation mode, thereby obtaining a work stack.
In one embodiment, the step S5 of storing each of the business reports and the coupling relation between each of the business reports to a target database includes:
s501: acquiring form information of each business report;
s502: sorting out a hierarchical rule according to the table information;
s503: dividing each business report to different levels according to the level rules;
s504: performing cluster analysis on the business reports of the same level, and giving the same label to the business reports of the same type according to analysis results;
s505: and storing the business reports to the target database in a classified manner according to the labels of the business reports, and storing the coupling relation among the business reports.
As described in the above steps S501-S505, the classified storage of the business report is realized. The method comprises the steps of firstly obtaining table information of service reports (generally only obtaining a table header), then finishing corresponding level rules, namely, presetting corresponding relations between the table information and levels, then obtaining level rules adapting to all service tables according to the table information, namely, all the service reports can be derived from contents in other service reports, but the table header is generally recorded, so that the levels of each service report can be divided according to the table header, each service report is divided into different levels, then clustering is carried out, and the clustering mode can be a text clustering algorithm (any one of a clustering algorithm based on division, a clustering algorithm based on level, a clustering algorithm based on density, a clustering algorithm based on grid, a clustering algorithm based on model and a clustering algorithm based on fuzzy) and then assigning the service reports of the same kind with the same label. And storing each business report and the coupling relation between the business reports in a target database according to the corresponding label.
In one embodiment, the step S5 of storing each of the business reports and the coupling relation between each of the business reports to a target database includes:
s511: acquiring script information of a task script; the script information at least comprises a script path, an operation type and related business reports;
s512: analyzing the script information to obtain the occurrence times and vertex information of each associated business report;
s513: setting corresponding weights for each associated business report according to the occurrence times of each associated business report;
s514: and setting the vertex information as a main key of the associated business report, setting the weight as a vertex attribute of the associated business report, storing the vertex attribute, and storing the coupling relation between the business reports.
As described in the above steps, the storage of each associated business report is realized. That is, in the target database, each business report is a vertex, and the data content contained in the business report is vertex attribute. The relationship between the vertexes is the coupling relationship between the business reports, and the vertex attribute is the basis of the importance of the business reports, namely, if the vertex attribute is good in the back edge searching process, the vertexes can be traversed first. Specifically, script information of a task script is obtained, wherein the script information comprises a corresponding script path, an operation type and related associated business report forms, even further comprises a data source in script data, according to the script information, the corresponding associated business report forms and the occurrence times of the associated business report forms can be obtained, vertex information (namely, information of the business report forms comprises content in the business report forms and coupling relations among other business report forms) and the like, weights are set for the associated business report forms according to the occurrence times of the associated business report forms so as to facilitate subsequent retrieval, and it is understood that the greater the occurrence times of the associated business report forms, the fewer the occurrence times of the associated business report forms are, the weights are smaller, and then a primary key is set for the associated business report forms, wherein the primary key is the expression form of the associated business report forms, can be the data after encryption of the script information, and can also be directly used as a primary key by setting the weights as vertex attributes to be saved, so that the storage of each business report form is realized.
In one embodiment, after the step S5 of obtaining the business reports in each source database and storing each business report and the coupling relationship between each business report in the target database, the method further includes:
s601: detecting an intermediate temporary table in each business report according to a set detection rule;
s602: acquiring a first report with a blood-edge relation with the intermediate temporary table and a second report with an association relation with the intermediate temporary table; the first report and the second report are both business reports;
s603: directly establishing a coupling relation between the first report and the second report according to the coupling relation between the intermediate temporary table and the second report;
s604: and deleting the intermediate temporary table to establish a knowledge graph of the target database.
As described in the above steps S601-S604, optimization of the target database is achieved. And detecting the middle temporary table in each business report according to the set detection rule. Generally, when each business report is generated, the generated basis time is taken as a header, so that the set detection rule can be set as a detection header, namely, whether the business report is an intermediate temporary table can be known according to the information of the header, and then a first report with a blood-related relationship with the intermediate temporary table and a second report with a related relationship are acquired, wherein the acquired mode is acquired according to the coupling relationship obtained through analysis, namely, the relationship between the intermediate temporary table and other business reports is recorded in the coupling relationship. According to the coupling relation between the intermediate temporary table and the second report, the coupling relation between the first report and the second report is directly established, specifically, the label of the intermediate temporary table can be marked as False, and the label of other business reports can be marked as True, then the map relation in the target database comprises four kinds of False-True, false-False, true-True, and the coupling relation between the True-True does not need to be processed, and the False-True, false-False, true-False, and regel map iterative computation are performed, and head-tail relations are stored in the vertex attribute set every time True-n False-True are encountered. And deleting the vertex of False, and directly establishing the relation between True and True according to the attribute set. Therefore, the knowledge graph of the target database is simplified, so that a user can more clearly and intuitively extract the data with useful value, and the maintenance of the target database is facilitated.
Referring to fig. 2, the present invention further provides a device for integrating service reports, including:
the searching module 10 is used for searching a source database storing the business report;
the reading module 20 is configured to read the library table information in each of the source databases, and generate a data dictionary according to each of the library table information, where the data dictionary records the location information of each of the business reports;
the generating module 30 is configured to generate an acquisition script corresponding to each service report according to the data dictionary, and acquire a task script for operating each service report according to each acquisition script;
an obtaining module 40, configured to recursively parse each task script to obtain a coupling relationship between each business report;
and the storage module 50 is used for acquiring the business reports in each source database and storing each business report and the coupling relation between each business report to a target database.
In one embodiment, the acquisition module 40 includes:
the acquisition sub-module is used for acquiring one or more SQL sentences involved in the task script;
the detection sub-module is used for detecting the business report executed in each SQL statement and whether the SQL statement is executable or not;
the processing sub-module is used for performing executable processing on the SQL statement which is not executable to obtain a target task script of the executable processing;
the building sub-module is used for analyzing the target task script and building a work stack based on the analyzed content; wherein the work stack comprises various steps executed by the target task script;
and the analysis sub-module is used for recursively analyzing the calculation functions in each step of the work stack to obtain the coupling relation between the business reports.
In one embodiment, establishing the sub-module includes:
the conversion unit is used for converting the target task script into an ASTOC abstract syntax tree;
the traversing unit is used for traversing the depth of the ASTOC abstract syntax tree and analyzing an output and input table and a condition judgment statement of the ASTOC abstract syntax tree;
and the setting unit is used for setting an execution scheme of an ASTOC abstract syntax tree according to the output and input table and the condition judgment statement so as to obtain the work stack.
In one embodiment, the memory module 50 includes:
the table information acquisition sub-module is used for acquiring the table information of each business report;
the arrangement sub-module is used for arranging the level rule according to the table information;
the dividing sub-module is used for dividing each business report to different levels according to the level rule;
the clustering sub-module is used for carrying out clustering analysis on the business reports of the same level and giving the same label to the business reports of the same type according to analysis results;
and the storage sub-module is used for storing the business reports to the target database in a classified manner according to the labels of the business reports and storing the coupling relation among the business reports.
In one embodiment, the memory module 50 further comprises:
the script information acquisition sub-module is used for acquiring script information of the task script; the script information at least comprises a script path, an operation type and related business reports;
the script information analysis sub-module is used for analyzing the script information to obtain the occurrence times and the vertex information of each associated business report;
the weight setting sub-module is used for setting corresponding weights for the associated business reports according to the occurrence times of the associated business reports;
and the main key setting sub-module is used for setting the vertex information as a main key of the associated business report, setting the weight as a vertex attribute of the associated business report, storing the vertex attribute, and storing the coupling relation between the business reports.
In one embodiment, the device for integrating the business report further comprises:
the middle temporary table detection module is used for detecting the middle temporary tables in the business reports according to the set detection rules;
the first report acquisition module is used for acquiring a first report with a blood margin relation with the intermediate temporary table and a second report with an association relation with the intermediate temporary table; the first report and the second report are both business reports;
the coupling relation establishing module is used for directly establishing the coupling relation between the first report and the second report according to the coupling relation between the intermediate temporary table and the second report;
and the deleting module is used for deleting the intermediate temporary table to establish a knowledge graph of the target database.
The invention has the beneficial effects that: and acquiring the corresponding task script through setting the acquisition script, analyzing the coupling relation among the business reports, and acquiring and storing the business reports in each source database and the coupling relation among the business reports. The method ensures that all the business reports in each source database exist in the target database, and the coupling relation among the business reports in the source databases is reserved, so that when related personnel search in the target database, the search result in the source databases can be obtained without traversing the source databases.
Referring to fig. 3, a computer device is further provided in the embodiment of the present application, where the computer device may be a server, and the internal structure of the computer device may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing various business reports and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The method for integrating business report forms according to any of the embodiments can be implemented when the computer program is executed by a processor.
Those skilled in the art will appreciate that the architecture shown in fig. 3 is merely a block diagram of a portion of the architecture in connection with the present application and is not intended to limit the computer device to which the present application is applied.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, where the computer program can implement the method for integrating business report according to any of the above embodiments when executed by a processor.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by hardware associated with a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in embodiments may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, apparatus, article or method that comprises the element.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.
Claims (10)
1. A method for integrating business reports, comprising:
searching a source database storing a business report;
reading the library table information in each source database, and generating a data dictionary according to each library table information, wherein the data dictionary records the position information of each business report;
generating acquisition scripts respectively corresponding to each business report according to the data dictionary, and acquiring task scripts for operating each business report according to each acquisition script;
recursively analyzing each task script to obtain a coupling relation between each business report;
and acquiring the business reports in each source database, and storing each business report and the coupling relation between each business report to a target database.
2. The method of integrating business reports according to claim 1, wherein said recursively parsing each of said task scripts to obtain coupling relationships between each of said business reports comprises:
acquiring one or more SQL sentences involved in a task script;
detecting the business report executed in each SQL statement and whether the SQL statement is executable or not;
performing executable processing on the SQL statement which is not executable to obtain a target task script of the executable processing;
analyzing the target task script, and building a work stack based on the analyzed content; wherein the work stack comprises various steps executed by the target task script;
and recursively analyzing the computing functions in each step of the working stack to obtain the coupling relation between the business reports.
3. The method of integrating business reports according to claim 1, wherein said step of storing each of said business reports and the coupling relationship between each of said business reports to a target database comprises:
acquiring form information of each business report;
sorting out a hierarchical rule according to the table information;
dividing each business report to different levels according to the level rules;
performing cluster analysis on the business reports of the same level, and giving the same label to the business reports of the same type according to analysis results;
and storing the business reports to the target database in a classified manner according to the labels of the business reports, and storing the coupling relation among the business reports.
4. The method of integrating business reports according to claim 1, wherein said step of storing each of said business reports and the coupling relationship between each of said business reports to a target database further comprises:
acquiring script information of the task script; the script information at least comprises a script path, an operation type and related business reports;
analyzing the script information to obtain the occurrence times and vertex information of each associated business report;
setting corresponding weights for each associated business report according to the occurrence times of each associated business report;
and setting the vertex information as a main key of the associated business report, setting the weight as a vertex attribute of the associated business report, storing the vertex attribute, and storing the coupling relation between the business reports.
5. The method for integrating business reports according to claim 1, wherein after the step of obtaining the business reports in each source database and storing each business report and the coupling relationship between each business report in a target database, the method further comprises:
detecting an intermediate temporary table in each business report according to a set detection rule;
acquiring a first report with a blood-edge relation with the intermediate temporary table and a second report with an association relation with the intermediate temporary table; the first report and the second report are both business reports;
directly establishing a coupling relation between the first report and the second report according to the coupling relation between the intermediate temporary table and the second report;
and deleting the intermediate temporary table to establish a knowledge graph of the target database.
6. The method of integrating a business report of claim 2, wherein the step of parsing the target task script and building a work stack comprises:
converting the target task script into an ASTODE abstract syntax tree;
traversing the depth of the ASTOP abstract syntax tree, and analyzing an output-input table and a condition judgment statement of the ASTOP abstract syntax tree;
setting an execution scheme of an ASTOP abstract syntax tree according to the output and input table and the condition judgment statement to obtain the work stack.
7. An apparatus for integrating a business report, comprising:
the searching module is used for searching a source database which stores the business report;
the reading module is used for reading the library table information in each source database and generating a data dictionary according to each library table information, wherein the data dictionary records the position information of each business report;
the generation module is used for generating acquisition scripts respectively corresponding to the business reports according to the data dictionary and acquiring task scripts for operating the business reports according to the acquisition scripts
The acquisition module is used for recursively analyzing each task script to acquire the coupling relation between each business report;
the storage module is used for acquiring the business reports in each source database and storing the business reports and the coupling relations among the business reports to a target database.
8. The apparatus for integrating a business report of claim 7, wherein the acquisition module comprises:
the acquisition sub-module is used for acquiring one or more SQL sentences involved in the task script;
the detection sub-module is used for detecting the business report executed in each SQL statement and whether the SQL statement is executable or not;
the processing sub-module is used for performing executable processing on the SQL statement which is not executable to obtain a target task script of the executable processing;
the building sub-module is used for analyzing the target task script and building a work stack based on the analyzed content; wherein the work stack comprises various steps executed by the target task script;
and the analysis sub-module is used for recursively analyzing the calculation functions in each step of the work stack to obtain the coupling relation between the business reports.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011549416.0A CN112667630B (en) | 2020-12-24 | 2020-12-24 | Method, device, equipment and storage medium for integrating business report |
PCT/CN2021/084534 WO2022134363A1 (en) | 2020-12-24 | 2021-03-31 | Service report integration method and apparatus, device, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011549416.0A CN112667630B (en) | 2020-12-24 | 2020-12-24 | Method, device, equipment and storage medium for integrating business report |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112667630A CN112667630A (en) | 2021-04-16 |
CN112667630B true CN112667630B (en) | 2023-06-02 |
Family
ID=75409843
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011549416.0A Active CN112667630B (en) | 2020-12-24 | 2020-12-24 | Method, device, equipment and storage medium for integrating business report |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112667630B (en) |
WO (1) | WO2022134363A1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114818645B (en) * | 2022-06-29 | 2022-10-28 | 深圳红途科技有限公司 | Automatic report generation method, device, equipment and medium based on data body |
CN115423595B (en) * | 2022-11-02 | 2023-03-28 | 深圳高灯计算机科技有限公司 | File information processing method and device, computer equipment and storage medium |
CN116303370B (en) * | 2023-05-17 | 2023-08-15 | 建信金融科技有限责任公司 | Script blood margin analysis method, script blood margin analysis device, storage medium, script blood margin analysis equipment and script blood margin analysis product |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102541867A (en) * | 2010-12-15 | 2012-07-04 | 金蝶软件(中国)有限公司 | Data dictionary generating method and system |
CN111125254A (en) * | 2019-12-23 | 2020-05-08 | 北京懿医云科技有限公司 | Database synchronization method and device, electronic equipment and computer readable medium |
CN111666743A (en) * | 2020-04-28 | 2020-09-15 | 平安科技(深圳)有限公司 | Report automatic generation method and device, computer equipment and storage medium |
CN111914066A (en) * | 2020-08-17 | 2020-11-10 | 山东合天智汇信息技术有限公司 | Multi-source database global search method and system |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110202831A1 (en) * | 2010-02-15 | 2011-08-18 | Microsoft Coproration | Dynamic cache rebinding of processed data |
CN104252443A (en) * | 2013-06-28 | 2014-12-31 | 腾讯科技(深圳)有限公司 | Report generation method and device |
CN105224536A (en) * | 2014-05-29 | 2016-01-06 | 国际商业机器公司 | The method and apparatus of partition database |
CN104036040B (en) * | 2014-06-30 | 2017-11-03 | 北京猎豹移动科技有限公司 | Report form generation method and device |
CN105893488A (en) * | 2016-03-29 | 2016-08-24 | 国云科技股份有限公司 | Method for quickly, conveniently and flexibly making data statistics report forms |
-
2020
- 2020-12-24 CN CN202011549416.0A patent/CN112667630B/en active Active
-
2021
- 2021-03-31 WO PCT/CN2021/084534 patent/WO2022134363A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102541867A (en) * | 2010-12-15 | 2012-07-04 | 金蝶软件(中国)有限公司 | Data dictionary generating method and system |
CN111125254A (en) * | 2019-12-23 | 2020-05-08 | 北京懿医云科技有限公司 | Database synchronization method and device, electronic equipment and computer readable medium |
CN111666743A (en) * | 2020-04-28 | 2020-09-15 | 平安科技(深圳)有限公司 | Report automatic generation method and device, computer equipment and storage medium |
CN111914066A (en) * | 2020-08-17 | 2020-11-10 | 山东合天智汇信息技术有限公司 | Multi-source database global search method and system |
Also Published As
Publication number | Publication date |
---|---|
CN112667630A (en) | 2021-04-16 |
WO2022134363A1 (en) | 2022-06-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112667630B (en) | Method, device, equipment and storage medium for integrating business report | |
CN110908997B (en) | Data blood relationship construction method and device, server and readable storage medium | |
US10572822B2 (en) | Modular memoization, tracking and train-data management of feature extraction | |
CN112882974B (en) | JSON data conversion method and device, computer equipment and storage medium | |
CN110019384B (en) | Method for acquiring blood edge data, method and device for providing blood edge data | |
CN107766353B (en) | Method and device for migrating statistical information of database | |
US20210319039A1 (en) | Extraction of a nested hierarchical structure from text data in an unstructured version of a document | |
CN111818175B (en) | Enterprise service bus configuration file generation method, device, equipment and storage medium | |
CN113760891B (en) | Data table generation method, device, equipment and storage medium | |
CN114253995B (en) | Data tracing method, device, equipment and computer readable storage medium | |
CN114625748A (en) | SQL query statement generation method and device, electronic equipment and readable storage medium | |
CN115098600A (en) | Directed acyclic graph construction method and device for data warehouse and computer equipment | |
CN112559538A (en) | Incidence relation generation method and device, computer equipment and storage medium | |
CN110874366A (en) | Data processing and query method and device | |
CN113377789A (en) | Processing method and device for database change data, computer equipment and medium | |
CN111475534A (en) | Data query method and related equipment | |
US20230141190A1 (en) | Late Materialization of Queried Data in Database Cache | |
US20130218928A1 (en) | Information processing device | |
CN113868138A (en) | Method, system, equipment and storage medium for acquiring test data | |
KR20220069229A (en) | The method of coupling with heterogeneous data using relation of fields in data | |
CN113051403A (en) | Database fault handling knowledge graph construction method and device and computer equipment | |
CN112416966B (en) | Impromptu query method, impromptu query device, computer device and storage medium | |
CN115052035B (en) | Message pushing method, device and storage medium | |
US20240078237A1 (en) | Database Join Operations With Early Filtering | |
CN117992436B (en) | Information system automatic transformation method and equipment based on different types of databases |
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 | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40041486 Country of ref document: HK |
|
GR01 | Patent grant | ||
GR01 | Patent grant |