CN113378517A - Data dictionary generation method and device, electronic equipment and storage medium - Google Patents

Data dictionary generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113378517A
CN113378517A CN202110674979.0A CN202110674979A CN113378517A CN 113378517 A CN113378517 A CN 113378517A CN 202110674979 A CN202110674979 A CN 202110674979A CN 113378517 A CN113378517 A CN 113378517A
Authority
CN
China
Prior art keywords
target
assignment
statement
data dictionary
statements
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
CN202110674979.0A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110674979.0A priority Critical patent/CN113378517A/en
Publication of CN113378517A publication Critical patent/CN113378517A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/237Lexical tools
    • G06F40/242Dictionaries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/253Grammatical analysis; Style critique

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The present disclosure provides a data dictionary generating method, which can be used in the computer technical field, financial field or other fields, and the method comprises: acquiring a target field; serializing a target program package to obtain at least one method object, wherein the target program package comprises at least one line of method statements, each line of method statements is used for realizing a grammar function, and the grammar function comprises an assignment grammar function; analyzing at least one method object to obtain an assignment statement; acquiring a target assignment statement from the assignment statement based on the target field; and generating a data dictionary of the target field according to the target assignment statement. In addition, the present disclosure also provides a data dictionary generating apparatus, an electronic device, a readable storage medium and a computer program product.

Description

