Data dictionary generation method, device, electronic device and storage medium
By using automated methods to generate data dictionaries, the problem of time-consuming, labor-intensive, and error-prone manual generation of data dictionaries during system maintenance is solved, achieving efficient and accurate data dictionary generation.
Patent Information
- Application Number
- CN202110674979.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-17
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2041-06-17
AI Technical Summary
During system maintenance, due to the large number of operators and the continuous expansion of the system, the field attributes in the data dictionary become inconsistent. Manually generating the data dictionary consumes a lot of manpower and is prone to omissions or errors.
The system uses automated methods to obtain target fields, serializes packages to obtain method objects, parses assignment statements, extracts target assignment statements from assignment statements based on target fields, and generates a data dictionary.
It effectively reduces the manpower cost of generating and maintaining data dictionaries, improves work efficiency, and reduces omissions and errors.
Smart Images

Figure CN113378517B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of computer technology and finance, and more specifically, to a data dictionary generating method, a data dictionary generating device, an electronic device, a readable storage medium, and a computer program product. Background Art
[0002] As the system continues to be built and expanded, the attributes of each field in the data dictionary also increase.
[0003] In the process of implementing the concept of the present disclosure, the inventors discovered that the system is generally maintained by multiple operators, which results in the attributes of the fields in the data dictionary retained in the operation document being inconsistent with the actual attributes of the field in the code. Therefore, when the operator performs field operations, it is necessary to regenerate the data dictionary for the field. Summary of the invention
[0004] In view of this, the present disclosure provides a data dictionary generating method, a data dictionary generating device, an electronic device, a readable storage medium and a computer program product.
[0005] One aspect of the present disclosure provides a data dictionary generation 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, and 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 generating a data dictionary for the target field according to the target assignment statement.
[0006] According to an embodiment of the present disclosure, the above-mentioned at least one line of method statements constitutes at least one method data block; wherein, the above-mentioned serialization target program package to obtain at least one method object includes: for each method data block of the above-mentioned target program package, using a policy chain to parse the method statement corresponding to the above-mentioned method data block to obtain a method class syntax tree; and serializing the above-mentioned method class syntax tree to obtain a method object corresponding to the above-mentioned method data block.
[0007] According to an embodiment of the present disclosure, the above-mentioned policy chain includes multiple method parsers established for each grammatical function respectively; wherein, the above-mentioned use of the policy chain to parse the method statement corresponding to the above-mentioned method data block to obtain the method class syntax tree includes: using the above-mentioned multiple method parsers in sequence to identify the above-mentioned method statement; and using the method parser that successfully identifies the above-mentioned method statement to parse the above-mentioned method statement to generate the above-mentioned method class syntax tree.
[0008] According to an embodiment of the present disclosure, the above-mentioned parsing of the at least one method object to obtain the assignment statement includes: parsing the at least one method object to obtain at least one function linked list; determining the function name of the above-mentioned assignment syntax function in the at least one function linked list; and extracting the statement containing the above-mentioned function name in the at least one function linked list to obtain the above-mentioned assignment statement.
[0009] According to an embodiment of the present disclosure, the above-mentioned assignment statement includes a variable name; wherein, based on the above-mentioned target field, obtaining the target assignment statement from the above-mentioned assignment statement includes: matching the above-mentioned target field with the variable name of each line of the assignment statement respectively to obtain a matching result; and when the above-mentioned matching result is a successful match, determining that the above-mentioned assignment statement is the above-mentioned target assignment statement.
[0010] According to an embodiment of the present disclosure, the above-mentioned target assignment statement includes assignment elements and operators; wherein, the above-mentioned data dictionary of the above-mentioned target field is generated according to the above-mentioned target assignment statement, including: for each line of target assignment statement, the above-mentioned assignment elements and the above-mentioned operators are combined according to preset rules to generate assignment attributes; and all assignment attributes are recorded to generate the data dictionary of the above-mentioned target field.
[0011] Another aspect of the present disclosure provides a data dictionary generation device, including: an acquisition module, a processing module, a parsing module, a selection module and a generation module. The acquisition module is used to acquire a target field; the processing module is used to serialize a target program package to acquire at least one method object, wherein the target program package includes at least one line of method statements, and each line of the method statement is used to implement a grammatical function, wherein the grammatical function includes an assignment grammatical function; the parsing module is used to parse the at least one method object to obtain an assignment statement; the selection module is used to acquire a target assignment statement from the assignment statement based on the target field; and the generation module is used to generate a data dictionary for the target field according to the target assignment statement.
[0012] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the method as described above.
[0013] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.
[0014] Another aspect of the present disclosure provides a computer program product, which includes computer executable instructions, and when the instructions are executed, are used to implement the method as described above.
[0015] According to an embodiment of the present disclosure, by obtaining assignment statements in a serialized target program package, and based on the target field to be processed, filtering out target assignment statements from the assignment statements, and then generating a data dictionary for the target field based on the target assignment statements, the problem of omissions or errors that are prone to occur when obtaining the data dictionary for the target field by manually combing through the code is at least partially overcome, thereby effectively reducing the manpower cost required for the generation and maintenance of the data dictionary and effectively improving work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0017] Figure 1 An exemplary system architecture 100 to which a data dictionary generation method according to an embodiment of the present disclosure can be applied is schematically shown;
[0018] Figure 2 A flowchart of a method for generating a data dictionary according to an embodiment of the present disclosure is schematically shown;
[0019] Figure 3 A schematic diagram schematically shows the workflow of the language parsing system according to an embodiment of the present disclosure;
[0020] Figure 4 A block diagram schematically shows a data dictionary generating device according to an embodiment of the present disclosure;
[0021] Figure 5 A block diagram of an electronic device suitable for implementing a data dictionary generating method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0022] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0023] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0024] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0025] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0026] A data dictionary is a definition and description of data items, data structures, data flows, data storage, processing logic, etc. Its purpose is to provide a detailed description of each element in the data flow diagram.
[0027] Passive data dictionaries are usually used in related technical systems, such as the FOVA system implemented in the EGL language. When the relevant fields of the data dictionary in the system are modified, the content of the data dictionary must be manually updated. However, during the continuous construction and expansion of the system, the attributes of the relevant fields will continue to increase, and the attributes of some fields will even increase from the initial few to hundreds later, so it is necessary to continuously expand and organize the data dictionary of the relevant fields.
[0028] In the related technology, the data dictionary of related fields is often obtained by manually combing the code and summarizing it. However, the source code of the system is usually very large, involving many statements of field operations. At the same time, the data dictionary of the system is generally updated over time, and there may be data dictionary conversion during the update process. These factors lead to the manual method of generating data dictionaries, which consumes a lot of human resources, has low work efficiency, and is prone to omissions or errors due to the complexity of program logic.
[0029] In view of this, the inventor proposes an automated data dictionary analysis method, which can assist designers in gaining an overall understanding of system functions by automatically collecting and displaying program data dictionaries, effectively saving labor costs and improving the efficiency of analyzing and updating data dictionaries.
[0030] Specifically, the embodiments of the present disclosure provide a data dictionary generation method, a data dictionary generation device, an electronic device, a readable storage medium, and a computer program product. The method includes: 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.
[0031] It should be noted that the data dictionary generation method and device provided by the embodiments of the present disclosure can be used in the field of computer technology or the financial field. For example, when a software system using a passive data dictionary is delivered, the method provided by the embodiments of the present disclosure can be used to generate a data dictionary to facilitate the preparation of a software user manual. The data dictionary generation method and device provided by the embodiments of the present disclosure can also be used in other fields besides the computer technology field and the financial field, and the application field of the data dictionary generation method and device provided by the embodiments of the present disclosure is not limited.
[0032] Figure 1 The exemplary system architecture 100 to which the data dictionary generation method according to the embodiment of the present disclosure can be applied is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0033] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a terminal device 101 .
[0034] The terminal device 101 may be any electronic device having a display screen and supporting network communication or data processing functions, including but not limited to a smart phone, a tablet computer, a portable computer, and a desktop computer.
[0035] Various client applications may be installed on the terminal device 101 , including but not limited to communication applications, programming environment applications, etc.
[0036] The data dictionary generation method provided in the embodiment of the present disclosure can generally be executed by the terminal device 101, and accordingly, the data dictionary generation device provided in the embodiment of the present disclosure can generally be set in the terminal device 101. For the program file 102 received or originally stored in the terminal device 101, the terminal device 101 can use the data dictionary generation method or device provided in the embodiment of the present disclosure to extract the data dictionary 103 of the target field from the program file 102, and display the data dictionary 104 on the display screen of the terminal device 101.
[0037] It should be noted that there may be multiple terminal devices, and different terminal devices may exchange information via wired and / or wireless communication links. The data dictionary generation method provided in 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 via a communication link for display.
[0038] The system architecture 100 according to the embodiment of the present disclosure may further include a server 104 .
[0039] The server 104 may be a server or a server group that provides various services. The server 104 and the terminal device 101 may exchange information via wired and / or wireless communication links.
[0040] The data dictionary generation method provided in the embodiment of the present disclosure may also be executed by the server 104, and accordingly, the data dictionary generation apparatus provided in the embodiment of the present disclosure may also be set 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 using the method provided in 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 devices different from the terminal device 101 via the communication link for display.
[0041] In addition, the data dictionary generation method provided by the embodiment of the present disclosure can also be executed by other servers or server groups different from the server 104. Accordingly, the data dictionary generation device provided by the embodiment of the present disclosure can also be set in other servers or server groups different from the server 104, which will not be repeated here.
[0042] It should be understood that there may be multiple servers 104 . Figure 1 There is no limit on the number of terminal devices and servers.
[0043] Figure 2 The flowchart of the data dictionary generation method according to the embodiment of the present disclosure is schematically shown.
[0044] like Figure 2 As shown, the method includes operations S210 to S250.
[0045] In operation S210, a target field is acquired.
[0046] In operation S220, the target package is serialized to obtain at least one method object.
[0047] In operation S230, at least one method object is parsed to obtain an assignment statement.
[0048] In operation S240 , a target assignment statement is acquired from the assignment statements based on the target field.
[0049] In operation S250, a data dictionary of the target field is generated according to the target assignment statement.
[0050] According to an embodiment of the present disclosure, the target field may be any one or more variables in a program.
[0051] According to an embodiment of the present disclosure, the target program package may include all program files of the system that require data dictionary generation.
[0052] According to the embodiment of the present disclosure, by serializing the target program package, program objects, method objects, structure objects and database objects can be obtained. Among them, the program object is obtained by serializing the program definition statement, method definition statement and data structure definition statement of each program file in the target program package; the method object is obtained by serializing the method statement of each method in the program file, and each line of method statement is used to implement a grammatical function, wherein the grammatical function includes the assignment grammatical 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 the structured query language statement in the program file.
[0053] According to an embodiment of the present disclosure, the target field may appear in statements that implement different grammatical functions. For example, the target field may be used as a variable or an element in an expression in an assignment statement, or as a variable in a conditional statement. In the process of generating a data dictionary for the target field, only the statements in which the target field appears as a variable need to be obtained.
[0054] According to an embodiment of the present disclosure, a serialized object such as a method object may be a data file in the form of binary data. By parsing the method object, the method object may be displayed to facilitate subsequent operations.
[0055] According to an embodiment of the present disclosure, the assignment statement may be a statement with an assignment syntax function identifier. For example, in the EGL language, in the presentation file obtained by parsing the method object, the assignment syntax function identifier may be CodeEvaluation.
[0056] According to an embodiment of the present disclosure, the name of the target field may be used as a keyword to perform keyword search in the acquired assignment statements to obtain a target assignment statement containing the target keyword.
[0057] According to an embodiment of the present disclosure, the attributes of the target field can be obtained according to the target assignment statement, and the data dictionary of the target field can be obtained by summarizing the attributes.
[0058] According to an embodiment of the present disclosure, by obtaining assignment statements in a serialized target program package, and based on the target field to be processed, filtering out target assignment statements from the assignment statements, and then generating a data dictionary for the target field based on the target assignment statements, the problem of omissions or errors that are prone to occur when obtaining the data dictionary for the target field by manually combing through the code is at least partially overcome, thereby effectively reducing the manpower cost required for the generation and maintenance of the data dictionary and effectively improving work efficiency.
[0059] Reference below Figure 3 , combined with specific embodiments Figure 2 The method shown is further explained.
[0060] Figure 3 The following is a schematic diagram schematically showing the workflow of the language parsing system according to an embodiment of the present disclosure.
[0061] like Figure 3 As shown, the system uses a policy chain 320 to identify and parse a target package 310 to generate a syntax tree 330 , and then serializes the syntax tree 330 to obtain a corresponding serialized object 340 .
[0062] According to an embodiment of the present disclosure, the policy chain 320 may include multiple method parsers 321 established for each grammatical function. For example, the policy chain 320 may include method parsers 311 such as Function-define, Evaluation, Expression, Flow-control, Function-call, and Program-call established for method definition statements, assignment statements, expression statements, flow control statements, method call statements, and program call statements in the target package.
[0063] According to an embodiment of the present disclosure, the syntax tree 330 includes a method-type 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.
[0064] According to an embodiment of the present disclosure, the steps of using the policy chain 320 to identify and parse the target package include: using multiple method parsers 321 in sequence to identify each method statement of the target package, and when the identification is successful, using the method parser 321 to parse the method statement, thereby generating a method class syntax tree 331 of the method statement.
[0065] According to an embodiment of the present disclosure, the serialization object 340 may include a method object 341 .
[0066] According to an embodiment of the present disclosure, all 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.
[0067] According to the embodiments of the present disclosure, for each method object 341, by parsing the method object 341, a function linked list can be obtained, and the function linked list includes all the information of the method object 341.
[0068] According to an embodiment of the present disclosure, the function linked list may include the name, setting parameters and return value of the corresponding method data block. In some embodiments, the setting parameters and return value of the method data block may be empty, and only the name of the method data block is set. In addition, the function linked list also includes information on all function statements contained in the method data block.
[0069] According to an embodiment of the present disclosure, there are certain differences in the naming of the same grammatical function in the source code and in the function list. For example, for the assignment grammatical function, its name in the source code is Evaluation, and its name in the function list is CodeEvaluation.
[0070] According to an embodiment of the present disclosure, based on the name of the assignment syntax function in the function chain list, the statement containing the name can be extracted from the function chain list to obtain the assignment statement.
[0071] According to an embodiment of the present disclosure, each assignment statement contains a variable name value, an assignment element alAssignment, and an operator alOperator. By matching the name of the target field with the variable name in all assignment statements, statements with the same variable name and target field name are extracted from the assignment statements, thereby obtaining the target assignment statement. For example, the target field "A" exists in the value column of one of the assignment statements, and in the alAssignment column of other assignment statements. The target assignment statement for the target field "A" obtained by matching is only the assignment statement where "A" exists in the value column.
[0072] According to an embodiment of the present disclosure, the assignment elements and operators can be combined according to preset rules to restore them to expressions. For example, the assignment elements and the elements in the operator can be interlaced and spliced with "," as a separator to restore them to expressions. For example, if the assignment elements are "1" and "A" respectively, and the operator is "+", the restored expression is 1+A; further, the line of statements can also be restored to the assignment statement in the source code: D=1+A.
[0073] According to the embodiments of the present 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.
[0074] In some embodiments, the assignment statement may also include relevant comment information. When generating a data dictionary, for example, a comment symbol such as “ / / ” may be added to the comment information and added to the relevant assignment attributes.
[0075] Figure 4 The block diagram of a data dictionary generating device according to an embodiment of the present disclosure is schematically shown.
[0076] like Figure 4 As shown, the data dictionary generating device includes an acquisition module 410 , a processing module 420 , a parsing module 430 , a selection module 440 and a generating module 450 .
[0077] The acquisition module 410 is used to acquire the target field.
[0078] The processing module 420 is used to serialize the 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.
[0079] The parsing module 430 is used to parse at least one method object to obtain an assignment statement.
[0080] The selection module 440 is used to obtain a target assignment statement from the assignment statements based on the target field.
[0081] The generating module 450 is used to generate a data dictionary of the target field according to the target assignment statement.
[0082] According to an embodiment of the present disclosure, by obtaining assignment statements in a serialized target program package, and based on the target field to be processed, filtering out target assignment statements from the assignment statements, and then generating a data dictionary for the target field based on the target assignment statements, the problem of omissions or errors that are prone to occur when obtaining the data dictionary for the target field by manually combing through the code is at least partially overcome, thereby effectively reducing the manpower cost required for the generation and maintenance of the data dictionary and effectively improving work efficiency.
[0083] 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.
[0084] The first processing unit is used to parse the method statement corresponding to each method data block of the target program package using the policy chain to obtain a method class syntax tree.
[0085] The second processing unit is used to serialize the method class syntax tree to obtain a method object corresponding to the method data block.
[0086] According to an embodiment of the present disclosure, the policy chain includes a plurality of method parsers established for each grammatical function. The first processing unit includes a first processing sub-unit and a second processing sub-unit.
[0087] The first processing subunit is used to use multiple method parsers in sequence to identify method statements.
[0088] The second processing subunit is used to parse the method statement using the method parser that successfully identifies the method statement to generate a method class syntax tree.
[0089] 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.
[0090] The first parsing unit is used to parse at least one method object to obtain at least one function linked list.
[0091] The second parsing unit is used to determine the function name of the assignment syntax function in at least one function chain list.
[0092] The third parsing unit is used to extract a statement containing a function name from at least one function linked list to obtain an assignment statement.
[0093] 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.
[0094] The first selection unit is used to match the target field with the variable name of each line of assignment statement to obtain a matching result.
[0095] The second selection unit is used to determine that the assignment statement is a target assignment statement when the matching result is a successful match.
[0096] According to an embodiment of the present disclosure, the target assignment statement includes an assignment element and an operator. The generation module 450 includes a first generation unit and a second generation unit.
[0097] The first generating unit is used to combine the assignment elements and operators according to preset rules for each line of target assignment statement to generate assignment attributes.
[0098] The second generation unit is used to record all the assigned attributes to generate a data dictionary of the target field.
[0099] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0100] For example, any multiple of the acquisition module 410, the processing module 420, the parsing module 430, the selection module 440 and the generation module 450 can be combined in one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more modules / units / sub-units in these modules / units / sub-units can be combined with at least part of the functions 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 acquisition module 410, the processing module 420, the parsing module 430, the selection module 440 and the generation module 450 can be at least partially implemented 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 can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware and firmware or by a suitable combination of any of them. Alternatively, 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, and when the computer program module is executed, a corresponding function may be performed.
[0101] It should be noted that the data dictionary generating device part in the embodiment of the present disclosure corresponds to the data dictionary generating method part in the embodiment of the present disclosure. The description of the data dictionary generating device part specifically refers to the data dictionary generating method part, which will not be repeated here.
[0102] Figure 5 A block diagram of an electronic device suitable for implementing a data dictionary generating method according to an embodiment of the present disclosure is schematically shown. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0103] like Figure 5As shown, the computer electronic device 500 according to the embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 to the random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.
[0104] In RAM 503, various programs and data required for the operation of electronic device 500 are stored. Processor 501, ROM 502 and RAM 503 are connected to each other via bus 504. Processor 501 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 502 and / or RAM 503. It should be noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0105] According to an embodiment of the present disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to the bus 504. The electronic device 500 may further include one or more of the following components connected to the I / O interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. A 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, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage portion 508 as needed.
[0106] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0107] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0108] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0109] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 502 and / or the RAM 503 described above and / or one or more memories other than the ROM 502 and the RAM 503 .
[0110] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains a program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the data dictionary generation method provided by the embodiment of the present disclosure.
[0111] When the computer program is executed by the processor 501, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0112] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 509, and / or installed from the removable medium 511. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0113] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0114] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments and / or claims of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0115] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes 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 various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
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. The method according to claim 1, wherein: The strategy chain includes 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. The method according to claim 1, wherein: The parsing of 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; 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. 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. The method according to claim 1, wherein: The target assignment statement includes 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. 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. An electronic device comprising: one or more processors; a memory for storing one or more instructions, 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. 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. 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.
Citation Information
Patent Citations
Code completion method and device, storage medium and electronic device
CN110502227A
Automated business rule harvesting with abstract syntax tree transformation
US20140282373A1