Field search method, field search device, electronic device and storage medium

By serializing the object to obtain the associated field name of the target field and generate a regular expression search, the problem that the modification of the hanging field causes the associated field to affect the complexity of the sorting field, and improves the search efficiency.

CN113392311BActive Publication Date: 2024-12-20INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110674723.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-17
Publication Date
2024-12-20
Estimated Expiration
2041-06-17

AI Technical Summary

Technical Problem

During the program editing process, the modification of the hanging field will cause the associated field to be modified, resulting in additional search for related fields when sorting out the impact, which increases the workload and complexity.

Method used

By serializing the target package, obtain the names of all associated fields associated with the target field, and search for these names as keywords, generating regular expressions to search in the target package.

Benefits of technology

It reduces the workload of sorting out the relationship between the lower hanging, simplifies the search process, improves the search efficiency, and avoids separate searches of related fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113392311B_ABST
    Figure CN113392311B_ABST
Patent Text Reader

Abstract

The present disclosure provides a field search method, a field search device, an electronic device and a storage medium, which can be applied to the fields of computer technology and finance. The field search method includes: obtaining a search scope, wherein the search scope includes a target program package, a target program file and a target field; serializing the target program package to obtain at least one target structure object; according to the name of the target field, obtaining the names of all associated fields associated with the target field from the at least one target structure object; and searching using the name of the target field and the names of all associated fields as keywords.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of computer technology and finance, and more specifically, to a field search method, a field search device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] During program editing, if a field is modified, it is usually necessary to sort out the impact of the modification of the field on the program.

[0003] In the process of implementing the concept of the present disclosure, the inventors found that the modification of the subordinate field will cause the associated field of the subordinate field to be modified. When sorting out the impact of the subordinate field on the program, it is also necessary to search its associated field. Summary of the invention

[0004] In view of this, the present disclosure provides a field search method, a field search device, an electronic device, a computer-readable storage medium, and a computer program product.

[0005] One aspect of the present disclosure provides a field search method, comprising:

[0006] Obtaining a search scope, wherein the search scope includes a target program package, a target program file, and a target field;

[0007] Serialize the target package to obtain at least one target structure object;

[0008] According to the name of the target field, obtaining the names of all associated fields associated with the target field from the at least one target structure object; and

[0009] Search using the name of the target field and the names of all the associated fields as keywords.

[0010] According to an embodiment of the present disclosure, each program file of the target program package includes multiple lines of definition statements and at least one data structure; wherein the multiple lines of definition statements include at least one line of program definition statements and at least one line of structure definition statements, and the data structures correspond to the structure definition statements one by one; wherein each data structure includes at least one line of data definition statements;

[0011] The step of serializing the target program package to obtain at least one target structure object includes:

[0012] For each program file, process the above multi-line definition statements to obtain the program object;

[0013] For each data structure, processing the at least one line of data definition statement to obtain a structure object;

[0014] According to the name of the target program file, determining the target program object from the program objects;

[0015] Parsing the target program object to obtain a structure linked list, wherein the structure linked list includes a name of at least one data structure; and

[0016] According to the name of the at least one data structure, the at least one target structure object is determined from the structure objects.

[0017] According to an embodiment of the present disclosure, the above-mentioned processing of the above-mentioned definition statement to obtain the program object includes:

[0018] Parsing the above multi-line definition statements using the policy chain to obtain multiple program class syntax trees; and

[0019] The multiple program class syntax trees are serialized to obtain the program objects.

[0020] According to an embodiment of the present disclosure, the above-mentioned policy chain includes a plurality of program parsers established for program definition statements and method definition statements respectively;

[0021] The above-mentioned use strategy chain parses the above-mentioned multiple lines of definition statements to obtain multiple program class syntax trees, including:

[0022] For each line of definition statement, sequentially use the multiple program parsers to identify the definition statement; and

[0023] The program parser that successfully identifies the definition statement is used to parse the definition statement to generate a program class syntax tree.

[0024] According to an embodiment of the present disclosure, the processing of the at least one line of data definition statement to obtain a structure object includes:

[0025] Parsing the at least one line of data definition statement using the policy chain to obtain at least one structure-class syntax tree; and

[0026] Serialize the at least one structure class syntax tree to obtain the structure object.

[0027] According to an embodiment of the present disclosure, the above-mentioned policy chain includes a plurality of data parsers established for each data type respectively;

