Script analysis method and system based on metadata, electronic equipment and storage medium

By performing table-level and field-level analysis on ETL scripts based on metadata, the problem of regular expressions missing analysis in complex ETL scripts is solved, achieving highly accurate script analysis.

CN120670301APending Publication Date: 2025-09-19CHINA CONTINENT PROPERTY & CASUALTY INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510757548.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

In the prior art, regular expressions may cause omissions or errors in analysis when analyzing complex ETL scripts, resulting in poor analysis accuracy, and existing tools are not compatible with multiple ETL script types.

Method used

Using a metadata-based approach, any type of ETL script is sliced ​​and stored in the database, metadata tables and script registration tables are obtained, script synchronization and configuration correctness are determined, and table-level and field-level analysis is performed through metadata tables, script registration tables, and script information tables.

Benefits of technology

It achieves comprehensive analysis of various types of ETL scripts, improves analysis accuracy, reduces the risk of omissions in manual maintenance, expands the management scope, and is compatible with multiple ETL script types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670301A_ABST
    Figure CN120670301A_ABST
Patent Text Reader

Abstract

The invention provides a script analysis method and system based on metadata, electronic equipment and a storage medium, and the method comprises the steps: executing slice storage on any type of ETL scripts to be analyzed to obtain a script information table; obtaining a first metadata table and a second metadata table, and obtaining a script registration table; judging whether the ETL script to be analyzed is synchronous and correctly configured or not; and if the ETL script to be analyzed is synchronous and correctly configured, performing table analysis and field analysis on the ETL script to be analyzed through the first metadata table, the second metadata table, the script registration table and the script information table to obtain a table analysis result and a field analysis result. According to the scheme, all types of ETL scripts are subjected to table-level and field-level analysis, and the ETL scripts are not comprehensively analyzed depending on a certain rule any more, so that the analysis accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a metadata-based script analysis method, system, electronic device and storage medium. Background Art

[0002] Currently, regular expressions are commonly used to analyze ETL (extract-transform-load) scripts. However, regular expressions are mainly used to analyze ETL scripts with the same writing style. ETL scripts are complex in type. When analyzing complex ETL scripts, regular expressions may not cover certain rules, resulting in omissions or errors in the analysis and poor analysis accuracy. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a metadata-based script analysis method, system, electronic device, and storage medium to solve problems such as poor analysis accuracy of regular expression analysis scripts.

[0004] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0005] A first aspect of an embodiment of the present invention discloses a metadata-based script analysis method, the method comprising:

[0006] Slice and store any type of ETL script to be analyzed to obtain a script information table;

[0007] Obtaining a first metadata table and a second metadata table, and obtaining a script registration table, wherein the first metadata table includes at least information about the database to which the table belongs and the table name, and the second metadata table includes at least information about the database, the table name, and field information;

[0008] Determine whether the ETL script to be analyzed is synchronized and configured correctly;

[0009] If the ETL script to be analyzed is synchronized and configured correctly, table analysis and field analysis are performed on the ETL script to be analyzed through the first metadata table, the second metadata table, the script registration table and the script information table to obtain table analysis results and field analysis results.

[0010] Preferably, determining whether the ETL script to be analyzed is synchronized and configured correctly includes:

[0011] Perform an acquisition operation according to the script ID of the ETL script to be analyzed, wherein the acquisition operation is used to obtain the script execution database instance and mode information;

[0012] Determine whether the information obtained by executing the acquisition operation is empty;

[0013] If the information obtained by executing the acquisition operation is not empty, it is determined that the ETL script to be analyzed is synchronized and configured correctly.

[0014] Preferably, if the ETL script to be analyzed is synchronized and configured correctly, table analysis and field analysis are performed on the ETL script to be analyzed through the first metadata table, the second metadata table, the script registration table, and the script information table to obtain table analysis results and field analysis results, including:

