[go: up one dir, main page]

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

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

Info

Publication number
CN113378517B
CN113378517B CN202110674979.0A CN202110674979A CN113378517B CN 113378517 B CN113378517 B CN 113378517B CN 202110674979 A CN202110674979 A CN 202110674979A CN 113378517 B CN113378517 B CN 113378517B
Authority
CN
China
Prior art keywords
target
assignment
statement
assignment statement
data dictionary
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.)
Active
Application number
CN202110674979.0A
Other languages
Chinese (zh)
Other versions
CN113378517A (en
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/CN113378517B/en
Publication of CN113378517A publication Critical patent/CN113378517A/en
Application granted granted Critical
Publication of CN113378517B publication Critical patent/CN113378517B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/237Lexical tools
    • G06F40/242Dictionaries
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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)
  • Machine Translation (AREA)

Abstract

本公开提供了一种数据字典生成方法,可用于计算机技术领域、金融领域或其他领域,该方法包括:获取目标字段;序列化目标程序包,以获取至少一个方法对象,其中,目标程序包中包括至少一行方法语句,每一行方法语句用于实现一种语法功能,其中,语法功能包括赋值语法功能;解析至少一个方法对象,得到赋值语句;基于目标字段,从赋值语句中获取目标赋值语句;以及根据目标赋值语句,生成目标字段的数据字典。此外,本公开还提供了一种数据字典生成装置、一种电子设备、一种可读存储介质和一种计算机程序产品。

The present disclosure provides a data dictionary generation method, which can be used in the field of computer technology, finance or other fields, the method comprising: obtaining a target field; serializing a target program package to obtain at least one method object, wherein the target program package includes at least one line of method statements, each line of method statements is used to implement a grammatical function, wherein the grammatical function includes an assignment grammatical function; parsing at least one method object to obtain an assignment statement; based on the target field, obtaining a target assignment statement from the assignment statement; 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 generation device, an electronic device, a readable storage medium and a computer program product.

Description