[0028] The use of the policy chain to parse the at least one line of data definition statement to obtain at least one structure-class syntax tree includes:

[0029] For each line of data definition statement, sequentially use the multiple data parsers to identify the data definition statement; and

[0030] The data definition statement is parsed using a data parser that successfully identifies the data definition statement to generate a structured class syntax tree.

[0031] According to an embodiment of the present disclosure, the above-mentioned associated field includes an upper-level field and a lower-level field;

[0032] The step of obtaining the names of all associated fields associated with the target field from at least one target structure object according to the name of the target field includes:

[0033] According to the name of the target field, obtaining field information of the target field from the at least one target structure object;

[0034] In the case where the field information of the target field includes the identifier of the parent field, the field information of the parent field is obtained according to the identifier of the parent field, and the names of the associated fields at the parent level are obtained step by step according to the field information of the parent field; and

[0035] When the field information of the target field includes the identifier of the subordinate field, the field information of the subordinate field is obtained according to the identifier of the subordinate field, and the names of the associated fields at the subordinate level are obtained step by step according to the field information of the subordinate field.

[0036] According to an embodiment of the present disclosure, the above-mentioned searching using the name of the above-mentioned target field and the names of the above-mentioned all associated fields as keywords includes:

[0037] Generate a regular expression based on the name of the target field and the names of all the associated fields; and

[0038] Search the target package based on the regular expression.

[0039] Another aspect of the present disclosure provides a field search device, comprising:

[0040] A first acquisition module, used to acquire a search scope, wherein the search scope includes a target program package, a target program file, and a target field;

[0041] A serialization module, used for serializing the target program package to obtain at least one target structure object;

[0042] a second acquisition module, configured to acquire, according to the name of the target field, names of all associated fields associated with the target field from the at least one target structure object; and

[0043] The determination module is used to search by using the name of the target field and the names of all the associated fields as keywords.

[0044] 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.

[0045] 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.

[0046] 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.

[0047] According to the embodiments of the present disclosure, because a technical means is adopted to obtain the names of all fields associated with the target field in the serialized object and then use these field names as keywords for searching, the technical problem that the modification of the subordinate fields will cause the associated fields of the subordinate fields to be modified, and when sorting out the impact of the subordinate fields on the program, it is also necessary to search its associated fields, thereby achieving the technical effect of reducing the workload of sorting out the subordinate relationships, simplifying the search process, and improving the search efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] 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:

[0049] Figure 1 An exemplary system architecture to which field search can be applied according to an embodiment of the present disclosure is schematically shown;

[0050] Figure 2 A flowchart of a field search method according to an embodiment of the present disclosure is schematically shown;

[0051] Figure 3 A schematic diagram of a scenario for obtaining a program object according to an embodiment of the present disclosure is schematically shown;

[0052] Figure 4 A schematic diagram schematically shows a scenario of associating fields according to an embodiment of the present disclosure;

[0053] Figure 5 A block diagram schematically shows a field search device according to an embodiment of the present disclosure; and

[0054] Figure 6 A block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0055] 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.

[0056] 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.

[0057] 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.

[0058] 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.).

[0059] When developers modify the code, if they modify the target field, the corresponding parent and child fields will also be modified in conjunction. For example, if the target field is modified, it is necessary not only to sort out the impact of the target field modification on the system, but also to search for the usage of the parent and child fields of the target field in the system.

[0060] When searching for keywords of a target field, there are two search methods. One is that the developer independently parses the target field's subordinate structure, and then uses regular expressions to search both the target field's parent and child fields. The other is that the developer searches the target field and its parent and child fields at least three times.

[0061] The data structure of programs written in Enterprise Generation Language (EGL) is often complex, with many levels of fields. Each additional level requires an additional search. In the end, all the results need to be summarized. At the same time, each search is a search of the entire code, so the overall time will also increase rapidly with the increase in the complexity of the data structure. If the search is completed through regular expressions, the EGL data structure must also be sorted out in advance, which requires developers to clarify the hierarchical relationship of the fields.

[0062] In view of this, the embodiments of the present disclosure provide a field search method, a downstream field search device, an electronic device, a computer-readable storage medium, and a computer program product. The method includes a process of obtaining a search range, a process of serializing the target program package, a process of obtaining the names of all associated fields associated with the target field, and a process of searching using the name of the target field and the names of all associated fields as keywords. The field search method of the embodiments of the present disclosure does not require the user to pay attention to the downstream structure of the target field, that is, the impact of changes in the target field on other fields can be known.

