Structured Query Language Detection Method, Device, Equipment and Medium
The method improves SQL syntax detection accuracy by using semantic similarity and type matching to ensure compliance with predefined standards, addressing inconsistencies in SQL statement meanings across different business contexts.
Patent Information
- Application Number
- CN202311187775.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-14
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2043-09-14
AI Technical Summary
In the prior art, the accuracy of the detection results of structured query statements is not high, especially when the functions of SQL statements with the same meaning are inconsistent in different business scenarios, resulting in inaccurate detection results.
By filtering the fields in the structured query statement to be checked, using natural language processing algorithms and deep learning frameworks to train the word segmentation model of the notes information, obtaining the semantic similarity of field names and dictionary value matching results, establishing a target field identification set, performing data type and dictionary value range detection, and determining whether the field meets the preset standard conditions.
It improves the accuracy of structured query statement detection, can comprehensively detect statements of data definition language and data operation language type, ensures that the fields meet standard conditions, and achieves more accurate standard judgments.
Smart Images

Figure CN117216095B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and particularly to a method, device, equipment and medium for detecting structured query statements. Background Art
[0002] With the increasing informatization of all walks of life, the data generated by each information system within an enterprise is also increasing. Although big data technology can aggregate and store a vast amount of data, how to utilize this vast amount of data has become a difficult problem in digital transformation. The first thing to solve in digital transformation is to clean the business data of each system in the enterprise, establish data standardization, and ensure data consistency, including data field names, field types, field meanings, and dictionary value consistency. Structured Query Language (SQL language) is a database query and programming language used to access data and query, update, and manage relational database systems. In related technologies, some syntax specifications of the SQL language are formulated into a unified standard syntax text. When detecting the development specifications of SQL statements, the above unified standard syntax text is used to check the SQL statements written by data development engineers to determine whether the written SQL statements conform to the specifications.
[0003] However, in the scenario of using SQL language coding in actual business, there may be cases where SQL statements with the same meaning have different functions in different businesses. Therefore, when using a standard syntax text with a single content to detect the specifications based on SQL statements, the accuracy of the detection results may be low.
[0004] In summary, how to improve the accuracy of structured query statement detection results is a problem to be solved in this field. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for detecting structured query statements, which can improve the accuracy of structured query statement detection results. The specific scheme is as follows:
[0006] In the first aspect, the present application discloses a method for detecting structured query statements, which is applied to a preset verification tool and includes:
[0007] Select a field from the structured query statement to be verified as the current field to be verified;
[0008] When the statement type of the structured query statement to be verified is a data definition language type and there is no historical field identifier corresponding to the current field to be verified in the preset data standard reference library, obtain the semantic similarities of each field name between the current field to be verified and each historical field in the preset data standard reference library, and determine the comprehensive similarity based on each of the field name semantic similarities;
[0009] Establish a target field identifier set for the current field to be verified according to the comprehensive similarity, and determine whether the current field to be verified meets the first preset standard condition based on the first data type detection result and the dictionary value matching result between the current field to be verified and the target field identifier set, and then re-jump to the step of screening a field from the structured query statement to be verified as the current field to be verified;
[0010] When the statement type of the structured query statement to be verified is a data manipulation language type and there is a target field identifier corresponding to the current field to be verified in the preset data standard reference library, determine whether the current field to be verified meets the second preset standard condition based on the second data type detection result and the dictionary value range detection result between the current field to be verified and the target field identifier, and then re-jump to the step of screening a field from the structured query statement to be verified as the current field to be verified.
[0011] Optionally, before screening a field from the structured query statement to be verified as the current field to be verified, it further includes:
[0012] Parse the log to be verified to obtain the initial structured query statement to be verified;
[0013] Perform format conversion on the initial structured query statement to be verified to obtain the structured query statement to be verified in the target format; where the target format is JSON format.
[0014] Optionally, the structured query statement detection method further includes:
[0015] When the statement type of the structured query statement to be verified is a data definition language type and there is a historical field identifier corresponding to the current field to be verified in the preset data standard reference library, determine that the current field to be verified meets the first preset standard condition, and then re-jump to the step of screening a field from the structured query statement to be verified as the current field to be verified;
[0016] When the statement type of the structured query statement to be verified is a data manipulation language type and there is no target field identifier corresponding to the current field to be verified in the preset data standard reference library, it is determined that the current field to be verified does not meet the second preset standard condition, and the process jumps back to the step of screening a field from the structured query statement to be verified as the current field to be verified.
[0017] Optionally, obtaining the semantic similarities of field names between the current field to be verified and each historical field in the preset data standard reference library includes:
[0018] Using a natural language processing algorithm to segment the field name of the current field to be verified to obtain segmented phrases;
[0019] Obtaining the first semantic similarity of field names between the segmented phrases and each field name in the preset data standard reference library;
[0020] Using a target segmentation model to segment the remarks information of the current field to be verified to obtain dictionary values, and obtaining a first set of English synonyms corresponding to the dictionary values;
[0021] Using the natural language processing algorithm to obtain the second semantic similarity of field names between the Chinese field name of the current field to be verified and each Chinese field name in the preset data standard reference library;
[0022] Obtaining the third semantic similarity of field names between the English field name of the current field to be verified and the second set of English synonyms in the preset data standard reference library;
[0023] Obtaining the fourth semantic similarity of field names between the first set of English synonyms and each English field name in the preset data standard reference library;
[0024] Correspondingly, before using the target segmentation model to segment the remarks information of the current field to be verified, it further includes:
[0025] Collecting the remarks information of each historical field in the preset data standard reference library, and performing annotation processing and data augmentation processing on the remarks information of each historical field to obtain remarks training samples;
[0026] Using the remarks training samples to train an initial segmentation model to obtain a target segmentation model.
[0027] Optionally, determining whether the current field to be verified meets the first preset standard condition based on the first data type detection result and dictionary value matching result between the current field to be verified and the set of target field identifiers includes:
[0028] Compare the data type of the currently to-be-verified field with the data types in the target field identifier set to obtain a first data type detection result;
[0029] Compare the dictionary value list of the currently to-be-verified field with the dictionary value list of the target field identifier set to obtain a dictionary value matching result;
[0030] Determine whether the currently to-be-verified field meets the first preset standard condition based on the first data type detection result and the dictionary value matching result;
[0031] Correspondingly, determining whether the currently to-be-verified field meets the second preset standard condition based on the second data type detection result and the dictionary value range detection result between the currently to-be-verified field and the target field identifier includes:
[0032] Compare the data type of the currently to-be-verified field with the data type of the target field identifier to obtain a second data type detection result;
[0033] Compare the field value corresponding to the currently to-be-verified field with the range of the dictionary value list of the target field identifier to obtain a dictionary value range detection result;
[0034] Determine whether the currently to-be-verified field meets the second preset standard condition based on the second data type detection result and the dictionary value range detection result.
[0035] Optionally, establishing the target field identifier set of the currently to-be-verified field according to the comprehensive similarity includes:
[0036] Determine each target field identifier in the preset data standard benchmark library whose comprehensive similarity is greater than the preset threshold, and establish the target field identifier set of the currently to-be-verified field according to each target field identifier.
[0037] Optionally, when the statement type of the to-be-verified structured query statement is a data definition language type and there is no corresponding historical field identifier for the currently to-be-verified field in the preset data standard benchmark library, obtaining the semantic similarity of each field name between the currently to-be-verified field and each historical field in the preset data standard benchmark library includes:
[0038] When the statement type of the to-be-verified structured query statement is a data definition language type and there is no corresponding historical field identifier for the currently to-be-verified field in the current business benchmark mapping table in the preset data standard benchmark library, obtain the semantic similarity of each field name between the currently to-be-verified field and each historical field in the preset data standard benchmark library;
[0039] Correspondingly, after establishing the target field identifier set of the current field to be verified according to the comprehensive similarity, the following steps are further included:
[0040] Construct a mapping relationship between the current field to be verified and each of the target field identifiers;
[0041] Save the mapping relationship to the current service benchmark mapping table, and update the current service benchmark mapping table to obtain a new current service benchmark mapping table.
[0042] In a second aspect, the present application discloses a structured query statement detection device, which is applied to a preset verification tool and includes:
[0043] A field screening module, configured to screen a field from the structured query statement to be verified as the current field to be verified;
[0044] A similarity determination module, configured to, when the statement type of the structured query statement to be verified is a data definition language type and there is no historical field identifier corresponding to the current field to be verified in the preset data standard benchmark library, obtain the semantic similarity of each field name between the current field to be verified and each historical field in the preset data standard benchmark library, and determine the comprehensive similarity based on each field name semantic similarity;
[0045] A first jump module, configured to establish a target field identifier set of the current field to be verified according to the comprehensive similarity, determine whether the current field to be verified meets the first preset standard condition based on the first data type detection result and the dictionary value matching result between the current field to be verified and the target field identifier set, and re-jump to the step of screening a field from the structured query statement to be verified as the current field to be verified;
[0046] A second jump module, configured to, when the statement type of the structured query statement to be verified is a data manipulation language type and there is a target field identifier corresponding to the current field to be verified in the preset data standard benchmark library, determine whether the current field to be verified meets the second preset standard condition based on the second data type detection result and the dictionary value range detection result between the current field to be verified and the target field identifier, and re-jump to the step of screening a field from the structured query statement to be verified as the current field to be verified.
[0047] In a third aspect, the present application discloses an electronic device, including:
[0048] A memory, configured to save a computer program;
[0049] A processor for executing the computer program to implement the steps of the structured query statement detection method disclosed above.
[0050] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the structured query statement detection method disclosed above are implemented.
[0051] The beneficial effects of the present application are as follows: The present application is applied to a preset verification tool to screen a field from the structured query statement to be verified as the current field to be verified; when the statement type of the structured query statement to be verified is a data definition language type and there is no historical field identifier corresponding to the current field to be verified in the preset data standard reference library, obtain the semantic similarity of each field name between the current field to be verified and each historical field in the preset data standard reference library, and determine the comprehensive similarity based on each field name semantic similarity; establish a target field identifier set for the current field to be verified according to the comprehensive similarity, and determine whether the current field to be verified meets the first preset standard condition based on the first data type detection result and dictionary value matching result between the current field to be verified and the target field identifier set, and then re-jump to the step of screening a field from the structured query statement to be verified as the current field to be verified; when the statement type of the structured query statement to be verified is a data manipulation language type and there is a target field identifier corresponding to the current field to be verified in the preset data standard reference library, determine whether the current field to be verified meets the second preset standard condition based on the second data type detection result and dictionary value range detection result between the current field to be verified and the target field identifier, and then re-jump to the step of screening a field from the structured query statement to be verified as the current field to be verified. It can be seen that the present application verifies each field in the structured query statement to be verified. When the statement type of the structured query statement to be verified is a data definition language type and there is no historical field identifier corresponding to the current field to be verified in the preset data standard reference library, the comprehensive similarity between the current field to be verified and each historical field in the preset data standard reference library can be determined, and then a target field identifier set is established according to the comprehensive similarity, so that the subsequent standard judgment of the current field to be verified can be more accurate, and the present application can detect structured query statements of data definition language type and data manipulation language type, and the detection type is more comprehensive. Description of the Drawings
[0052] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on the provided drawings.
[0053] Figure 1 Flowchart of a structured query language detection method disclosed in the present application;
[0054] Figure 2 Flowchart of a specific structured query language detection method disclosed in the present application;
[0055] Figure 3 Flowchart of another specific structured query language detection method disclosed in the present application;
[0056] Figure 4 Schematic diagram of the structure of a structured query language detection device disclosed in the present application;
[0057] Figure 5 Structural diagram of an electronic device disclosed in the present application. Detailed implementation manners
[0058] The following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0059] As the degree of informatization in all walks of life is getting higher and higher, the data generated by each information system within an enterprise is also increasing. Although big data technology can aggregate and store a large amount of data, how to utilize this large amount of data has become a problem in digital transformation. The first thing to solve in digital transformation is to clean the business data of each system in the enterprise, establish data standardization, and ensure data consistency, including data field names, field types, field meanings, and dictionary value consistency. Structured Query Language is a database query and programming language used to access data and query, update, and manage relational database systems. In the related art, some grammar specifications of SQL language are formulated into a unified standard grammar text. When detecting the development specifications of SQL statements, the above unified standard grammar text is used to check the SQL statements written by data development engineers to determine whether the written SQL statements meet the specifications.
[0060] However, in the scenario of encoding using the SQL language in actual business, there may be cases where SQL statements with the same meaning have different effects in different businesses. Therefore, when using a specification grammar text with a single content to perform specification detection based on SQL statements, the accuracy of the detection results may be low.
[0061] Therefore, the present application correspondingly provides a structured query statement detection solution, which can improve the accuracy of the structured query statement detection results.
[0062] See Figure 1 As shown, an embodiment of the present application discloses a structured query statement detection method, which is applied to a preset verification tool and includes:
[0063] Step S11: Screen a field from the structured query statement to be verified as the current field to be verified.
[0064] It can be understood that each business system within an enterprise is developed by different project teams. Then, the definitions of fields with the same meaning may be inconsistent. Even within the same project team, different project members may also have inconsistent definitions of fields with the same meaning. For example, as shown in the following table:
[0065] Table 1
[0066]
[0067]
[0068] As can be seen from the above, the definitions of the "document type" table field in the database tables of different systems may be inconsistent. Therefore, structured query statements with the same field name and other information cannot be directly merged, and standard verification needs to be performed on them.
[0069] In this embodiment, the preset verification tool includes an automatic verification pre-module (Biz-Detector) and an automatic verification engine (Detect-Engine). Among them, the automatic verification pre-module includes a slave node monitoring unit (DB-Monitor), a pre-processing unit (Pre-Processor), and a post-processing unit (Post-Processor). Before performing the detection, corresponding pre-preparations need to be carried out:
[0070] 1) Enable the Binary Log (binary log) related functions of MySQL. This function is mainly used to record operations on the MySQL database DDL (Data Definition Language, that is, data definition language) and DML (Data Manipulation Language, that is, data manipulation language). That is, modify the MySQL configuration file my.cnf of all business verification databases. Specifically, it is as follows:
[0071] log-bin = mysql-bin;
[0072] binlog_format=row;
[0073] server-id=1;
[0074] This embodiment utilizes the master-slave replication mechanism of MySQL. By simulating the slave node listening device, it can monitor the script operations of all databases in the development and testing environment in real time, and monitor in real time whether the data changes meet the data standards, without waiting until a specific stage for centralized processing.
[0075] 2) Preset the data standard reference library in the automatic verification engine, and preset the data standard information according to national, industry and enterprise standards, including: field name (English), field type (int, varchar), field name abbreviation, field length, field Chinese name, field dictionary value, and English synonym set. The English synonym set is a set that translates the "field Chinese name" into English by calling the Chinese-English translation API (Application Programming Interface), as shown in Table 2:
[0076] Table 2
[0077]
[0078]
[0079] 3) Collect a large amount of comments from the fields of the database, and annotate the comments in the format of "field name, dictionary value (key-value)", and use data enhancement technology to enrich the sample of the comments, and use the natural language processing algorithm (NLP) deep learning framework to train the initial word segmentation model of the comments, and finally obtain the target word segmentation model of the comments. After the target word segmentation model is used for word segmentation, the text analysis in the format of "field name, dictionary value 1, dictionary value 2" is obtained. For example, for "document type, 1: ID card; 2: passport; 3: military officer's card", after calling the analysis model, the format of {document type 1-ID card 2-passport 3-military officer's card} is obtained.
[0080] In this embodiment, before screening a field from the structured query statement to be verified as the current field to be verified, the following steps are further included: parsing the log to be verified to obtain an initial structured query statement to be verified; performing format conversion on the initial structured query statement to obtain a structured query statement to be verified in the target format, where the target format is JSON (JavaScript Object Notation) format. The specific process is as follows:
[0081] 1) The node monitoring unit simulates the MySQL slave node and is responsible for sending the dump (registration) protocol to the MySQL master node. After the MySQL service verification database receives the registration protocol request, developers execute DDL scripts and DML scripts in the service verification database, or the system program automatically executes DDL statements and DML statements to generate a structured query statement to be verified. Then, the MySQL service verification database starts to push the corresponding log to be verified to the node monitoring unit, and the node monitoring unit parses the log to be verified into an initial structured query statement to be verified;
[0082] 2) The preprocessing unit is responsible for converting the initial structured query statement to be verified into JSON (JavaScript Object Notation) format data.
[0083] For example, the DDL table creation statement:
[0084] create table T_Customer(
[0085] `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key ID',
[0086] `certificate_type` int(8) NOT NULL COMMENT 'certificate type, 1: ID card, 2: passport, 3: military officer ID',
[0087] `certificate_no` varchar(32) NOT NULL COMMENT 'certificate number', .... );
[0090] The preprocessing is parsed into JSON format:
[0091]
[0092] For example, the DML statement:
[0093]
[0094] After the preprocessing is completed, traverse the list of param parameters in the JSON string, call the interface of the automatic verification engine, and determine the currently to-be-verified field from the to-be-verified structured query statement.
[0095] Step S12: When the statement type of the to-be-verified structured query statement is a data definition language type and there is no historical field identifier corresponding to the currently to-be-verified field in the preset data standard reference library, obtain the semantic similarities of the field names between the currently to-be-verified field and each historical field in the preset data standard reference library, and determine the comprehensive similarity based on each of the field name semantic similarities.
[0096] In this embodiment, when the statement type of the to-be-verified structured query statement is a data definition language type and there is no historical field identifier corresponding to the currently to-be-verified field in the preset data standard reference library, obtain the semantic similarities of the field names between the currently to-be-verified field and each historical field in the preset data standard reference library, and perform weighted average processing on each of the field name semantic similarities to obtain the comprehensive similarity.
[0097] Step S13: Establish a target field identifier set for the currently to-be-verified field according to the comprehensive similarity, and determine whether the currently to-be-verified field meets the first preset standard condition based on the first data type detection result and the dictionary value matching result between the currently to-be-verified field and the target field identifier set, and then re-jump to the step of screening a field from the to-be-verified structured query statement as the currently to-be-verified field.
[0098] In this embodiment, determining whether the current field to be verified meets the first preset standard condition based on the first data type detection result and dictionary value matching result between the current field to be verified and the target field identifier set includes: comparing the data type of the current field to be verified with the data type of the target field identifier set to obtain the first data type detection result; comparing the dictionary value list of the current field to be verified with the dictionary value list of the target field identifier set to obtain the dictionary value matching result; and determining whether the current field to be verified meets the first preset standard condition based on the first data type detection result and the dictionary value matching result. The target field identifier set of the current field to be verified is constructed according to the fields in the preset data standard reference library whose comprehensive similarity exceeds the preset threshold. Then, the data type of the current field to be verified is compared with the corresponding data type of the target field identifier set to obtain the first data type detection result, and the dictionary value list of the current field to be verified is compared with the dictionary value list of the target field identifier set to obtain the dictionary value matching result. If the first data type detection result indicates that the data type of the current field to be verified is consistent with the corresponding data type of the target field identifier set, and the dictionary value matching result indicates that the dictionary value list of the current field to be verified matches the dictionary value list of the target field identifier set, it means that the current field to be verified passes the verification, that is, it meets the first preset standard condition. For example, the dictionary value list of the current field to be verified is {1: ID card, 2: passport}, and the dictionary value list of the fields in the target field identifier set is: {1: passport, 2: ID card}. The dictionary Key of the current field to be verified is 1, Value = ID card, but the dictionary Key of the fields in the target identifier set is 1, Value = passport, Key = 1, so the meanings represented are inconsistent; the dictionary value list of the current field to be verified is {1: ID card, 2: passport}, and the dictionary value list of the fields in the target field identifier set is: {3: ID card, 4: passport}. The dictionary value Keys of the current field to be verified include {1, 2}, but the Keys of the fields in the target identifier set are {3, 4}, so the dictionary value verification fails.
[0099] Step S14: When the statement type of the structured query statement to be verified is a data manipulation language type and there is a target field identifier corresponding to the current field to be verified in the preset data standard reference library, determine whether the current field to be verified meets the second preset standard condition based on the second data type detection result and dictionary value range detection result between the current field to be verified and the target field identifier, and then jump back to the step of selecting a field from the structured query statement to be verified as the current field to be verified.
[0100] In this embodiment, determining whether the current field to be verified meets the second preset standard condition based on the second data type detection result and dictionary value range detection result between the current field to be verified and the target field identifier includes: comparing the data type of the current field to be verified with the data type of the target field identifier to obtain the second data type detection result; comparing the field value corresponding to the current field to be verified with the dictionary value list range of the target field identifier to obtain the dictionary value range detection result; and determining whether the current field to be verified meets the second preset standard condition based on the second data type detection result and the dictionary value range detection result.
[0101] When the statement type of the structured query statement to be verified is a data manipulation language type and there is a target field identifier corresponding to the current field to be verified in the preset data standard reference library, the automatic verification engine determines the corresponding dictionary value list range according to the target field identifier, obtains the field value of the current field to be verified, that is, the field value inserted or changed for the current field to be verified, determines whether the field value of the current field to be verified belongs to the dictionary value range, that is, obtains the dictionary value range detection result, and determines whether the data type of the current field to be verified is consistent with the data type of the target field identifier, that is, obtains the second data type detection result. When the dictionary value range detection result is that the field value of the current field to be verified belongs to the dictionary value range and the second data type detection result is that the data type of the current field to be verified is consistent with the data type of the target field identifier, it indicates that the current field to be verified passes the verification, that is, meets the second preset standard condition. If the dictionary value detection result and the second data type detection result are not the above situations, it indicates that the current field to be verified fails the verification, that is, does not meet the second preset standard condition. For example, when changing the value of the certificate_type field to 3, but in the dictionary value list range of the target field identifier, there are only key = 1, value = ID card; key = 2, value = passport, that is to say, 3 is not in this dictionary value list range of the target field identifier, so the verification fails.
[0102] It can be understood that the post-processing module stores the verification results of each field in the SQL standardization detection association table of the automatic detection database, so that developers can make corresponding rectifications according to the fields and structured query statements that do not meet the first preset standard condition and / or the second preset standard condition in the SQL standardization detection association table.
[0103] The beneficial effects of this application are as follows: This application is applied to a preset verification tool, and a field is selected from the structured query statement to be verified as the current field to be verified; when the statement type of the structured query statement to be verified is a data definition language type and there is no corresponding historical field identifier for the current field to be verified in the preset data standard reference library, the semantic similarity of each field name between the current field to be verified and each historical field in the preset data standard reference library is obtained, and the comprehensive similarity is determined based on each of the field name semantic similarities; a target field identifier set of the current field to be verified is established according to the comprehensive similarity, and based on the first data type detection result and dictionary value matching result between the current field to be verified and the target field identifier set, it is determined whether the current field to be verified meets the first preset standard condition, and the step of selecting a field from the structured query statement to be verified as the current field to be verified is re-jumped to; when the statement type of the structured query statement to be verified is a data manipulation language type and there is a target field identifier corresponding to the current field to be verified in the preset data standard reference library, based on the second data type detection result and dictionary value range detection result between the current field to be verified and the target field identifier, it is determined whether the current field to be verified meets the second preset standard condition, and the step of selecting a field from the structured query statement to be verified as the current field to be verified is re-jumped to. Thus, it can be seen that this application verifies each field in the structured query statement to be verified. When the statement type of the structured query statement to be verified is a data definition language type and there is no corresponding historical field identifier for the current field to be verified in the preset data standard reference library, the comprehensive similarity between the current field to be verified and each historical field in the preset data standard reference library can be determined, and then a target field identifier set is established according to the comprehensive similarity, so that the subsequent standard judgment of the current field to be verified can be more accurate. Moreover, this application can detect structured query statements of data definition language type and data manipulation language type, and the detection type is more comprehensive.
[0104] See Figure 2 As shown, an embodiment of this application discloses a specific structured query statement detection method, which is applied to a preset verification tool and includes:
[0105] Step S21: Select a field from the structured query statement to be verified as the current field to be verified.
[0106] Step S22: When the statement type of the structured query statement to be verified is a data definition language type and there is no historical field identifier corresponding to the current field to be verified in the preset data standard reference library, obtain the semantic similarities of field names between the current field to be verified and each historical field in the preset data standard reference library, and determine the comprehensive similarity based on each of the semantic similarities of field names.
[0107] In this embodiment, alternatively, the obtaining of the semantic similarities of field names between the current field to be verified and each historical field in the preset data standard reference library includes: using a natural language processing algorithm to perform word segmentation on the field name of the current field to be verified to obtain segmented phrases; obtaining the first semantic similarity of field names between the segmented phrases and each field name in the preset data standard reference library; using a target word segmentation model to perform word segmentation on the remarks information of the current field to be verified to obtain dictionary values, and obtaining a first set of English synonyms corresponding to the dictionary values; using the natural language processing algorithm to obtain the second semantic similarity of field names between the Chinese field name of the current field to be verified and each Chinese field name in the preset data standard reference library; obtaining the third semantic similarity of field names between the English field name of the current field to be verified and a second set of English synonyms in the preset data standard reference library; obtaining the fourth semantic similarity of field names between the first set of English synonyms and each English field name in the preset data standard reference library. The specific process is as follows:
[0108] 1) Use a natural language processing algorithm to perform word segmentation on the field name of the current field to be verified, and calculate the synonym similarity (with a value range of [0,1]) between the segmented phrases and each field name in the preset data standard reference library to obtain the first semantic similarity of field names;
[0109] 2) Use a target word segmentation model to perform word segmentation on the remarks information of the current field to be verified to obtain dictionary values, such as "Chinese field name key1-value1 key2-value2...", and then call the Chinese-English translation application programming interface to translate the segmented Chinese field names into several corresponding synonymous English words to obtain a first set of English synonyms [syn1, syn2,...];
[0110] 3) Use a natural language processing algorithm to calculate the similarity between the Chinese field name of the current field to be verified and each Chinese field name in the preset data standard reference library to obtain the second semantic similarity of field names;
[0111] 4) Calculate the similarity between the English field name of the current field to be verified and a second set of English synonyms in the preset data standard reference library to obtain the third semantic similarity of field names;
[0112] 5) The semantic similarity of the fourth field name between the first English synonym set and each English field name in the preset data standard benchmark library.
[0113] In this embodiment, determining the comprehensive similarity based on the semantic similarity of each field name includes: performing weighted average processing on the first field name semantic similarity, the second field name semantic similarity, the third field name semantic similarity, and the fourth field name semantic similarity to obtain the comprehensive similarity. The comprehensive similarity calculation formula is as follows:
[0114]
[0115] In the formula, similar represents the comprehensive similarity, σ i represents the weight, X i represents the semantic similarity of the field name, and i represents the serial number of the semantic similarity of the field name.
[0116] In this embodiment, before using the target tokenization model to perform tokenization processing on the note information of the current field to be verified, it further includes: collecting the note information of each historical field in the preset data standard benchmark library, and performing annotation processing and data enhancement processing on the note information of each historical field to obtain note training samples; using the note training samples to train the initial tokenization model to obtain the target tokenization model. Collect a large amount of note information of each historical field, perform annotation processing and data enhancement processing on the note information to obtain note training samples, and then use the note training samples to train the initial tokenization model to obtain the target tokenization model.
[0117] In this embodiment, when the statement type of the structured query statement to be verified is a data definition language type and there is no historical field identifier corresponding to the current field to be verified in the preset data standard benchmark library, obtaining the semantic similarity of each field name between the current field to be verified and each historical field in the preset data standard benchmark library includes: when the statement type of the structured query statement to be verified is a data definition language type and there is no historical field identifier corresponding to the current field to be verified in the current business benchmark mapping table of the preset data standard benchmark library, obtaining the semantic similarity of each field name between the current field to be verified and each historical field in the preset data standard benchmark library. It can be understood that it is necessary to determine whether there is a historical field identifier corresponding to the current field to be verified in the current business benchmark mapping table of the preset data standard benchmark library. If not, obtain the semantic similarity of each field name between the current field to be verified and each historical field in the preset data standard benchmark library.
[0118] Step S23: Determine each target field identifier with a comprehensive similarity greater than a preset threshold from the preset data standard benchmark library, and establish a set of target field identifiers for the currently to-be-verified field according to each of the target field identifiers.
[0119] It should be noted that if there is no historical field identifier corresponding to the currently to-be-verified field in the current business benchmark mapping table, the current business benchmark mapping table needs to be updated so that the historical field identifier corresponding to the currently to-be-verified field can be found in the new current business benchmark mapping table in the future. The specific update process is as follows: Construct the mapping relationship between the currently to-be-verified field and each of the target field identifiers; Save the mapping relationship to the current business benchmark mapping table, and update the current business benchmark mapping table to obtain a new current business benchmark mapping table. In this way, when searching in the future, the historical field identifier corresponding to the currently to-be-verified field, that is, the target field identifier, can be found in the new current business benchmark mapping table.
[0120] Step S24: Determine whether the currently to-be-verified field meets the first preset standard condition based on the first data type detection result and dictionary value matching result between the currently to-be-verified field and the set of target field identifiers, and then jump back to the step of screening a field from the to-be-verified structured query statement as the currently to-be-verified field.
[0121] Step S25: When the statement type of the to-be-verified structured query statement is a data manipulation language type and there is a target field identifier corresponding to the currently to-be-verified field in the preset data standard benchmark library, determine whether the currently to-be-verified field meets the second preset standard condition based on the second data type detection result and dictionary value range detection result between the currently to-be-verified field and the target field identifier, and then jump back to the step of screening a field from the to-be-verified structured query statement as the currently to-be-verified field.
[0122] It can be seen that this application can analyze the note information in the data definition language type, and use the open-source models of natural language processing algorithms and deep learning frameworks to train the initial word segmentation model to obtain the target word segmentation model for note information, which is beneficial to the data standardization process of metadata with a fixed dictionary value type. Moreover, this application can also have the ability to monitor, detect and analyze the to-be-verified structured query statement of the data definition language type in real time.
[0123] See Figure 3 As shown, an embodiment of this application discloses a specific structured query statement detection method, which is applied to a preset verification tool and includes:
[0124] Step S31: Select a field from the structured query statement to be verified as the current field to be verified.
[0125] It can be understood that the way to select a field can be to select it according to the field arrangement order, for example, to select it according to the ascending arrangement order, or to randomly select a field from the structured query statement to be verified as the current field to be verified.
[0126] Step S32: When the statement type of the structured query statement to be verified is a data definition language type and there is no historical field identifier corresponding to the current field to be verified in the preset data standard reference library, obtain the semantic similarity of each field name between the current field to be verified and each historical field in the preset data standard reference library, and determine the comprehensive similarity based on each semantic similarity of the field names.
[0127] In this embodiment, if the statement type of the structured query statement to be verified is a data definition language type and there is no historical field identifier corresponding to the current field to be verified in the preset data standard reference library, it means that the current field to be verified of the structured query statement to be verified has not been verified. Therefore, it is necessary to verify the current field to be verified to determine whether it meets the first preset standard condition.
[0128] Step S33: Establish a target field identifier set for the current field to be verified according to the comprehensive similarity, and determine whether the current field to be verified meets the first preset standard condition based on the first data type detection result and the dictionary value matching result between the current field to be verified and the target field identifier set, and then re-jump to the step of selecting a field from the structured query statement to be verified as the current field to be verified.
[0129] It should be noted that before re-jumping to the step of selecting a field from the structured query statement to be verified as the current field to be verified, it is necessary to determine whether there are un-verified fields in the structured query statement to be verified. If there are un-verified fields, it is necessary to re-jump to the step of selecting a field from the structured query statement to be verified as the current field to be verified. If there are no un-verified fields, that is, each field in the structured query statement to be verified has been verified, then there is no need to re-jump to the step of selecting a field from the structured query statement to be verified as the current field to be verified.
[0130] Step S34: When the statement type of the structured query statement to be verified is a data definition language type and there is a historical field identifier corresponding to the current field to be verified in the preset data standard reference library, it is determined that the current field to be verified meets the first preset standard condition, and the process jumps back to the step of screening a field from the structured query statement to be verified as the current field to be verified.
[0131] In this embodiment, if the statement type of the structured query statement to be verified is a data definition language type and there is a historical field identifier corresponding to the current field to be verified in the preset data standard reference library, it indicates that the current field to be verified in the structured query statement to be verified has been verified previously, so there is no need to verify the current field to be verified again.
[0132] Step S35: When the statement type of the structured query statement to be verified is a data manipulation language type and there is a target field identifier corresponding to the current field to be verified in the preset data standard reference library, determine whether the current field to be verified meets the second preset standard condition based on the second data type detection result and the dictionary value range detection result between the current field to be verified and the target field identifier, and then jump back to the step of screening a field from the structured query statement to be verified as the current field to be verified.
[0133] It can be understood that after determining whether the current field to be verified meets the second preset standard condition, it is necessary to determine whether there are still fields in the structured query statement to be verified that have not been verified. Only when there are still fields that have not been verified, the process jumps back to the step of screening a field from the structured query statement to be verified as the current field to be verified.
[0134] Step S36: When the statement type of the structured query statement to be verified is a data manipulation language type and there is no target field identifier corresponding to the current field to be verified in the preset data standard reference library, it is determined that the current field to be verified does not meet the second preset standard condition, and the process jumps back to the step of screening a field from the structured query statement to be verified as the current field to be verified.
[0135] It should be noted that since the premise of the data manipulation language type is to ensure that the metadata of this field has completed the corresponding verification and mapping through the data definition language type operation, if the statement type of the structured query statement to be verified is a data manipulation language type and there is no target field identifier corresponding to the current field to be verified in the preset data standard reference library, an exception message can be directly returned, that is, it is directly determined that the current field to be verified does not meet the second preset standard condition.
[0136] It can be seen that the present application verifies each field in the structured query statement to be verified, and can not only detect structured query statements of the data definition language type, but also detect structured query statements of the data manipulation language type, with a more comprehensive detection type.
[0137] See Figure 4 As shown, an embodiment of the present application discloses a structured query statement detection device, which is applied to a preset verification tool and includes:
[0138] A field screening module 11, configured to screen a field from the structured query statement to be verified as the currently to-be-verified field;
[0139] A similarity determination module 12, configured to, when the statement type of the structured query statement to be verified is of the data definition language type and there is no corresponding historical field identifier for the currently to-be-verified field in the preset data standard reference library, obtain the semantic similarities of the field names between the currently to-be-verified field and each historical field in the preset data standard reference library, and determine a comprehensive similarity based on each of the field name semantic similarities;
[0140] A first jump module 13, configured to establish a target field identifier set for the currently to-be-verified field according to the comprehensive similarity, determine whether the currently to-be-verified field meets the first preset standard condition based on the first data type detection result and the dictionary value matching result between the currently to-be-verified field and the target field identifier set, and re-jump to the step of screening a field from the structured query statement to be verified as the currently to-be-verified field;
[0141] A second jump module 14, configured to, when the statement type of the structured query statement to be verified is of the data manipulation language type and there is a target field identifier corresponding to the currently to-be-verified field in the preset data standard reference library, determine whether the currently to-be-verified field meets the second preset standard condition based on the second data type detection result and the dictionary value range detection result between the currently to-be-verified field and the target field identifier, and re-jump to the step of screening a field from the structured query statement to be verified as the currently to-be-verified field.
[0142] The beneficial effects of this application are as follows: This application is applied to a preset verification tool, and a field is selected from the structured query statement to be verified as the currently to-be-verified field; when the statement type of the structured query statement to be verified is a data definition language type and there is no corresponding historical field identifier for the currently to-be-verified field in the preset data standard reference library, the semantic similarities of the field names between the currently to-be-verified field and each historical field in the preset data standard reference library are obtained, and the comprehensive similarity is determined based on each of the field name semantic similarities; a target field identifier set for the currently to-be-verified field is established according to the comprehensive similarity, and based on the first data type detection result and dictionary value matching result between the currently to-be-verified field and the target field identifier set, it is determined whether the currently to-be-verified field meets the first preset standard condition, and then it jumps back to the step of selecting a field from the structured query statement to be verified as the currently to-be-verified field; when the statement type of the structured query statement to be verified is a data manipulation language type and there is a target field identifier corresponding to the currently to-be-verified field in the preset data standard reference library, based on the second data type detection result and dictionary value range detection result between the currently to-be-verified field and the target field identifier, it is determined whether the currently to-be-verified field meets the second preset standard condition, and then it jumps back to the step of selecting a field from the structured query statement to be verified as the currently to-be-verified field. Thus, it can be seen that this application verifies each field in the structured query statement to be verified. When the statement type of the structured query statement to be verified is a data definition language type and there is no corresponding historical field identifier for the currently to-be-verified field in the preset data standard reference library, the comprehensive similarity between the currently to-be-verified field and each historical field in the preset data standard reference library can be determined, and then a target field identifier set is established according to the comprehensive similarity, enabling more accurate determination of the current to-be-verified field standard in the subsequent process. Moreover, this application can detect structured query statements of data definition language type and data manipulation language type, and the detection types are more comprehensive.
[0143] Furthermore, an embodiment of this application also provides an electronic device. Figure 5 It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure should not be regarded as any limitation on the usage scope of this application.
[0144] Figure 5Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the structured query statement detection method executed by the electronic device disclosed in any of the foregoing embodiments.
[0145] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of the present application, and no specific limitation is imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitation is made here.
[0146] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, and the AI processor is used to process computing operations related to machine learning.
[0147] In addition, as a carrier for resource storage, the memory 22 may be a read-only memory, a random access memory, a magnetic disk, or an optical disc, etc. The resources stored thereon include an operating system 221, a computer program 222, and data 223, etc., and the storage method may be temporary storage or permanent storage.
[0148] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device, so as to implement the operation and processing of the massive data 223 in the memory 22 by the processor 21. It can be Windows, Unix, Linux, etc. In addition to the computer program that can be used to complete the structured query statement detection method executed by the electronic device disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs that can be used to complete other specific tasks. The data 223 may include not only the data transmitted by external devices received by the electronic device, but also the data collected by its own input / output interface 25, etc.
[0149] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the foregoing disclosed structured query statement detection method is implemented. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.
[0150] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and reference can be made to the description in the method part for related parts.
[0151] Those skilled in the art may further realize that the units and algorithm steps of each example described in connection with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application. The steps of the methods or algorithms described in connection with the embodiments disclosed herein can be directly implemented by hardware, software modules executed by a processor, or a combination of the two. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable EPROM (Erasable Programmable Read Only Memory), electrically erasable programmable EEPROM (Electrically Erasable Programmable read only memory), registers, hard disks, removable disks, CD-ROM (Compact Disc Read-Only Memory), or any other form of storage medium known in the art.
[0152] Finally, it should also be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0153] The above has introduced in detail a method, device, equipment and medium for detecting structured query statements provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A method for detecting structured query statements, characterized in that, Applied to a preset verification tool, including: Select a field from the structured query statement to be verified as the currently to-be-verified field; When the statement type of the structured query statement to be verified is a data definition language type and there is no historical field identifier corresponding to the currently to-be-verified field in the preset data standard benchmark library, obtain the semantic similarity of each field name between the currently to-be-verified field and each historical field in the preset data standard benchmark library, and determine the comprehensive similarity based on each of the field name semantic similarities; Establish a target field identifier set for the currently to-be-verified field according to the comprehensive similarity, and determine whether the currently to-be-verified field meets the first preset standard condition based on the first data type detection result and dictionary value matching result between the currently to-be-verified field and the target field identifier set, and then re-jump to the step of selecting a field from the structured query statement to be verified as the currently to-be-verified field; When the statement type of the structured query statement to be verified is a data manipulation language type and there is a target field identifier corresponding to the currently to-be-verified field in the preset data standard benchmark library, determine whether the currently to-be-verified field meets the second preset standard condition based on the second data type detection result and dictionary value range detection result between the currently to-be-verified field and the target field identifier, and then re-jump to the step of selecting a field from the structured query statement to be verified as the currently to-be-verified field.
2. The method for detecting a structured query statement according to claim 1, wherein Before the step of selecting a field from the structured query statement to be verified as the currently to-be-verified field, it further includes: Parse the to-be-verified log to obtain the initial structured query statement to be verified; Perform format conversion on the initial structured query statement to be verified to obtain the structured query statement to be verified in the target format; wherein, the target format is JSON format.
3. The structured query statement detection method according to claim 1, characterized in that It further includes: When the statement type of the structured query statement to be verified is a data definition language type and there is a historical field identifier corresponding to the currently to-be-verified field in the preset data standard benchmark library, determine that the currently to-be-verified field meets the first preset standard condition, and then re-jump to the step of selecting a field from the structured query statement to be verified as the currently to-be-verified field; When the statement type of the structured query statement to be verified is a data manipulation language type and there is no target field identifier corresponding to the currently to-be-verified field in the preset data standard benchmark library, determine that the currently to-be-verified field does not meet the second preset standard condition, and then re-jump to the step of selecting a field from the structured query statement to be verified as the currently to-be-verified field.
4. The structured query statement detection method according to claim 1, wherein The obtaining of the semantic similarity of each field name between the currently to-be-verified field and each historical field in the preset data standard benchmark library includes: Use a natural language processing algorithm to segment the field name of the currently to-be-verified field to obtain the segmented phrases; Obtain the first field name semantic similarity between the segmented phrases and each field name in the preset data standard benchmark library; Use the target word segmentation model to perform word segmentation on the remark information of the current field to be verified, so as to obtain dictionary values, and obtain the first set of English synonyms corresponding to the dictionary values; Use the natural language processing algorithm to obtain the second semantic similarity of field names between the Chinese field name of the current field to be verified and each Chinese field name in the preset data standard reference library; Obtain the third semantic similarity of field names between the English field name of the current field to be verified and the second set of English synonyms in the preset data standard reference library; Obtain the fourth semantic similarity of field names between the first set of English synonyms and each English field name in the preset data standard reference library; Correspondingly, before using the target word segmentation model to perform word segmentation on the remark information of the current field to be verified, it also includes: Collect the remark information of each historical field in the preset data standard reference library, and perform annotation processing and data enhancement processing on the remark information of each historical field to obtain remark training samples; Use the remark training samples to train the initial word segmentation model to obtain the target word segmentation model.
5. The structured query statement detection method according to claim 1, characterized in that The determining whether the current field to be verified meets the first preset standard condition based on the first data type detection result and the dictionary value matching result between the current field to be verified and the target field identifier set includes: Compare the data type of the current field to be verified with the data type of the target field identifier set to obtain the first data type detection result; Compare the dictionary value list of the current field to be verified with the dictionary value list of the target field identifier set to obtain the dictionary value matching result; Determine whether the current field to be verified meets the first preset standard condition based on the first data type detection result and the dictionary value matching result; Correspondingly, the determining whether the current field to be verified meets the second preset standard condition based on the second data type detection result and the dictionary value range detection result between the current field to be verified and the target field identifier includes: Compare the data type of the current field to be verified with the data type of the target field identifier to obtain the second data type detection result; Compare the field value corresponding to the current field to be verified with the dictionary value list range of the target field identifier to obtain the dictionary value range detection result; Determine whether the current field to be verified meets the second preset standard condition based on the second data type detection result and the dictionary value range detection result.
6. The method for detecting a structured query statement according to any one of claims 1 to 5, characterized in that The establishing the target field identifier set of the current field to be verified according to the comprehensive similarity includes: Determine each target field identifier in the preset data standard reference library whose comprehensive similarity is greater than the preset threshold, and establish the target field identifier set of the current field to be verified according to each target field identifier.
7. The structured query statement detection method according to claim 6, wherein When the statement type of the structured query statement to be verified is a data definition language type and there is no historical field identifier corresponding to the current field to be verified in the preset data standard reference library, obtaining the semantic similarities of each field name between the current field to be verified and each historical field in the preset data standard reference library includes: When the statement type of the structured query statement to be verified is a data definition language type and there is no historical field identifier corresponding to the current field to be verified in the current business benchmark mapping table of the preset data standard reference library, obtaining the semantic similarities of each field name between the current field to be verified and each historical field in the preset data standard reference library; Correspondingly, after establishing the target field identifier set of the current field to be verified according to the comprehensive similarity, it further includes: Constructing a mapping relationship between the current field to be verified and each of the target field identifiers; Saving the mapping relationship to the current business benchmark mapping table and updating the current business benchmark mapping table to obtain a new current business benchmark mapping table.
8. A structured query statement detection device, characterized in that, Applied to a preset verification tool, including: A field screening module for screening a field from the structured query statement to be verified as the current field to be verified; A similarity determination module for obtaining the semantic similarities of each field name between the current field to be verified and each historical field in the preset data standard reference library and determining a comprehensive similarity based on the semantic similarities of each field name when the statement type of the structured query statement to be verified is a data definition language type and there is no historical field identifier corresponding to the current field to be verified in the preset data standard reference library; A first jump module for establishing a target field identifier set of the current field to be verified according to the comprehensive similarity, determining whether the current field to be verified meets the first preset standard condition based on the first data type detection result and dictionary value matching result between the current field to be verified and the target field identifier set, and re-jumping to the step of screening a field from the structured query statement to be verified as the current field to be verified; A second jump module for determining whether the current field to be verified meets the second preset standard condition based on the second data type detection result and dictionary value range detection result between the current field to be verified and the target field identifier when the statement type of the structured query statement to be verified is a data manipulation language type and there is a target field identifier corresponding to the current field to be verified in the preset data standard reference library, and re-jumping to the step of screening a field from the structured query statement to be verified as the current field to be verified.
9. An electronic device, characterized in that, Including: A memory for storing a computer program; A processor for executing the computer program to implement the steps of the structured query statement detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, For storing a computer program; wherein, when the computer program is executed by the processor, the steps of the structured query statement detection method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method and device for processing field data in data warehouse
CN114091426A
Natural language data query method and device, electronic equipment and storage medium
CN114281957A