WO2022134363A1 - Service report integration method and apparatus, device, and storage medium - Google Patents

Service report integration method and apparatus, device, and storage medium Download PDF

Info

Publication number
WO2022134363A1
WO2022134363A1 PCT/CN2021/084534 CN2021084534W WO2022134363A1 WO 2022134363 A1 WO2022134363 A1 WO 2022134363A1 CN 2021084534 W CN2021084534 W CN 2021084534W WO 2022134363 A1 WO2022134363 A1 WO 2022134363A1
Authority
WO
WIPO (PCT)
Prior art keywords
business
business reports
report
reports
coupling relationship
Prior art date
Application number
PCT/CN2021/084534
Other languages
French (fr)
Chinese (zh)
Inventor
王雍富
贺春艳
孙燕
梁丽娜
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2022134363A1 publication Critical patent/WO2022134363A1/en

Links

Classifications

    • 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/22Indexing; Data structures therefor; Storage structures
    • 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
    • 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/245Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the field of data processing, and in particular, to a method, apparatus, device and storage medium for integrating business reports.
  • a database also known as a data management system, is a collection of data in which the processed data is stored together in a certain way, allowing multiple users to share and reducing redundancy as much as possible.
  • the inventor realized that when saving business data, due to the limitations of the database or when developers develop different functions, the same type of business data may be stored in multiple databases respectively, and each database needs to be traversed during retrieval. This makes the retrieval process very cumbersome. Even some business data will be saved repeatedly, wasting storage space, so a method of integrating business reports is urgently needed.
  • the main purpose of the present application is to provide a method, device, device and storage medium for integrating business reports, which aims to solve the problem that each database needs to be traversed during retrieval, which makes the retrieval process very cumbersome.
  • This application provides a method for integrating business reports, including:
  • the application also provides a device for integrating business reports, including:
  • the search module is used to search the source database that saves the business report
  • a reading module 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, wherein the data dictionary records the location information of each of the business reports;
  • a generating module configured to generate respective acquisition scripts corresponding to each business report according to the data dictionary, and obtain a task script for operating each of the business reports according to each of the acquisition scripts;
  • an acquisition module used to recursively parse each of the task scripts to acquire the coupling relationship between each of the business reports
  • the storage module is used for acquiring the business reports in each source database, and storing the business reports and the coupling relationship between the business reports to obtain the target database.
  • the present application also provides a computer device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the integrated business report The steps of the method:
  • the present application also provides a storage medium storing computer-readable instructions.
  • the computer-readable instructions When the computer-readable instructions are executed by one or more processors, the one or more processors perform the steps of the computer device:
  • the corresponding task script is obtained by setting the obtaining script, and the coupling relationship between the business reports is parsed, and the business reports in each source database and the coupling relationship between the business reports are obtained and saved.
  • the target database contains all the business reports in each source database, and also retains the coupling relationship between each business report in the source database, so that when relevant personnel search in the target database, they do not need to traverse multiple source databases, and can get with traversing multiple source databases for retrieval results.
  • FIG. 1 is a schematic flowchart of a method for integrating business reports according to an embodiment of the present application
  • FIG. 2 is a schematic structural block diagram of an apparatus for integrating business reports according to an embodiment of the present application
  • FIG. 3 is a schematic structural block diagram of a computer device according to an embodiment of the present application.
  • the present application proposes a method for integrating business reports, including:
  • S2 Read the library table information in each of the source databases, and generate a data dictionary according to each of the library table information; wherein the data dictionary records the location information of each of the business reports;
  • S3 Generate respective acquisition scripts corresponding to each business report according to the data dictionary, and obtain a task script for operating each of the business reports according to each of the acquisition scripts;
  • S5 Acquire the business reports in each source database, and store the business reports and the coupling relationship between the business reports in the target database.
  • the source database storing the business report is searched.
  • the way to obtain it is to first obtain the header information of the required business report, and then set the corresponding automated script according to the header information to read the library table information in each initial database.
  • the header information generally refers to the business report.
  • the set automation script can be only the header information, or can include the synonymous information of the header information, so that the obtained business data report is more comprehensive.
  • the settings of the automation script can be set by themselves according to the header information, or can be set by the developer.
  • the library table information in each of the source databases is read, and a data dictionary is generated according to each of the library table information.
  • the reading method may be to read the library table information in the initial database according to the automated script, filter out the source database with business reports, and obtain the library table information in the source database, where the library table information is the directory of different data tables.
  • the database generally establishes the database table information to facilitate the query of the corresponding data. If there is no database table information, the database table information can be obtained by traversing, and then the corresponding data dictionary is generated according to the database table information.
  • a duplicate check can be performed, that is, it can be detected whether there is a business report with the same title. If so, you can obtain only one of the business reports to avoid the problem of data duplication.
  • an acquisition script corresponding to each business report is generated according to the data dictionary, and a task script for operating each of the business reports is acquired according to each of the acquisition scripts.
  • the task script can exist in the source database or in a third-party channel such as a third client, and can be obtained by obtaining the script at the set location.
  • a plurality of corresponding acquisition scripts are set according to the data dictionary, wherein, in addition to acquiring the corresponding business report, the acquisition script should also acquire a task script related to the business report.
  • each task script is a task script for operating the business report, that is, by obtaining the business report for operating the business report, the use of the business report can be known, and the situation of each business report being called in the source database can be known, that is, the same as that of the source database. Coupling relationship of other business reports.
  • each of the task scripts is recursively parsed to obtain the coupling relationship between each of the business reports. Since the execution process of the task script may be very complicated, it may be difficult to obtain the final result by direct analysis. Therefore, the execution steps of each task script can be obtained, and the final result can be obtained by reverse recursion, that is, the recursion of each task script. Parse.
  • the business reports in each source database are acquired, and the business reports and the coupling relationship between the business reports are stored to obtain the target database.
  • the business reports obtained from each source database and the coupling relationship between the parsed business reports are stored. Therefore, the obtained target database not only contains all the business reports in each source database, but also retains the coupling relationship between each business report in the source database, so that the relevant personnel do not need to traverse multiple source databases when searching in the target database. It is also possible to obtain and traverse the retrieval results in multiple source databases.
  • the step S4 of recursively analyzing each of the task scripts to obtain the coupling relationship between each of the business reports includes:
  • S403 Perform executable processing on the non-executable SQL statement to obtain an executable target task script
  • S404 Parse the target task script, and build a work stack based on the parsed content; wherein, the work stack includes each step executed by the target task script;
  • S405 Recursively analyze the calculation functions in each step of the work stack to obtain the coupling relationship between the business reports.
  • the task script includes at least one SQL (Structured Query Language, Structured Query Language) statement, and the corresponding task in the task script has been completed.
  • SQL Structured Query Language
  • the coupling relationship between various business reports is mainly obtained, that is, in this task script
  • the business report executed in the SQL statement is first detected (it should be noted that SQL does not contain business reports, but only includes processing, calling and other execution commands for each business report). Since the obtained SQL statement It often contains instructions, special functions, custom functions, dynamic parameter transfer, etc. to make SQL statements unexecutable.
  • Parse the target task script and establish a work stack wherein the way of establishing the work stack can be by establishing an abstract syntax tree, combining the conditional judgment in the target task script to set the nodes of the abstract syntax tree, and then according to the execution steps of the target task script,
  • the result of the reverse derivation of the abstract syntax tree that is, the order in which each business report is called, in which, through the above recursive calculation method, a large and complex problem can be transformed into a smaller problem similar to the original problem. Solve, simplify the operation difficulty.
  • the step S404 of parsing the target task script and establishing a work stack includes:
  • S4042 Traverse the depth of the ASTNode abstract syntax tree, and parse out the output input table and the condition judgment statement of the ASTNode abstract syntax tree;
  • the target task script is first converted into the ASTNode abstract syntax tree.
  • the ASTNode abstract syntax tree does not depend on the specific grammar and does not depend on the details of the language, which can solve the redundant components brought by the grammar analysis. The redundant components may be It will adversely affect the subsequent stages.
  • the target task script is a step that is judged by conditions and executed in sequence. If the equivalent exchange of grammars is performed before, it may affect the subsequent steps. Therefore, using the ASTNode abstract syntax tree can solve the technical problems brought by the grammar. Specifically, the target task script is first converted into an ASTNode abstract syntax tree.
  • the conversion method can be to set the nodes of the tree according to the conditional judgment in the target task script, and set the branches of the tree according to the relationship between the various steps, thereby Get the corresponding ASTNode abstract syntax tree.
  • set the corresponding execution plan that is, first calculate the result that can be calculated, and then return the calculated result to the previous node to continue the calculation, and use the above calculation method to obtain the corresponding execution plan, so as to obtain the work. stack.
  • the step S5 of storing the business reports and the coupling relationship between the business reports in the target database includes:
  • S502 Sort out hierarchical rules according to the table information
  • S504 Perform cluster analysis on the business reports of the same level, and give the same labels to the business reports of the same class according to the analysis results;
  • S505 Classify and store each of the business reports in the target database according to the labels of each of the business reports, and store the coupling relationship between the business reports.
  • the classified storage of the business report is realized. That is, first obtain the table information of the business report (generally only the header), and after obtaining the table information of each business report, you can sort out the corresponding hierarchical rules.
  • the way of sorting is to set the correspondence between the table information and the level in advance. relationship, and then obtain the hierarchical rules that adapt to all business tables according to the table information, that is, some business reports may be derived from the content of other business reports, but this is generally recorded in the header, so according to the header You can divide the levels of each business report, divide each business report into different levels, and then perform cluster analysis.
  • the clustering method can be text clustering algorithm (clustering algorithm based on division, clustering algorithm, density-based clustering algorithm, grid-based clustering algorithm, model-based clustering algorithm, and fuzzy-based clustering algorithm), and then assign the same label to the business report of the same type. Subsequently, each business report and the coupling relationship between the business reports are saved in the target database according to the corresponding tags.
  • the step S5 of storing the business reports and the coupling relationship between the business reports in the target database includes:
  • S511 Obtain script information of the task script; wherein, the script information at least includes a script path, an operation type, and an associated business report involved;
  • S513 Set a corresponding weight for each of the associated business reports according to the number of occurrences of each of the associated business reports;
  • S514 Set the vertex information as the primary key of the associated service report, set the weight as the vertex attribute of the associated service report to save, and save the coupling relationship between each of the service reports.
  • each business report is a vertex
  • the data content it contains is vertex attribute.
  • the relationship between vertices and vertices is the coupling relationship between business reports
  • the vertex attribute is the basis for the importance of the business report, that is, in the later retrieval process, if the vertex attribute is good, you can first
  • the vertex is traversed.
  • the script information of the task script is obtained, wherein the script information includes the corresponding script path, the operation type, the related business report involved, and even the data source in the script data. According to the script information, the corresponding association can be obtained.
  • the number of occurrences of business reports and related business reports, and the vertex information (that is, the information of the business report, including the content in the business report and the coupling relationship with other business reports, etc.), set the weight for the related business report according to the number of occurrences of the related business report , so as to facilitate subsequent retrieval, it should be understood that the more times the associated business report appears, the greater its weight, the less the number of times the associated business report appears, the smaller its weight, and then set the primary key for the associated business report, where the primary key For the representation of the associated business report, it can be data encrypted with script information, or directly use the script information as the primary key, and then set the weight as the vertex attribute to save, thus realizing the preservation of each business report.
  • the method further includes:
  • S601 Detect intermediate temporary tables in each of the business reports according to a set detection rule
  • S602 Obtain a first report that has a blood relationship with the intermediate temporary table, and a second report that has an associated relationship with the intermediate temporary table; the first report and the second report are both the business report;
  • S604 Delete the intermediate temporary table to establish a knowledge graph of the target database.
  • the optimization of the target database is realized. That is, the intermediate temporary tables in each of the business reports are detected according to the set detection rules.
  • the set detection rule can be set as the detection header, that is, according to the information in the header, you can know whether the business report is The intermediate temporary table, and then obtain the first report that has a blood relationship with the intermediate temporary table and the second report that has an associated relationship. The relationship of the table to other business reports.
  • the coupling relationship between the first report and the second report is directly established.
  • the label of the intermediate temporary table can be marked as False
  • the graph relationships in the target database include four types of False-True, False-False, True-False, and True-True.
  • the coupling relationship between True-True does not need to be processed. False-True, False-False, True-False, perform Pregel graph iterative calculation, every time True-n Talse-tures are encountered, the head-to-tail relationship is stored in the vertex attribute set. Delete the False vertices, and directly establish the relationship between True and True according to the attribute set. This simplifies the knowledge graph of the target database, enables users to extract valuable data more clearly and intuitively, and facilitates the maintenance of the target database.
  • the present application also provides a device for integrating business reports, including:
  • the search module 10 is used to search the source database that saves the business report
  • the reading module 20 is used 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, wherein the data dictionary records the location information of each of the business reports;
  • the generating module 30 is configured to generate respectively corresponding acquisition scripts of each business report according to the data dictionary, and acquire a task script for operating each of the business reports according to each of the acquisition scripts;
  • an acquisition module 40 used for recursively analyzing each of the task scripts to acquire the coupling relationship between each of the business reports;
  • the storage module 50 is configured to acquire the business reports in each source database, and store the business reports and the coupling relationship between the business reports in the target database.
  • the obtaining module 40 includes:
  • a detection submodule for detecting the business report executed in each of the SQL statements, and whether the SQL statements are executable
  • a processing submodule for performing executable processing on the unexecutable SQL statement to obtain an executable processing target task script
  • the parsing submodule is used for recursively parsing the calculation functions in each step of the work stack to obtain the coupling relationship between the business reports.
  • a sub-module is established, including:
  • a traversing unit used to traverse the depth of the ASTNode abstract syntax tree, and parse out the output input table and the condition judgment statement of the ASTNode abstract syntax tree;
  • a setting unit configured to set the execution plan of the ASTNode abstract syntax tree according to the output and input table and the conditional judgment statement, so as to obtain the work stack.
  • the storage module 50 includes:
  • a form information acquisition sub-module used to acquire the form information of each of the business reports
  • a clustering submodule for performing cluster analysis on the business reports of the same level, and assigning the same labels to the business reports of the same class according to the analysis results;
  • the storage sub-module is configured to classify and store each of the business reports in the target database according to the labels of each of the business reports, and store the coupling relationship between the business reports.
  • the storage module 50 further includes:
  • a script information acquisition sub-module used for acquiring script information of the task script; wherein the script information at least includes a script path, an operation type and a related business report;
  • a script information analysis sub-module for analyzing the script information to obtain the occurrence times and vertex information of each of the associated business reports
  • a weight setting submodule configured to set a corresponding weight for each of the associated business reports according to the number of occurrences of each of the associated business reports;
  • the primary key setting submodule is used to set the vertex information as the primary key of the associated business report, and to set the weight as the vertex attribute of the associated business report to save, and to save the relationship between each of the business reports. coupling relationship.
  • the device for integrating business reports further includes:
  • an intermediate temporary table detection module used for detecting the intermediate temporary table in each of the business reports according to the set detection rules
  • the first report obtaining module is used to obtain a first report that has a blood relationship with the intermediate temporary table, and a second report that has an associated relationship with the intermediate temporary table; the first report and the second report are for said business statement;
  • a coupling relationship establishing module configured to directly establish a coupling relationship between the first statement and the second statement according to the coupling relationship between the intermediate temporary table and the second statement;
  • a deletion module is used to delete the intermediate temporary table to establish a knowledge graph of the target database.
  • the beneficial effects of the present application are as follows: the corresponding task script is acquired by setting the acquisition script, and the coupling relationship between the business reports is parsed, and the business reports in each source database and the coupling relationship between the business reports are acquired, saved and stored.
  • the target database contains all the business reports in each source database, and also retains the coupling relationship between each business report in the source database, so that when the relevant personnel search in the target database, they do not need to traverse multiple source databases, and can get with traversing multiple source databases for retrieval results.
  • an embodiment of the present application further provides a computer device.
  • the computer device may be a server, and its internal structure may be as shown in FIG. 3 .
  • the computer device includes a processor, memory, a network interface and a database connected by a system bus.
  • the processor of the computer design is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium, an internal memory.
  • the nonvolatile storage medium stores an operating system, a computer program, and a database.
  • the memory provides an environment for the execution of the operating system and computer programs in the non-volatile storage medium.
  • the database of the computer equipment is used to store various business reports and the like.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.