[0063] It should be noted that the field search method and device provided by the present disclosure can be used in the financial field, such as banks, or can be used in any field other than the financial field, such as hospitals. Therefore, the application field of the field search method and device provided by the present disclosure is not limited.

[0064] Figure 1 The exemplary system architecture 100 to which the field search 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.

[0065] like Figure 1As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0066] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software, etc. (only as examples).

[0067] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0068] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0069] It should be noted that the field search method provided in the embodiment of the present disclosure can generally be executed by the terminal device 101, 102, or 103, or can also be executed by other terminal devices different from the terminal device 101, 102, or 103. Accordingly, the field search system provided in the embodiment of the present disclosure can also be set in the terminal device 101, 102, or 103, or in other terminal devices different from the terminal device 101, 102, or 103. Alternatively, the field search method provided in the embodiment of the present disclosure can also be executed by the server 105. Accordingly, the field search system provided in the embodiment of the present disclosure can be set in the server 105. The field search method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal device 101, 102, 103 and / or the server 105. Accordingly, the field search system provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal device 101, 102, 103 and / or the server 105.

[0070] It should be understood that Figure 1The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0071] Figure 2 The flowchart of the field search method according to the embodiment of the present disclosure is schematically shown.

[0072] like Figure 2 As shown, the field search method may include operations S201 to S204.

[0073] In operation S201 , a search scope is acquired, wherein the search scope includes a target program package, a target program file, and a target field.

[0074] In operation S202, the target program package is serialized to obtain at least one target structure object.

[0075] In operation S203, according to the name of the target field, names of all associated fields associated with the target field are acquired from at least one target structure object.

[0076] In operation S204 , the name of the target field and the names of all associated fields are used as keywords for searching.

[0077] According to an embodiment of the present disclosure, the structure object may be a Record object, wherein the target structure object stores specific information of each field.

[0078] According to an embodiment of the present disclosure, the target package is serialized to obtain a target structure object, and its associated fields are obtained from the target structure object according to the name of the target field in the search scope. The name of the target field and the name of the associated field are used as keywords for searching.

[0079] According to the embodiments of the present disclosure, because a technical means is adopted to obtain the names of all fields associated with the target field in the serialized object and then use these field names as keywords for searching, the technical problem that the modification of the subordinate fields will cause the associated fields of the subordinate fields to be modified, and when sorting out the impact of the subordinate fields on the program, it is also necessary to search its associated fields, thereby achieving the technical effect of reducing the workload of sorting out the subordinate relationships, simplifying the search process, and improving the search efficiency.

[0080] Figure 3 A schematic diagram of a scenario for obtaining a program object according to an embodiment of the present disclosure is schematically shown.

[0081] According to an embodiment of the present disclosure, each program file of the target program package includes multiple lines of definition statements and at least one data structure; wherein the multiple lines of definition statements include at least one line of program definition statements and at least one line of structure definition statements, and the data structures and structure definition statements correspond one to one; wherein each data structure includes at least one line of data definition statements.

[0082] Wherein, the target package is serialized to obtain at least one target structure object, such as Figure 3 As shown, the following operations may be included.

[0083] For each program file, multiple lines of definition statements are processed to obtain a program object; for each data structure, at least one line of data definition statement is processed to obtain a structure object; according to the name of the target program file, a target program object is determined from the program object; the target program object is parsed to obtain a structure linked list, wherein the structure linked list includes the name of at least one data structure; and according to the name of at least one data structure, at least one target structure object is determined from the structure object.

[0084] According to an embodiment of the present disclosure, each program file in a target program package is processed to obtain a program object, which may be a Program object. Each data structure is processed to obtain a structure object, which may include a Record structure and a Dataitem structure. According to the name of the target program file in the search range, the target program object is determined from the program object. The target program object is parsed to obtain a structure linked list. Each node of the structure linked list stores a data structure, which may include a Dataitem structure, and the data structure is used to record information of a specific field. According to the name of the data structure, the target structure object is determined from the structure object.

[0085] According to an embodiment of the present disclosure, a definition statement is processed to obtain a program object, such as Figure 3 As shown, the following operations may be included.