[0015] If the ETL script to be analyzed is synchronized and configured correctly, performing table analysis on the ETL script to be analyzed row by row using the first metadata table and the script registration table to obtain a table analysis result, wherein the script registration table includes at least script information to be synchronized, and the table analysis result includes at least: the name and location of the table appearing in the ETL script to be analyzed;

[0016] Using the second metadata table, the script information table and the table analysis result, field analysis is performed on the ETL script to be analyzed row by row to obtain a field analysis result, wherein the field analysis result at least includes: the name and location of the field appearing in the ETL script to be analyzed.

[0017] Preferably, before performing table analysis and field analysis on the ETL script to be analyzed, the method further includes:

[0018] The script information table is standardized.

[0019] A second aspect of an embodiment of the present invention discloses a metadata-based script analysis system, the system comprising:

[0020] The execution unit is used to execute slice storage for any type of ETL script to be analyzed to obtain a script information table;

[0021] an acquiring unit, configured to acquire a first metadata table and a second metadata table, and a script registration table, wherein the first metadata table includes at least information about the database to which the table belongs and a table name, and the second metadata table includes at least information about the database, the table name, and field information;

[0022] A judgment unit, configured to judge whether the ETL script to be analyzed is synchronized and configured correctly;

[0023] The analyzing unit is configured to perform table analysis and field analysis on the ETL script to be analyzed through the first metadata table, the second metadata table, the script registration table, and the script information table if the ETL script to be analyzed is synchronized and configured correctly, so as to obtain table analysis results and field analysis results.

[0024] Preferably, the judging unit includes:

[0025] An execution module, configured to execute an acquisition operation according to the script ID of the ETL script to be analyzed, wherein the acquisition operation is used to acquire the script execution database instance and mode information;

[0026] A judging module, configured to judge whether the information obtained by executing the obtaining operation is empty;

[0027] The determination module is configured to determine whether the ETL script to be analyzed is synchronized and configured correctly if the information obtained by executing the acquisition operation is not empty.

[0028] Preferably, the analysis unit comprises:

[0029] A table analysis module is configured to, if the ETL script to be analyzed is synchronized and configured correctly, perform table analysis on the ETL script to be analyzed row by row using the first metadata table and the script registration table to obtain a table analysis result, wherein the script registration table at least includes script information to be synchronized, and the table analysis result at least includes: the name and location of the table appearing in the ETL script to be analyzed;

[0030] A field analysis module is used to use the second metadata table, the script information table and the table analysis result to perform field analysis on the ETL script to be analyzed row by row to obtain a field analysis result, wherein the field analysis result at least includes: the name and location of the field appearing in the ETL script to be analyzed.

[0031] Preferably, it also includes:

[0032] A standardization unit is used to perform standardization processing on the script information table.

[0033] A third aspect of an embodiment of the present invention discloses an electronic device, comprising: a processor and a memory, wherein the processor and the memory are connected via a communication bus; wherein the processor is used to call and execute a program stored in the memory; and the memory is used to store a program, wherein the program is used to implement the metadata-based script analysis method disclosed in the first aspect of the embodiment of the present invention.

[0034] A fourth aspect of an embodiment of the present invention discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the metadata-based script analysis method disclosed in the first aspect of the embodiment of the present invention is implemented.

[0035] Based on the above-mentioned embodiments of the present invention, a metadata-based script analysis method, system, electronic device, and storage medium are provided. The method comprises the following steps: slicing and storing any type of ETL script to be analyzed to obtain a script information table; obtaining a first metadata table and a second metadata table, as well as a script registration table; determining whether the ETL script to be analyzed is synchronized and correctly configured; and if so, performing table analysis and field analysis on the ETL script to be analyzed using the first metadata table, the second metadata table, the script registration table, and the script information table to obtain table analysis results and field analysis results. This solution performs table-level and field-level analysis on various types of ETL scripts, eliminating the reliance on specific rules for comprehensive ETL script analysis, thereby improving analysis accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0037] Figure 1 A flowchart of a metadata-based script analysis method provided by an embodiment of the present invention;

[0038] Figure 2 A flowchart of performing table analysis and field analysis provided by an embodiment of the present invention;