Data dictionary generation method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technology and the field of finance, and more particularly, to a data dictionary generation method, a data dictionary generation apparatus, an electronic device, a readable storage medium, and a computer program product.
Background
With the continuous construction and expansion of the system, the attribute of each field in the data dictionary is increased.
In the process of implementing the disclosed concept, the inventor finds that the system is generally maintained by a plurality of operators, so that the attribute of a field in a data dictionary retained in an operation document is not completely consistent with the actual attribute of the field in the code, and therefore, the operator needs to regenerate the data dictionary of the field when performing field operation.
Disclosure of Invention
In view of the above, the present disclosure provides a data dictionary generating method, a data dictionary generating apparatus, an electronic device, a readable storage medium, and a computer program product.
One aspect of the present disclosure provides a data dictionary generating method, including: acquiring a target field; serializing a target program package to obtain at least one method object, wherein the target program package comprises at least one line of method statements, each line of the method statements is used for realizing a grammar function, and the grammar function comprises an assignment grammar function; analyzing the at least one method object to obtain an assignment statement; acquiring a target assignment statement from the assignment statement based on the target field; and generating a data dictionary of the target field according to the target assignment statement.
According to an embodiment of the present disclosure, the at least one line of method statements constitutes at least one method data block; wherein serializing the object package to obtain at least one method object comprises: analyzing a method statement corresponding to each method data block of the target program package by using a strategy chain to obtain a method type syntax tree; and serializing the method syntax tree to obtain a method object corresponding to the method data block.
According to an embodiment of the present disclosure, the policy chain includes a plurality of method resolvers respectively established for each of the syntax functions; the analyzing, by using the policy chain, the method statement corresponding to the method data block to obtain a method syntax tree, including: sequentially using the plurality of method resolvers to identify the method sentences; and analyzing the method statement by using a method analyzer which successfully identifies the method statement to generate the method type syntax tree.
According to an embodiment of the present disclosure, the analyzing the at least one method object to obtain an assignment statement includes: analyzing the at least one method object to obtain at least one function linked list; determining a function name of the assignment grammar function in the at least one function linked list; and extracting statements containing the function names from the at least one function linked list to obtain the assignment statements.
According to an embodiment of the present disclosure, the assignment statement includes a variable name; wherein, the obtaining a target assignment statement from the assignment statement based on the target field includes: matching the target field with the variable name of each row of assignment statement respectively to obtain a matching result; and determining the assignment statement as the target assignment statement under the condition that the matching result is successful.
According to an embodiment of the present disclosure, the target assignment statement includes an assignment element and an operator; wherein the generating the data dictionary of the target field according to the target assignment statement includes: for each line of target assignment statements, combining the assignment elements and the operators according to preset rules to generate assignment attributes; and recording all the assignment attributes to generate a data dictionary of the target field.
Another aspect of the present disclosure provides a data dictionary generating apparatus, including: the device comprises an acquisition module, a processing module, an analysis module, a selection module and a generation module. The acquisition module is used for acquiring a target field; a processing module, configured to serialize a target program package to obtain at least one method object, where the target program package includes at least one line of method statements, and each line of the method statements is used to implement a syntax function, where the syntax function includes an assignment syntax function; the analysis module is used for analyzing the at least one method object to obtain an assignment statement; a selection module, configured to obtain a target assignment statement from the assignment statement based on the target field; and the generating module is used for generating the data dictionary of the target field according to the target assignment statement.
Another aspect of the present disclosure provides an electronic device including: one or more processors; memory to store one or more instructions, wherein the one or more instructions, when executed by the one or more processors, cause the one or more processors to implement a method as described above.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for implementing the method as described above when executed.
Another aspect of the disclosure provides a computer program product comprising computer executable instructions for implementing the method as described above when executed.
According to the embodiment of the disclosure, the assignment statements are obtained from the serialized target program package, the target assignment statements are obtained by screening from the assignment statements based on the target fields to be processed, and then the data dictionary of the target fields is generated according to the target assignment statements, so that the problem that the data dictionary of the target fields is easy to miss or error in a mode of manually combing codes is at least partially solved, the labor cost required by generation and maintenance of the data dictionary is effectively reduced, and the working efficiency is effectively improved.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an exemplary system architecture 100 to which a data dictionary generation method may be applied, according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow diagram of a data dictionary generation method in accordance with an embodiment of the present disclosure;
FIG. 3 schematically illustrates a schematic diagram of a workflow of a language parsing system according to an embodiment of the present disclosure;
FIG. 4 schematically illustrates a block diagram of a data dictionary generation apparatus in accordance with an embodiment of the present disclosure;
FIG. 5 schematically illustrates a block diagram of an electronic device suitable for implementing a data dictionary generation method in accordance with an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The data dictionary is used for defining and describing data items, data structures, data streams, data stores, processing logic and the like of data, and aims to provide detailed description on each element in the data flow chart.
In the related art system, a passive data dictionary is generally used, for example, the FOVA system implemented by EGL language, and when relevant fields of the data dictionary in the system are modified, the contents of the data dictionary must be manually updated. However, in the process of continuously building and expanding the system, the attributes of the relevant fields are continuously increased, and the attributes of some fields are even increased from the initial few to the later hundreds, so that the data dictionary of the relevant fields needs to be continuously expanded and organized.
In the related art, the data dictionary of the related fields is often acquired by manually combing codes and then summarizing. However, the source code of the system is usually huge, many statements related to field operations exist, meanwhile, the data dictionary of the system is generally updated continuously over time, and there may be cases of data dictionary conversion in the updating process, which causes that the way of generating the data dictionary by manual means needs to consume a lot of human resources, the working efficiency is low, and omission or errors are easily generated due to the complexity of program logic.
In view of this, the inventor provides an automated analysis method for a data dictionary, which can assist designers to integrally understand system functions by automatically collecting and presenting a program data dictionary. The labor cost can be effectively saved, and the efficiency of analyzing and updating the data dictionary is improved.
Specifically, embodiments of the present disclosure provide a data dictionary generation method, a data dictionary generation apparatus, an electronic device, a readable storage medium, and a computer program product. The method comprises the following steps: acquiring a target field; serializing a target program package to obtain at least one method object, wherein the target program package comprises at least one line of method statements, each line of method statements is used for realizing a grammar function, and the grammar function comprises an assignment grammar function; analyzing at least one method object to obtain an assignment statement; acquiring a target assignment statement from the assignment statement based on the target field; and generating a data dictionary of the target field according to the target assignment statement.
It should be noted that the data dictionary generation method and apparatus provided by the embodiments of the present disclosure may be used in the field of computer technology or the field of finance, for example, when a software system using a passive data dictionary is delivered, the method provided by the embodiments of the present disclosure may be used to generate a data dictionary to facilitate writing of a software usage manual. The data dictionary generation method and apparatus provided by the embodiments of the present disclosure may also be used in other fields besides the field of computer technology and the field of finance, and the application fields of the data dictionary generation method and apparatus provided by the embodiments of the present disclosure are not limited.
FIG. 1 schematically illustrates an exemplary system architecture 100 to which the data dictionary generation method may be applied, according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, a system architecture 100 according to this embodiment may include a terminal device 101.
The terminal device 101 may be various electronic devices having a display screen and supporting network communication or data processing functions, including but not limited to a smartphone, a tablet computer, a portable computer, a desktop computer, and the like.
Various client applications may be installed on the terminal device 101, including but not limited to communication applications, programming environment applications, and the like.
The data dictionary generating method provided by the embodiment of the present disclosure may be generally executed by the terminal device 101, and accordingly, the data dictionary generating apparatus provided by the embodiment of the present disclosure may be generally disposed in the terminal device 101. For a program file 102 received or originally stored in the terminal device 101, the terminal device 101 may extract a data dictionary 103 of a target field from the program file 102 by using the data dictionary generating method or apparatus provided in the embodiments of the present disclosure, and display a data dictionary 104 on a display screen of the terminal device 101.
It should be noted that the number of the terminal devices may be multiple, and different terminal devices may exchange information through wired and/or wireless communication links. The data dictionary generation method provided by the embodiment of the present disclosure may be executed by one of the terminal devices, and the generated data dictionary 103 may be transmitted to another terminal device for presentation via a communication link.
The system architecture 100 according to embodiments of the present disclosure may also include a server 104.
The server 104 may be a server or a server group providing various services, and information interaction between the server 104 and the terminal device 101 may be performed by means of a wired and/or wireless communication link.
The data dictionary generation method provided by the embodiment of the present disclosure may also be executed by the server 104, and accordingly, the data dictionary generation apparatus provided by the embodiment of the present disclosure may also be disposed in the server 104. The terminal device 101 may send the corresponding program file 102 to the server 104 via the communication link, and the server 104 may process the program file 102 by adopting the method provided by the embodiment of the present disclosure to obtain the data dictionary 103. The data dictionary 103 may also be returned to the terminal device 101 or other terminal device different from the terminal device 101 for presentation via the communication link.
In addition, the data dictionary generating method provided by the embodiment of the present disclosure may also be executed by a server or a server group different from the server 104, and accordingly, the data dictionary generating apparatus provided by the embodiment of the present disclosure may also be arranged in a server or a server group different from the server 104, which is not described herein again.
It should be understood that there may be more than one number of servers 104. The number of terminal devices and servers in fig. 1 is not limited.
FIG. 2 schematically shows a flow diagram of a data dictionary generation method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S210 to S250.
In operation S210, a target field is acquired.
In operation S220, the object package is serialized to acquire at least one method object.
In operation S230, at least one method object is parsed to obtain an assignment statement.
In operation S240, a target assignment statement is obtained from the assignment statement based on the target field.
In operation S250, a data dictionary of the target field is generated according to the target assignment statement.
According to embodiments of the present disclosure, the target field may be any one or more variables in the program.
According to embodiments of the present disclosure, the target package may include all program files of the system that require data dictionary generation.
According to an embodiment of the present disclosure, by serializing the object package, a program object, a method object, a structure object, and a database object can be acquired. The program object is obtained by serializing a program definition statement, a method definition statement and a data structure definition statement of each program file in a target program package; the method object is obtained by serializing method statements of each method in the program file, and each row of method statements is used for realizing a grammar function, wherein the grammar function comprises an assignment grammar function; the structure object is obtained by serializing the data definition statement of each data structure in the program file; the database object is obtained by serializing a structured query language statement in a program file.
According to an embodiment of the present disclosure, the target field may appear in statements that implement different syntax functions, for example, the target field may be used as a variable or an element in an expression in an assignment statement, or may be used as a variable in a conditional statement. In the generation process of the data dictionary of the target field, only the statement of which the target field appears as a variable needs to be acquired.
According to the embodiment of the disclosure, serialized objects such as method objects can be data files in the form of binary data, and the method objects can be displayed by analyzing the method objects so as to facilitate subsequent operations.
According to an embodiment of the present disclosure, the assignment statement may be a statement having an assignment syntax function identification. For example, in the EGL language, the assignment grammar function identifier may be CodeEvaluation in a presentation file obtained by parsing a method object.
According to the embodiment of the disclosure, the name of the target field can be used as a keyword, and keyword retrieval is performed in the obtained assignment statement to obtain the target assignment statement containing the target keyword.
According to the embodiment of the disclosure, the attributes of the target field can be obtained according to the target assignment statement, and the attributes are collected, so that the data dictionary of the target field can be obtained.
According to the embodiment of the disclosure, the assignment statements are obtained from the serialized target program package, the target assignment statements are obtained by screening from the assignment statements based on the target fields to be processed, and then the data dictionary of the target fields is generated according to the target assignment statements, so that the problem that the data dictionary of the target fields is easy to miss or error in a mode of manually combing codes is at least partially solved, the labor cost required by generation and maintenance of the data dictionary is effectively reduced, and the working efficiency is effectively improved.
The method of fig. 2 is further described with reference to fig. 3 in conjunction with specific embodiments.
FIG. 3 schematically shows a schematic diagram of a workflow of a language parsing system according to an embodiment of the present disclosure.
As shown in fig. 3, the system uses the policy chain 320 to identify and parse the target package 310 to generate the syntax tree 330, and then sequences the syntax tree 330 to obtain the corresponding serialized objects 340.
According to an embodiment of the present disclosure, a plurality of method resolvers 321 respectively established for each grammar function may be included in the policy chain 320. For example, the policy chain 320 may include method resolvers 311 respectively establishing Function-define, Evaluation, Expression, Flow-control, Function-call, and Program-call statements for method definition statements, assignment statements, Expression statements, Flow-control statements, method call statements, and Program call statements in the target package.
According to an embodiment of the present disclosure, the syntax tree 330 includes a method class syntax tree 331 generated after parsing each syntax Function, for example, a Function syntax tree generated by parsing a method definition statement, an Evaluation syntax tree generated by parsing an assignment statement, and the like.
According to an embodiment of the present disclosure, the step of identifying and parsing the target package using the policy chain 320 includes: the method parser 321 is used to sequentially recognize each method statement of the target package, and if the recognition is successful, the method parser 321 is used to parse the method statement, thereby generating a method class syntax tree 331 of the method statement.
Method object 341 may be included in serialized object 340 in accordance with an embodiment of the present disclosure.
According to the embodiment of the present disclosure, all the method class syntax trees 331 belonging to the same method data block in the target package are serialized to obtain the method object 341 of the method data block. In some embodiments, a method data block may also be referred to as a function.
According to the embodiment of the present disclosure, for each method object 341, the method object 341 is analyzed, and a function linked list may be obtained, where the function linked list includes all information of the method object 341.
According to the embodiments of the present disclosure, the function linked list may include a name, a setting parameter, and a return value of a corresponding method data block, and in some embodiments, the setting parameter and the return value of the method data block may be null, and only the name of the method data block is set. In addition, the function linked list also includes the information of all the function statements contained in the data block of the method.
According to the embodiment of the disclosure, there is a certain difference between the naming modes of the same grammar function in the source code and in the function linked list, for example, for the assignment grammar function, the name in the source code is Evaluation, and the name in the function linked list is CodeEvaluation.
According to the embodiment of the disclosure, the statement containing the name can be extracted from the function linked list according to the name of the assignment grammatical function in the function linked list, so as to obtain the assignment statement.
According to the embodiment of the disclosure, each sentence assignment statement comprises a variable name value, an assignment element alaassignment and an operator alaactor. And matching the name of the target field with the variable names in all the assignment statements, and extracting the statements with the variable names identical to the name of the target field from the assignment statements, so that the target assignment statements can be obtained. For example, the target field "a" exists in the value column of one of the assignment statements and in the assignment column of the other assignment statements, and the target assignment statement of the target field "a" obtained by matching is only the assignment statement of "a" existing in the value column.
According to the embodiment of the disclosure, the assignment elements and the operators can be combined according to the preset rules, so as to be restored into the expression. For example, the evaluation elements and the elements in the operators can be interleaved and spliced to be restored into expressions as "separators". For example, if the evaluation elements are "1" and "a", respectively, and the operator is "+", the expression obtained by restoration is 1+ a; further, the line statement can be restored to an assignment statement in the source code: d ═ 1+ a.
According to the embodiment of the disclosure, each restored expression can be used as an assignment attribute of the target field, and all the assignment attributes are integrated to obtain the data dictionary of the target field.
In some embodiments, the assignment statement may further include related annotation information, and when the data dictionary generation is performed, for example, annotation symbols such as "//" may be added to the annotation information and added to the related assignment attribute.
Fig. 4 schematically shows a block diagram of a data dictionary generation apparatus according to an embodiment of the present disclosure.
As shown in fig. 4, the data dictionary generating apparatus includes an obtaining module 410, a processing module 420, a parsing module 430, a selecting module 440, and a generating module 450.
An obtaining module 410, configured to obtain the target field.
The processing module 420 is configured to serialize a target package to obtain at least one method object, where the target package includes at least one line of method statements, and each line of method statements is used to implement a syntax function, where the syntax function includes an assignment syntax function.
And the analysis module 430 is configured to analyze at least one method object to obtain an assignment statement.
And a selecting module 440, configured to obtain the target assignment statement from the assignment statements based on the target field.
And the generating module 450 is configured to generate a data dictionary of the target field according to the target assignment statement.
According to the embodiment of the disclosure, the assignment statements are obtained from the serialized target program package, the target assignment statements are obtained by screening from the assignment statements based on the target fields to be processed, and then the data dictionary of the target fields is generated according to the target assignment statements, so that the problem that the data dictionary of the target fields is easy to miss or error in a mode of manually combing codes is at least partially solved, the labor cost required by generation and maintenance of the data dictionary is effectively reduced, and the working efficiency is effectively improved.
According to an embodiment of the present disclosure, at least one line of method statements constitutes at least one method data block. The processing module 420 includes a first processing unit and a second processing unit.
And the first processing unit is used for analyzing the method statement corresponding to each method data block of the target program package by using the strategy chain to obtain a method type syntax tree.
And the second processing unit is used for serializing the method class syntax tree to obtain the method object corresponding to the method data block.
According to an embodiment of the present disclosure, the policy chain includes a plurality of method resolvers respectively established for each of the grammar functions. The first processing unit comprises a first processing subunit and a second processing subunit.
A first processing subunit for identifying the method statements sequentially using the plurality of method resolvers.
A second processing subunit for parsing the method statement using a method parser that successfully recognizes the method statement to generate a method class syntax tree.
According to an embodiment of the present disclosure, the parsing module 430 includes a first parsing unit, a second parsing unit, and a third parsing unit.
The first analysis unit is used for analyzing at least one method object to obtain at least one function linked list.
And the second analysis unit is used for determining the function name of the assignment grammar function in at least one function linked list.
And the third analysis unit is used for extracting the statement containing the function name from at least one function linked list to obtain the assignment statement.
According to an embodiment of the present disclosure, the assignment statement includes a variable name. The selection module 440 includes a first selection unit and a second selection unit.
And the first selection unit is used for matching the target field with the variable name of each row of assignment statement respectively to obtain a matching result.
And the second selection unit is used for determining the assignment statement as the target assignment statement under the condition that the matching result is that the matching is successful.
According to an embodiment of the present disclosure, the target assignment statement includes an assignment element and an operator. The generating module 450 includes a first generating unit and a second generating unit.
And the first generation unit is used for combining the assignment elements and the operators according to a preset rule for each line of the target assignment statement so as to generate the assignment attributes.
And the second generation unit is used for recording all the assignment attributes so as to generate a data dictionary of the target field.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any plurality of the obtaining module 410, the processing module 420, the parsing module 430, the selecting module 440, and the generating module 450 may be combined and implemented in one module/unit/sub-unit, or any one of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least part of the functionality of one or more of these modules/units/sub-units may be combined with at least part of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to an embodiment of the present disclosure, at least one of the obtaining module 410, the processing module 420, the parsing module 430, the selecting module 440, and the generating module 450 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or may be implemented in any one of three implementations of software, hardware, and firmware, or in a suitable combination of any several of them. Alternatively, at least one of the obtaining module 410, the processing module 420, the parsing module 430, the selecting module 440 and the generating module 450 may be at least partially implemented as a computer program module, which when executed may perform a corresponding function.
It should be noted that the data dictionary generation device part in the embodiment of the present disclosure corresponds to the data dictionary generation method part in the embodiment of the present disclosure, and the description of the data dictionary generation device part specifically refers to the data dictionary generation method part, which is not described herein again.
FIG. 5 schematically illustrates a block diagram of an electronic device suitable for implementing a data dictionary generation method in accordance with an embodiment of the present disclosure. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, a computer electronic device 500 according to an embodiment of the present disclosure includes a processor 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. The processor 501 may comprise, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 501 may also include onboard memory for caching purposes. Processor 501 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the disclosure.
In the RAM 503, various programs and data necessary for the operation of the electronic apparatus 500 are stored. The processor 501, the ROM 502, and the RAM 503 are connected to each other by a bus 504. The processor 501 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 502 and/or the RAM 503. Note that the programs may also be stored in one or more memories other than the ROM 502 and the RAM 503. The processor 501 may also perform various operations of method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, electronic device 500 may also include an input/output (I/O) interface 505, input/output (I/O) interface 505 also being connected to bus 504. The electronic device 500 may also include one or more of the following components connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program, when executed by the processor 501, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, a computer-readable storage medium may include ROM 502 and/or RAM 503 and/or one or more memories other than ROM 502 and RAM 503 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method provided by the embodiments of the present disclosure, when the computer program product is run on an electronic device, the program code being adapted to cause the electronic device to carry out the method of generating a data dictionary provided by the embodiments of the present disclosure.
The computer program, when executed by the processor 501, performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed in the form of a signal on a network medium, downloaded and installed through the communication section 509, and/or installed from the removable medium 511. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. 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 some 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 or flowchart illustration, and combinations of blocks in the block diagrams 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. Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (10)