[0086] The strategy chain is used to parse multiple lines of definition statements to obtain multiple program class syntax trees; and the multiple program class syntax trees are serialized to obtain program objects.

[0087] According to an embodiment of the present disclosure, a syntax tree may include a Program syntax tree, a Record syntax tree, a Dataitem syntax tree, etc., wherein a program-type syntax tree may be a Program syntax.

[0088] According to an embodiment of the present disclosure, for multiple lines of definition statements in a program file, a policy chain is used to parse and obtain multiple program-like syntax trees. Multiple program-like syntax trees are serialized to obtain program objects.

[0089] According to an embodiment of the present disclosure, the policy chain includes a plurality of program parsers established for program definition statements and method definition statements respectively;

[0090] The following operations may be included in the process of using the policy chain to parse multiple lines of definition statements and obtain multiple program class syntax trees.

[0091] For each line of definition statement, a plurality of program parsers are used in sequence to identify the definition statement; and the definition statement is parsed using the program parser that successfully identifies the definition statement to generate a program class syntax tree.

[0092] According to an embodiment of the present disclosure, a policy chain may include a program parser and a method parser, wherein the program parser may include a Program-define parser, a Record-define parser, and a Dataitem-define parser.

[0093] According to an embodiment of the present disclosure, each line of definition statement is parsed in turn using multiple program parsers to generate a corresponding program class syntax tree.

[0094] According to an embodiment of the present disclosure, when multiple program parsers cannot recognize a definition statement, the definition statement is serialized into a persistent object and saved using a specific class.

[0095] According to an embodiment of the present disclosure, processing at least one line of data definition statement to obtain a structure object may include the following operations.

[0096] At least one line of data definition statement is parsed using a policy chain to obtain at least one structure class syntax tree; and at least one structure class syntax tree is serialized to obtain a structure object.

[0097] According to an embodiment of the present disclosure, a structure-type syntax tree may include a Record syntax and a Dataitem syntax.

[0098] According to an embodiment of the present disclosure, for multiple lines of data definition statements in a program file, multiple structure-type syntax trees can be obtained by using a policy chain to parse the statements, and structure objects can be obtained by serializing the multiple structure-type syntax trees.

[0099] According to an embodiment of the present disclosure, the policy chain includes multiple data parsers established for each data type.

[0100] The process of parsing at least one line of data definition statement using a policy chain to obtain at least one structure-class syntax tree may include the following operations.

[0101] For each line of data definition statements, a plurality of data parsers are used in sequence to identify the data definition statements; and the data definition statements are parsed using the data parser that successfully identifies the data definition statements to generate a structured syntax tree.

[0102] According to an embodiment of the present disclosure, the policy chain may further include a data parser, and the data parser may include a Record-define parser and a DateItem-define parser.

[0103] According to an embodiment of the present disclosure, each line of data definition statements is parsed in turn using multiple data parsers to generate a corresponding structure-like syntax tree.

[0104] According to an embodiment of the present disclosure, when multiple data parsers cannot recognize a definition statement, the data definition statement is serialized into a persistent object and saved using a specific class.

[0105] Figure 4 A schematic diagram of a scenario of associated fields according to an embodiment of the present disclosure is schematically shown.

[0106] According to the embodiments of the present disclosure, Figure 4 As shown, the associated fields include upper-level fields and lower-level fields.

[0107] Wherein, according to the name of the target field, obtaining the names of all associated fields associated with the target field from at least one target structure object may include the following operations.

[0108] According to the name of the target field, the field information of the target field is obtained from at least one target structure object; when the field information of the target field includes the identifier of the upper-level field, the field information of the upper-level field is obtained according to the identifier of the upper-level field, and the names of the respective associated fields at the upper level are obtained step by step according to the field information of the upper-level field; and when the field information of the target field includes the identifier of the lower-level field, the field information of the lower-level field is obtained according to the identifier of the lower-level field, and the names of the respective associated fields at the lower level are obtained step by step according to the field information of the lower-level field.

[0109] According to the embodiments of the present disclosure, Figure 4 As shown, a package whose target package is written for EGL code is used as an example.

[0110] According to an embodiment of the present disclosure, Figure 4In the Record_Name, the name of the data structure is defined. Fields A1, A2, B1, B2, C1, C2, C3, C4, etc. are fields defined in the data structure. Among them, fields C1 and C2 are subordinate fields of field B1, fields C3 and C4 are subordinate fields of field B2, and field A1 is the superior field of fields B1 and B2.