[0039] Figure 3 An example diagram of parsing code segment by segment to match field names provided by an embodiment of the present invention;

[0040] Figure 4 An overall architecture diagram of a metadata-based script analysis method provided by an embodiment of the present invention;

[0041] Figure 5 A structural block diagram of a metadata-based script analysis system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0042] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0043] In this application, the terms "comprises," "comprising," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0044] Currently, enterprises maintain a large number of ETL (extract-transform-load) scripts. The processing logic of these ETL scripts is relatively complex, and there is a risk of omissions when manually maintaining table usage in ETL scripts.

[0045] On the one hand, the management scope of existing ETL scripts only covers the table level and does not include reference analysis of fields. On the other hand, ETL script types are complex, including database types such as Greenplum, Oracle, and Hive. ETL script implementation methods include Function, Procedure, and Shell, lacking a unified analysis method.

[0046] There are two main methods for analyzing ETL scripts: one is to use regular expressions for analysis, and the other is to use open source JAR packages for analysis.

[0047] However, regular expressions are mainly used to analyze ETL scripts with the same writing style, requiring the ETL scripts to have a single rule and consistent writing style. For complex ETL scripts, using regular expressions may result in some rules not being covered, resulting in omissions or errors in the analysis.

[0048] The open source jar package mainly analyzes standard ETL scripts of the Procedure type, and the analysis method is mostly targeted at a specific type of SQL rules. It cannot analyze ETL scripts encapsulated in text formats such as Shell.

[0049] To this end, embodiments of the present invention provide a metadata-based script analysis method, system, electronic device, and storage medium, which can perform table-level and field-level analysis on various types of ETL scripts, thereby obtaining the status of tables and fields used in the ETL scripts, and no longer relying on certain rules to comprehensively analyze the ETL scripts, thereby improving analysis accuracy.

[0050] See also Figure 1 , shows a flowchart of a metadata-based script analysis method provided by an embodiment of the present invention, the script analysis method comprising:

[0051] Step S101: Slice and store any type of ETL script to be analyzed to obtain a script information table.

[0052] In the specific implementation of step S101 , an ETL script to be analyzed of any type (such as SQL type or text type) is obtained from the data source, and then the ETL script to be analyzed is sliced ​​and stored in the database by row, thereby obtaining a script information table (denoted as Tab_B).

[0053] For example, you can obtain SQL-type ETL scripts to be analyzed from a database, or obtain text-type ETL scripts to be analyzed from S3 service storage.

[0054] In the specific implementation, the specific method of slicing the ETL script to be analyzed into the database by row is: reading data by row into the database table through Java program and SQL script, thereby obtaining the script information table (Tab_B).

[0055] Step S102: Acquire the first metadata table and the second metadata table, and acquire the script registration table.

[0056] It should be noted that the first metadata table (denoted as Tab_C) at least includes the database information to which the table belongs and the table name;

[0057] The second metadata table (denoted as Tab_D) includes at least database information, table name, and field information;

[0058] The script registration table (denoted as Tab_A) at least includes the script information that needs to be synchronized.

[0059] In the specific process of implementing step S102 , the first metadata table (Tab_C), the second metadata table (Tab_D), and the script registration table (Tab_A) are obtained.

[0060] Specifically, table information is obtained from a dictionary table of a database, and the obtained table information is stored in a corresponding database table to obtain a first metadata table (Tab_C);

[0061] Obtaining field information from a dictionary table of a database, and storing the obtained field information in a corresponding database table to obtain a second metadata table (Tab_D);

[0062] Register the information that needs to be synchronized in the ETL script in the table in advance to obtain the script information table (Tab_A).

[0063] The content in the script information table mainly includes "what information of the script needs to be synchronized", which can be used to subsequently locate the content to be synchronized.

[0064] Step S103: Determine whether the ETL script to be analyzed is synchronized and configured correctly. If the ETL script to be analyzed is synchronized and configured correctly, execute step S104; otherwise, exit the analysis.