1. A data dictionary generation method, comprising:
acquiring a target field;
serializing a target program package to obtain at least one method object, wherein the target program package comprises at least one line of method statements, each line of the method statements is used for realizing a grammar function, and the grammar function comprises an assignment grammar function;
analyzing the at least one method object to obtain an assignment statement;
acquiring a target assignment statement from the assignment statement based on the target field; and
and generating a data dictionary of the target field according to the target assignment statement.
2. The method of claim 1, wherein the at least one line of method statements constitutes at least one method data block;
wherein the serializing the object package to obtain at least one method object comprises:
for each method data block of the target program package, analyzing a method statement corresponding to the method data block by using a strategy chain to obtain a method type syntax tree; and
and serializing the method type syntax tree to obtain a method object corresponding to the method data block.
3. The method of claim 2, wherein the policy chain includes a plurality of method resolvers established separately for each grammar function;
analyzing the method statement corresponding to the method data block by using the strategy chain to obtain a method type syntax tree, wherein the method type syntax tree comprises the following steps:
sequentially using the plurality of method parsers to identify the method statement; and
parsing the method statement using a method parser that successfully identifies the method statement to generate the method class syntax tree.
4. The method of claim 1, wherein said parsing said at least one method object to obtain an assignment statement comprises:
analyzing the at least one method object to obtain at least one function linked list;
determining a function name of the assignment grammar function in the at least one function linked list; and
and extracting statements containing the function names from the at least one function linked list to obtain the assignment statements.
5. The method of claim 1, wherein the assignment statement comprises a variable name;
wherein, the obtaining a target assignment statement from the assignment statement based on the target field includes:
matching the target field with the variable name of each row of assignment statement respectively to obtain a matching result; and
and determining the assignment statement as the target assignment statement under the condition that the matching result is successful.
6. The method of claim 1, wherein the target assignment statement comprises an assignment element and an operator;
wherein the generating the data dictionary of the target field according to the target assignment statement comprises:
for each line of target assignment statements, combining the assignment elements and the operators according to preset rules to generate assignment attributes; and
and recording all the assignment attributes to generate a data dictionary of the target field.
7. A data dictionary generation apparatus comprising:
the acquisition module is used for acquiring a target field;
the system comprises a processing module, a processing module and a processing module, wherein the processing module is used for serializing a target program package to obtain at least one method object, the target program package comprises at least one line of method statements, and each line of the method statements is used for realizing a grammar function, and the grammar function comprises an assignment grammar function;
the analysis module is used for analyzing the at least one method object to obtain an assignment statement;
the selection module is used for acquiring a target assignment statement from the assignment statement based on the target field; and
and the generating module is used for generating the data dictionary of the target field according to the target assignment statement.
8. An electronic device, comprising:
one or more processors;
a memory to store one or more instructions that,
wherein the one or more instructions, when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
9. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 6.
10. A computer program product comprising computer executable instructions for implementing the method of any one of claims 1 to 6 when executed.
CN202110674979.0A 2021-06-17 2021-06-17 Data dictionary generation method and device, electronic equipment and storage medium Pending CN113378517A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110674979.0A CN113378517A (en) 2021-06-17 2021-06-17 Data dictionary generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110674979.0A CN113378517A (en) 2021-06-17 2021-06-17 Data dictionary generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113378517A true CN113378517A (en) 2021-09-10