[0111] According to an embodiment of the present disclosure, for example, when field B1 is a target field, the names of the associated fields of the target field at the upper level are obtained, such as Figure 4 At the same time, get the names of the associated fields under the target field, such as Figure 4 The C1 and C2 fields in .

[0112] According to the embodiments of the present disclosure, when the data of the target field is modified, its upper and lower fields will be modified synchronously. For example, when the B1 field is modified, the A1 field will also be automatically modified. If the B1 field is modified to the first 5 digits of the code, the C1 field will also be automatically modified. If the B1 field is modified to the last 5 digits of the code, the C2 field will also be automatically modified. Therefore, when performing a keyword search, it is necessary to search the upper and lower fields of the target field synchronously.

[0113] According to an embodiment of the present disclosure, an example is given in which a target program package is a program package written in an enterprise generation language.

[0114] According to an embodiment of the present disclosure, if the target field is b1, for example, field information with IDs such as "a1_b1", "a1_b1_c1", and "a1_b1_c2" can be obtained, from which it can be determined that the name of the upper-level field is "a1", and the names of the lower-level fields are "c1" and "c2", so the generated regular expression is "\b(a1|b1|c1|c2)\b". Search is performed in the target package based on the regular expression.

[0115] According to another embodiment of the present disclosure, for example, the target field is b1, the upper-level field of b1 is a1, the lower-level fields of b1 are c1 and c2, and the lower-level fields of c1 are d1 and d2, then field information such as IDs "a1_b1", "a1_b1_c1", "a1_b1_c2", "a1_b1_c1_d1" and "a1_b1_c1_d2" can be obtained from the corresponding structure linked list, thereby generating a regular expression of "\b(a1|b1|c1|c2|d1|d2)\b", and searching in the target program package based on the regular expression. It should be noted that the upper-level field can also have the upper-level field of the upper-level field, and the lower-level field can also have its lower-level field.

[0116] According to an embodiment of the present disclosure, searching using the name of the target field and the names of all associated fields as keywords may include the following operations.

[0117] Generate a regular expression based on the name of a target field and the names of all associated fields; and search in a target package based on the regular expression.

[0118] According to an embodiment of the present disclosure, a regular expression is a sequence of characters that defines a search pattern. A regular expression is used for a "find" or "find and replace" operation on a string through a string search algorithm. For example, in the regular expression a., a is a literal character that matches only 'a', and '.' is a metacharacter that matches every character except the newline. Therefore, the characters matched by the regular expression can be 'a', 'ax', or 'a0'. Metacharacters and literal characters can be used together to identify target packages.

[0119] According to an embodiment of the present disclosure, the name of the target field, the name of the corresponding upper-level field, and the name of the lower-level field are summarized to generate a regular expression. A search is performed in the target program package according to the regular expression.

[0120] Figure 5 The block diagram of a field search device according to an embodiment of the present disclosure is schematically shown.

[0121] like Figure 5 As shown, the field search device 500 includes a first acquisition module 510 , a serialization module 520 , a second acquisition module 530 and a determination module 540 .

[0122] The first acquisition module 510 is used to acquire a search scope, wherein the search scope includes a target program package, a target program file, and a target field.

[0123] The serialization module 520 is used to serialize the target program package to obtain at least one target structure object.

[0124] The second acquisition module 530 is used to acquire the names of all associated fields associated with the target field from at least one target structure object according to the name of the target field.

[0125] The determination module 540 is used to search using the name of the target field and the names of all associated fields as keywords.

[0126] According to the embodiments of the present disclosure, because a technical means is adopted of obtaining the names of all fields associated with the target field in the serialized object and then searching with these field names as keywords, the technical problem that the modification of the subordinate fields will cause the associated fields of the subordinate fields to be modified, and when sorting out the impact of the subordinate fields on the program, it is also necessary to search for their associated fields, thereby achieving the technical effect of reducing the workload of sorting out the subordinate relationships, simplifying the search process, and improving the search efficiency.

[0127] According to an embodiment of the present disclosure, the serialization module 520 may include a first processing submodule, a second processing submodule, a first determination submodule, a parsing submodule, and a second determination submodule.