[0065] In the specific implementation of step S103 , an acquisition operation is performed according to the script ID of the ETL script to be analyzed, and the acquisition operation is used to acquire the “script execution database instance” and the “mode information”.

[0066] Determine whether the information obtained by executing the acquisition operation is empty;

[0067] If the information obtained by executing the acquisition operation is not empty, it is determined that the ETL script to be analyzed is synchronized and configured correctly, and step S104 is executed;

[0068] On the contrary, if the information obtained by executing the acquisition operation is empty, it is determined that the ETL script to be analyzed is not synchronized and the configuration is incorrect, and the analysis process is exited.

[0069] Specifically, based on the script ID of the ETL script to be analyzed, the "script execution database instance" and "mode information" are obtained; if the obtained information is not empty, it is determined that the ETL script to be analyzed is synchronized and configured correctly; otherwise, it is determined that the analysis ETL script is not synchronized and configured incorrectly, and the analysis process is exited.

[0070] It should be noted that the obtained script execution database instance and pattern information can be used to match dictionary information.

[0071] Step S104: performing table analysis and field analysis on the ETL script to be analyzed through the first metadata table, the second metadata table, the script registration table, and the script information table to obtain table analysis results and field analysis results.

[0072] In some specific embodiments, before executing step S104 , the script information table (Tab_B) is standardized, for example, the contents such as uppercase and lowercase letters, spaces, etc. in the script information table are standardized.

