A credit investigation derivative variable processing system and method based on SQL syntax

Through the credit-derived variable processing system based on SQL grammar, the abstract syntax tree matching and operation module execution logic is used to solve the problem of inefficient data processing of credit report in the existing technology, and efficient and accurate data processing and statistical analysis are achieved .

CN117874056BActive Publication Date: 2025-01-14GUANGDONG GF INTERNET MICROFINANCE LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202311823333.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-27
Publication Date
2025-01-14
Estimated Expiration
2043-12-27

AI Technical Summary

Technical Problem

The existing technology is inefficient when processing credit report data, and requires frequent query of the manual. XML node reading and traditional code methods require writing a large amount of code to implement functions such as aggregation, statistics, and connection, which leads to cumbersome processing and error-prone.

Method used

Adopt a credit-derived variable processing system based on SQL syntax, including input module, syntax analysis engine, persistence module, metadata matching module and operation module. Through the matching and operation module of abstract syntax trees, the code writing is simplified and data is improved. Processing efficiency.

Benefits of technology

By improving the efficiency and accuracy of data processing, developers can rely on automatic prompts and completion functions to simplify the writing of processing code, improving work efficiency and code quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117874056B_ABST
    Figure CN117874056B_ABST
Patent Text Reader

Abstract

The present invention discloses a credit derived variable processing system and method based on SQL grammar, comprising an input module, a grammar parsing engine, a persistence module, a metadata matching module and an operation module; comprising the following steps: S1. Processing of standard documents: collecting standard documents of credit reports and extracting data item metadata of standard documents, and interpreting standard documents to obtain a dictionary tree and a data item entity class of the standard documents; S2. Processing of processing codes: using an SQL word segmenter to segment the processing codes, and then interpreting the segmentation results to obtain an abstract syntax tree of the processing codes, and obtaining table names and field names therein; S3. Processing of credit reports: converting the data of the credit report into a data item entity class instance generated in step S1, reading data of the corresponding fields of the data item instance class instance according to the table name and field name obtained in step S2, and using the data as an execution context to execute SQL statements to obtain results.
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 methods, and in particular to a credit-derivative variable processing system and method based on SQL syntax. Background Art

[0002] The processing of derived variables in credit reports requires reference to the People's Bank of China Credit Reporting System Standard Q / PBCCRC 1.1-2016. This standard contains more than a dozen specifications and instructions, with as many as 400-500 data items displayed in XML format, with multiple structural levels and non-natural language naming, which is difficult to remember. Traditional processing methods usually require manual writing of complex codes to read and process XML data, resulting in low efficiency and prone to errors.

[0003] There are already some solutions to process credit report data, mainly including manual parsing of XML data, using custom functions and calculation expressions, etc. Manual parsing of XML data requires familiarity with XML format and data structure, and requires writing a lot of code to read and process data; using custom functions can simplify code writing, but still requires processing personnel to have certain code knowledge and experience; complex data operations and connections with calculation expressions are still difficult.

[0004] There are the following problems with using the current solutions for variable processing: 1. The instructions need to be frequently queried during the processing, and the processing efficiency is very low; 2. XML node reading and the traditional use of code to implement statistical functions such as aggregation, statistics, and connections require writing a lot of code. Summary of the invention