[0128] The first processing submodule is used for processing multiple lines of definition statements for each program file to obtain a program object.

[0129] The second processing submodule is used to process at least one line of data definition statement for each data structure to obtain a structure object.

[0130] The first determining submodule is used to determine the target program object from the program objects according to the name of the target program file.

[0131] The parsing submodule is used to parse the target program object to obtain a structure linked list, wherein the structure linked list includes the name of at least one data structure.

[0132] The second determining submodule is used to determine at least one target structure object from the structure objects according to the name of at least one data structure.

[0133] According to an embodiment of the present disclosure, the first processing submodule may include a first parsing unit and a first serialization unit.

[0134] The first parsing unit is used to parse multiple lines of definition statements using the policy chain to obtain multiple program class syntax trees.

[0135] The first serialization unit is used to serialize multiple program class syntax trees to obtain program objects.

[0136] According to an embodiment of the present disclosure, the first parsing unit may include a first identifying subunit and a first parsing subunit.

[0137] The first recognition subunit is used to use multiple program parsers to recognize definition statements in sequence for each line of definition statements.

[0138] The first parsing subunit is used to parse the definition statement using the program parser that successfully identifies the definition statement to generate a program class syntax tree.

[0139] According to an embodiment of the present disclosure, the second processing submodule may include a second parsing unit and a second serialization unit.

[0140] The second parsing unit is used to parse at least one line of data definition statement using the policy chain to obtain at least one structure-type syntax tree.

[0141] The second serialization unit is used to serialize at least one structure class syntax tree to obtain a structure object.

[0142] According to an embodiment of the present disclosure, the second parsing unit may include a second identifying subunit and a second parsing subunit.

[0143] The second identification subunit is used to use multiple data parsers to identify the data definition statements in sequence for each line of data definition statements.

[0144] The second parsing subunit is used to parse the data definition statement using the data parser that successfully identifies the data definition statement to generate a structured syntax tree.

[0145] According to an embodiment of the present disclosure, the second acquisition module 530 may include a first acquisition submodule, a second acquisition submodule and a third acquisition submodule.

[0146] The first acquisition submodule is used to acquire field information of a target field from at least one target structure object according to the name of the target field.

[0147] The second acquisition submodule is used to obtain the field information of the upper-level field according to the identifier of the upper-level field when the field information of the target field includes the identifier of the upper-level field, and to obtain the names of each associated field at the upper level step by step according to the field information of the upper-level field.

[0148] The third acquisition submodule is used to obtain the field information of the subordinate field according to the identifier of the subordinate field when the field information of the target field includes the identifier of the subordinate field, and to obtain the names of each associated field at the subordinate level step by step according to the field information of the subordinate field.

[0149] According to an embodiment of the present disclosure, the determination module 540 may include a generation submodule and a search submodule.

[0150] Generate submodule for generating regular expressions based on the name of the target field and the names of all associated fields.

[0151] Search submodule for searching within target packages based on regular expressions.

[0152] 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.

[0153] For example, any multiple of the first acquisition module 510, the serialization module 520, the second acquisition module 530, and the determination module 540 can be combined in one module / submodule / unit / subunit for implementation, or any one of the modules / submodules / units / subunits can be split into multiple modules / submodules / units / subunits. Alternatively, at least part of the functions of one or more of these modules / submodules / units / subunits can be combined with at least part of the functions of other modules / submodules / units / subunits and implemented in one module / submodule / unit / subunit. According to an embodiment of the present disclosure, at least one of the first acquisition module 510, the serialization module 520, the second acquisition module 530 and the determination module 540 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 an appropriate combination of any of them. Alternatively, at least one of the first acquisition module 510, the serialization module 520, the second acquisition module 530 and the determination module 540 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be performed.

[0154] It should be noted that the field search system part in the embodiment of the present disclosure corresponds to the field search method part in the embodiment of the present disclosure. The description of the field search system part specifically refers to the field search method part, which will not be repeated here.

[0155] Figure 6 A block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present disclosure is schematically shown. Figure 6 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.

[0156] like Figure 6 As shown, the computer electronic device 600 according to the embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 to the random access memory (RAM) 603. The processor 601 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 601 may also include an onboard memory for caching purposes. The processor 601 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.

[0157] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 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.

[0158] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.

[0159] 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 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, 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.

[0160] 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.

[0161] 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.