[0073] More specifically, the standardized processing flow for the script information table (Tab_B) is as follows: 1. Replace the ETL script parameters in the script information table (Tab_B); 2. Convert all scripts to lowercase; 3. Replace the spaces after the beginning of a line, before the end of a line, and before and after specified symbols (such as +, -, $, ^, etc.), regardless of whether there are several spaces or no spaces, with a single space. Remove spaces before and after the punctuation mark "." and specified symbols (such as " and ').

[0074] In the specific implementation of step S104 , the first metadata table (Tab_C), the second metadata table (Tab_D), the script registration table (Tab_A), and the script information table (Tab_B) are used to perform table analysis and field analysis on the ETL script to be analyzed, thereby obtaining corresponding table analysis results and field analysis results.

[0075] In an embodiment of the present invention, various types of ETL scripts can be analyzed at the table and field levels, thereby obtaining the information of the tables and fields used in the ETL scripts. This eliminates the need to rely on certain rules to comprehensively analyze the ETL scripts, thereby improving analysis accuracy.

[0076] For the above embodiments of the present invention Figure 1 For the table analysis results and field analysis results involved in step S104, see Figure 2 , which shows a flowchart of performing table analysis and field analysis according to an embodiment of the present invention, Figure 2 The steps include:

[0077] Step S201: If the ETL script to be analyzed is synchronized and configured correctly, table analysis is performed on the ETL script to be analyzed row by row using the first metadata table and the script registration table to obtain a table analysis result.

[0078] In the specific implementation of step S201, if the ETL script to be analyzed is synchronized and configured correctly, table analysis is performed on the ETL script to be analyzed row by row using the script registration table (Tab_A) and the first metadata table (Tab_C), thereby obtaining table analysis results, and writing the table analysis results to the first result table (denoted as Tab_E).

[0079] The table analysis results include at least: the name and location of the table appearing in the ETL script to be analyzed.

[0080] Specifically, during the table analysis of the ETL script to be analyzed,

[0081] The script registration table (Tab_A) is associated with the first metadata table (Tab_C). The table names in the first metadata table are matched by row like (like is SQL syntax) to obtain the corresponding tables, thereby obtaining the table analysis results.

[0082] That is, the table information obtained from the dictionary table is combined with the SQL syntax "like" to perform association to perform table analysis on the ETL script to be analyzed row by row, thereby obtaining the table analysis result.

[0083] Step S202: using the second metadata table, the script information table and the table analysis result, perform field analysis on the ETL script to be analyzed row by row to obtain a field analysis result.

[0084] In the specific implementation of step S202, the second metadata table (Tab_D), the script information table (Tab_B), and the first result table (Tab_E, containing the table analysis results) are used to perform field analysis on the ETL script to be analyzed row by row, thereby obtaining field analysis results, and writing the field analysis results into the second result table (denoted as Tab_F).

[0085] The field analysis result includes at least: the name and location of the field appearing in the ETL script to be analyzed.

[0086] Specifically, in the process of performing field analysis on the ETL script to be analyzed, the program segments are divided according to the position of the semicolon (i.e., ";"), and the fields of the corresponding table in each program segment are analyzed in combination with the table analysis results and the field information obtained from the dictionary table to obtain the field analysis results.

[0087] More specifically, the occurrence of the "semicolon" is analyzed and the starting position is recorded. According to the line number range of the "semicolon", the script information table (Tab_B), the first result table (Tab_E, containing the table analysis results), and the second metadata table (Tab_D) are associated, and the like field information is analyzed to obtain the corresponding fields in each row to obtain the field analysis results.

[0088] That is, after parsing out the line numbers of all semicolons, the code is parsed section by section according to the line numbers of the semicolons and the table names to match the field names, thereby obtaining the field analysis results.

[0089] like Figure 3 As shown in the example diagram of parsing the code section by section to match field names, the parsed row numbers of all semicolons are 108, 109, 127, and 155 respectively. Based on the table row numbers analyzed in the first result table, the table row numbers are matched with the row numbers where the semicolons appear, and the results are "108 < table row number <= 109", "109 < table row number <= 127", and "127 < table row number <= 155". Furthermore, the table name appearing in the semicolon can be obtained.

[0090] The code is parsed section by section based on the line number and table name of the semicolon to match the field name. The field analysis results are as follows Figure 3 is shown in the rightmost table.

[0091] above Figure 2 It is about the instructions for table analysis and field analysis.

[0092] In order to better understand the content of this plan, we will take a holistic approach. Figure 4 The overall architecture diagram of a metadata-based script analysis method is shown as an example.

[0093] like Figure 4 As shown in the figure, the overall architecture diagram of the script analysis method includes three parts: "ETL script processing", "metadata information processing" and "ETL script analysis". These parts are explained below.

[0094] In the "ETL Script Processing" section, the SQL-based ETL script to be analyzed is retrieved from the database, or text-based ETL scripts are retrieved from S3 service storage. The ETL script to be analyzed is sliced ​​and stored row-by-row, resulting in a script information table (Tab_B). The pre-registered script registration table (Tab_A) is then retrieved.

[0095] "Metadata information processing" part: obtain table information from the dictionary table of the database and store the table information in the first metadata table (Tab_C); obtain field information from the dictionary table of the database and store the field information in the second metadata table (Tab_D).

[0096] "ETL Script Analysis" section: Determines whether the ETL script to be analyzed is synchronized and configured correctly. If so, obtains the database instance and schema information for the script execution. ETL scripts are standardized. Table analysis is performed on the ETL script to be analyzed row by row, and the table analysis results are written to the first result table (Tab_E). Field analysis is performed on the ETL script to be analyzed row by row, and the field analysis results are written to the second result table (Tab_F).

[0097] It should be noted that Figure 4 The execution principle of each part can be found in the above embodiment of the present invention. Figure 1 and Figure 2 The content in will not be repeated here.

[0098] In general, this solution manages all types of collected ETL scripts in a unified manner. First, it splits the surface into points by row. Then, based on the collected table information (metadata) and field information (metadata), it analyzes each point one by one through reverse matching to obtain the table information and field information contained in each point. Finally, it re-converges to the surface to realize reference analysis of tables and fields in the ETL script. Therefore, this solution has the following advantages: it reduces the risk of analysis omissions caused by manual maintenance by automatically analyzing ETL scripts; it realizes field-level reference analysis and expands the management scope of ETL scripts; it is compatible with various types of ETL scripts and has high scalability and practicality; the analysis does not depend on a specific SQL rule and implementation method; the analysis results are comprehensive and avoid the situation where tables or fields are missed and not analyzed.

[0099] Corresponding to the metadata-based script analysis method provided in the above embodiment of the present invention, see Figure 5The embodiment of the present invention further provides a structural block diagram of a metadata-based script analysis system, which includes: an execution unit 100, an acquisition unit 200, a judgment unit 300 and an analysis unit 400.

[0100] The execution unit 100 is used to execute slicing and warehousing of any type of ETL script to be analyzed to obtain a script information table.

[0101] The acquisition unit 200 is used to acquire a first metadata table and a second metadata table, and acquire a script registration table. The first metadata table includes at least the database information and the table name, and the second metadata table includes at least the database information, the table name, and the field information.

[0102] The judging unit 300 is used to judge whether the ETL script to be analyzed is synchronized and configured correctly.

[0103] The analyzing unit 400 is used to perform table analysis and field analysis on the ETL script to be analyzed through the first metadata table, the second metadata table, the script registration table and the script information table if the ETL script to be analyzed is synchronized and configured correctly, so as to obtain table analysis results and field analysis results.

[0104] In an embodiment of the present invention, various types of ETL scripts can be analyzed at the table and field levels, thereby obtaining the information of the tables and fields used in the ETL scripts. This eliminates the need to rely on certain rules to comprehensively analyze the ETL scripts, thereby improving analysis accuracy.

[0105] Preferably, combined Figure 5 The content shown, the judgment unit 300 includes an execution module, a judgment module and a determination module, and the execution principle of each module is as follows:

[0106] The execution module is used to perform an acquisition operation according to the script ID of the ETL script to be analyzed, and the acquisition operation is used to obtain the script execution database instance and mode information.

[0107] The judgment module is used to judge whether the information obtained by executing the acquisition operation is empty.

[0108] The determination module is used to determine whether the ETL script to be analyzed is synchronized and configured correctly if the information obtained by performing the acquisition operation is not empty.

[0109] Preferably, combined Figure 5 The analysis unit 400 includes a table analysis module and a field analysis module. The execution principle of each module is as follows:

[0110] The table analysis module is used to perform table analysis on the ETL script to be analyzed row by row using the first metadata table and the script registration table if the ETL script to be analyzed is synchronized and configured correctly to obtain a table analysis result. The script registration table at least includes script information that needs to be synchronized, and the table analysis result at least includes: the name and location of the table appearing in the ETL script to be analyzed.

[0111] The field analysis module is used to use the second metadata table, the script information table and the table analysis results to perform field analysis on the ETL script to be analyzed row by row to obtain field analysis results. The field analysis results at least include: the name and location of the field appearing in the ETL script to be analyzed.

[0112] Preferably, combined Figure 5 The script analysis system further includes:

[0113] A standardization unit is used to standardize the script information table.

[0114] Preferably, an embodiment of the present invention also provides an electronic device, comprising: a processor and a memory, the processor and the memory being connected via a communication bus; wherein the processor is used to call and execute a program stored in the memory; the memory is used to store the program, and the program is used to implement the metadata-based script analysis method provided in the above method embodiment diagram.

[0115] Preferably, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the metadata-based script analysis method provided by the above method embodiment is implemented.

[0116] In summary, the embodiments of the present invention provide a metadata-based script analysis method, system, electronic device and storage medium, which perform table-level and field-level analysis on various types of ETL scripts, and no longer rely on certain rules to comprehensively analyze ETL scripts, thereby improving analysis accuracy.

[0117] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple. For relevant parts, refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without expending creative work.

[0118] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0119] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A script analysis method based on metadata, characterized in that: The method comprises: Slice and store any type of ETL script to be analyzed to obtain a script information table; Obtaining a first metadata table and a second metadata table, and obtaining a script registration table, wherein the first metadata table includes at least information about the database to which the table belongs and the table name, and the second metadata table includes at least information about the database, the table name, and field information; Determine whether the ETL script to be analyzed is synchronized and configured correctly; If the ETL script to be analyzed is synchronized and configured correctly, table analysis and field analysis are performed on the ETL script to be analyzed through the first metadata table, the second metadata table, the script registration table and the script information table to obtain table analysis results and field analysis results.

