CN116360794A - Database language analysis method, device, computer equipment and storage medium - Google Patents

Database language analysis method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN116360794A
CN116360794A CN202310356406.2A CN202310356406A CN116360794A CN 116360794 A CN116360794 A CN 116360794A CN 202310356406 A CN202310356406 A CN 202310356406A CN 116360794 A CN116360794 A CN 116360794A
Authority
CN
China
Prior art keywords
database
language
command
database language
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310356406.2A
Other languages
Chinese (zh)
Inventor
张春和
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202310356406.2A priority Critical patent/CN116360794A/en
Publication of CN116360794A publication Critical patent/CN116360794A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/285Clustering or classification
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to the field of database language analysis, and discloses a database language analysis method, a device, computer equipment and a storage medium, wherein the method comprises the following steps: reading an input database language code and identifying the language category of the database language code; acquiring command keywords in the database language code, and analyzing the execution sequence of sentences in which each command keyword in the database language code is located according to the command keywords and the logic rules of the language class; and generating a corresponding flow chart according to the execution sequence. The method and the device enable developers to quickly acquire the meaning of the language codes of the database, know the execution flow of the language codes, determine the output result, quicken the reading efficiency of the codes, and further improve the working efficiency.

Description

Database language analysis method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of database language analysis, and in particular, to a database language analysis method, apparatus, computer device, and storage medium.
Background
There is currently no tool in the industry to parse concrete statement meanings from SQL (database language) statements and table structures. In the process of demand research and development, database development and maintenance and handover above codes are often required, and for database operation, database language is often large and long, difficult to read and even not annotated, so that a long time is required for understanding the codes, subsequent developers easily misjudge and even correct the codes, and the working efficiency is reduced.
Disclosure of Invention
The invention discloses a database language analysis method, a device, computer equipment and a storage medium, which can be applied to other fields such as financial science and technology.
In a first aspect, the present application provides a method for parsing a database language, including:
reading an input database language code and identifying the language category of the database language code;
acquiring command keywords in the database language code, and analyzing the execution sequence of sentences in which each command keyword in the database language code is located according to the command keywords and the logic rules of the language class;
and generating a corresponding flow chart according to the execution sequence.
Further, the method further comprises:
acquiring a database table associated with the database language code;
and verifying whether the database language code is correct according to the structure of the database table.
Further, after verifying whether the database language code is correct, the method further includes:
if the database language code is verified to be incorrect, marking the incorrect code and relevant parts on the flow chart, and prompting error reasons and error types.
Further, the generating a corresponding flowchart according to the execution sequence includes:
generating step frames with the same number as the sentences of the database language codes, and filling the sentences in which the command keywords are positioned into each step frame according to the execution sequence;
and translating the sentences in each step frame into steps corresponding to natural language forms according to each command keyword to form the flow chart.
Further, the step of translating the sentence in each step frame into a corresponding text form according to each command keyword includes:
presetting corresponding regular expressions for all the command keywords, and associating each regular expression with a corresponding natural language sentence structure;
converting sentences in which the command keywords are located in each step frame into sentence pattern structures associated with the matched regular expressions;
reading variable parameters in sentences where the command keywords are located, and filling the variable parameters into the corresponding sentence pattern structures to form the text form.
Further, the parsing the execution sequence of the sentence where each command keyword is located in the database language code according to the command keyword and the logic rule of the language class includes:
matching database sentences in which the command keywords are located through a preset regular expression to obtain a plurality of execution steps;
and acquiring an analysis library corresponding to the language category and the database language, and determining the execution sequence of the execution steps corresponding to each command keyword through logic rules in the analysis library and the arrangement sequence of each command keyword.
Further, the obtaining the command keyword in the database language code includes:
acquiring a command table corresponding to the language of the database according to the language category;
and traversing all command keywords from the head according to the command table by taking the database language codes as character strings, and arranging the command keywords in sequence.
In a second aspect, the present application further provides a database language parsing apparatus, including:
the reading module is used for reading the input database language codes and identifying the language types of the database language codes;
the analysis module is used for acquiring command keywords in the database language code and analyzing the execution sequence of sentences in which each command keyword is positioned in the database language code according to the command keywords and the logic rules of the language class;
and the generating module is used for generating a corresponding flow chart according to the execution sequence.
In a third aspect, the present application further provides a computer terminal, including a processor and a memory, the memory storing a computer program, the computer program executing the database language parsing method when running on the processor.
In a fourth aspect, the present application also provides a readable storage medium storing a computer program which, when run on a processor, performs the database language parsing method.
The invention discloses a database language analysis method, a device, computer equipment and a storage medium, wherein the method comprises the following steps: reading an input database language code and identifying the language category of the database language code; acquiring command keywords in the database language code, and analyzing the execution sequence of sentences in which each command keyword in the database language code is located according to the command keywords and the logic rules of the language class; and generating a corresponding flow chart according to the execution sequence. The method and the device enable developers to quickly acquire the meaning of the language codes of the database, know the execution flow of the language codes, determine the output result, quicken the reading efficiency of the codes, and further improve the working efficiency.
Drawings
In order to more clearly illustrate the technical solutions of the present invention, the drawings that are required for the embodiments will be briefly described, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope of the present invention. Like elements are numbered alike in the various figures.
FIG. 1 is a schematic flow chart of a method for parsing a database language according to an embodiment of the present application;
FIG. 2 illustrates a database language code schematic diagram according to an embodiment of the present application;
FIG. 3 illustrates a first schematic diagram of a flow chart generated after parsing a database language in accordance with an embodiment of the present application;
FIG. 4 illustrates a second schematic diagram of a flow chart generated after a database language parsing in accordance with an embodiment of the present application;
FIG. 5 illustrates a third schematic diagram of a flow chart generated after a database language parsing in an embodiment of the present application;
FIG. 6 is a schematic diagram of a database table structure code according to an embodiment of the present application;
fig. 7 shows a schematic structural diagram of a database language parsing device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments.
The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present invention.
The terms "comprises," "comprising," "including," or any other variation thereof, are intended to cover a specific feature, number, step, operation, element, component, or combination of the foregoing, which may be used in various embodiments of the present invention, and are not intended to first exclude the presence of or increase the likelihood of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing.
Furthermore, the terms "first," "second," "third," and the like are used merely to distinguish between descriptions and should not be construed as indicating or implying relative importance.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the invention belong. The terms (such as those defined in commonly used dictionaries) will be interpreted as having a meaning that is the same as the context of the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein in connection with the various embodiments of the invention.
The technical scheme is applied to the development process of the database, a large amount of maintenance work is required to be carried out on the database in the maintenance of the server, particularly in the fields related to financial science and technology like banks, and during the period, a large amount of database language codes which can be written by a developer or written by other people are inevitably required to be processed. When reading codes written by other people, development efficiency is often affected due to the fact that sentences are obscure and understandable or the fact that the sentences are too long, so that development efficiency is reduced. Therefore, the method and the device for analyzing the database language quickly convert the database language into the natural language and the flow chart which are easy to read and understand, thereby quickly helping developers to read and understand codes.
The method for analyzing the language of the database is applied to the development process of the database, particularly in the field of financial science and technology, when analyzing the code language in a database similar to a bank, analyzing the sentence by acquiring the database sentence needing to be interpreted, determining the execution sequence of each sentence, and then translating the sentences to obtain steps, thereby acquiring the execution flow chart of the sentence and assisting developers in understanding. The method and the device enable developers not to read codes in a word-by-sentence mode, but can quickly obtain analyzed database language execution logic through the scheme of the method and the device, so that working efficiency is improved.
The technical scheme of the application is described in the following specific embodiments.
Example 1
As shown in fig. 1, the database language parsing method of the present application includes the following steps:
step S100, reading the input database language code and identifying the language category of the database language code.
The database language code is a code written under the database language rule through the database language, and is used for performing operations such as adding, deleting, checking and the like in the database so as to maintain the database. The types of the databases are various, and grammar rules, command keywords and the like of different databases are different.
When a developer has a need of identifying a database code, the database language code to be identified is input first, and the code needs to be a complete code sentence so as to be correctly identified, for example, the sentence "SELECT id, NAME, SUBJECT, score, flag FROM student _score WHERE flag=1" is a complete sentence, which means that the data of "flag=1" is obtained from the table "student_score". If the SELECT command, the FROM command, or the like is absent, the sentence itself is an erroneous sentence and cannot be parsed.
After reading the code, it is first necessary to identify which database language the code is in, such as mysql database language or oracle database language, etc., and the categories of these database languages may be entered by the developer when the code is entered or identified by keywords in the code. For example, mysql database limits the number of bars by limt key, while Oracle database limits the number of results returned by rowum. The language class of the input code can be identified by the difference of the commands therein. Taking the above database language as an example, the database language may be considered as mysql database language.
After the language category is identified, the corresponding library and the corresponding logic rule can be called for analysis, and because different database languages and different commands and different grammar are adopted, the specific analysis after distinguishing is needed.
Step 200, obtaining command keywords in the database language code, and analyzing the execution sequence of sentences in which each command keyword is located in the database language code according to the command keywords and the logic rules of the language class.
The command key is a variety of commands previously defined in the database language, such as SELECT command, FROM command, and WHERE command in the example of the steps described above, which are all commands commonly used in mysql database language.
Command symbols, such as brackets, that can affect the code architecture, are also acquired, the command keywords described above being used to represent the content of the database language code, and the symbols being used to represent the hierarchy in the database language code.
Typically, a database language code is composed of commands and variable parameters, such as the variable parameters in the above example: id, NAME, SUBJECT, score, flag, student_score, flag=1, which define the data to be acquired, the data table, and the conditions of the acquired data, and the meaning of the code can be obtained by combining these variable parameters and commands.
So to get the meaning of the code, it is first necessary to obtain these command keywords, which are skeletons in the database language code, and the database language is basically linear from other programming languages, so that the order of these command keywords can represent the execution order of the code to some extent.
After obtaining the keywords, the sentences of the database are further required to be divided to obtain steps, and the steps in the embodiment are the minimum steps of the database language, and the steps are divided by taking a command action as a reference. It can also be understood as finding a complete sentence in the database language code. It will be appreciated that code is written with rules that are self-contained, so that for a command key, commands may need to be written in different formats for some effect, and each command has a single function, so that the format associated with each command is limited. The sentences in the read code can thus be determined by presetting corresponding regular expressions for each command keyword, representing the possible sentence patterns involved by each command keyword by the regular expressions, and then matching the read database language code with these regular expressions.
Thus, command keywords in the database language code are read first, corresponding regular expressions are found according to the command keywords to match sentence patterns in the database language code, and then a plurality of database sentences are obtained, and the sentences can be regarded as executing steps. It will be appreciated that there may be multiple regular expressions for each command key, so when a command key is extracted and a corresponding command key is found, all relevant regular expressions need to be used for matching, and then the most conforming regular expression is found.
For example, the regular expression may be an expression such as "SELECT a-z FROM a-z", where a-z represents matching 26 english alphabets, and represents matching all variable parameters composed of english alphabets after two command keywords, SELECT and FROM, so that in order to expand the matching range, sentences such as up 0-9 may be added, so that the above regular expression may match numbers, and specifically how the regular expression of each command parameter is designed, and is set according to practical situations.
That is, the regular expression can be used to match the sentence composed of SELECT and FROM, while there is also a sentence pattern of "SELECT a-z FROM a-z WHERE a-z", depending on the scene of use. Then when "SELECT a-z FROM a-z WHERE a-z" can be matched in one database language code, then "SELECT a-z FROM a-z" must be matched, in which case "SELECT a-z FROM a-z" is a more conforming regular expression because WHERE alone cannot sentence.
After the command keywords are extracted according to the mode, character strings formed by arranging the command keywords in sequence are obtained, the regular expressions are formed by corresponding command keywords, and a plurality of sections of complete database language sentences can be divided from the whole section of database language codes by matching the command keywords with the regular expressions related to the command keywords, and the sentences are used as steps, so that a plurality of execution steps are obtained. The order of these execution steps is then determined according to the database logic rules, thereby completing the analysis operation.
Besides parsing and matching by regular expressions, sentences can be divided by punctuation marks in the database language. For example, punctuation marks such as a score and brackets indicate the end of a sentence or the start of a new sentence in the code, for example, dividing a command keyword between scores into a sentence, dividing a command keyword between brackets into a sentence, etc., thereby obtaining a plurality of database sentences, obtaining a plurality of execution steps, and then determining the order of the execution steps according to the logic rules of the database.
Taking the database language code in fig. 2 as an example, it is divided into two layers, there is one SELECT statement in the bracket, the whole outside the bracket is the SELECT statement, and there are two order statements in the bracket at the same time, then through analysis, four steps can be obtained, then according to the corresponding database logic rule, the order of each step is determined, it can be understood that the statement in this embodiment needs to execute the statement in the bracket first, and then execute the statement outside the bracket.
For convenience of description, the four steps are translated into natural language, and then the four steps of "screening FLAG 1 data", "sorting from high to low by score", "grouping according to name", "outputting from high to low by score" are sequentially performed. The sequence complies with the rule that the SELECT statement and the order statement in brackets need to be executed first, then the SELECT statement and the order statement outside the brackets are executed, and the analysis and the sequencing are carried out to obtain the execution sequence of the steps.
The execution sequence of each step can be obtained, and it should be noted that the above description is for convenience of description, and the translated step description sequence is actually that in this step, the database language is matched according to the original form, then divided, and then ordered, so as to form each step and the corresponding execution sequence.
Step S300, generating a corresponding flow chart according to the execution sequence.
After the statement and step are determined, the meaning of each step needs to be determined according to the specific variable parameters, and for this purpose, each regular expression and the corresponding meaning need to be associated, for example, "SELECT a-z FROM a-z" can be associated with a sentence structure "query XX data FROM XX table", wherein "XX" in the sentence is determined according to the variable parameters in the actual code.
For example, "SELECT id, NAME, SUBJECT, score, flag FROM student _score" refers to the "id, NAME, SUBJECT, score, flag" data queried from the table "student_score". Wherein "student_score" and "id, NAME, SUBECT, score, flag" are not command keywords in the original code, but variable parameters, which are filled in XX in the associated sentence pattern, to get the complete steps described above.
From step S200, the execution sequence of the execution steps has been determined, so that a corresponding number of step frames may be generated according to the number of execution steps, database sentences corresponding to each execution step are filled into the step frames, and then, according to the above manner, the database sentences in each step frame are replaced by association of regular expressions and sentence structures, so as to form a natural language that can be directly understood. The step box is a carrying container for executing steps, and can be formed by data structures of types such as an array or a character string, and the like, and one step box represents one step.
Fig. 3, fig. 4 and fig. 5 are schematic views of the process of converting the code of fig. 2 into a flowchart.
In the flowchart in fig. 3, database sentences which are sentences divided in step S200 are recorded in each step frame, and these sentences are filled in one step frame as one step. It will be appreciated that these sentences have been matched to regular expressions, so that conversion between code and natural language can be performed by simply filling the sentence structure associated with the corresponding regular expression into it.
Natural language, i.e., chinese, english, japanese, etc., is a language produced by cultural evolution, as in the present embodiment, by translating codes into chinese.
After filling the sentence pattern structure associated with the corresponding regular expression, a flow chart shown in fig. 4 is formed, in the flow chart, the sentence patterns in each frame are sentence patterns formed in advance according to the regular expression, wherein XX is a variable parameter which is not filled in the sentence pattern structure and needs to be matched from the original database language, and the complete step content can be obtained by filling the variable parameter into the variable parameter.
After the variable parameters are filled into fig. 4, fig. 5 is obtained, which is a flowchart required by the database language parsing method of the present application. It can be seen that the statement that the variable parameters are filled in to get the complete meaning can clearly explain what the database language code in fig. 2 does, and thus which steps are executed.
In addition, the database language code is executed in a table named student_score, and data of attributes id, NAME, SUBJECT, score, and flag are manipulated, as in the database language code shown in fig. 2, and if the data is not present in the table, the code is not satisfied.
Therefore, the corresponding database table can be obtained, and then whether the database language code is correct or not can be verified according to the structure of the database table.
For example, FIG. 6 is a definition of the table named student_score described above.
As can be seen from the table structure definition in fig. 6, the table is a table for counting the scores of the students, that is, a student score table, in which data of the attributes ID, NAME, SUBJECT, score, flag are included, and represents the status of the student ID, NAME, SUBJECT, score, and whether to register, respectively. The elements referred to in the database language code of fig. 2 may be declared and defined in the table, and the database language code of fig. 2 is a valid code.
After the database language code in fig. 2 is subjected to the parsing process in the above steps, the flow in the obtained flow chart represents that the data in the table are obtained and sorted according to the scores, and then are grouped according to the names. The end result is data that is a group of everyone, from top to bottom by score.
It will be appreciated that if the elements referred to in fig. 2 exceed the scope of the statement in fig. 6, the parsing operation in this embodiment will still be performed and the flowchart described above will be generated, but the place where the error is detected will be marked, for example, if the first step is detected, the step where the first step is located will be marked red to indicate that the step may be wrong. Or marking the code directly, and highlighting the error position to prompt the developer to pay attention.
It should be noted that, the method for parsing the database language of the present application may be implemented by a single program, where the program may be executed locally on a computer or may be executed on a cloud platform, and then after the developer connects to the cloud platform from the working computer, the developer applies for using the service. According to the method, the analysis libraries of a plurality of different databases can be connected, and the corresponding library can be found for analysis when the code is analyzed.
The database language analysis method identifies the language category of the database language code by reading the input database language code; acquiring command keywords in the database language code, and analyzing the execution sequence of sentences in which each command keyword in the database language code is located according to the command keywords and the logic rules of the language class; and generating a corresponding flow chart according to the execution sequence. The method and the system have the advantages that complicated database language codes can be quickly analyzed into easy-to-read natural languages, and according to execution steps, a flow chart is generated, so that a developer can quickly comprehend the meaning of the complicated database language codes when reading the large-section strange database language codes, the excessive time spent in examination due to the complexity of the codes can be avoided, meanwhile, the related database tables can be referred to for checking the codes, the error codes or steps are identified, and the developer is prompted to pay attention to correction. The working efficiency is increased. In addition, in the technical scheme, the conversion between the database language and the natural language is realized by the user definition of the developer, so that the method is used for being closer to the understanding of the developer, the step language formulation after conversion is prevented from being difficult to understand, the converted language is easier to understand, and the method is convenient to modify.
Example 2
As shown in fig. 7, the present application further provides a database language parsing apparatus, including:
a reading module 10, configured to read an input database language code, and identify a language class of the database language code;
the parsing module 20 is configured to obtain command keywords in the database language code, and parse execution sequences of sentences in which the command keywords are located in the database language code according to the command keywords and logic rules of the language classes;
and the generating module 30 is configured to generate a corresponding flowchart according to the execution sequence.
In a third aspect, the present application further provides a computer terminal, including a processor and a memory, the memory storing a computer program, the computer program executing the database language parsing method when running on the processor.
In a fourth aspect, the present application also provides a readable storage medium storing a computer program which, when run on a processor, performs the database language parsing method.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners as well. The apparatus embodiments described above are merely illustrative, for example, of the flow diagrams and block diagrams in the figures, which illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules or units in various embodiments of the invention may be integrated together to form a single part, or the modules may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a smart phone, a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention.