Abstract

A service report integration method and apparatus, a device, and a storage medium, which relate to the field of artificial intelligence. The method comprises: searching source databases that store service reports (S1); reading database table information in each source database, and generating a data dictionary according to each piece of the database table information (S2); according to the data dictionary, generating an acquisition script respectively corresponding to each service report, and according to each acquisition script, acquiring a task script for operating each service report (S3); recursively parsing the task scripts so as to acquire coupling relationships between the service reports (S4); and acquiring the service reports in each source database, and storing the service reports and the coupling relationships between the service reports to obtain a target database (S5). The beneficial effect is that the target database not only has all of the service reports in each source database, but also retains the coupling relationships between the service reports in the source databases.

Description

整合业务报表的方法、装置、设备以及存储介质Method, device, device and storage medium for integrating business reports
本申请要求于2020年12月24日提交中国专利局、申请号为2020115494160,发明名称为“整合业务报表的方法、装置、设备以及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 2020115494160 and the invention titled "Method, Apparatus, Equipment and Storage Medium for Integrating Business Reports" filed with the China Patent Office on December 24, 2020, the entire contents of which are by reference Incorporated in this application.
技术领域technical field
本申请涉及数据处理领域,特别涉及一种整合业务报表的方法、装置、设备以及存储介质。The present application relates to the field of data processing, and in particular, to a method, apparatus, device and storage medium for integrating business reports.
背景技术Background technique
数据库又称为数据管理系统,是处理的数据按照一定的方式储存在一起,能够让多个用户共享、尽可能减小冗余度的数据集合。发明人意识到,在保存业务数据时,由于数据库的局限性或者是开发人员针对不同的功能进行开发时,可能会将相同种类业务数据分别保存在多个数据库中,检索时需要遍历各个数据库,使得检索过程十分繁琐。甚至有的业务数据会重复保存,浪费保存空间,因此亟需一种整合业务报表的方法。A database, also known as a data management system, is a collection of data in which the processed data is stored together in a certain way, allowing multiple users to share and reducing redundancy as much as possible. The inventor realized that when saving business data, due to the limitations of the database or when developers develop different functions, the same type of business data may be stored in multiple databases respectively, and each database needs to be traversed during retrieval. This makes the retrieval process very cumbersome. Even some business data will be saved repeatedly, wasting storage space, so a method of integrating business reports is urgently needed.
技术问题technical problem
本申请的主要目的为提供一种整合业务报表的方法、装置、设备以及存储介质,旨在解决检索时需要遍历各个数据库,使得检索过程十分繁琐的问题。The main purpose of the present application is to provide a method, device, device and storage medium for integrating business reports, which aims to solve the problem that each database needs to be traversed during retrieval, which makes the retrieval process very cumbersome.
技术解决方案technical solutions
本申请提供了一种整合业务报表的方法,包括:This application provides a method for integrating business reports, including:
搜索保存有业务报表的源数据库;Search the source database where business reports are stored;
读取各所述源数据库中的库表信息,并根据各所述库表信息生成数据字典,其中所述数据字典记载有各所述业务报表的位置信息;Reading the library table information in each of the source databases, and generating a data dictionary according to each of the library table information, wherein the data dictionary records the location information of each of the business reports;
根据所述数据字典生成各业务报表分别对应的获取脚本,并根据各所述获取脚本获取操作各所述业务报表的任务脚本;Generate respective acquisition scripts corresponding to each business report according to the data dictionary, and acquire a task script for operating each of the business reports according to each of the acquisition scripts;
递归解析各所述任务脚本以获取各所述业务报表之间的耦合关系;Recursively analyze each of the task scripts to obtain the coupling relationship between each of the business reports;
获取各源数据库中的所述业务报表,并将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库。Acquire the business reports in each source database, and store the business reports and the coupling relationship between the business reports in the target database.
本申请还提供了一种整合业务报表的装置,包括:The application also provides a device for integrating business reports, including:
搜索模块,用于搜索保存有业务报表的源数据库;The search module is used to search the source database that saves the business report;
读取模块,用于读取各所述源数据库中的库表信息,并根据各所述库表信息生成数据字典,其中所述数据字典记载有各所述业务报表的位置信息;a reading module, 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, wherein the data dictionary records the location information of each of the business reports;
生成模块,用于根据所述数据字典生成各业务报表分别对应的获取脚本,并根据各所述获取脚本获取操作各所述业务报表的任务脚本;a generating module, configured to generate respective acquisition scripts corresponding to each business report according to the data dictionary, and obtain a task script for operating each of the business reports according to each of the acquisition scripts;
获取模块,用于递归解析各所述任务脚本以获取各所述业务报表之间的耦合关系;an acquisition module, used to recursively parse each of the task scripts to acquire the coupling relationship between each of the business reports;
存储模块,用于获取各源数据库中的所述业务报表,并将各所述业务报表以及各所述业务报表之间的耦合关系进行存储,得到所述目标数据库。The storage module is used for acquiring the business reports in each source database, and storing the business reports and the coupling relationship between the business reports to obtain the target database.
本申请还提供了一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行整合业务报表的方法的步骤:The present application also provides a computer device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the integrated business report The steps of the method:
搜索保存有业务报表的源数据库;Search the source database where business reports are stored;
读取各所述源数据库中的库表信息,并根据各所述库表信息生成数据字典,其中所述数据字典记载有各所述业务报表的位置信息;Reading the library table information in each of the source databases, and generating a data dictionary according to each of the library table information, wherein the data dictionary records the location information of each of the business reports;
根据所述数据字典生成各业务报表分别对应的获取脚本,并根据各所述获取脚本获取操作各所述业务报表的任务脚本;Generate respective acquisition scripts corresponding to each business report according to the data dictionary, and acquire a task script for operating each of the business reports according to each of the acquisition scripts;
递归解析各所述任务脚本以获取各所述业务报表之间的耦合关系;Recursively analyze each of the task scripts to obtain the coupling relationship between each of the business reports;
获取各源数据库中的所述业务报表,并将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库。Acquire the business reports in each source database, and store the business reports and the coupling relationship between the business reports in the target database.
本申请还提供了一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行所述计算机设备的步骤:The present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors perform the steps of the computer device:
搜索保存有业务报表的源数据库;Search the source database where business reports are stored;
读取各所述源数据库中的库表信息,并根据各所述库表信息生成数据字典,其中所述数据字典记载有各所述业务报表的位置信息;Reading the library table information in each of the source databases, and generating a data dictionary according to each of the library table information, wherein the data dictionary records the location information of each of the business reports;
根据所述数据字典生成各业务报表分别对应的获取脚本,并根据各所述获取脚本获取操作各所述业务报表的任务脚本;Generate respective acquisition scripts corresponding to each business report according to the data dictionary, and acquire a task script for operating each of the business reports according to each of the acquisition scripts;
递归解析各所述任务脚本以获取各所述业务报表之间的耦合关系;Recursively analyze each of the task scripts to obtain the coupling relationship between each of the business reports;
获取各源数据库中的所述业务报表,并将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库。Acquire the business reports in each source database, and store the business reports and the coupling relationship between the business reports in the target database.
有益效果beneficial effect
通过设定获取脚本获取对应的任务脚本,并解析出各业务报表之间的耦合关系,获取保并存各个源数据库中的业务报表以及各业务报表之间的耦合关系。使得目标数据库中既有各源数据库中所有的业务报表,又保留有源数据库中各个业务报表之间的耦合关系,使相关人员在目标数据库中检索时,无需遍历多个源数据库,又可以得到与遍历多个源数据库中的检索结果。The corresponding task script is obtained by setting the obtaining script, and the coupling relationship between the business reports is parsed, and the business reports in each source database and the coupling relationship between the business reports are obtained and saved. The target database contains all the business reports in each source database, and also retains the coupling relationship between each business report in the source database, so that when relevant personnel search in the target database, they do not need to traverse multiple source databases, and can get with traversing multiple source databases for retrieval results.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description serve to explain the principles of the application.
图1 是本申请一实施例的一种整合业务报表的方法的流程示意图;FIG. 1 is a schematic flowchart of a method for integrating business reports according to an embodiment of the present application;
图2 是本申请一实施例的一种整合业务报表的装置的结构示意框图;2 is a schematic structural block diagram of an apparatus for integrating business reports according to an embodiment of the present application;
图3 为本申请一实施例的计算机设备的结构示意框图。FIG. 3 is a schematic structural block diagram of a computer device according to an embodiment of the present application.
本申请的最佳实施方式Best Mode for Carrying Out the Application
参照图1,本申请提出一种整合业务报表的方法,包括:1, the present application proposes a method for integrating business reports, including:
S1:搜索保存有业务报表的源数据库;S1: Search the source database where business reports are stored;
S2:读取各所述源数据库中的库表信息,并根据各所述库表信息生成数据字典;其中所述数据字典记载有各所述业务报表的位置信息;S2: Read the library table information in each of the source databases, and generate a data dictionary according to each of the library table information; wherein the data dictionary records the location information of each of the business reports;
S3:根据所述数据字典生成各业务报表分别对应的获取脚本,并根据各所述获取脚本获取操作各所述业务报表的任务脚本;S3: Generate respective acquisition scripts corresponding to each business report according to the data dictionary, and obtain a task script for operating each of the business reports according to each of the acquisition scripts;
S4:递归解析各所述任务脚本以获取各所述业务报表之间的耦合关系;S4: recursively parse each of the task scripts to obtain the coupling relationship between each of the business reports;
S5:获取各源数据库中的所述业务报表,并将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库。S5: Acquire the business reports in each source database, and store the business reports and the coupling relationship between the business reports in the target database.
如上述步骤S1所述,搜索保存有业务报表的源数据库。获取的方式为可以先获取到所需业务报表的表头信息,根据表头信息设定对应的自动化脚本读取各个初始数据库中的库表信息,应当理解的是,该表头信息一般指业务报表的抬头,设定的自动化脚本可以仅仅是该表头信息,也可以包括该表头信息的近义信息,以使获取的业务数据报表更加全面。自动化脚本的设置可以根据表头信息自行设置,也可以由开发人员进行设定。As described in the above step S1, the source database storing the business report is searched. The way to obtain it is to first obtain the header information of the required business report, and then set the corresponding automated script according to the header information to read the library table information in each initial database. It should be understood that the header information generally refers to the business report. For the header of the report, the set automation script can be only the header information, or can include the synonymous information of the header information, so that the obtained business data report is more comprehensive. The settings of the automation script can be set by themselves according to the header information, or can be set by the developer.
如上述步骤S2所述,读取各所述源数据库中的库表信息,并根据各所述库表信息生成数据字典。读取的方式可以是根据自动化脚本读取初始数据库中的库表信息,筛选出具有业务报表的源数据库,并获取源数据库中的库表信息,该库表信息中为不同数据表格的目录。数据库一般都会建立库表信息,以便于查询对应的资料,若没有库表信息,则可以通过遍历的方式进行获取库表信息,然后根据库表信息生成对应的数据字典,该数据字典中包含了各个业务报表所存的数据库的位置,以及在数据库中的位置信息。在一些实施例中,可能会存在某一个业务表格同时存在于两个源数据库中,因此根据各个源数据库的库存信息建立数据字典前可以进行查重,即检测出是否有相同抬头的业务报表,若有,则可以只获取其中一份业务报表,以免发生数据重复的问题。As described in the above step S2, the library table information in each of the source databases is read, and a data dictionary is generated according to each of the library table information. The reading method may be to read the library table information in the initial database according to the automated script, filter out the source database with business reports, and obtain the library table information in the source database, where the library table information is the directory of different data tables. The database generally establishes the database table information to facilitate the query of the corresponding data. If there is no database table information, the database table information can be obtained by traversing, and then the corresponding data dictionary is generated according to the database table information. The location of the database where each business report is stored, and the location information in the database. In some embodiments, a certain business form may exist in two source databases at the same time. Therefore, before establishing a data dictionary according to the inventory information of each source database, a duplicate check can be performed, that is, it can be detected whether there is a business report with the same title. If so, you can obtain only one of the business reports to avoid the problem of data duplication.
如上述步骤S3所述,根据所述数据字典生成各业务报表分别对应的获取脚本,并根据各所述获取脚本获取操作各所述业务报表的任务脚本。其中任务脚本可以存在于源数据库中,也可以存在于第三客户端等第三方渠道中,通过获取脚本去设定的位置获取即可。其中根据数据字典设定多个相应的获取脚本,其中,获取脚本除了获取对应的业务报表之外,还应获取与业务报表相关的任务脚本。其中,该各任务脚本为操作该业务报表的任务脚本,即通过获取操作业务报表的业务报表可以获知业务报表被使用的情况,也可以知道在源数据库中各业务报表被调用的情况,即与其他业务报表的耦联关系。As described in the above step S3, an acquisition script corresponding to each business report is generated according to the data dictionary, and a task script for operating each of the business reports is acquired according to each of the acquisition scripts. The task script can exist in the source database or in a third-party channel such as a third client, and can be obtained by obtaining the script at the set location. A plurality of corresponding acquisition scripts are set according to the data dictionary, wherein, in addition to acquiring the corresponding business report, the acquisition script should also acquire a task script related to the business report. Among them, each task script is a task script for operating the business report, that is, by obtaining the business report for operating the business report, the use of the business report can be known, and the situation of each business report being called in the source database can be known, that is, the same as that of the source database. Coupling relationship of other business reports.
如上述步骤S4所述,递归解析各所述任务脚本以获取各所述业务报表之间的耦合关系。由于任务脚本的执行过程可能会非常的复杂,直接解析可能难以得到最终的结果,因此可以获取各任务脚本的执行步骤,通过反向递推的方式得到最后的结果,即对各任务脚本的递归解析。As described in the above step S4, each of the task scripts is recursively parsed to obtain the coupling relationship between each of the business reports. Since the execution process of the task script may be very complicated, it may be difficult to obtain the final result by direct analysis. Therefore, the execution steps of each task script can be obtained, and the final result can be obtained by reverse recursion, that is, the recursion of each task script. Parse.
如上述步骤S5所述,获取各源数据库中的所述业务报表,并将各所述业务报表以及各所述业务报表之间的耦合关系进行存储,得到所述目标数据库。将获取到各个源数据库中的业务报表以及解析到的业务报表之间的耦合关系进行存储。从而使得到的目标数据库既包含了各源数据库中所有的业务报表,又保留有源数据库中各个业务报表之间的耦合关系,使相关人员在目标数据库中检索时,无需遍历多个源数据库,又可以得到与遍历多个源数据库中的检索结果。As described in step S5 above, the business reports in each source database are acquired, and the business reports and the coupling relationship between the business reports are stored to obtain the target database. The business reports obtained from each source database and the coupling relationship between the parsed business reports are stored. Therefore, the obtained target database not only contains all the business reports in each source database, but also retains the coupling relationship between each business report in the source database, so that the relevant personnel do not need to traverse multiple source databases when searching in the target database. It is also possible to obtain and traverse the retrieval results in multiple source databases.
在一个实施例中,所述递归解析各所述任务脚本以获取各所述业务报表之间的耦合关系的步骤S4,包括:In one embodiment, the step S4 of recursively analyzing each of the task scripts to obtain the coupling relationship between each of the business reports includes:
S401:获取任务脚本中涉及的一个或者多个SQL语句;S401: Obtain one or more SQL statements involved in the task script;
S402:检测各所述SQL语句中所执行的所述业务报表,以及所述SQL语句是否可执行;S402: Detect the business report executed in each of the SQL statements, and whether the SQL statement is executable;
S403:将不可执行的所述SQL语句进行可执行化处理,得到可执行化处理的目标任务脚本;S403: Perform executable processing on the non-executable SQL statement to obtain an executable target task script;
S404:解析所述目标任务脚本,并基于解析的内容建立工作栈;其中,所述工作栈包括所述目标任务脚本执行的各个步骤;S404: Parse the target task script, and build a work stack based on the parsed content; wherein, the work stack includes each step executed by the target task script;
S405:递归解析所述工作栈各个步骤中的计算函数,得到所述业务报表之间的耦合关系。S405: Recursively analyze the calculation functions in each step of the work stack to obtain the coupling relationship between the business reports.
如上述步骤S401-S405所述,实现了对任务脚本的递归解析。其中任务脚本中包括至少一句SQL(Structured Query Language,结构化查询语言)语句,已完成任务脚本中对应的任务,本申请中主要是获取各个业务报表之间的耦合关系,即在这个任务脚本中业务报表被调用的次数,以及被调用的顺序,关联度等。具体地,先检测出SQL语句中所执行的业务报表(需要说明的是,SQL中不含业务报表,仅仅是包含了对各个业务报表的处理,调用等执行命令),由于获取到的SQL语句常常含有指令、特殊函数、自定义函数、动态传参等使SQL语句不可执行,因此需要通过置换函数、或者是参数常量化等操作将不可执行语句变为可执行语句,上述操作可以通过设置对应的程序实现自动化完成,然若碰到无法自动处理的不可执行语句,则可以将该不可执行语句单独提取出来,由对应的技术人员对该不可执行语句进行可执行化处理(一般也为通过置换函数、或者是参数常量化等操作进行处理)。从而使任务脚本中的SQL语句都可以被执行,得到目标任务脚本。解析目标任务脚本并建立工作栈,其中,建立工作栈的方式可以是通过建立抽象语法树,将目标任务脚本中的条件判断结合设定抽象语法树的节点,然后根据目标任务脚本的执行步骤,反向推导抽象语法树的结果,即各个业务报表被调用的先后顺序,其中,通过上述的递归计算方法可以将一个大型复杂的问题层层转化为一个与原问题相似的规模较小的问题来求解,简化了运算难度。As described in the above steps S401-S405, recursive parsing of the task script is implemented. The task script includes at least one SQL (Structured Query Language, Structured Query Language) statement, and the corresponding task in the task script has been completed. In this application, the coupling relationship between various business reports is mainly obtained, that is, in this task script The number of times the business report is called, as well as the order in which it is called, the degree of relevance, etc. Specifically, the business report executed in the SQL statement is first detected (it should be noted that SQL does not contain business reports, but only includes processing, calling and other execution commands for each business report). Since the obtained SQL statement It often contains instructions, special functions, custom functions, dynamic parameter transfer, etc. to make SQL statements unexecutable. Therefore, it is necessary to change the unexecutable statement into an executable statement by replacing the function or parameter constancy. The above operations can be set by setting the corresponding The program is automatically completed, but if you encounter an unexecutable statement that cannot be processed automatically, you can extract the unexecutable statement separately, and the corresponding technician will perform the executable processing on the unexecutable statement (usually also through replacement). functions, or operations such as parameter constancy for processing). Therefore, all the SQL statements in the task script can be executed to obtain the target task script. Parse the target task script and establish a work stack, wherein the way of establishing the work stack can be by establishing an abstract syntax tree, combining the conditional judgment in the target task script to set the nodes of the abstract syntax tree, and then according to the execution steps of the target task script, The result of the reverse derivation of the abstract syntax tree, that is, the order in which each business report is called, in which, through the above recursive calculation method, a large and complex problem can be transformed into a smaller problem similar to the original problem. Solve, simplify the operation difficulty.
在一个实施例中,所述解析所述目标任务脚本并建立工作栈的步骤S404,包括:In one embodiment, the step S404 of parsing the target task script and establishing a work stack includes:
S4041:将所述目标任务脚本转化为ASTNode抽象语法树;S4041: Convert the target task script into an ASTNode abstract syntax tree;
S4042:遍历所述ASTNode抽象语法树的深度,并解析出所述ASTNode抽象语法树的输出输入表以及条件判断语句;S4042: Traverse the depth of the ASTNode abstract syntax tree, and parse out the output input table and the condition judgment statement of the ASTNode abstract syntax tree;
S4043:根据所述输出输入表以及所述条件判断语句设定ASTNode抽象语法树的执行方案,以得到所述工作栈。S4043: Set the execution plan of the ASTNode abstract syntax tree according to the output and input table and the conditional judgment statement, so as to obtain the work stack.
如上述步骤S4041-S4043所述,实现了工作栈的简历。即将目标任务脚本先转化为ASTNode抽象语法树,其中,ASTNode抽象语法树不依赖于具体的文法,不依赖于语言的细节,可以解决在进行文法分析是所带来的多余成分,该多余成分可能会对后续阶段造成不利的影响,目标任务脚本是通过条件判断,依次执行的步骤,若在之前进行文法的等价交换,可能会影响后续的步骤。因此采用ASTNode抽象语法树可以解决文法方面带来的技术问题。具体地,先将目标任务脚本转化为ASTNode抽象语法树,转化的方法可以是根据目标任务脚本中的条件判断设定出树的节点,根据各个步骤之间的关系设置出树的枝干,从而得到对应的ASTNode抽象语法树。遍历所述ASTNode抽象语法树的深度,并解析出所述ASTNode抽象语法树的输出输入表以及条件判断语句,其中,深度是指树枝干的复杂程度,即需要进行的步骤数目,然后解析出其中的输出输入表以及条件判断语句。然后再设定出对应的执行方案,即现将可以计算得到的结果先进行计算,然后再将该计算的结果返回上一个节点继续计算,采用如上的计算方式得到对应的执行方案,从而得到工作栈。As described in the above steps S4041-S4043, the resume of the work stack is realized. The target task script is first converted into the ASTNode abstract syntax tree. The ASTNode abstract syntax tree does not depend on the specific grammar and does not depend on the details of the language, which can solve the redundant components brought by the grammar analysis. The redundant components may be It will adversely affect the subsequent stages. The target task script is a step that is judged by conditions and executed in sequence. If the equivalent exchange of grammars is performed before, it may affect the subsequent steps. Therefore, using the ASTNode abstract syntax tree can solve the technical problems brought by the grammar. Specifically, the target task script is first converted into an ASTNode abstract syntax tree. The conversion method can be to set the nodes of the tree according to the conditional judgment in the target task script, and set the branches of the tree according to the relationship between the various steps, thereby Get the corresponding ASTNode abstract syntax tree. Traverse the depth of the ASTNode abstract syntax tree, and parse out the output and input table and conditional judgment statement of the ASTNode abstract syntax tree, where the depth refers to the complexity of the branches, that is, the number of steps to be performed, and then parse out which The output input table and conditional judgment statement. Then set the corresponding execution plan, that is, first calculate the result that can be calculated, and then return the calculated result to the previous node to continue the calculation, and use the above calculation method to obtain the corresponding execution plan, so as to obtain the work. stack.
在一个实施例中,所述将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库的步骤S5,包括:In one embodiment, the step S5 of storing the business reports and the coupling relationship between the business reports in the target database includes:
S501:获取各所述业务报表的表格信息;S501: Obtain table information of each of the business reports;
S502:根据所述表格信息整理出层级规则;S502: Sort out hierarchical rules according to the table information;
S503:根据所述层级规则将各个所述业务报表划分至不同的层级;S503: Divide each of the business reports into different levels according to the level rule;
S504:将相同层级的所述业务报表进行聚类分析,并根据分析结果对同类的所述业务报表赋予相同的标签;S504: Perform cluster analysis on the business reports of the same level, and give the same labels to the business reports of the same class according to the analysis results;
S505:按照各所述业务报表的所述标签将各所述业务报表分类存储至所述目标数据库,以及存储各业务报表之间的耦合关系。S505: Classify and store each of the business reports in the target database according to the labels of each of the business reports, and store the coupling relationship between the business reports.
如上述步骤S501-S505所述,实现了对业务报表的分类保存。即先获取到业务报表的表格信息(一般只获取表头),得到各个业务报表的表格信息后,可以整理出对应的层级规则,整理的方式为事先设定好表格信息与层级之间的对应关系,然后根据表格信息获取到适配所有业务表格的层级规则,即有的业务报表可能是由其他业务报表中的内容衍生出来的,但是这个一般在表头中都会记载有,因此根据表头可以对各个业务报表的层级进行划分,将各个业务报表划分至不同的层级,然后进行聚类分析,聚类的方式可以是采用文本聚类算法(基于划分的聚类算法、基于层次的聚类算法、基于密度的聚类算法、基于网格的聚类算法、基于模型的聚类算法以及基于模糊的聚类算法中的任意一种),然后对同类的所述业务报表赋予相同的标签。后续根据对应的标签在目标数据库中保存各个业务报表以及业务报表之间的耦合关系。As described in the above steps S501-S505, the classified storage of the business report is realized. That is, first obtain the table information of the business report (generally only the header), and after obtaining the table information of each business report, you can sort out the corresponding hierarchical rules. The way of sorting is to set the correspondence between the table information and the level in advance. relationship, and then obtain the hierarchical rules that adapt to all business tables according to the table information, that is, some business reports may be derived from the content of other business reports, but this is generally recorded in the header, so according to the header You can divide the levels of each business report, divide each business report into different levels, and then perform cluster analysis. The clustering method can be text clustering algorithm (clustering algorithm based on division, clustering algorithm, density-based clustering algorithm, grid-based clustering algorithm, model-based clustering algorithm, and fuzzy-based clustering algorithm), and then assign the same label to the business report of the same type. Subsequently, each business report and the coupling relationship between the business reports are saved in the target database according to the corresponding tags.
在一个实施例中,所述将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库的步骤S5,包括:In one embodiment, the step S5 of storing the business reports and the coupling relationship between the business reports in the target database includes:
S511:获取任务脚本的脚本信息;其中,所述脚本信息至少包括脚本路径、操作类型以及涉及的关联业务报表;S511: Obtain script information of the task script; wherein, the script information at least includes a script path, an operation type, and an associated business report involved;
S512:分析所述脚本信息,得到各所述关联业务报表的出现的次数以及顶点信息;S512: Analyze the script information to obtain the occurrence times and vertex information of each of the associated business reports;
S513:根据各所述关联业务报表的出现的次数为各所述关联业务报表设置对应的权重;S513: Set a corresponding weight for each of the associated business reports according to the number of occurrences of each of the associated business reports;
S514:将所述顶点信息设置为所述关联业务报表的主键,并将所述权重设置为所述关联业务报表的顶点属性进行保存,以及保存各所述业务报表之间的耦合关系。S514: Set the vertex information as the primary key of the associated service report, set the weight as the vertex attribute of the associated service report to save, and save the coupling relationship between each of the service reports.
如上述步骤所述,实现了对各个关联业务报表的保存。即在目标数据库中,每一个业务报表都是一个顶点,其包含的数据内容为顶点属性。在顶点与顶点之间的关系,即为业务报表之间的耦合关系,而顶点属性为该业务报表的重要性的依据,即在后边检索过程中,若该顶点属性较好,则可以先对该顶点进行遍历。具体地,获取到任务脚本的脚本信息,其中,脚本信息中包括有对应的脚本路径、操作类型以及涉及的关联业务报表,甚至还包括脚本数据中的数据源,根据该脚本信息可以得到对应关联业务报表以及关联业务报表出现的次数,和顶点信息(即业务报表的信息,包括业务报表中的内容以及与其他业务报表的耦合关系等),根据关联业务报表出现的次数为关联业务报表设置权重,以便于后续的检索,应当理解的是,关联业务报表出现的次数越多,其权重越大,关联业务报表出现的次数越少,其权重越小,然后为关联业务报表设置主键,其中主键为关联业务报表的表现形式,可以是将脚本信息进行加密后的数据,也可以直接由脚本信息作为主键,然后将权重设置为顶点属性进行保存,从而实现了对各个业务报表的保存。As described in the above steps, the saving of each associated business report is realized. That is, in the target database, each business report is a vertex, and the data content it contains is vertex attribute. The relationship between vertices and vertices is the coupling relationship between business reports, and the vertex attribute is the basis for the importance of the business report, that is, in the later retrieval process, if the vertex attribute is good, you can first The vertex is traversed. Specifically, the script information of the task script is obtained, wherein the script information includes the corresponding script path, the operation type, the related business report involved, and even the data source in the script data. According to the script information, the corresponding association can be obtained. The number of occurrences of business reports and related business reports, and the vertex information (that is, the information of the business report, including the content in the business report and the coupling relationship with other business reports, etc.), set the weight for the related business report according to the number of occurrences of the related business report , so as to facilitate subsequent retrieval, it should be understood that the more times the associated business report appears, the greater its weight, the less the number of times the associated business report appears, the smaller its weight, and then set the primary key for the associated business report, where the primary key For the representation of the associated business report, it can be data encrypted with script information, or directly use the script information as the primary key, and then set the weight as the vertex attribute to save, thus realizing the preservation of each business report.
在一个实施例中,所述获取各源数据库中的所述业务报表,并将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库的步骤S5之后,还包括:In one embodiment, after the step S5 of acquiring the business reports in each source database and storing the business reports and the coupling relationship between the business reports in the target database, the method further includes:
S601:按照设定的检测规则检测各所述业务报表中的中间临时表;S601: Detect intermediate temporary tables in each of the business reports according to a set detection rule;
S602:获取与所述中间临时表具有血缘关系的第一报表,以及与所述中间临时表具有关联关系的第二报表;所述第一报表和所述第二报表均为所述业务报表;S602: Obtain a first report that has a blood relationship with the intermediate temporary table, and a second report that has an associated relationship with the intermediate temporary table; the first report and the second report are both the business report;
S603:根据所述中间临时表与所述第二报表的耦合关系,直接建立所述第一报表与所述第二报表之间的耦合关系;S603: According to the coupling relationship between the intermediate temporary table and the second report, directly establish a coupling relationship between the first report and the second report;
S604:删除所述中间临时表以建立所述目标数据库的知识图谱。S604: Delete the intermediate temporary table to establish a knowledge graph of the target database.
如上述步骤S601-S604所述,实现了对目标数据库的优化。即按照设定的检测规则检测各所述业务报表中的中间临时表。一般来说每个业务报表在生成时,都会以生成的依据时间作为表头,故设定的检测规则可以设定为检测表头,即根据表头的信息就可以得知该业务报表是否为中间临时表,然后获取到与中间临时表具有血缘关系的第一报表以及具有关联关系的第二报表,其中获取的方式是根据分析得到的耦合关系所得到的,即耦合关系中记载着中间临时表与其他业务报表的关系。根据所述中间临时表与所述第二报表的耦合关系,直接建立所述第一报表与所述第二报表之间的耦合关系,具体地,可以将中间临时表的标签记为False,而将其他业务报表的记为True,则在目标数据库中的图谱关系包括四种False-True,False-False,Ture-False,True-True,对于True-True之间的耦合关系无需进行处理,对于False-True,False-False,Ture-False,进行Pregel图迭代计算,每遇到True-n个Talse-ture将首尾关系存入顶点属性集合。将False的顶点删除,根据属性集合直接建立True和True之间的关系。从而简化了目标数据库的知识图谱,使用户更清晰直观的提取有用价值的数据,也方便对目标数据库的维护。As described in the above steps S601-S604, the optimization of the target database is realized. That is, the intermediate temporary tables in each of the business reports are detected according to the set detection rules. Generally speaking, when each business report is generated, the generated time will be used as the header, so the set detection rule can be set as the detection header, that is, according to the information in the header, you can know whether the business report is The intermediate temporary table, and then obtain the first report that has a blood relationship with the intermediate temporary table and the second report that has an associated relationship. The relationship of the table to other business reports. According to the coupling relationship between the intermediate temporary table and the second report, the coupling relationship 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 If other business reports are recorded as True, the graph relationships in the target database include four types of False-True, False-False, True-False, and True-True. The coupling relationship between True-True does not need to be processed. False-True, False-False, True-False, perform Pregel graph iterative calculation, every time True-n Talse-tures are encountered, the head-to-tail relationship is stored in the vertex attribute set. Delete the False vertices, and directly establish the relationship between True and True according to the attribute set. This simplifies the knowledge graph of the target database, enables users to extract valuable data more clearly and intuitively, and facilitates the maintenance of the target database.
参照图2,本申请还提供了一种整合业务报表的装置,包括:2, the present application also provides a device for integrating business reports, including:
搜索模块10,用于搜索保存有业务报表的源数据库;The search module 10 is used to search the source database that saves the business report;
读取模块20,用于读取各所述源数据库中的库表信息,并根据各所述库表信息生成数据字典,其中所述数据字典记载有各所述业务报表的位置信息;The reading module 20 is used 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, wherein the data dictionary records the location information of each of the business reports;
生成模块30,用于根据所述数据字典生成各业务报表分别对应的获取脚本,并根据各所述获取脚本获取操作各所述业务报表的任务脚本;The generating module 30 is configured to generate respectively corresponding acquisition scripts of each business report according to the data dictionary, and acquire a task script for operating each of the business reports according to each of the acquisition scripts;
获取模块40,用于递归解析各所述任务脚本以获取各所述业务报表之间的耦合关系;an acquisition module 40, used for recursively analyzing each of the task scripts to acquire the coupling relationship between each of the business reports;
存储模块50,用于获取各源数据库中的所述业务报表,并将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库。The storage module 50 is configured to acquire the business reports in each source database, and store the business reports and the coupling relationship between the business reports in the target database.
在一个实施例中,所述获取模块40包括:In one embodiment, the obtaining module 40 includes:
获取子模块,用于获取任务脚本中涉及的一个或者多个SQL语句;Get the submodule, which is used to get one or more SQL statements involved in the task script;
检测子模块,用于检测各所述SQL语句中所执行的所述业务报表,以及所述SQL语句是否可执行;A detection submodule for detecting the business report executed in each of the SQL statements, and whether the SQL statements are executable;
处理子模块,用于将不可执行的所述SQL语句进行可执行化处理,得到可执行化处理的目标任务脚本;A processing submodule, for performing executable processing on the unexecutable SQL statement to obtain an executable processing target task script;
建立子模块,用于解析所述目标任务脚本,并基于解析的内容建立工作栈;其中,所述工作栈包括所述目标任务脚本执行的各个步骤;establishing a submodule for parsing the target task script, and establishing a work stack based on the parsed content; wherein the work stack includes each step executed by the target task script;
解析子模块,用于递归解析所述工作栈各个步骤中的计算函数,得到所述业务报表之间的耦合关系。The parsing submodule is used for recursively parsing the calculation functions in each step of the work stack to obtain the coupling relationship between the business reports.
在一个实施例中,建立子模块,包括:In one embodiment, a sub-module is established, including:
转化单元,用于将所述目标任务脚本转化为ASTNode抽象语法树;A conversion unit for converting the target task script into an ASTNode abstract syntax tree;
遍历单元,用于遍历所述ASTNode抽象语法树的深度,并解析出所述ASTNode抽象语法树的输出输入表以及条件判断语句;A traversing unit, used to traverse the depth of the ASTNode abstract syntax tree, and parse out the output input table and the condition judgment statement of the ASTNode abstract syntax tree;
设定单元,用于根据所述输出输入表以及所述条件判断语句设定ASTNode抽象语法树的执行方案,以得到所述工作栈。A setting unit, configured to set the execution plan of the ASTNode abstract syntax tree according to the output and input table and the conditional judgment statement, so as to obtain the work stack.
在一个实施例中,存储模块50,包括:In one embodiment, the storage module 50 includes:
表格信息获取子模块,用于获取各所述业务报表的表格信息;a form information acquisition sub-module, used to acquire the form information of each of the business reports;
整理子模块,用于根据所述表格信息整理出层级规则;a sorting sub-module for sorting out hierarchical rules according to the table information;
划分子模块,用于根据所述层级规则将各个所述业务报表划分至不同的层级;dividing sub-modules for dividing each of the business reports into different levels according to the level rules;
聚类子模块,用于将相同层级的所述业务报表进行聚类分析,并根据分析结果对同类的所述业务报表赋予相同的标签;A clustering submodule for performing cluster analysis on the business reports of the same level, and assigning the same labels to the business reports of the same class according to the analysis results;
存储子模块,用于按照各所述业务报表的所述标签将各所述业务报表分类存储至所述目标数据库,以及存储各业务报表之间的耦合关系。The storage sub-module is configured to classify and store each of the business reports in the target database according to the labels of each of the business reports, and store the coupling relationship between the business reports.
在一个实施例中,存储模块50,还包括:In one embodiment, the storage module 50 further includes:
脚本信息获取子模块,用于获取所述任务脚本的脚本信息;其中,所述脚本信息至少包括脚本路径、操作类型以及涉及的关联业务报表;a script information acquisition sub-module, used for acquiring script information of the task script; wherein the script information at least includes a script path, an operation type and a related business report;
脚本信息分析子模块,用于分析所述脚本信息,得到各所述关联业务报表的出现的次数以及顶点信息;a script information analysis sub-module for analyzing the script information to obtain the occurrence times and vertex information of each of the associated business reports;
权重设置子模块,用于根据各所述关联业务报表的出现的次数为各所述关联业务报表设置对应的权重;A weight setting submodule, configured to set a corresponding weight for each of the associated business reports according to the number of occurrences of each of the associated business reports;
主键设置子模块,用于将所述顶点信息设置为所述关联业务报表的主键,并将所述权重设置为所述关联业务报表的顶点属性进行保存,以及保存各所述业务报表之间的耦合关系。The primary key setting submodule is used to set the vertex information as the primary key of the associated business report, and to set the weight as the vertex attribute of the associated business report to save, and to save the relationship between each of the business reports. coupling relationship.
在一个实施例中,整合业务报表的装置,还包括:In one embodiment, the device for integrating business reports further includes:
中间临时表检测模块,用于按照设定的检测规则检测各所述业务报表中的中间临时表;an intermediate temporary table detection module, used for detecting the intermediate temporary table in each of the business reports according to the set detection rules;
第一报表获取模块,用于获取与所述中间临时表具有血缘关系的第一报表,以及与所述中间临时表具有关联关系的第二报表;所述第一报表和所述第二报表均为所述业务报表;The first report obtaining module is used to obtain a first report that has a blood relationship with the intermediate temporary table, and a second report that has an associated relationship with the intermediate temporary table; the first report and the second report are for said business statement;
耦合关系建立模块,用于根据所述中间临时表与所述第二报表的耦合关系,直接建立所述第一报表与所述第二报表之间的耦合关系;a coupling relationship establishing module, configured to directly establish a coupling relationship between the first statement and the second statement according to the coupling relationship between the intermediate temporary table and the second statement;
删除模块,用于删除所述中间临时表以建立所述目标数据库的知识图谱。A deletion module is used to delete the intermediate temporary table to establish a knowledge graph of the target database.
本申请的有益效果:通过设定获取脚本获取对应的任务脚本,并解析出各业务报表之间的耦合关系,获取保并存各个源数据库中的业务报表以及各业务报表之间的耦合关系。使得目标数据库中既有各源数据库中所有的业务报表,又保留有源数据库中各个业务报表之间的耦合关系,使相关人员在目标数据库中检索时,无需遍历多个源数据库,又可以得到与遍历多个源数据库中的检索结果。The beneficial effects of the present application are as follows: the corresponding task script is acquired by setting the acquisition script, and the coupling relationship between the business reports is parsed, and the business reports in each source database and the coupling relationship between the business reports are acquired, saved and stored. The target database contains all the business reports in each source database, and also retains the coupling relationship between each business report in the source database, so that when the relevant personnel search in the target database, they do not need to traverse multiple source databases, and can get with traversing multiple source databases for retrieval results.
参照图3,本申请实施例中还提供一种计算机设备,该计算机设备可以是服务器,其内部结构可以如图3所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设计的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储各种业务报表等。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时可以实现上述任一实施例所述的整合业务报表的方法。Referring to FIG. 3 , an embodiment of the present application further provides a computer device. The computer device may be a server, and its internal structure may be as shown in FIG. 3 . The computer device includes a processor, memory, a network interface and a database connected by a system bus. Among them, the processor of the computer design is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium, an internal memory. The nonvolatile storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the execution of the operating system and computer programs in the non-volatile storage medium. The database of the computer equipment is used to store various business reports and the like. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the method for integrating business reports described in any of the foregoing embodiments can be implemented.