2. The method according to claim 1, characterized in that Determining whether the ETL script to be analyzed is synchronized and configured correctly includes: Perform an acquisition operation according to the script ID of the ETL script to be analyzed, wherein the acquisition operation is used to obtain the script execution database instance and mode information; Determine whether the information obtained by executing the acquisition operation is empty; If the information obtained by executing the acquisition operation is not empty, it is determined that the ETL script to be analyzed is synchronized and configured correctly.

3. The method according to claim 1, characterized in that If the ETL script to be analyzed is synchronized and configured correctly, table analysis and field analysis are performed on the ETL script to be analyzed using the first metadata table, the second metadata table, the script registration table, and the script information table to obtain table analysis results and field analysis results, including: If the ETL script to be analyzed is synchronized and configured correctly, performing table analysis on the ETL script to be analyzed row by row using the first metadata table and the script registration table to obtain a table analysis result, wherein the script registration table includes at least script information to be synchronized, and the table analysis result includes at least: the name and location of the table appearing in the ETL script to be analyzed; Using the second metadata table, the script information table and the table analysis result, field analysis is performed on the ETL script to be analyzed row by row to obtain a field analysis result, wherein the field analysis result at least includes: the name and location of the field appearing in the ETL script to be analyzed.

4. The method according to any one of claims 1 to 3, characterized in that Before performing table analysis and field analysis on the ETL script to be analyzed, the following steps are also included: The script information table is standardized.