[0162] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 602 and / or the RAM 603 described above and / or one or more memories other than the ROM 602 and the RAM 603 .

[0163] 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 field search method provided by the embodiment of the present disclosure.

[0164] When the computer program is executed by the processor 601, 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.

[0165] 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 609, and / or installed from a removable medium 611. 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.

[0166] 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 (e.g., using an Internet service provider to connect through the Internet).

[0167] 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.

[0168] 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 field search method, comprising: Acquire a search scope, wherein the search scope includes a target program package, a target program file, and a target field; serializing the target program package to obtain at least one target structure object; According to the name of the target field, acquiring the names of all associated fields associated with the target field from the at least one target structure object, wherein the associated fields include upper-level fields and lower-level fields; and The name of the target field and the names of all associated fields are used as keywords for searching.

2. The method according to claim 1, wherein: Each program file of the target program package includes a plurality of lines of definition statements and at least one data structure; wherein the plurality of lines of definition statements include at least one line of program definition statement and at least one line of structure definition statement, and the data structure and the structure definition statement correspond one to one; wherein each data structure includes at least one line of data definition statement; The step of serializing the target program package to obtain at least one target structure object includes: For each program file, processing the multiple lines of definition statements to obtain a program object; For each data structure, processing the at least one line of data definition statement to obtain a structure object; Determining a target program object from program objects according to the name of the target program file; Parsing the target program object to obtain a structure linked list, wherein the structure linked list includes a name of at least one data structure; and According to the name of the at least one data structure, the at least one target structure object is determined from the structure objects.

3. The method according to claim 2, wherein: The processing of the multiple lines of definition statements to obtain a program object includes: Parsing the multiple lines of definition statements using a policy chain to obtain multiple program class syntax trees; and The multiple program class syntax trees are serialized to obtain the program object.

4. The method according to claim 3, wherein: The policy chain includes a plurality of program parsers established for program definition statements and method definition statements respectively; The use of the policy chain to parse the multiple lines of definition statements to obtain multiple program class syntax trees includes: For each line of definition statement, using the plurality of program parsers in sequence to identify the definition statement; and The definition statement is parsed using a program parser that successfully identifies the definition statement to generate a program class syntax tree.

5. The method according to claim 2, wherein: The processing of the at least one line of data definition statement to obtain a structure object includes: Parsing the at least one line of data definition statement using the policy chain to obtain at least one structure-class syntax tree; and The at least one structure class syntax tree is serialized to obtain the structure object.

6. The method according to claim 5, wherein: The strategy chain includes a plurality of data parsers established for each data type; The step of using the policy chain to parse the at least one line of data definition statement to obtain at least one structure-type syntax tree includes: For each line of data definition statements, using the multiple data parsers in sequence to identify the data definition statements; and The data definition statement is parsed using a data parser that successfully identifies the data definition statement to generate a structured syntax tree.

7. The method according to claim 1, wherein: The acquiring, according to the name of the target field, the names of all associated fields associated with the target field from at least one target structure object comprises: According to the name of the target field, acquiring field information of the target field from the at least one target structure object; In the case where the field information of the target field includes the identifier of the parent field, the field information of the parent field is acquired according to the identifier of the parent field, and the names of the associated fields at the parent level are acquired level by level according to the field information of the parent field; and When the field information of the target field includes the identifier of the subordinate field, the field information of the subordinate field is obtained according to the identifier of the subordinate field, and the names of the associated fields at the subordinate level are obtained step by step according to the field information of the subordinate field.

8. The method according to claim 1, wherein: The searching using the name of the target field and the names of all associated fields as keywords includes: Generate a regular expression according to the name of the target field and the names of all associated fields; and A search is performed in the target package based on the regular expression.

9. A field search device, comprising: A first acquisition module, used for acquiring a search scope, wherein the search scope includes a target program package, a target program file and a target field; A serialization module, used for serializing the target program package to obtain at least one target structure object; a second acquisition module, configured to acquire, according to the name of the target field, from the at least one target structure object, names of all associated fields associated with the target field, wherein the associated fields include upper-level fields and lower-level fields; and The determination module is used to search by using the name of the target field and the names of all associated fields as keywords.

10. 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 8.

11. 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 8.

12. A computer program product, comprising computer executable instructions, which are used to implement the method of any one of claims 1 to 8 when executed.