Family

ID=77577584

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110674979.0A Pending CN113378517A (en) 2021-06-17 2021-06-17 Data dictionary generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113378517A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140282373A1 (en) * 2013-03-15 2014-09-18 Trinity Millennium Group, Inc. Automated business rule harvesting with abstract syntax tree transformation
CN104915383A (en) * 2015-05-19 2015-09-16 中国电子科技集团公司第二十八研究所 General method for automatic object adapting in database access
CN110032363A (en) * 2019-03-21 2019-07-19 深圳点猫科技有限公司 A kind of data structure construction method and system for robotic programming
CN110502227A (en) * 2019-08-28 2019-11-26 网易(杭州)网络有限公司 The method and device of code completion, storage medium, electronic equipment
CN110502535A (en) * 2019-08-28 2019-11-26 上海达梦数据库有限公司 Data access method, device, equipment and storage medium
CN112199274A (en) * 2020-09-18 2021-01-08 北京大学 JavaScript dynamic taint tracking method based on V8 engine and electronic device
CN112947914A (en) * 2021-03-31 2021-06-11 中国建设银行股份有限公司 Code generation method and device based on model, computer equipment and medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140282373A1 (en) * 2013-03-15 2014-09-18 Trinity Millennium Group, Inc. Automated business rule harvesting with abstract syntax tree transformation
CN104915383A (en) * 2015-05-19 2015-09-16 中国电子科技集团公司第二十八研究所 General method for automatic object adapting in database access
CN110032363A (en) * 2019-03-21 2019-07-19 深圳点猫科技有限公司 A kind of data structure construction method and system for robotic programming
CN110502227A (en) * 2019-08-28 2019-11-26 网易(杭州)网络有限公司 The method and device of code completion, storage medium, electronic equipment
CN110502535A (en) * 2019-08-28 2019-11-26 上海达梦数据库有限公司 Data access method, device, equipment and storage medium
CN112199274A (en) * 2020-09-18 2021-01-08 北京大学 JavaScript dynamic taint tracking method based on V8 engine and electronic device
CN112947914A (en) * 2021-03-31 2021-06-11 中国建设银行股份有限公司 Code generation method and device based on model, computer equipment and medium