5. A metadata-based script analysis system, characterized in that: The system comprises: The execution unit is used to execute slice storage for any type of ETL script to be analyzed to obtain a script information table; an acquiring unit, configured to acquire a first metadata table and a second metadata table, and a script registration table, wherein the first metadata table includes at least information about the database to which the table belongs and a table name, and the second metadata table includes at least information about the database, the table name, and field information; A judgment unit, configured to judge whether the ETL script to be analyzed is synchronized and configured correctly; The analyzing unit is configured to perform table analysis and field analysis on the ETL script to be analyzed through the first metadata table, the second metadata table, the script registration table, and the script information table if the ETL script to be analyzed is synchronized and configured correctly, so as to obtain table analysis results and field analysis results.

6. The system according to claim 5, characterized in that The judging unit includes: An execution module, configured to execute an acquisition operation according to the script ID of the ETL script to be analyzed, wherein the acquisition operation is used to acquire the script execution database instance and mode information; A judging module, configured to judge whether the information obtained by executing the obtaining operation is empty; The determination module is configured to determine whether the ETL script to be analyzed is synchronized and configured correctly if the information obtained by executing the acquisition operation is not empty.

7. The system according to claim 6, characterized in that The analysis unit comprises: A table analysis module is configured to, if the ETL script to be analyzed is synchronized and configured correctly, perform table analysis on the ETL script to be analyzed row by row using the first metadata table and the script registration table to obtain a table analysis result, wherein the script registration table at least includes script information to be synchronized, and the table analysis result at least includes: the name and location of the table appearing in the ETL script to be analyzed; A field analysis module is used to use the second metadata table, the script information table and the table analysis result to perform field analysis on the ETL script to be analyzed row by row to obtain a field analysis result, wherein the field analysis result at least includes: the name and location of the field appearing in the ETL script to be analyzed.

8. The system according to any one of claims 5 to 7, characterized in that: Also includes: A standardization unit is used to perform standardization processing on the script information table.

9. An electronic device, characterized in that: include: A processor and a memory, wherein the processor and the memory are connected via a communication bus; wherein the processor is configured to call and execute a program stored in the memory; The memory is used to store a program, and the program is used to implement the metadata-based script analysis method as described in any one of claims 1-4.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the metadata-based script analysis method according to any one of claims 1 to 4 is implemented.