Data dictionary generation method, 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 generating method, a data dictionary generating apparatus, an electronic device, a readable storage medium, and a computer program product.
Background
With the continuous construction and expansion of systems, the attributes of each field in the data dictionary are increased.
In implementing the concepts of the present disclosure, the inventors have discovered that the system is typically maintained by a plurality of operators, thus resulting in incomplete agreement between the attributes of the fields in the data dictionary maintained in the operation document and the actual attributes of the fields in the code, so that the operators need to regenerate the data dictionary of the field when performing the field operation.
Disclosure of Invention
In view of this, 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 disclosure provides a data dictionary generating method, which comprises the steps of obtaining a target field, serializing a target program package to obtain at least one method object, wherein the target program package comprises at least one row of method sentences, each row of method sentences is used for realizing a grammar function, the grammar function comprises an assignment grammar function, analyzing the at least one method object to obtain an assignment sentence, obtaining the target assignment sentence from the assignment sentence based on the target field, and generating the data dictionary of the target field according to the target assignment sentence.
According to the embodiment of the disclosure, the at least one row of method sentences form at least one method data block, wherein the serializing of the target program package to obtain at least one method object comprises analyzing the method sentences corresponding to the method data blocks by using a strategy chain for each method data block of the target program package to obtain a method class grammar tree, and serializing the method class grammar tree to obtain the method object corresponding to the method data block.
According to the embodiment of the disclosure, the strategy chain comprises a plurality of method resolvers which are respectively established for each grammar function, wherein the strategy chain is used for resolving method sentences corresponding to the method data blocks to obtain a method class grammar tree, the method class grammar tree comprises the steps of sequentially using the plurality of method resolvers to identify the method sentences, and using the method resolvers which successfully identify the method sentences to resolve the method sentences so as to generate the method class grammar tree.
According to the embodiment of the disclosure, the parsing the at least one method object to obtain an assignment statement includes parsing 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 a statement containing the function name from the at least one function linked list to obtain the assignment statement.
According to the embodiment of the disclosure, the assignment statement comprises variable names, wherein the obtaining of the target assignment statement from the assignment statement based on the target field comprises the steps of respectively matching the target field with the variable names of each row of assignment statement to obtain a matching result, and determining that the assignment statement is the target assignment statement when the matching result is successful.
According to the embodiment of the disclosure, the target assignment statement comprises assignment elements and operators, wherein the generation of the data dictionary of the target field according to the target assignment statement comprises the steps of combining the assignment elements and the operators according to preset rules for each row of target assignment statement to generate assignment attributes, and recording all the assignment attributes to generate the data dictionary of the target field.
Another aspect of the present disclosure provides a data dictionary generating apparatus, including an obtaining module, a processing module, an analyzing module, a selecting module, and a generating module. The system comprises an acquisition module, a processing module, a selection module and a generation module, wherein the acquisition module is used for acquiring a target field, the processing module is used for serializing a target program package to acquire at least one method object, the target program package comprises at least one row of method sentences, each row of method sentences is used for realizing a grammar function, 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 sentence, the selection module is used for acquiring the target assignment sentence from the assignment sentence based on the target field, and the generation module is used for generating a data dictionary of the target field according to the target assignment sentence.
Another aspect of the disclosure provides an electronic device comprising one or more processors and a memory for storing 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 the method as described above.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed, are configured to implement a method as described above.
Another aspect of the present disclosure provides a computer program product comprising computer executable instructions which, when executed, are for implementing a method as described above.
According to the embodiment of the disclosure, the assignment statement is obtained from the serialized target program package, the target assignment statement is obtained from the assignment statement through screening based on the target field to be processed, and then the data dictionary of the target field is generated according to the target assignment statement, so that the problem that omission or errors are easy to occur in the data dictionary of the target field obtained by manually combing codes is at least partially solved, the labor cost required for generating and maintaining 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 thereof with reference to the accompanying drawings in which:
FIG. 1 schematically illustrates an exemplary system architecture 100 in which a data dictionary generation method may be applied, according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart 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 generating apparatus according to an embodiment of the present disclosure;
fig. 5 schematically illustrates a block diagram of an electronic device adapted to implement a data dictionary generating method according to 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 only exemplary 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 present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to 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/or 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 should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a convention should be interpreted in accordance with the meaning of one of skill in the art having generally understood the convention (e.g., "a system having at least one of A, B and C" would include, but not be limited to, systems having 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 formulation similar to at least one of "A, B or C, etc." is used, in general such a formulation should be interpreted in accordance with the ordinary understanding of one skilled in the art (e.g. "a system with at least one of A, B or C" would include but not be limited to systems with 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.).
A data dictionary refers to a definition and description of data items, data structures, data flows, data stores, processing logic, etc. of data for the purpose of describing elements of a data flow diagram in detail.
A passive data dictionary is generally used in the related art system, for example, FOVA system implemented by EGL language, and related fields of the data dictionary in the system must be manually updated when the related fields of the data dictionary are modified. However, in the continuous construction and expansion process of the system, the attribute of the relevant fields is continuously increased, and the attribute of some fields is even increased from the initial few fields to the later hundreds of fields, so that the data dictionary of the relevant fields needs to be continuously expanded and organized.
In the related art, a data dictionary of related fields is often obtained by manually combing codes and summarizing. However, the source code of the system is usually quite huge, the sentences related to field operation are numerous, meanwhile, the data dictionary of the system is generally updated continuously along with the time, and the situation of data dictionary conversion may exist in the updating process, so that a mode of generating the data dictionary by manual means needs to consume a great deal of manpower resources, has low working efficiency, and is easy to miss or error due to the complexity of program logic.
In view of the above, the inventor provides an automatic analysis method of a data dictionary, which can assist a designer to understand the system functions as a whole by automatically collecting and displaying 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 generating method, a data dictionary generating apparatus, an electronic device, a readable storage medium, and a computer program product. The method comprises the steps of obtaining a target field, serializing a target program package to obtain at least one method object, wherein the target program package comprises at least one row of method sentences, each row of method sentences is used for realizing a grammar function, the grammar function comprises an assignment grammar function, analyzing the at least one method object to obtain an assignment sentence, obtaining the target assignment sentence from the assignment sentence based on the target field, and generating a data dictionary of the target field according to the target assignment sentence.
It should be noted that the method and apparatus for generating a data dictionary provided in 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 in the embodiments of the present disclosure may be used to generate a data dictionary, so as to facilitate writing of a software instruction manual. The data dictionary generating method and device provided by the embodiment of the disclosure can be used in other fields besides the technical field of computers and the financial field, and the application field of the data dictionary generating method and device provided by the embodiment of the disclosure is not limited.
Fig. 1 schematically illustrates an exemplary system architecture 100 in which a 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 embodiments of the present disclosure may be applied to assist those skilled in the art in understanding the technical content of the present disclosure, but does not mean that embodiments of the present disclosure may not be used in 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 a variety of electronic devices having a display screen and supporting network communication or data processing functions, including but not limited to smartphones, tablets, portable computers, desktop computers, and the like.
The terminal device 101 may have various client applications installed thereon, including but not limited to communication-type applications, programming-environment-type 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 provided in the terminal device 101. For the program file 102 received or otherwise stored in the terminal device 101, the terminal device 101 may extract the data dictionary 103 of the target field from the program file 102 using the data dictionary generating method or apparatus provided in the embodiment of the present disclosure, and display the data dictionary 104 on the display screen of the terminal device 101.
It should be noted that the number of terminal devices may be plural, and that information interaction between different terminal devices may be performed by means of wired and/or wireless communication links. The data dictionary generating method provided by the embodiment of the present disclosure may be performed by one of the terminal devices, and the generated data dictionary 103 may be transmitted to the other terminal device via a communication link for presentation.
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 group of servers 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 generating method provided by the embodiment of the present disclosure may also be executed by the server 104, and correspondingly, the data dictionary generating apparatus provided by the embodiment of the present disclosure may also be provided in the server 104. The terminal device 101 may send the corresponding program file 102 to the server 104 via a communication link, and the server 104 may process the program file 102 to obtain the data dictionary 103 by adopting a method provided by an embodiment of the present disclosure. The data dictionary 103 may also be returned to the terminal device 101 via a communication link for presentation by other terminal devices than the terminal device 101.
In addition, the data dictionary generating method provided in the embodiment of the present disclosure may also be performed by other servers or server groups different from the server 104, and accordingly, the data dictionary generating apparatus provided in the embodiment of the present disclosure may also be provided in other servers or server groups different from the server 104, which are not described herein again.
It should be appreciated that there may be multiple numbers of servers 104. The number of terminal devices and servers in fig. 1 is not limited.
Fig. 2 schematically illustrates a flow chart of a data dictionary generating method according to an embodiment of the present disclosure.
As shown in FIG. 2, the method includes operations S210-S250.
In operation S210, a target field is acquired.
In operation S220, the target package is serialized to acquire at least one method object.
In operation S230, at least one method object is parsed, resulting in an assignment statement.
In operation S240, a target assignment statement is acquired from the assignment statements 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 embodiments of the present disclosure, program objects, method objects, structure objects, and database objects may be obtained by serializing target packages. The method comprises the steps of obtaining a program object from a program definition statement, a method definition statement and a data structure definition statement of each program file in a target program package, obtaining a method object from a method statement of each method in the program file after being serialized, obtaining a grammar function from each row of method statements, wherein the grammar function comprises an assignment grammar function, obtaining a structure object from a data definition statement of each data structure in the program file after being serialized, and obtaining a database object from a structured query language statement in the program file after being serialized.
According to embodiments of the present disclosure, the target field may appear in statements that implement different grammar functions, e.g., the target field may be an element in a variable or expression in an assignment statement, or may be a variable in a conditional statement. In the data dictionary generation process of the target field, only sentences in which the target field appears as a variable need to be acquired.
According to the embodiment of the disclosure, the serialization objects such as the 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, an assignment statement may be a statement with an assignment grammar function identification. For example, in the EGL language, the assigned grammar function identification may be CodeEvaluation in a presentation file obtained by parsing the 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 so as to obtain the target assignment statement containing the target keyword.
According to the embodiment of the disclosure, the attribute of the target field can be obtained according to the target assignment statement, and the attribute is summarized, so that the data dictionary of the target field can be obtained.
According to the embodiment of the disclosure, the assignment statement is obtained from the serialized target program package, the target assignment statement is obtained from the assignment statement through screening based on the target field to be processed, and then the data dictionary of the target field is generated according to the target assignment statement, so that the problem that omission or errors are easy to occur in the data dictionary of the target field obtained by manually combing codes is at least partially solved, the labor cost required for generating and maintaining the data dictionary is effectively reduced, and the working efficiency is effectively improved.
The method illustrated in fig. 2 is further described below with reference to fig. 3 in conjunction with an exemplary embodiment.
Fig. 3 schematically illustrates 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 object 340.
According to embodiments of the present disclosure, a plurality of method resolvers 321, which are separately built for each grammar function, may be included in the policy chain 320. For example, the policy chain 320 may include method resolvers 311 for respectively creating functions-define, evaluation, expression, flow-control, function-call, program-call, and the like for method definition statements, assignment statements, expression statements, flow control statements, method call statements, and Program call statements, and the like in the target package.
According to an embodiment of the present disclosure, the grammar tree 330 includes a method class grammar tree 331 generated after parsing each grammar Function, e.g., a Function grammar tree generated by parsing a method definition statement, an Evaluation grammar tree generated by parsing an assignment statement, etc.
The step of identifying and parsing the target package using the policy chain 320 according to an embodiment of the present disclosure includes identifying each method sentence of the target package using a plurality of method parsers 321 in sequence, and in case the identification is successful, parsing the method sentence using the method parsers 321, thereby generating a method class syntax tree 331 of the method sentence.
In accordance with an embodiment of the present disclosure, method object 341 may be included in serialized object 340.
According to an embodiment of the present disclosure, all the method class syntax trees 331 belonging to the same method data block in the target program 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, parsing the method object 341 may obtain a function linked list, where all information of the method object 341 is included in the function linked list.
According to 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 comprises information of all function sentences contained in the data block of the method.
According to embodiments of the present disclosure, the naming of the same grammar function in source code and in the function link list differs somewhat, e.g., for an assigned grammar function, the name in source code is Evaluation and the name in function link list is CodeEvaluation.
According to the embodiment of the disclosure, according to the name of the assignment grammar function in the function linked list, sentences containing the name can be extracted from the function linked list to obtain assignment sentences.
According to an embodiment of the present disclosure, each sentence assignment statement contains a variable name value, an assignment element ALASSIGNMENT, and an operator alOperator. And matching the names of the target fields with the variable names in all the assignment sentences, and extracting sentences with the same names of the variable names and the target fields from the assignment sentences, so that the target assignment sentences can be obtained. For example, the target field "a" exists in the value field of one of the assignment statements and exists in the ALASSIGNMENT fields 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 field.
According to embodiments of the present disclosure, the assignment elements and operators may be combined according to preset rules to restore into an expression. For example, the assigned elements and the elements in the operators may be interleaved as "as a segmenter" to be restored to the expression. For example, if the assignment elements are "1" and "a" respectively and the operators are "+", the restored expression is 1+a, and further, the line statement may be restored to an assignment statement in the source code, where d=1+a.
According to the embodiment of the disclosure, each restored expression can be used as one assignment attribute of the target field, and all assignment attributes are integrated, so that a data dictionary of the target field can be obtained.
In some embodiments, the assignment statement may further include relevant annotation information, and when the data dictionary is generated, for example, annotation symbols such as "//" may be added to the annotation information and added to the relevant assignment attribute.
Fig. 4 schematically shows a block diagram of a data dictionary generating apparatus according to an embodiment of the present disclosure.
As shown in fig. 4, the data dictionary generating apparatus includes an acquisition module 410, a processing module 420, a parsing module 430, a selection module 440, and a generation module 450.
The obtaining module 410 is configured to obtain the target field.
The processing module 420 is configured to serialize the object package to obtain at least one method object, where the object package includes at least one line of method statements, and each line of method statements is configured to implement a grammar function, and the grammar function includes an assigned grammar function.
The parsing module 430 is configured to parse at least one method object to obtain an assignment statement.
The selection module 440 is configured to obtain a target assignment statement from the assignment statements based on the target field.
And the generating module 450 is used for generating a data dictionary of the target field according to the target assignment statement.
According to the embodiment of the disclosure, the assignment statement is obtained from the serialized target program package, the target assignment statement is obtained from the assignment statement through screening based on the target field to be processed, and then the data dictionary of the target field is generated according to the target assignment statement, so that the problem that omission or errors are easy to occur in the data dictionary of the target field obtained by manually combing codes is at least partially solved, the labor cost required for generating and maintaining the data dictionary is effectively reduced, and the working efficiency is effectively improved.
According to an embodiment of the present disclosure, at least one row 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 sentences corresponding to the method data blocks by using the strategy chain for each method data block of the target program package to obtain a method class grammar tree.
And the second processing unit is used for serializing the method class grammar tree to obtain a method object corresponding to the method data block.
According to an embodiment of the present disclosure, a policy chain includes a plurality of method resolvers respectively established for each grammar function. The first processing unit includes a first processing subunit and a second processing subunit.
A first processing subunit for identifying the method statement using the plurality of method resolvers in turn.
A second processing subunit for parsing the method statement using a method parser that successfully identifies 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 analyzing unit is used for analyzing at least one method object to obtain at least one function linked list.
And the second parsing unit is used for determining the function names of the assigned grammar functions in at least one function linked list.
And the third parsing unit is used for extracting sentences containing function names from at least one function linked list to obtain assignment sentences.
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 respectively matching the target field with the variable names of each row of assignment statement to obtain a matching result.
And the second selection unit is used for determining the assignment statement as a target assignment statement under the condition that the matching result is successful.
According to an embodiment of the present disclosure, a target assignment statement includes an assignment element and an operator. The generation module 450 includes a first generation unit and a second generation unit.
The first generation unit is used for combining the assignment elements and the operators according to preset rules for each row of target assignment statement so as to generate assignment attributes.
And the second generation unit is used for recording all the assignment attributes to generate a data dictionary of the target field.
Any number of modules, sub-modules, units, sub-units, or at least some of the functionality of any number of the sub-units according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented as split into multiple 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-chip, a system-on-substrate, a system-on-package, an Application Specific Integrated Circuit (ASIC), or in any other reasonable manner of hardware or firmware that integrates or encapsulates the circuit, or in any one of or a suitable combination of three of software, hardware, and firmware. Or one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be at least partially implemented as computer program modules, which, when executed, may perform the corresponding functions.
For example, any of the acquisition module 410, the processing module 420, the parsing module 430, the selection module 440, and the generation module 450 may be combined in one module/unit/sub-unit or any of the modules/units/sub-units may be split into multiple modules/units/sub-units. Or at least some of the functionality of one or more of these modules/units/sub-units may be combined with at least some of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to embodiments of the present disclosure, at least one of the acquisition module 410, the processing module 420, the parsing module 430, the selection module 440, and the generation module 450 may be implemented at least in part as hardware circuitry, 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 way of integrating or packaging circuitry, or in any one of or a suitable combination of three of software, hardware, and firmware. Or at least one of the acquisition module 410, the processing module 420, the parsing module 430, the selection module 440 and the generation module 450 may be at least partially implemented as a computer program module which, when executed, may perform the corresponding functions.
It should be noted that, in the embodiments of the present disclosure, the data dictionary generating apparatus portion corresponds to the data dictionary generating method portion in the embodiments of the present disclosure, and the description of the data dictionary generating apparatus portion specifically refers to the data dictionary generating method portion and is not described herein again.
Fig. 5 schematically illustrates a block diagram of an electronic device adapted to implement a data dictionary generating method according to an embodiment of the present disclosure. The electronic device shown in fig. 5 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
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 include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. The processor 501 may also include on-board memory for caching purposes. The processor 501 may comprise a single processing unit or a plurality of processing units for performing different actions of the method flows according to embodiments of the disclosure.
In the RAM 503, various programs and data required for the operation of the electronic apparatus 500 are stored. The processor 501, ROM 502, and RAM 503 are connected to each other by a bus 504. The processor 501 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 502 and/or the RAM 503. Note that the program may 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 the method flow 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, the electronic device 500 may also include an input/output (I/O) interface 505, the input/output (I/O) interface 505 also being connected to the bus 504. The electronic device 500 may also include one or more of an input section 506 including a keyboard, mouse, etc., an output section 507 including a Cathode Ray Tube (CRT), liquid Crystal Display (LCD), etc., and speaker, etc., a storage section 508 including a hard disk, etc., and a communication section 509 including a network interface card such as a LAN card, modem, etc., connected to the I/O interface 505. The communication section 509 performs communication processing via a network such as the internet. The drive 510 is also connected to the I/O interface 505 as needed. 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 needed so that a computer program read therefrom is mounted into the storage section 508 as needed.
According to embodiments of the present disclosure, the method flow according to embodiments of the present disclosure may be implemented as a computer software program. 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 comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 509, and/or installed from the removable media 511. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 501. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
The present disclosure also provides a computer-readable storage medium that may be included in the apparatus/device/system described in the above embodiments, or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Such as, but 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 context of this 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, the 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 comprising program code for performing the methods provided by the embodiments of the present disclosure, the program code for causing an electronic device to implement the data dictionary generating methods provided by the embodiments of the present disclosure when the computer program product is run on the electronic device.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 501. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based 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, and downloaded and installed in the form of a signal on a network medium, and/or installed from a removable medium 511 via the communication portion 509. The computer program may comprise program code that is transmitted using any appropriate network medium, including but not limited to wireless, wireline, etc., or any suitable combination of the preceding.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, 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., connected via the Internet using an Internet service provider).
The flowcharts 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 the features recited in the various embodiments of the disclosure and/or in the claims may be combined in various combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. These examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (9)