Claims (19)

  1. 一种整合业务报表的方法,其中,包括:A method of consolidating business reporting, which includes:
    搜索保存有业务报表的源数据库;Search the source database where business reports are stored;
    读取各所述源数据库中的库表信息,并根据各所述库表信息生成数据字典,其中所述数据字典记载有各所述业务报表的位置信息;Reading the library table information in each of the source databases, and generating a data dictionary according to each of the library table information, wherein the data dictionary records the location information of each of the business reports;
    根据所述数据字典生成各业务报表分别对应的获取脚本,并根据各所述获取脚本获取操作各所述业务报表的任务脚本;Generate respective acquisition scripts corresponding to each business report according to the data dictionary, and acquire a task script for operating each of the business reports according to each of the acquisition scripts;
    递归解析各所述任务脚本以获取各所述业务报表之间的耦合关系;Recursively analyze each of the task scripts to obtain the coupling relationship between each of the business reports;
    获取各源数据库中的所述业务报表,并将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库。Acquire the business reports in each source database, and store the business reports and the coupling relationship between the business reports in the target database.
  2. 如权利要求1所述的整合业务报表的方法,其中,所述递归解析各所述任务脚本以获取各所述业务报表之间的耦合关系的步骤,包括:The method for integrating business reports according to claim 1, wherein the step of recursively analyzing each of the task scripts to obtain the coupling relationship between the business reports comprises:
    获取任务脚本中涉及的一个或者多个SQL语句;Get one or more SQL statements involved in the task script;
    检测各所述SQL语句中所执行的所述业务报表,以及所述SQL语句是否可执行;Detecting the business report executed in each of the SQL statements, and whether the SQL statements are executable;
    将不可执行的所述SQL语句进行可执行化处理,得到可执行化处理的目标任务脚本;Performing executable processing on the non-executable SQL statement to obtain an executable processing target task script;
    解析所述目标任务脚本,并基于解析的内容建立工作栈;其中,所述工作栈包括所述目标任务脚本执行的各个步骤;Parse the target task script, and build a work stack based on the parsed content; wherein, the work stack includes each step executed by the target task script;
    递归解析所述工作栈各个步骤中的计算函数,得到所述业务报表之间的耦合关系。The calculation functions in each step of the work stack are recursively analyzed to obtain the coupling relationship between the business reports.
  3. 如权利要求1所述的整合业务报表的方法,其中,所述将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库的步骤,包括:The method for integrating business reports according to claim 1, wherein the step of storing each of the business reports and the coupling relationship between the business reports in a target database comprises:
    获取各所述业务报表的表格信息;Obtain the form information of each of the described business reports;
    根据所述表格信息整理出层级规则;Sort out hierarchical rules according to the table information;
    根据所述层级规则将各个所述业务报表划分至不同的层级;Divide each of the business reports into different levels according to the level rules;
    将相同层级的所述业务报表进行聚类分析,并根据分析结果对同类的所述业务报表赋予相同的标签;Perform cluster analysis on the business reports of the same level, and assign the same labels to the business reports of the same type according to the analysis results;
    按照各所述业务报表的所述标签将各所述业务报表分类存储至所述目标数据库,以及存储各业务报表之间的耦合关系。According to the labels of the business reports, the business reports are classified and stored in the target database, and the coupling relationship between the business reports is stored.
  4. 如权利要求1所述的整合业务报表的方法,其中,所述将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库的步骤,还包括:The method for integrating business reports according to claim 1, wherein the step of storing each of the business reports and the coupling relationship between the business reports in a target database further comprises:
    获取所述任务脚本的脚本信息;其中,所述脚本信息至少包括脚本路径、操作类型以及涉及的关联业务报表;Acquiring script information of the task script; wherein the script information at least includes a script path, an operation type, and an associated business report involved;
    分析所述脚本信息,得到各所述关联业务报表的出现的次数以及顶点信息;Analyze the script information to obtain the occurrence times and vertex information of each of the associated business reports;
    根据各所述关联业务报表的出现的次数为各所述关联业务报表设置对应的权重;Setting a corresponding weight for each of the associated business reports according to the number of occurrences of each of the associated business reports;
    将所述顶点信息设置为所述关联业务报表的主键,并将所述权重设置为所述关联业务报表的顶点属性进行保存,以及保存各所述业务报表之间的耦合关系。The vertex information is set as the primary key of the associated business report, and the weight is set as the vertex attribute of the associated business report for saving, and the coupling relationship between the business reports is saved.
  5. 如权利要求1所述的整合业务报表的方法,其中,所述获取各源数据库中的所述业务报表,并将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库的步骤之后,还包括:The method for integrating business reports according to claim 1, wherein the obtaining the business reports in each source database, and storing the business reports and the coupling relationship between the business reports in the target database After the steps, also include:
    按照设定的检测规则检测各所述业务报表中的中间临时表;Detect intermediate temporary tables in each of the business reports according to the set detection rules;
    获取与所述中间临时表具有血缘关系的第一报表,以及与所述中间临时表具有关联关系的第二报表;所述第一报表和所述第二报表均为所述业务报表;Obtain a first report that has a blood relationship with the intermediate temporary table, and a second report that has an associated relationship with the intermediate temporary table; the first report and the second report are both the business report;
    根据所述中间临时表与所述第二报表的耦合关系,直接建立所述第一报表与所述第二报表之间的耦合关系;According to the coupling relationship between the intermediate temporary table and the second report, the coupling relationship between the first report and the second report is directly established;
    删除所述中间临时表以建立所述目标数据库的知识图谱。The intermediate temporary table is deleted to establish a knowledge graph of the target database.
  6. 如权利要求2所述的整合业务报表的方法,其中,所述解析所述目标任务脚本并建立工作栈的步骤,包括:The method for integrating business reports according to claim 2, wherein the step of parsing the target task script and establishing a work stack comprises:
    将所述目标任务脚本转化为ASTNode抽象语法树;The target task script is converted into an ASTNode abstract syntax tree;
    遍历所述ASTNode抽象语法树的深度,并解析出所述ASTNode抽象语法树的输出输入表以及条件判断语句;Traverse the depth of the ASTNode abstract syntax tree, and parse out the output input table and the conditional judgment statement of the ASTNode abstract syntax tree;
    根据所述输出输入表以及所述条件判断语句设定ASTNode抽象语法树的执行方案,以得到所述工作栈。The execution plan of the ASTNode abstract syntax tree is set according to the input and output table and the conditional judgment statement, so as to obtain the work stack.
  7. 一种整合业务报表的装置,其中,包括:A device for integrating business reports, comprising:
    搜索模块,用于搜索保存有业务报表的源数据库;The search module is used to search the source database that saves the business report;
    读取模块,用于读取各所述源数据库中的库表信息,并根据各所述库表信息生成数据字典,其中所述数据字典记载有各所述业务报表的位置信息;a reading module, 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, wherein the data dictionary records the location information of each of the business reports;
    生成模块,用于根据所述数据字典生成各业务报表分别对应的获取脚本,并根据各所述获取脚本获取操作各所述业务报表的任务脚本A generating module, configured to generate respective acquisition scripts corresponding to each business report according to the data dictionary, and obtain a task script for operating each of the business reports according to each of the acquisition scripts
    获取模块,用于递归解析各所述任务脚本以获取各所述业务报表之间的耦合关系;an acquisition module, used to recursively parse each of the task scripts to acquire the coupling relationship between each of the business reports;
    存储模块,用于获取各源数据库中的所述业务报表,并将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库。The storage module is used for acquiring the business reports in each source database, and storing the business reports and the coupling relationship between the business reports in the target database.
  8. 一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行整合业务报表的方法的步骤:A computer device includes a memory and a processor, the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor is made to perform the steps of the method for integrating business reports:
    搜索保存有业务报表的源数据库;Search the source database where business reports are stored;
    读取各所述源数据库中的库表信息,并根据各所述库表信息生成数据字典,其中所述数据字典记载有各所述业务报表的位置信息;Reading the library table information in each of the source databases, and generating a data dictionary according to each of the library table information, wherein the data dictionary records the location information of each of the business reports;
    根据所述数据字典生成各业务报表分别对应的获取脚本,并根据各所述获取脚本获取操作各所述业务报表的任务脚本;Generate respective acquisition scripts corresponding to each business report according to the data dictionary, and acquire a task script for operating each of the business reports according to each of the acquisition scripts;
    递归解析各所述任务脚本以获取各所述业务报表之间的耦合关系;Recursively analyze each of the task scripts to obtain the coupling relationship between each of the business reports;
    获取各源数据库中的所述业务报表,并将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库。Acquire the business reports in each source database, and store the business reports and the coupling relationship between the business reports in the target database.
  9. 如权利要求8所述的计算机设备,其中,所述递归解析各所述任务脚本以获取各所述业务报表之间的耦合关系的步骤,包括:The computer device according to claim 8, wherein the step of recursively parsing each of the task scripts to obtain a coupling relationship between each of the business reports comprises:
    获取任务脚本中涉及的一个或者多个SQL语句;Get one or more SQL statements involved in the task script;
    检测各所述SQL语句中所执行的所述业务报表,以及所述SQL语句是否可执行;Detecting the business report executed in each of the SQL statements, and whether the SQL statements are executable;
    将不可执行的所述SQL语句进行可执行化处理,得到可执行化处理的目标任务脚本;Performing executable processing on the non-executable SQL statement to obtain an executable processing target task script;
    解析所述目标任务脚本,并基于解析的内容建立工作栈;其中,所述工作栈包括所述目标任务脚本执行的各个步骤;Parse the target task script, and build a work stack based on the parsed content; wherein, the work stack includes each step executed by the target task script;
    递归解析所述工作栈各个步骤中的计算函数,得到所述业务报表之间的耦合关系。The calculation functions in each step of the work stack are recursively analyzed to obtain the coupling relationship between the business reports.
  10. 如权利要求8所述的计算机设备,其中,所述将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库的步骤,包括:The computer device according to claim 8, wherein the step of storing each of the business reports and the coupling relationship between the business reports in the target database comprises:
    获取各所述业务报表的表格信息;Obtain the form information of each of the described business reports;
    根据所述表格信息整理出层级规则;Sort out hierarchical rules according to the table information;
    根据所述层级规则将各个所述业务报表划分至不同的层级;Divide each of the business reports into different levels according to the level rules;
    将相同层级的所述业务报表进行聚类分析,并根据分析结果对同类的所述业务报表赋予相同的标签;Perform cluster analysis on the business reports of the same level, and assign the same labels to the business reports of the same type according to the analysis results;
    按照各所述业务报表的所述标签将各所述业务报表分类存储至所述目标数据库,以及存储各业务报表之间的耦合关系。According to the labels of the business reports, the business reports are classified and stored in the target database, and the coupling relationship between the business reports is stored.
  11. 如权利要求8所述的计算机设备,其中,所述将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库的步骤,还包括:The computer device according to claim 8, wherein the step of storing each of the business reports and the coupling relationship between each of the business reports in the target database further comprises:
    获取所述任务脚本的脚本信息;其中,所述脚本信息至少包括脚本路径、操作类型以及涉及的关联业务报表;Acquire script information of the task script; wherein, the script information at least includes a script path, an operation type, and an associated business report involved;
    分析所述脚本信息,得到各所述关联业务报表的出现的次数以及顶点信息;Analyze the script information to obtain the occurrence times and vertex information of each of the associated business reports;
    根据各所述关联业务报表的出现的次数为各所述关联业务报表设置对应的权重;Setting a corresponding weight for each of the associated business reports according to the number of occurrences of each of the associated business reports;
    将所述顶点信息设置为所述关联业务报表的主键,并将所述权重设置为所述关联业务报表的顶点属性进行保存,以及保存各所述业务报表之间的耦合关系。The vertex information is set as the primary key of the associated business report, and the weight is set as the vertex attribute of the associated business report for saving, and the coupling relationship between the business reports is saved.
  12. 如权利要求8所述的计算机设备,其中,所述获取各源数据库中的所述业务报表,并将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库的步骤之后,还包括:The computer device according to claim 8, wherein after the step of acquiring the business reports in each source database and storing the business reports and the coupling relationship between the business reports in the target database ,Also includes:
    按照设定的检测规则检测各所述业务报表中的中间临时表;Detect intermediate temporary tables in each of the business reports according to the set detection rules;
    获取与所述中间临时表具有血缘关系的第一报表,以及与所述中间临时表具有关联关系的第二报表;所述第一报表和所述第二报表均为所述业务报表;Obtain a first report that has a blood relationship with the intermediate temporary table, and a second report that has an associated relationship with the intermediate temporary table; the first report and the second report are both the business report;
    根据所述中间临时表与所述第二报表的耦合关系,直接建立所述第一报表与所述第二报表之间的耦合关系;According to the coupling relationship between the intermediate temporary table and the second report, the coupling relationship between the first report and the second report is directly established;
    删除所述中间临时表以建立所述目标数据库的知识图谱。The intermediate temporary table is deleted to establish a knowledge graph of the target database.
  13. 如权利要求9所述的计算机设备,其中,所述解析所述目标任务脚本并建立工作栈的步骤,包括:The computer device of claim 9, wherein the step of parsing the target task script and establishing a work stack comprises:
    将所述目标任务脚本转化为ASTNode抽象语法树;The target task script is converted into an ASTNode abstract syntax tree;
    遍历所述ASTNode抽象语法树的深度,并解析出所述ASTNode抽象语法树的输出输入表以及条件判断语句;Traverse the depth of the ASTNode abstract syntax tree, and parse out the output input table and the conditional judgment statement of the ASTNode abstract syntax tree;
    根据所述输出输入表以及所述条件判断语句设定ASTNode抽象语法树的执行方案,以得到所述工作栈。The execution plan of the ASTNode abstract syntax tree is set according to the input and output table and the conditional judgment statement, so as to obtain the work stack.
  14. 一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行所述计算机设备的步骤:A storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the computer device:
    搜索保存有业务报表的源数据库;Search the source database where business reports are stored;
    读取各所述源数据库中的库表信息,并根据各所述库表信息生成数据字典,其中所述数据字典记载有各所述业务报表的位置信息;Reading the library table information in each of the source databases, and generating a data dictionary according to each of the library table information, wherein the data dictionary records the location information of each of the business reports;
    根据所述数据字典生成各业务报表分别对应的获取脚本,并根据各所述获取脚本获取操作各所述业务报表的任务脚本;Generate respective acquisition scripts corresponding to each business report according to the data dictionary, and acquire a task script for operating each of the business reports according to each of the acquisition scripts;
    递归解析各所述任务脚本以获取各所述业务报表之间的耦合关系;Recursively analyze each of the task scripts to obtain the coupling relationship between each of the business reports;
    获取各源数据库中的所述业务报表,并将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库。Acquire the business reports in each source database, and store the business reports and the coupling relationship between the business reports in the target database.
  15. 如权利要求14所述的存储介质,其中,所述递归解析各所述任务脚本以获取各所述业务报表之间的耦合关系的步骤,包括:The storage medium according to claim 14, wherein the step of recursively parsing each of the task scripts to obtain a coupling relationship between each of the business reports comprises:
    获取任务脚本中涉及的一个或者多个SQL语句;Get one or more SQL statements involved in the task script;
    检测各所述SQL语句中所执行的所述业务报表,以及所述SQL语句是否可执行;Detecting the business report executed in each of the SQL statements, and whether the SQL statements are executable;
    将不可执行的所述SQL语句进行可执行化处理,得到可执行化处理的目标任务脚本;Performing executable processing on the non-executable SQL statement to obtain an executable processing target task script;
    解析所述目标任务脚本,并基于解析的内容建立工作栈;其中,所述工作栈包括所述目标任务脚本执行的各个步骤;Parse the target task script, and build a work stack based on the parsed content; wherein, the work stack includes each step executed by the target task script;
    递归解析所述工作栈各个步骤中的计算函数,得到所述业务报表之间的耦合关系。The calculation functions in each step of the work stack are recursively analyzed to obtain the coupling relationship between the business reports.
  16. 如权利要求14所述的存储介质,其中,所述将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库的步骤,包括:The storage medium according to claim 14, wherein the step of storing the business reports and the coupling relationship between the business reports in the target database comprises:
    获取各所述业务报表的表格信息;Obtain the form information of each of the described business reports;
    根据所述表格信息整理出层级规则;Sort out hierarchical rules according to the table information;
    根据所述层级规则将各个所述业务报表划分至不同的层级;Divide each of the business reports into different levels according to the level rules;
    将相同层级的所述业务报表进行聚类分析,并根据分析结果对同类的所述业务报表赋予相同的标签;Perform cluster analysis on the business reports of the same level, and assign the same labels to the business reports of the same type according to the analysis results;
    按照各所述业务报表的所述标签将各所述业务报表分类存储至所述目标数据库,以及存储各业务报表之间的耦合关系。According to the labels of the business reports, the business reports are classified and stored in the target database, and the coupling relationship between the business reports is stored.
  17. 如权利要求14所述的存储介质,其中,所述将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库的步骤,还包括:The storage medium according to claim 14, wherein the step of storing the business reports and the coupling relationship between the business reports in the target database further comprises:
    获取所述任务脚本的脚本信息;其中,所述脚本信息至少包括脚本路径、操作类型以及涉及的关联业务报表;Acquire script information of the task script; wherein, the script information at least includes a script path, an operation type, and an associated business report involved;
    分析所述脚本信息,得到各所述关联业务报表的出现的次数以及顶点信息;Analyze the script information to obtain the occurrence times and vertex information of each of the associated business reports;
    根据各所述关联业务报表的出现的次数为各所述关联业务报表设置对应的权重;Setting a corresponding weight for each of the associated business reports according to the number of occurrences of each of the associated business reports;
    将所述顶点信息设置为所述关联业务报表的主键,并将所述权重设置为所述关联业务报表的顶点属性进行保存,以及保存各所述业务报表之间的耦合关系。The vertex information is set as the primary key of the associated business report, and the weight is set as the vertex attribute of the associated business report for saving, and the coupling relationship between the business reports is saved.
  18. 如权利要求14所述的存储介质,其中,所述获取各源数据库中的所述业务报表,并将各所述业务报表以及各所述业务报表之间的耦合关系存储到目标数据库的步骤之后,还包括:The storage medium according to claim 14, wherein after the step of acquiring the business reports in each source database, and storing the business reports and the coupling relationship between the business reports in the target database ,Also includes:
    按照设定的检测规则检测各所述业务报表中的中间临时表;Detect intermediate temporary tables in each of the business reports according to the set detection rules;
    获取与所述中间临时表具有血缘关系的第一报表,以及与所述中间临时表具有关联关系的第二报表;所述第一报表和所述第二报表均为所述业务报表;Obtain a first report that has a blood relationship with the intermediate temporary table, and a second report that has an associated relationship with the intermediate temporary table; the first report and the second report are both the business report;
    根据所述中间临时表与所述第二报表的耦合关系,直接建立所述第一报表与所述第二报表之间的耦合关系;According to the coupling relationship between the intermediate temporary table and the second report, the coupling relationship between the first report and the second report is directly established;
    删除所述中间临时表以建立所述目标数据库的知识图谱。The intermediate temporary table is deleted to establish a knowledge graph of the target database.
  19. 如权利要求15所述的存储介质,其中,所述解析所述目标任务脚本并建立工作栈的步骤,包括:The storage medium of claim 15, wherein the step of parsing the target task script and establishing a work stack comprises:
    将所述目标任务脚本转化为ASTNode抽象语法树;The target task script is converted into an ASTNode abstract syntax tree;
    遍历所述ASTNode抽象语法树的深度,并解析出所述ASTNode抽象语法树的输出输入表以及条件判断语句;Traverse the depth of the ASTNode abstract syntax tree, and parse out the output input table and the conditional judgment statement of the ASTNode abstract syntax tree;
    根据所述输出输入表以及所述条件判断语句设定ASTNode抽象语法树的执行方案,以得到所述工作栈。The execution plan of the ASTNode abstract syntax tree is set according to the input and output table and the conditional judgment statement, so as to obtain the work stack.