[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a system and method that is novel and reliable, and uses SQL to read, derive, process, prompt and complete credit report data, thereby improving the efficiency of data processing and reducing errors.

[0006] In order to achieve the above purpose, the technical solution adopted by the present invention is: a credit-derived variable processing system based on SQL syntax, including an input module, a syntax parsing engine, a persistence module, a metadata matching module and an operation module; the input module is used to input SQL statements; the syntax parsing engine is used to compile the input script, match it according to the symbol table predefined by the syntax rules, and obtain an abstract syntax tree; the persistence module is used to save the abstract syntax tree, and when the script compiling the abstract syntax tree is repeatedly referenced, the persistence module directly calls the compiled abstract syntax tree; the metadata matching module is used to match the metadata with the abstract syntax tree, traverse the abstract syntax tree, and perform quantitative matching on the node information in the abstract syntax tree combined with the data, wherein the metadata of the ordinary variable value is directly matched with the abstract syntax tree, and the metadata of the object attribute is defined according to the variable hierarchical structure of the abstract syntax tree, matching the first-level child node attribute of the object attribute, or more levels of child node attributes, and the attribute value is the value of the variable; the operation module is used to execute the operation logic of the abstract syntax tree to obtain the operation result.

[0007] The present invention also discloses a method for processing credit derived variables based on SQL syntax, comprising the following steps: S1. Processing of standard documents: collecting standard documents of credit reports and extracting data item metadata of standard documents, and interpreting standard documents to obtain data item entity classes of standard documents; S2. Processing of processing codes: using an SQL word segmenter to segment the processing codes, and then interpreting the segmentation results to obtain an abstract syntax tree of the processing codes, and obtaining table names and field names therein; S3. Processing of credit reports: converting the data of the credit report into a data item entity class instance generated in step S1, reading data of corresponding fields of the data item instance class instance according to the table name and field name obtained in step S2, and using the data as an execution context to execute SQL statements to obtain results.

[0008] Preferably, the integrated development environment used to write processing codes has a prompt and completion function and a data item index dictionary tree display function; prompt and completion function: prompt the data item metadata of the standard document corresponding to the field name and table name according to the context; display data item index dictionary tree function: by clicking on the node of the index dictionary tree, the XML Tag of the corresponding data item can be inserted at the current position.

[0009] Preferably, the prompt and completion function includes the following steps: Sa. Generate a dictionary tree: collect the standard document of the credit report and extract the data item metadata of the standard document, and generate a dictionary tree for the extracted data item metadata according to its superior-subordinate relationship; Sb. Listen to the "input" event and "mouse hover" event of the code editor; Sc. When an event occurs, use the SQL language word segmenter to segment the code in the code editing area, parse the word segmentation result to form an abstract syntax tree, and obtain the table name and field name therein; Sd. Obtain the row and column position triggered by the code editor event, and then obtain the word segmentation token of the code corresponding to the row and column position; Se. According to the word segmentation token, search the abstract syntax tree to obtain the credit report data item query keyword; Sf. Fuzzy query the key of the dictionary tree, find the key value that meets the conditions, and obtain the value corresponding to each key value; Sg. Display the data item completion prompt.

[0010] Preferably, the prompt and completion function includes the following steps: SA. Generate a dictionary tree: collect the standard documents of the letter report and extract the data item metadata of the standard documents, and generate a dictionary tree for the extracted data item metadata according to their superior-subordinate relationship; SB. Listen to the "input" event of the dictionary tree search box; SC. Get the input text of the dictionary tree search box; SD. Traverse the dictionary tree according to the acquired text, fuzzy match the key value of each node, and hide the unmatched nodes; SE. Listen to the "mouse hover" event of the dictionary tree node. When the event is triggered, the metadata of the corresponding node is displayed in the form of a bubble, and the subordinate nodes in the metadata are set to the display state; listen to the "mouse click" event of the dictionary tree node. When the event is triggered, the XML Tag of the corresponding node is inserted at the cursor position of the code editor, and the "mouse click" event of the dictionary tree node expansion button is listened to. When the event is triggered, the display state Boolean value of all child nodes is inverted to switch the display / hide state of the child nodes.

[0011] Preferably, in step Se, the method for obtaining the query keyword for the credit report data item is as follows: (a) if the token type is an sql field name, query AST to obtain the input content between the position and the previous English period separator as the keyword for querying the dictionary tree; (b) if the token type is an sql alias, search the abstract syntax tree to obtain the original field name token corresponding to the alias, and then use the original field name token as a reference to obtain the keyword in the manner of (a); (c) if the token type is "English period separator", find the first sql field name type token before the position, and then use the original field name token as a reference to obtain the keyword in the manner of (a).

[0012] Preferably, in step Sg, if the event that occurs is "input", the data item completion prompt is displayed in the form of a list; if the event that occurs is "mouse hover", the data item metadata is displayed in the form of a bubble.

[0013] Preferably, in step S1, the process of extracting data item metadata includes the following steps: S1-1. Using a programming language, load a specification document and store it in memory, and extract the document structure that defines the credit data in the specification document; S1-2. Traverse the document structure that defines the credit data, read the text in each document structure, and extract data items of all data in the document according to text features and store them in an indexable data structure. The text features include the row, column, header name, punctuation separator, and hyperlink where the text is located. The data items include the names, inclusion relationships, and data types of all data. The data structures include dictionaries and Maps; S1-3. Traverse the extracted data items, and generate a dictionary tree and a credit report data item entity class according to the inclusion relationship between the data items, and then serialize and store them in a storage medium. The storage medium includes but is not limited to a file system, a database, and a memory; S1-4. Write a test for the data item entity class generated above.

[0014] Preferably, in step S1-5, the test process is as follows: using the method of the present invention, load a desensitized real credit report message, parse the contents of all fields in the message through the program to form a message instance; read the dictionary tree, according to the parent-child relationship of the data nodes in the dictionary tree, read the corresponding data in the message instance according to the XML Tag, and compare it with the data value in the real message to verify the correctness of the dictionary tree and the credit report data item entity class.

[0015] The beneficial effects of the present invention are as follows: the system and method of the present invention can be applied to read and process the data of the credit report, and to calculate and statistically analyze the data-derived variables, thereby improving the effect and accuracy of the derived variable processing. Specifically, by using the system and method of the present invention, when developers write processing codes, they can rely on automatic prompts and completion methods to integrate the content of the credit report into the processing platform, simplify the process of writing processing codes, improve the work efficiency of developers, and improve development efficiency and code quality. In addition, due to the importance and wide applicability of credit report data, the present invention is also expected to be widely demanded by the market. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 Schematic diagram of the system of the present invention.

[0017] Figure 2 This is a flow chart of the credit report derived variable processing method of the present invention.

[0018] Figure 3It is a flow chart of the prompt and completion functions of the present invention.

[0019] Figure 4 This is an interface diagram of the prompt function of the present invention.

[0020] Figure 5 This is an interface diagram of the supplement function of the present invention.

[0021] Figure 6 This is a diagram of the dictionary tree operation interface of the present invention.

[0022] Figure 7 This is a flow chart of extracting credit report data of the present invention. Implementation

[0023] The technical solution adopted by the present invention is now further described in detail in conjunction with the accompanying drawings and specific embodiments.

[0024] See also Figures 1 to 7 As shown, the system in this embodiment includes an input module, a syntax parsing engine, a persistence module, a metadata matching module and a calculation module.

[0025] The input module is used to input SQL statements and is not limited to single-end SQL statements.

[0026] The syntax parsing engine is used to compile the input script, match it according to the pre-defined symbol table of the syntax rules, obtain the abstract syntax tree, and identify the variable names and operators, etc.

[0027] The persistence module is used to save the abstract syntax tree. When the script for compiling the abstract syntax tree is repeatedly referenced, the persistence module directly calls the compiled abstract syntax tree, thereby avoiding repeated script compilation and shortening the response speed.

[0028] The metadata matching module is used to match metadata with an abstract syntax tree, traverse the abstract syntax tree, and perform quantitative matching on node information in the abstract syntax tree in combination with data, wherein the metadata of common variable values ​​is directly matched with the abstract syntax tree, and the metadata of object attributes is defined according to the variable hierarchical structure of the abstract syntax tree, matching the first-level child node attributes of the object attributes, or more levels of child node attributes, and the attribute value is the value of the variable.

[0029] The operation module is used to execute the operation logic of the abstract syntax tree to obtain the operation result.

[0030] In this embodiment, SQL is used to read and process credit report data, and the process includes the following steps:

[0031] S1. Processing of standard documents: Use the collection component of any programming language to collect the standard documents of the credit report and extract metadata.

[0032] The metadata in this step includes the data item name, data item description, data type, XML tag, number of occurrences, and subordinate elements, which are stored in json format. The specific process will be described in detail later. The metadata is parsed to form the credit report entity class and dictionary tree.

[0033] S2: Processing of the processed code: The processed code is segmented using an SQL word segmenter, and then the segmentation result is interpreted to obtain an abstract syntax tree of the processed code. Specifically, in this embodiment, the process of obtaining the abstract syntax tree is as follows:

[0034] The processed code is analyzed according to the logic and grammatical structure to identify key elements such as expressions, operators, and function calls. Then, based on the identified key elements, the nodes of the syntax tree are constructed, and the nodes are connected to form a tree structure. After that, type inference and semantic analysis are performed on each node to ensure the legitimacy of the entire syntax tree. Finally, additional nodes are added to the syntax tree to represent control flows such as conditional branches and loop structures.

[0035] After obtaining the abstract syntax tree, first use the depth-first search algorithm (DFS) to traverse the abstract syntax tree to obtain the table name and field name. Then use the XML parsing library and SAX parser to read and parse the XML data of the credit report; then according to the structure of the data item entity class, recursively obtain the XPath of each attribute of the entity class through reflection; finally, obtain the data item in the XML message through XPath and fill it into the attributes of the PBOC credit derivative variable instance.

[0036] S3 obtains the result: converts the data of the credit report instance into the data item entity class instance generated in step S1, reads the data of the corresponding field of the data item instance class instance according to the table name and field name obtained in step S2, sends the SQL statement abstract syntax tree to the operation module using the data as the execution context, and interprets and executes the SQL statement to obtain the result.

[0037] In this embodiment, the IDE code is used to enable the integrated development environment used to write and process the code to have the function of prompting and completing the credit report data item information. Prompt and complete function: prompt the data item metadata of the standard document corresponding to the field name and table name according to the context; display the data item index dictionary tree function: by clicking the node of the index dictionary tree, the XML tag of the corresponding data item can be inserted at the current position.

[0038] In this embodiment, the use of the data item index dictionary tree function is as follows:

[0039] In the processing logic editing interface, call the index module to display the credit data dictionary tree. Each node of the tree supports expansion and collapse operations. After expansion, the sub-data name under the node will be displayed. The dictionary tree supports fuzzy search of Chinese names and data field names. The search hit fields are also displayed in the interface in the form of a tree; when the mouse hovers over a node in the tree, the data field name and data type corresponding to the node will be displayed. After clicking the node, the data field name corresponding to the node will be automatically written to the cursor position in the code editing area;

[0040] The specific process of the system realizing the function of displaying the data item index dictionary tree includes the following steps:

[0041] SA. Generate dictionary tree: collect the standard documents of the letter report and extract the data item metadata of the standard documents, and generate a dictionary tree based on the upper and lower relationships of the extracted data item metadata;

[0042] SB. Listen for the "input" event of the dictionary tree search box;

[0043] SC. Get the input text of the dictionary tree search box;

[0044] SD. Traverse the dictionary tree according to the obtained text, fuzzy match the key value of each node, and hide the unmatched nodes;

[0045] SE. Listen to the "mouse hover" event of the dictionary tree node. When the event is triggered, the metadata of the corresponding node is displayed in the form of a bubble, and the subordinate nodes in the metadata are set to display status; listen to the "mouse click" event of the dictionary tree node. When the event is triggered, insert the XML Tag of the corresponding node at the cursor position of the code editor; listen to the "mouse click" event of the dictionary tree node expansion button. When the event is triggered, the display status Boolean value of all child nodes is inverted to switch the display / hide status of the child nodes.

[0046] In this embodiment, the prompt and completion functions are specifically implemented as follows:

[0047] The English period is used as the delimiter, and an input monitor is set for the delimiter in the editor. When the editor monitors the input delimiter, all the codes in the editing area are first input into the SQL tokenizer, all the code tokens are extracted, and the codes are decomposed into various language elements, such as keywords, variable names, function names, etc. The language elements obtained by lexical analysis are then combined into an abstract syntax tree through a parser.

[0048] Search forward from the current input position by single characters to find the input position of the previous separator or space, and extract the input content between the two positions; use the extracted content as the search content to search in the dictionary tree to determine possible PBOC credit derivative variable prompt items.

[0049] The Chinese name completion prompt of the sub-data of the data field pops up. After selecting the Chinese name of the sub-data by keyboard or mouse, the sub-data field name will be automatically entered after the English period, and the input content will be replaced with the corresponding data field name;

[0050] If the user continues to input, the child node list is filtered according to the input characters. If the input is English, it is filtered according to the field name. If the input is Chinese, it is filtered according to the Chinese name of the field name. If the user selects a candidate node, the field name corresponding to the selected node is directly inserted after the input separator.

[0051] The specific process of the system implementing the prompt and completion functions includes the following steps:

[0052] Sa. Generate a dictionary tree: collect the standard documents of the letter report and extract the data item metadata of the standard documents, and generate a dictionary tree for the extracted data item metadata according to its superior-subordinate relationship.

[0053] Sb. Listen to the "input" event and "mouse hover" event of the code editor.

[0054] Sc. When an event occurs, the code in the code editing area is segmented using the SQL language word breaker, and the segmentation result is parsed to form an abstract syntax tree to obtain the table name and field name.

[0055] Sd. Get the row and column position where the code editor event is triggered, and then get the word segmentation token of the code corresponding to the row and column position.

[0056] Se. According to the segmentation token, search the abstract syntax tree to obtain the query keyword of the credit report data item; the method of obtaining the query keyword of the credit report data item is as follows:

[0057] (a) If the token type is a SQL field name, query the AST to obtain the input content between this position and the previous English period separator as the keyword for querying the dictionary tree;

[0058] (b) If the token type is a SQL alias, search the abstract syntax tree to obtain the original field name token corresponding to the alias, and then use the original field name token as a reference to obtain keywords in the manner of (a);

[0059] (c) If the token type is "period separator", find the first sql field name type token before the position, and then use the original field name token as the basis to obtain the keyword in method (a).

[0060] Sf. Fuzzy query the key of the dictionary tree, find the key value that meets the conditions, and obtain the value corresponding to each key value.

[0061] Sg. Display data item completion prompts. If the event is "input", the data item completion prompts are displayed in the form of a list; if the event is "mouse hover", the data item metadata is displayed in the form of bubbles.

[0062] In step S1 “processing the specification document” in this embodiment, the process of extracting metadata of data items includes the following steps:

[0063] S1-1. Use a programming language to load a specification document into memory and extract the document structure that defines the credit data in the specification document. The specific method is: read the content of the credit report product specification document through a processing module of a programming language, traverse each page of the specification document, and perform the following operations on each page: read all tables, table numbers and titles in the page; write the read table, the title as the worksheet name, and the content as the worksheet content into an Excel file.

[0064] S1-2. Traverse the document structure that defines the credit data, read the text in each document structure, extract all the data items in the document according to the text features and store them in an indexable data structure. The text features include the row, column, header name, punctuation separator, and hyperlink of the text. The data items include the names, inclusion relationships, and data types of all the data. The data structures include dictionaries and maps.

[0065] In this embodiment, the specific method is: use any programming language Excel processing module to read the Excel file, traverse each worksheet of the generated Excel file, and perform the following operations on each worksheet: read the first row in the page, determine the meaning of each column, such as "data item", "XML Tag", "number of occurrences", "subordinate elements", and "field length";

[0066] Then read the second to the last row of the worksheet, each row corresponds to a credit data. Recursively traverse all rows in all worksheets, parse the data of each row into a node of the dictionary tree, determine the worksheet corresponding to the subordinate element according to the "subordinate element" field of each row, and use the nodes parsed from all rows in the subordinate element worksheet as the child elements of the current row;

[0067] The next step is to parse the parent-child relationship between data items. As an embodiment, the specific method is as follows: recursively traverse all tables and titles, extract the name, field name, field type, and subordinate elements of the data items described in each table, use the extracted elements as a node of the tree, extract the subordinate element node according to the table number pointed to by the subordinate element, and use the subordinate element node as the child node of the current node;

[0068] S1-3. Traverse the extracted data items, generate a dictionary tree and a credit report data item entity class according to the inclusion relationship between the data items, and then store them in a storage medium after serialization, which includes but is not limited to a file system, a database, and a memory; in this embodiment, the specific method is: pre-order traverse each node of the dictionary tree to generate a parent-child relationship dictionary of the parent node and the child node; while pre-order traversal, generate a mapping dictionary of the Chinese name of the data and the node field name; serialize the mapping dictionary generated in the above steps into json format and store it in a storage medium;

[0069] S1-4. Write a test for the data item entity class generated above. In this embodiment, the test process is as follows: use the system of this implementation to load a desensitized real credit report message, parse the contents of all fields in the message through the program to form a message instance; read the dictionary tree, according to the parent-child relationship of the data nodes in the dictionary tree, read the corresponding data in the message instance according to the XML Tag, and compare it with the data value in the real message to verify the correctness of the dictionary tree and the credit report data item entity class.

[0070] The embodiments described above are only preferred embodiments of the present invention and are not intended to limit the present invention in any form. Any technician familiar with the art can use the above disclosed technical content to make more possible changes and modifications to the technical solution of the present invention without departing from the scope of the technical solution of the present invention, or modify it into an equivalent embodiment of equivalent changes. Therefore, all equivalent and equivalent changes made according to the ideas of the present invention without departing from the content of the technical solution of the present invention should be included in the protection scope of the present invention.

Claims

1. A credit investigation derivative variable processing method based on SQL syntax, characterized in that: The following steps are involved: S1. Processing of standard documents: collecting standard documents of credit reports and extracting data item metadata of standard documents, and interpreting standard documents to obtain data item entity classes of standard documents; S2. Processing of the processing code: The processing code is segmented using an SQL word segmenter, and then the segmentation result is interpreted to obtain an abstract syntax tree of the processing code, and the table name and field name therein are obtained; S3. Obtaining results: converting the data of the credit report instance into the data item entity class instance generated in step S1, reading the data of the corresponding field of the data item instance class instance according to the table name and field name obtained in step S2, and using the data of the corresponding field of the instance class instance as the result of executing the SQL statement; The integrated development environment used to write processing codes has prompt and completion functions and a function for displaying the data item index dictionary tree; Prompt and complete function: Prompt the data item metadata of the standard document corresponding to the field name and table name according to the context; Display the data item index dictionary tree function: by clicking the node of the index dictionary tree, insert the XML tag of the corresponding data item at the current position; The prompt and completion functions are: Sa. Generate a dictionary tree: collect the standard documents of the credit report and extract the data item metadata of the standard documents, and generate a dictionary tree based on the upper and lower relationships of the extracted data item metadata; Sb. Listen to the "input" event and "mouse hover" event of the code editor; Sc. When an event occurs, the code in the code editing area is segmented using the SQL language word segmenter, and the segmentation result is parsed to form an abstract syntax tree to obtain the table name and field name; Sd. Get the row and column position where the code editor event is triggered, and then get the token of the code corresponding to the row and column position; Se. According to the segmentation token, search the abstract syntax tree to obtain the query keyword of the credit report data item. The method of obtaining the query keyword of the credit report data item is as follows: (a) If the token type is a SQL field name, query the AST to obtain the input content between this position and the previous English period separator as the keyword for querying the dictionary tree; (b) If the type of the token is a SQL alias, search the abstract syntax tree to obtain the original field name token corresponding to the alias, and then use the original field name token as a reference to obtain keywords in the manner of (a); (c) If the token type is a period separator, find the first sql field name type token before the position, and then use the original field name token as the basis to obtain the keyword in the manner of (a); Sf. Fuzzy query the key of the dictionary tree, find the key value that meets the conditions, and obtain the value corresponding to each key value; Sg. Display data item completion hints.

2. The method for processing credit derived variables based on SQL syntax according to claim 1, characterized in that: The display data item index dictionary tree function includes the following steps: SA. Generate dictionary tree: collect the standard documents of the letter report and extract the data item metadata of the standard documents, and generate a dictionary tree based on the upper and lower relationships of the extracted data item metadata; SB. Listen to the "input" event of the dictionary tree search box; SC. Get the input text of the dictionary tree search box; SD. Traverse the dictionary tree according to the obtained text, fuzzy match the key value of each node, and hide the unmatched nodes; SE. Listen to the "mouse hover" event of the dictionary tree node. When the event is triggered, the metadata of the corresponding node is displayed in the form of a bubble, and the subordinate nodes in the metadata are set to display status; listen to the "mouse click" event of the dictionary tree node. When the event is triggered, insert the XML Tag of the corresponding node at the cursor position of the code editor; listen to the "mouse click" event of the dictionary tree node expansion button. When the event is triggered, the display status Boolean value of all child nodes is inverted to switch the display / hide status of the child nodes.

3. The credit investigation derived variable processing method based on SQL syntax according to claim 1 is characterized by: In the step Sg, if the event is "input", the data item completion prompt is displayed in the form of a list; If the event is "mouse hover", the data item metadata is displayed in the form of a bubble.

4. The method for processing credit-related derivative variables based on SQL syntax according to claim 1, characterized in that: In step S1, the process of extracting metadata of data items includes the following steps: S1-1. Use a programming language to load a specification document into memory and extract the document structure that defines the credit data in the specification document; S1-2. Traverse the document structure that defines the credit data, read the text in each document structure, extract all the data items in the document according to the text features and store them in an indexable data structure. The text features include the row, column, header name, punctuation separator, and hyperlink of the text. The data items include the names, inclusion relationships, and data types of all the data. The data structures include dictionaries and maps. S1-3. Traverse the extracted data items, generate a dictionary tree and a credit report data item entity class according to the inclusion relationship between the data items, and serialize the data item entity class and store it in a storage medium, which includes a file system, a database, and a memory; S1-4. Write tests for the generated data item entity class.

5. The method for processing credit-related derivative variables based on SQL syntax according to claim 4, characterized in that: In step S1-4, the test process is as follows: load a desensitized real credit report message, parse the contents of all fields in the message through the program to form a message instance; read the dictionary tree, according to the parent-child relationship of the data nodes in the dictionary tree, read the corresponding data in the message instance according to the XML Tag, and compare it with the data value in the real message to verify the correctness of the dictionary tree and the credit report data item entity class.

6. A credit investigation derivative variable processing system based on SQL syntax, characterized in that: The system is applied to the credit-derived variable processing method based on SQL syntax as described in any one of claims 1 to 5, comprising an input module, a syntax parsing engine, a persistence module, a metadata matching module and a calculation module; The input module is used to input SQL statements; The syntax parsing engine is used to compile the input script, match it according to the symbol table predefined by the syntax rules, and obtain an abstract syntax tree; The persistence module is used to save the abstract syntax tree. When the script for compiling the abstract syntax tree is repeatedly referenced, the persistence module directly calls the compiled abstract syntax tree. The metadata matching module is used to match metadata with an abstract syntax tree, traverse the abstract syntax tree, and perform quantitative matching on node information in the abstract syntax tree in combination with data, wherein metadata of common variable values ​​are directly matched with the abstract syntax tree, and metadata of object attributes are defined according to the variable hierarchical structure of the abstract syntax tree, matching the first-level child node attributes of the object attributes, or more levels of child node attributes, and the attribute value is the value of the variable; The operation module is used to execute the operation logic of the abstract syntax tree to obtain the operation result.

Citation Information

Patent Citations

  • Data query method, system and device

    CN110399388A

  • Blood relationship spectrum analysis method and system for credit investigation data

    CN112634004A

  • Code editing method and device, server, user equipment and storage medium

    CN112817583A

  • SQL grammar parse tree optimization method and system

    CN114003231A