Claims (10)

1. A method for language parsing of a database, comprising:
reading an input database language code and identifying the language category of the database language code;
acquiring command keywords in the database language code, and analyzing the execution sequence of sentences in which each command keyword in the database language code is located according to the command keywords and the logic rules of the language class;
and generating a corresponding flow chart according to the execution sequence.
2. The database language parsing method of claim 1, further comprising:
acquiring a database table associated with the database language code;
and verifying whether the database language code is correct according to the structure of the database table.
3. The method for parsing a database language according to claim 2, wherein after verifying whether the database language code is correct, further comprising:
if the database language code is verified to be incorrect, marking the incorrect code and relevant parts on the flow chart, and prompting error reasons and error types.
4. The method of claim 1, wherein generating the corresponding flow chart according to the execution order comprises:
generating step frames with the same number as the sentences of the database language codes, and filling the sentences in which the command keywords are positioned into each step frame according to the execution sequence;
and translating the sentences in each step frame into steps corresponding to natural language forms according to each command keyword to form the flow chart.
5. The method of claim 4, wherein the step of translating the sentence in each step frame into a corresponding text form according to each command keyword comprises:
presetting corresponding regular expressions for all the command keywords, and associating each regular expression with a corresponding natural language sentence structure;
converting sentences in which the command keywords are located in each step frame into sentence pattern structures associated with the matched regular expressions;
reading variable parameters in sentences where the command keywords are located, and filling the variable parameters into the corresponding sentence pattern structures to form the text form.
6. The method for parsing a database language according to claim 1, wherein parsing the execution sequence of the sentence in which each command keyword is located in the database language code according to the command keyword and the logic rule of the language class comprises:
matching database sentences in which the command keywords are located through a preset regular expression to obtain a plurality of execution steps;
and acquiring an analysis library corresponding to the language category and the database language, and determining the execution sequence of the execution steps corresponding to each command keyword through logic rules in the analysis library and the arrangement sequence of each command keyword.
7. The method of claim 1, wherein the obtaining command keywords in the database language code comprises:
acquiring a command table corresponding to the language of the database according to the language category;
and traversing all command keywords from the head according to the command table by taking the database language codes as character strings, and arranging the command keywords in sequence.
8. A database language parsing apparatus, comprising:
the reading module is used for reading the input database language codes and identifying the language types of the database language codes;
the analysis module is used for acquiring command keywords in the database language code and analyzing the execution sequence of sentences in which each command keyword is positioned in the database language code according to the command keywords and the logic rules of the language class;
and the generating module is used for generating a corresponding flow chart according to the execution sequence.
9. A computer terminal comprising a processor and a memory, the memory storing a computer program that, when run on the processor, performs the database language parsing method of any one of claims 1 to 7.
10. A readable storage medium, characterized in that it stores a computer program which, when run on a processor, performs the database language parsing method of any one of claims 1 to 7.
CN202310356406.2A 2023-03-27 2023-03-27 Database language analysis method, device, computer equipment and storage medium Pending CN116360794A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310356406.2A CN116360794A (en) 2023-03-27 2023-03-27 Database language analysis method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310356406.2A CN116360794A (en) 2023-03-27 2023-03-27 Database language analysis method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116360794A true CN116360794A (en) 2023-06-30