PCT/CN2021/084534 2020-12-24 2021-03-31 Service report integration method and apparatus, device, and storage medium WO2022134363A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011549416.0 2020-12-24
CN202011549416.0A CN112667630B (en) 2020-12-24 2020-12-24 Method, device, equipment and storage medium for integrating business report

Publications (1)

Publication Number Publication Date
WO2022134363A1 true WO2022134363A1 (en) 2022-06-30

Family

ID=75409843

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/084534 WO2022134363A1 (en) 2020-12-24 2021-03-31 Service report integration method and apparatus, device, and storage medium

Country Status (2)

Country Link
CN (1) CN112667630B (en)
WO (1) WO2022134363A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
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 (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110202831A1 (en) * 2010-02-15 2011-08-18 Microsoft Coproration Dynamic cache rebinding of processed data
CN104036040A (en) * 2014-06-30 2014-09-10 贝壳网际(北京)安全技术有限公司 Method and device for generating report
CN104252443A (en) * 2013-06-28 2014-12-31 腾讯科技(深圳)有限公司 Report generation method and device
CN105893488A (en) * 2016-03-29 2016-08-24 国云科技股份有限公司 Method for quickly, conveniently and flexibly making data statistics report forms
CN111666743A (en) * 2020-04-28 2020-09-15 平安科技(深圳)有限公司 Report automatic generation method and device, computer equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541867A (en) * 2010-12-15 2012-07-04 金蝶软件(中国)有限公司 Data dictionary generating method and system
CN105224536A (en) * 2014-05-29 2016-01-06 国际商业机器公司 The method and apparatus of partition database
CN111125254A (en) * 2019-12-23 2020-05-08 北京懿医云科技有限公司 Database synchronization method and device, electronic equipment and computer readable medium
CN111914066B (en) * 2020-08-17 2024-02-02 山东合天智汇信息技术有限公司 Global searching method and system for multi-source database

Patent Citations (5)

* Cited by examiner, † Cited by third party
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
CN104036040A (en) * 2014-06-30 2014-09-10 贝壳网际(北京)安全技术有限公司 Method and device for generating report
CN105893488A (en) * 2016-03-29 2016-08-24 国云科技股份有限公司 Method for quickly, conveniently and flexibly making data statistics report forms
CN111666743A (en) * 2020-04-28 2020-09-15 平安科技(深圳)有限公司 Report automatic generation method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112667630B (en) 2023-06-02
CN112667630A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
US10678669B2 (en) Field content based pattern generation for heterogeneous logs
WO2022134363A1 (en) Service report integration method and apparatus, device, and storage medium
US11907216B2 (en) Multi-language fusion query method and multi-model database system
US10338960B2 (en) Processing data sets in a big data repository by executing agents to update annotations of the data sets
KR20210141640A (en) Natural language-based processing methods for data stored in heterogeneous data sources
US8417690B2 (en) Automatically avoiding unconstrained cartesian product joins
CN114265945A (en) Blood relationship extraction method and device and electronic equipment
CN111627552A (en) Medical streaming data blood relationship analysis and storage method and device
CN114328759A (en) Data construction and management method and terminal of data warehouse
CN113297057A (en) Memory analysis method, device and system
US20200004750A1 (en) Transforming a user-defined table function to a derived table in a database management system
CN114356964A (en) Data blood margin construction method and device, storage medium and electronic equipment
CN113934750A (en) Data blood relationship analysis method based on compiling mode
US20070033178A1 (en) Quality of service feedback for technology-neutral data reporting
CN116483831B (en) Recommendation index generation method for distributed database
CN110008448B (en) Method and device for automatically converting SQL code into Java code
US20180060404A1 (en) Schema abstraction in data ecosystems
JP4031947B2 (en) Query optimization processing device, query optimization processing method, program for causing computer to execute the method, and recording medium storing program
CN115292347A (en) Active SQL algorithm performance checking device and method based on rules
CN113221528B (en) Automatic generation and execution method of clinical data quality evaluation rule based on openEHR model
CN114443699A (en) Information query method and device, computer equipment and computer readable storage medium
CN114547083A (en) Data processing method and device and electronic equipment
JP2012512455A (en) Automatic data store architecture discovery
CN112527796A (en) Data table processing method and device and computer readable storage medium
CN116795663B (en) Method for tracking and analyzing execution performance of trino engine

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21908375

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21908375

Country of ref document: EP

Kind code of ref document: A1