Similar Documents

Publication Publication Date Title
US11221832B2 (en) Pruning engine
US11074047B2 (en) Library suggestion engine
US11740876B2 (en) Method and system for arbitrary-granularity execution clone detection
US10983789B2 (en) Systems and methods for automating and monitoring software development operations
US9645799B2 (en) Method and system for model driven development
CN108197024B (en) Embedded browser debugging method, debugging terminal and computer readable storage medium
CN113032244A (en) Interface testing method, device, computer system and computer readable storage medium
CN113419740A (en) Program data stream analysis method and device, electronic device and readable storage medium
CN111177089B (en) Log processing code generation method and device, computer system and storage medium
US10606728B2 (en) Framework for detecting source code anomalies
CN116414855A (en) Information processing method and device, electronic equipment and computer readable storage medium
CN113138767B (en) Code language conversion method, device, electronic equipment and storage medium
CN113392311A (en) Field searching method, field searching device, electronic equipment and storage medium
CN113378517A (en) Data dictionary generation method and device, electronic equipment and storage medium
CN114169318A (en) Process identification method, apparatus, device, medium, and program
CN113032256A (en) Automatic test method, device, computer system and readable storage medium
CN112416727A (en) Batch processing operation checking method, device, equipment and medium
CN113110947B (en) Program call chain generation method, system, electronic device and medium
CN113392112A (en) Data analysis method, data analysis device, electronic device, and storage medium
CN113392199A (en) Keyword search method, keyword search device, electronic device, and storage medium
CN112860259B (en) Interface processing method, device, electronic equipment and storage medium
CN113377377A (en) Static code analysis method, analysis device, electronic device and readable storage medium
CN109101473B (en) Method and apparatus for processing two-dimensional data table
CN113900919A (en) crontab management method, device, electronic device, medium, and program product
CN116382703A (en) Software package generation method, code development method and device, electronic equipment and medium

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