1.一种数据字典生成方法,包括:1. A method for generating a data dictionary, comprising: 获取目标字段;Get the target field; 序列化目标程序包,以获取至少一个方法对象,其中,所述目标程序包中包括至少一行方法语句,每一行所述方法语句用于实现一种语法功能,其中,所述语法功能包括赋值语法功能;Serializing a target program package to obtain at least one method object, wherein the target program package includes at least one line of method statements, each line of the method statements is used to implement a grammatical function, wherein the grammatical function includes an assignment grammatical function; 解析所述至少一个方法对象,得到赋值语句;Parsing the at least one method object to obtain an assignment statement; 基于所述目标字段,从所述赋值语句中获取目标赋值语句;以及Based on the target field, obtaining a target assignment statement from the assignment statement; and 根据所述目标赋值语句,生成所述目标字段的数据字典;Generate a data dictionary of the target field according to the target assignment statement; 其中,所述至少一行方法语句构成至少一个方法数据块;Wherein, the at least one line of method statements constitutes at least one method data block; 其中,所述序列化目标程序包,以获取至少一个方法对象,包括:The step of serializing the target package to obtain at least one method object includes: 对于所述目标程序包的每一个方法数据块,使用策略链解析与所述方法数据块对应的方法语句,得到方法类语法树,所述方法类语法树与所述方法数据块的语法功能相对应;以及For each method data block of the target program package, using the policy chain to parse the method statement corresponding to the method data block to obtain a method class syntax tree, wherein the method class syntax tree corresponds to the syntax function of the method data block; and 序列化所述方法类语法树,得到与所述方法数据块对应的方法对象。The method class syntax tree is serialized to obtain a method object corresponding to the method data block. 2.根据权利要求1所述的方法,其中,所述策略链包括针对于每一种语法功能分别建立的多个方法解析器;2. The method according to claim 1, wherein the policy chain comprises a plurality of method parsers established for each grammatical function; 其中,所述使用策略链解析与所述方法数据块对应的方法语句,得到方法类语法树,包括:The method statement corresponding to the method data block is parsed using the policy chain to obtain a method class syntax tree, including: 依次使用所述多个方法解析器识别所述方法语句;以及sequentially using the plurality of method parsers to identify the method statements; and 使用成功识别所述方法语句的方法解析器来解析所述方法语句,以生成所述方法类语法树。The method statement is parsed using a method parser that successfully identifies the method statement to generate the method class syntax tree. 3.根据权利要求1所述的方法,其中,所述解析所述至少一个方法对象,得到赋值语句,包括:3. The method according to claim 1, wherein the parsing of the at least one method object to obtain an assignment statement comprises: 解析所述至少一个方法对象,得到至少一个功能链表;Parsing the at least one method object to obtain at least one function linked list; 确定所述赋值语法功能在所述至少一个功能链表中的功能名称;以及Determine the function name of the assignment syntax function in the at least one function linked list; and 在所述至少一个功能链表中提取包含所述功能名称的语句,得到所述赋值语句。A statement containing the function name is extracted from the at least one function linked list to obtain the assignment statement. 4.根据权利要求1所述的方法,其中,所述赋值语句包括变量名;4. The method according to claim 1, wherein the assignment statement includes a variable name; 其中,所述基于所述目标字段,从所述赋值语句中获取目标赋值语句,包括:Wherein, 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 line of assignment statement to obtain a matching result; and 在所述匹配结果为匹配成功的情况下,确定所述赋值语句为所述目标赋值语句。When the matching result is a successful match, the assignment statement is determined to be the target assignment statement. 5.根据权利要求1所述的方法,其中,所述目标赋值语句包括赋值元素和操作符;5. The method according to claim 1, wherein the target assignment statement comprises an assignment element and an operator; 其中,所述根据所述目标赋值语句,生成所述目标字段的数据字典,包括:The step of generating a data dictionary of the target field according to the target assignment statement includes: 对于每一行目标赋值语句,将所述赋值元素和所述操作符按预设规则组合,以生成赋值属性;以及For each line of target assignment statement, combining the assignment element and the operator according to a preset rule to generate an assignment attribute; and 记录所有赋值属性,以生成所述目标字段的数据字典。All assigned attributes are recorded to generate a data dictionary for the target field. 6.一种数据字典生成装置,包括:6. A data dictionary generating device, comprising: 获取模块,用于获取目标字段;The acquisition module is used to obtain the target field; 处理模块,用于序列化目标程序包,以获取至少一个方法对象,其中,所述目标程序包中包括至少一行方法语句,每一行所述方法语句用于实现一种语法功能,其中,所述语法功能包括赋值语法功能;A processing module, configured to serialize a target program package to obtain at least one method object, wherein the target program package includes at least one line of method statements, each line of the method statements is used to implement a grammatical function, wherein the grammatical function includes an assignment grammatical function; 解析模块,用于解析所述至少一个方法对象,得到赋值语句;A parsing module, used for parsing the at least one method object to obtain an assignment statement; 选择模块,用于基于所述目标字段,从所述赋值语句中获取目标赋值语句;以及A selection module, configured to obtain a target assignment statement from the assignment statements based on the target field; and 生成模块,用于根据所述目标赋值语句,生成所述目标字段的数据字典;A generating module, used for generating a data dictionary of the target field according to the target assignment statement; 其中,所述至少一行方法语句构成至少一个方法数据块;Wherein, the at least one line of method statements constitutes at least one method data block; 其中,所述处理模块,包括:Wherein, the processing module includes: 第一处理单元,用于对于所述目标程序包的每一个方法数据块,使用策略链解析与所述方法数据块对应的方法语句,得到方法类语法树,所述方法类语法树与所述方法数据块的语法功能相对应;以及a first processing unit, configured to parse, for each method data block of the target program package, a method statement corresponding to the method data block using a policy chain to obtain a method class syntax tree, wherein the method class syntax tree corresponds to a syntax function of the method data block; and 第二处理单元,用于序列化所述方法类语法树,得到与所述方法数据块对应的方法对象。The second processing unit is used to serialize the method class syntax tree to obtain a method object corresponding to the method data block. 7.一种电子设备,包括:7. An electronic device comprising: 一个或多个处理器;one or more processors; 存储器,用于存储一个或多个指令,A memory for storing one or more instructions, 其中,当所述一个或多个指令被所述一个或多个处理器执行时,使得所述一个或多个处理器实现权利要求1至5中任一项所述的方法。Wherein, when the one or more instructions are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 5. 8.一种计算机可读存储介质,其上存储有可执行指令,所述可执行指令被处理器执行时使处理器实现权利要求1至5中任一项所述的方法。8. A computer-readable storage medium having executable instructions stored thereon, wherein when the executable instructions are executed by a processor, the processor is enabled to implement the method according to any one of claims 1 to 5. 9.一种计算机程序产品,所述计算机程序产品包括计算机可执行指令,所述计算机可执行指令在被执行时用于实现权利要求1至5中任一项所述的方法。9. A computer program product, comprising computer executable instructions, wherein the computer executable instructions are used to implement the method according to any one of claims 1 to 5 when executed.
CN202110674979.0A 2021-06-17 2021-06-17 Data dictionary generation method, device, electronic device and storage medium Active CN113378517B (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN113378517A CN113378517A (en) 2021-09-10
CN113378517B true CN113378517B (en) 2025-01-14

Family

ID=77577584

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN113378517B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114841707B (en) * 2022-05-12 2025-08-08 中国工商银行股份有限公司 Account verification rule extraction method, device, equipment, storage medium and program product

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110502227A (en) * 2019-08-28 2019-11-26 网易(杭州)网络有限公司 The method and device of code completion, storage medium, electronic equipment

Family Cites Families (6)

* 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
CN104915383B (en) * 2015-05-19 2018-03-02 中国电子科技集团公司第二十八研究所 A kind of method of automatic adaptation object during Universal Database accesses
CN110032363B (en) * 2019-03-21 2023-07-07 深圳点猫科技有限公司 Data structure construction method and system for robot programming
CN110502535B (en) * 2019-08-28 2022-02-22 上海达梦数据库有限公司 Data access method, device, equipment and storage medium
CN112199274B (en) * 2020-09-18 2022-05-03 北京大学 JavaScript dynamic tain 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 (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110502227A (en) * 2019-08-28 2019-11-26 网易(杭州)网络有限公司 The method and device of code completion, storage medium, electronic equipment

Also Published As

Publication number Publication date
CN113378517A (en) 2021-09-10

Similar Documents

Publication Publication Date Title
CN111221521B (en) Log code generation method, device, computer system and readable storage medium
US8601438B2 (en) Data transformation based on a technical design document
US9645799B2 (en) Method and system for model driven development
CN113419740B (en) Program data stream analysis method and device, electronic equipment and readable storage medium
US9245030B2 (en) Analytics based on pipes programming model
CN110019116A (en) Data traceability method, apparatus, data processing equipment and computer storage medium
CN113110947B (en) Program call chain generation method, system, electronic device and medium
CN114356964A (en) Data lineage construction method, device, storage medium and electronic device
CN113032256B (en) Automated testing method, apparatus, computer system, and readable storage medium
CN113138767B (en) Code language conversion method, device, electronic equipment and storage medium
CN113238796A (en) Code reconstruction method, device, equipment and storage medium
CN113378517B (en) Data dictionary generation method, device, electronic device and storage medium
CN113392112B (en) Data analysis method, data analysis device, electronic device and storage medium
CN114169318A (en) Process identification method, apparatus, device, medium and program
CN116382703B (en) Software package generation method, code development method and device, electronic equipment and medium
CN117370177A (en) Project document normalization checking method and device
CN113392311B (en) Field search method, field search device, electronic device and storage medium
CN113377377B (en) Static code analysis method, analysis device, electronic device and readable storage medium
CN116661857A (en) Data extraction method, device, equipment and storage medium
US11392373B1 (en) System and methods for code base transformations
CN113392199B (en) Keyword search method, keyword search device, electronic device and storage medium
CN114281835B (en) Batch version change monitoring method and device
CN120763167A (en) Data product automated management method and device based on data specifications
CN116339755A (en) Database object installation method, device, equipment and medium
CN116243961A (en) Version file processing method and device, electronic equipment and storage 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
GR01 Patent grant
GR01 Patent grant