Family

ID=86936952

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310356406.2A Pending CN116360794A (en) 2023-03-27 2023-03-27 Database language analysis method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116360794A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117453229A (en) * 2023-12-26 2024-01-26 天津戎行集团有限公司 Output code analysis method for automatic code generation database

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117453229A (en) * 2023-12-26 2024-01-26 天津戎行集团有限公司 Output code analysis method for automatic code generation database
CN117453229B (en) * 2023-12-26 2024-02-23 天津戎行集团有限公司 Output code analysis method for automatic code generation database

Similar Documents

Publication Publication Date Title
US20210157975A1 (en) Device, system, and method for extracting named entities from sectioned documents
CN112801010B (en) Visual rich document information extraction method for actual OCR scene
KR101678787B1 (en) Method for automatic question-answering and apparatus therefor
US20060149543A1 (en) Construction of an automaton compiling grapheme/phoneme transcription rules for a phoneticizer
JPS6375835A (en) Apparatus for generating intended code, program, list and design document
CN112926345B (en) Multi-feature fusion neural machine translation error detection method based on data enhancement training
US11158118B2 (en) Language model, method and apparatus for interpreting zoning legal text
CN109840255A (en) Reply document creation method, device, equipment and storage medium
CN112420145A (en) Electronic medical record document data processing method and device and computer readable storage medium
JP2020190970A (en) Document processing device, method therefor, and program
JP2002117027A (en) Feeling information extracting method and recording medium for feeling information extracting program
CN110633456B (en) Language identification method, language identification device, server and storage medium
CN116360794A (en) Database language analysis method, device, computer equipment and storage medium
Wax Automated grammar engineering for verbal morphology
US11907656B2 (en) Machine based expansion of contractions in text in digital media
Hocking et al. Optical character recognition for South African languages
JP2008112363A (en) Document processor and document processing program
JP2010061403A (en) Character string recognition device, method, and program
CN114385491A (en) JS translator defect detection method based on deep learning
CN113722421A (en) Contract auditing method and system and computer readable storage medium
CN116842128B (en) Text relation extraction method and device, computer equipment and storage medium
US20220004708A1 (en) Methods and apparatus to improve disambiguation and interpretation in automated text analysis using structured language space and transducers applied on automatons
Sedlácek et al. Automatic Processing of Czech Inflectional and Derivative Morphology
CN117273001A (en) Medical record entity extraction method and device
CN115238037A (en) Function point generation method and device based on agile user story

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination