Keyword search method, keyword search device, electronic device and storage medium

Through the method of searching keywords in target statements, the problem of wide search scope in the prior art is solved, fast and accurate keyword retrieval is achieved, and the accuracy and efficiency of search is improved.

CN113392199BActive Publication Date: 2025-08-29INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110674771.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-17
Publication Date
2025-08-29
Estimated Expiration
2041-06-17

AI Technical Summary

Technical Problem

When searching for program keywords in the prior art, the search scope is relatively broad, and the desired search results cannot be obtained quickly and accurately, resulting in a large amount of unnecessary information contained in the search results, which increases the difficulty of manual sorting and reduces work efficiency.

Method used

By obtaining the search scope, serialize the target package to obtain the target method object, obtain the target statement from the target method object according to the target syntax function, and retrieve the target keyword in the target statement, displaying the target statement containing the target keyword.

Benefits of technology

It effectively reduces unnecessary information in the search results, improves the accuracy and work efficiency of searches, and ensures the speed and accuracy of keyword retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113392199B_ABST
    Figure CN113392199B_ABST
Patent Text Reader

Abstract

The present disclosure provides a keyword search method, a keyword search device, an electronic device, and a storage medium, which can be applied in the fields of computer technology and finance. The keyword search method includes: obtaining a search scope, wherein the search scope includes a target program package, a target program file, a target grammatical function, and a target keyword; serializing the target program package to obtain at least one target method object; obtaining at least one target statement from the at least one target method object based on the target grammatical function; searching for a target keyword in the at least one target statement; and displaying the target statement containing the target keyword.
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 keyword search method, a keyword search device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] As a program is used for a longer time, its source code tends to become larger and larger, and the calls between programs become more and more complicated.

[0003] In the process of realizing the concept of the present disclosure, the inventors found that when using relevant tools for field search, the search scope is relatively broad and it is impossible to obtain the desired search results quickly and accurately. Summary of the Invention

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

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

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

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

[0008] According to the target grammar function, obtaining at least one target statement from the at least one target method object;

[0009] Retrieving the target keyword in the at least one target sentence; and

[0010] Display target sentences containing the above target keywords.

[0011] 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 method data block; wherein the multiple lines of definition statements include at least one line of program definition statements and at least one line of method definition statements, and the method data blocks and the method definition statements correspond one to one; wherein each method data block includes at least one line of method statements, and each line of the method statements is used to implement a grammatical function;

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

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

[0014] For each method data block, processing the at least one line of method statement and the method definition statement to obtain a method object;

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

[0016] Parsing the target program object to obtain a method list, wherein the method list includes a name of at least one method data block; and

[0017] The at least one target method object is determined from the method objects according to the name of the at least one method data block.

[0018] According to an embodiment of the present disclosure, processing the definition statement to obtain the program object includes:

[0019] Use the policy chain to parse the above multi-line definition statements to obtain multiple program-class syntax trees; and

[0020] Serialize the multiple program class syntax trees to obtain the program objects.

[0021] 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;

[0022] The above-mentioned policy chain is used to parse the above-mentioned multiple lines of definition statements to obtain multiple program-class syntax trees, including:

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

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

[0025] According to an embodiment of the present disclosure, the processing of the at least one line of method statement to obtain a method object includes:

[0026] Parsing the at least one method statement using the policy chain to obtain at least one method class syntax tree; and

[0027] Serialize the at least one method class syntax tree to obtain the method object.

[0028] According to an embodiment of the present disclosure, the above-mentioned policy chain includes a plurality of method parsers established for each grammatical function;

[0029] The above-mentioned use of the policy chain to parse the at least one line of method statement to obtain at least one method class syntax tree includes:

[0030] For each line of method statement, sequentially use the multiple method parsers to identify the method statement; and

[0031] The method parser that successfully identifies the method statement is used to parse the method statement to generate a method class syntax tree.

[0032] According to an embodiment of the present disclosure, obtaining at least one line of target statement from at least one target method object according to the target grammar function includes:

[0033] Parsing the at least one target method object to obtain at least one function linked list;

[0034] According to the target grammatical function, obtaining a function name corresponding to the target grammatical function from a data dictionary; and

[0035] A statement containing the above-mentioned function name is extracted from the above-mentioned at least one function linked list to obtain at least one line of target statement of the above-mentioned at least one target method object.

[0036] Another aspect of the present disclosure provides a keyword search device, comprising:

[0037] A first acquisition module is used to acquire a search scope, wherein the search scope includes a target program package, a target program file, a target grammatical function, and a target keyword;

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

[0039] A second acquisition module is configured to acquire at least one line of target statement from the at least one target method object according to the target grammar function;

[0040] a retrieval module, configured to retrieve the target keyword in the at least one target sentence; and

[0041] The display module is used to display the target sentence containing the above target keywords.

[0042] 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 are enabled to implement the method described above.

[0043] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the method described above when executed.

[0044] Another aspect of the present disclosure provides a computer program product comprising computer executable instructions, which are used to implement the method described above when the instructions are executed.

[0045] According to the embodiments of the present disclosure, because a technical means is adopted by obtaining a target statement that can realize the corresponding grammatical function in a method object, then searching for keywords in the target statement, and displaying the retrieved statements containing keywords, it at least partially overcomes the technical problem that when searching for code, the search scope is relatively wide and the desired search results cannot be obtained quickly and accurately, thereby effectively reducing unnecessary information in the search results, and effectively improving the accuracy of the search and work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0047] Figure 1 Schematically shows a search scope diagram of the related technology according to an embodiment of the present disclosure;

[0048] Figure 2 The following schematically illustrates an exemplary system architecture for application keyword retrieval according to an embodiment of the present disclosure;

[0049] Figure 3 The flowchart of the keyword search method according to the embodiment of the present disclosure is schematically shown;

[0050] Figure 4 Schematically shows a schematic diagram of obtaining a target method object according to an embodiment of the present disclosure;

[0051] Figure 5 Schematically shows a flow chart of a method for obtaining a target method object according to another embodiment of the present disclosure;

[0052] Figure 6 A flowchart of a method for acquiring a target sentence according to another embodiment of the present disclosure is schematically shown;

[0053] Figure 7 A block diagram schematically illustrates a keyword search device according to an embodiment of the present disclosure; and

[0054] Figure 8 The block diagram schematically shows an electronic device suitable for implementing the keyword retrieval method according to an embodiment of the present disclosure. 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 merely exemplary and are not intended to limit the scope of the present disclosure. In the detailed description below, 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 well-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 presence of the features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0057] All terms used herein (including technical and scientific terms) 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] When expressions such as “at least one of A, B, and C, etc.” are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (e.g., “a system having at least one of A, B, and C” should include but is not limited to systems having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, and C, etc.). When expressions such as “at least one of A, B, or C, etc.” are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (e.g., “a system having at least one of A, B, or C” should include but is not limited to systems having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, and C, etc.).

[0059] When developing a program, developers often need to perform keyword searches on the program to retrieve relevant content. For example, keyword searches are required in the following three situations.

[0060] Scenario 1: When a change in field length affects the system, it is necessary to query the entire system code using keywords (field names) to sort out the logic involved.

[0061] For example, in EGL, unlike other programming languages, parameter definitions require not only the type but also the length. Modifying the length of a parameter in one EGL program also requires modifying the length of the corresponding parameter in other EGL programs that call that parameter. Otherwise, the program will generate an error when running.

[0062] Scenario 2: When changes in method logic affect the caller, it is necessary to query the entire system code using keywords (method name) to sort out the logic of calling the method.

[0063] Scenario 3: When expanding the data dictionary for a field, you first need to understand the value assignments for that field in the existing data. In this case, you need to search the entire system code using the keyword (field name), sort through all the assignment statements, and obtain the data dictionary currently used for that field.

[0064] Figure 1 The following schematically shows a search scope diagram of the related art according to an embodiment of the present disclosure.

[0065] like Figure 1 As shown, in the related art, when performing keyword search on an EGL program, the search can only be performed by selecting a relatively rough range, for example, searching for a certain parameter of a certain function.

[0066] In current R&D environments, obsolete code is often handled through comments. This results in a large amount of code content in the system, often represented by multi-line comments such as " / *......* / ". Related keyword search methods do not support filtering these comments. Therefore, when using keyword search methods in related technologies, search results often contain a large number of comments, and the multi-line comments in these comments are difficult to find in the search results, which requires further processing before they can be used.

[0067] On the other hand, when R&D personnel conduct keyword searches, they usually intend to focus only on keywords that exist in a certain grammatical function statement, for example, only on the keyword in the assignment statement. For other grammatical function statements, such as field definitions, field calls, etc., R&D personnel do not need to know whether they contain the keyword.

[0068] Therefore, using the search function in related technologies often does not get the desired results in one go, but requires manual further processing on the search results. When the system is large and the amount of code is large, it often increases the difficulty of subsequent manual sorting and reduces work efficiency. Taking the above three situations as an example, the impact of changes in field length on the system is mainly the impact on assignment statements; changes in method logic have an impact on the system mainly on call statements that need to obtain method return values; and when expanding the data dictionary of fields, the assignment statements also need to be paid attention to. The search method of related technologies will list all statements in the system that use the keyword, corresponding to the specific grammatical functions, which require further manual screening.

[0069] In view of this, embodiments of the present disclosure provide a keyword search method, a keyword search device, an electronic device, a computer-readable storage medium, and a computer program product. The method includes obtaining a search scope, serializing a target program package, retrieving a target keyword, and displaying a target sentence containing the target keyword.

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

[0071] Figure 2 The exemplary system architecture 200 to which the keyword search method according to the embodiment of the present disclosure can be applied is schematically shown. It should be noted that, Figure 2 The examples shown are merely examples of system architectures to which the embodiments of the present disclosure may be applied, to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure may not be used in other devices, systems, environments or scenarios.

[0072] like Figure 2 As shown, the system architecture 200 according to this embodiment may include terminal devices 201, 202, 203, a network 204, and a server 205. The network 204 is used as a medium for providing communication links between the terminal devices 201, 202, 203 and the server 205. The network 204 may include various connection types, such as wired and / or wireless communication links, etc.

[0073] Users can use terminal devices 201, 202, and 203 to interact with server 205 via network 204 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 201, 202, and 203, such as web browser applications, search applications, instant messaging tools, email clients, and / or social platform software (for example only).

[0074] The terminal devices 201 , 202 , and 203 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.

[0075] Server 205 may be a server that provides various services, such as a background management server (for example only) that supports websites browsed by users using terminal devices 201, 202, and 203. The background management server may analyze and process received data such as user requests, and feed back processing results (e.g., web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0076] It should be noted that the keyword search method provided in the embodiments of the present disclosure can generally be executed by the server 205. Accordingly, the keyword search system provided in the embodiments of the present disclosure can generally be set in the server 205. The keyword search method provided in the embodiments of the present disclosure can also be executed by a server or server cluster that is different from the server 205 and can communicate with the terminal devices 201, 202, 203 and / or the server 205. Accordingly, the keyword search system provided in the embodiments of the present disclosure can also be set in a server or server cluster that is different from the server 205 and can communicate with the terminal devices 201, 202, 203 and / or the server 205.

[0077] It should be understood that Figure 2 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.

[0078] Figure 3 The flowchart of the keyword search method according to the embodiment of the present disclosure is schematically shown.

[0079] like Figure 3 As shown, the keyword search method may include operations S301 to S305.

[0080] In operation S301 , a search scope is acquired, wherein the search scope includes a target program package, a target program file, a target syntax function, and a target keyword.

[0081] In operation S302 , the target package is serialized to obtain at least one target method object.

[0082] In operation S303 , at least one line of target statement is obtained from at least one target method object according to the target grammar function.

[0083] In operation S304 , a target keyword is retrieved from at least one target sentence line.

[0084] In operation S305 , a target sentence including the target keyword is displayed.

[0085] According to embodiments of the present disclosure, the search scope can be specified by the developer. The target method object can be a Function object, and the target statement can be a method statement. Method statements can include, but are not limited to, assignment statements and flow control statements. Syntactic functions can include, but are not limited to, assignment, logical expressions, flow control, method calls, and procedure calls.

[0086] Figure 4 The following schematically shows a schematic diagram of obtaining a target method object according to an embodiment of the present disclosure.

[0087] According to the embodiments of the present disclosure, Figure 4 As shown in the figure, taking the EGL package as an example, based on the selected search scope, starting from the program objects generated by the EGL language parsing system, the method objects used by each program object are determined. The corresponding data structures, such as "Assignment (Evaluation)," "Logical Expression (Expression)," "Flow Control (Flow Control)," "Method Call (Function Call)," and "Program Call (EGL Call)," are found through the method objects.

[0088] According to an embodiment of the present disclosure, each program object corresponds to a target program package. The program object stores method information used by the target program package. The program object can be a Program object. For each method information, the deserialized target method object can search for the target statement corresponding to the grammatical information from the target method object. Then, a keyword search is performed in the target statement based on the target grammatical function within the search range, and the target statement that meets the conditions is displayed, thereby completing the keyword search.

[0089] According to the embodiments of the present disclosure, because a technical means is adopted by obtaining a target statement that can realize the corresponding grammatical function in a method object, then searching for keywords in the target statement, and displaying the retrieved statements containing keywords, it at least partially overcomes the technical problem that when searching for code, the search scope is relatively wide and the desired search results cannot be obtained quickly and accurately, thereby effectively reducing unnecessary information in the search results, and effectively improving the accuracy of the search and work efficiency.

[0090] Figure 5 A flowchart of a method for acquiring a target method object according to another embodiment of the present disclosure is schematically shown.

[0091] 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 method data block; wherein, the multiple lines of definition statements include at least one line of program definition statements and at least one line of method definition statements, and the method data blocks and method definition statements correspond one to one; wherein, each method data block includes at least one line of method statements, and each line of method statements is used to implement a grammatical function.

[0092] Wherein, the target package is serialized to obtain at least one target method object, such as Figure 5 As shown, operations S501 to S505 may be included.

[0093] In operation S501 , for each program file, multiple lines of definition statements are processed to obtain program objects.

[0094] In operation S502 , for each method data block, at least one line of method statement and method definition statement is processed to obtain a method object.

[0095] In operation S503 , a target program object is determined from among the program objects according to the name of the target program file.

[0096] In operation S504, the target program object is parsed to obtain a method linked list, wherein the method linked list includes the name of at least one method data block.

[0097] In operation S505 , at least one target method object is determined from the method objects according to the name of the at least one method data block.

[0098] According to an embodiment of the present disclosure, each program file in the target program package is processed to obtain a program object, and a target program object is determined from the program objects based on the name of the target program file in the search range. The target program object is parsed to obtain a method list.

[0099] According to an embodiment of the present disclosure, a target method object is determined from method objects according to the name of the method data block in the method chain list.

[0100] According to the embodiments of the present disclosure, Figure 4 As shown, processing the definition statement to obtain the program object may include the following operations.

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

[0102] According to the embodiments of the present disclosure, Figure 4 As shown, the policy chain includes multiple program parsers established for program definition statements and method definition statements respectively.

[0103] The following operations may be performed to parse multiple lines of definition statements using a policy chain to obtain multiple program-class syntax trees.

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

[0105] According to an embodiment of the present disclosure, the syntax tree may include a Program syntax tree, a Record syntax tree, a Dataitem syntax tree, a Function syntax tree, an Evaluation syntax tree, an Expression syntax tree, a Flow-control syntax tree, a Function-call syntax tree, and an EGL-call syntax tree, etc., wherein the program-type syntax tree may be a Program syntax.

[0106] According to an embodiment of the present disclosure, the 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.

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

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

[0109] According to the embodiments of the present disclosure, Figure 4 As shown, processing at least one line of method statement to obtain a method object may include the following operations.

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

[0111] According to the embodiments of the present disclosure, Figure 4 As shown, the policy chain includes multiple method parsers established for each grammatical function.

[0112] Here, using the policy chain to parse at least one line of method statement to obtain at least one method class syntax tree may include the following operations.

[0113] For each line of method statement, a plurality of method parsers are used in sequence to identify the method statement; and the method parser that successfully identifies the method statement is used to parse the method statement to generate a method class syntax tree.

[0114] According to an embodiment of the present disclosure, the method-class syntax tree may be a Function syntax.

[0115] According to an embodiment of the present disclosure, a method parser may include but is not limited to a Function-define parser, an Evaluation parser, an Expression parser, a Flow-control parser, a Function-call parser, and the like.

[0116] According to an embodiment of the present disclosure, each line of method statement is parsed in sequence using multiple method parsers to generate a corresponding method class syntax tree.

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

[0118] Figure 6 A flowchart of a method for acquiring a target sentence according to another embodiment of the present disclosure is schematically shown.

[0119] According to the embodiments of the present disclosure, Figure 6 As shown, obtaining at least one line of target statement from at least one target method object according to the target grammar function may include operations S601 to S603.

[0120] In operation S601, at least one target method object is parsed to obtain at least one function linked list.

[0121] In operation S602 , according to the target grammatical function, a function name corresponding to the target grammatical function is acquired from a data dictionary.

[0122] In operation S603, a statement containing a function name is extracted from at least one function chain list to obtain at least one line of target statement of at least one target method object.

[0123] According to an embodiment of the present disclosure, the target method object is deserialized to obtain a corresponding function list, wherein the function list contains the grammatical function of each line of statement, such as assignment and call.

[0124] According to an embodiment of the present disclosure, a function name corresponding to a target grammatical function in a search scope is obtained from a data dictionary, and a statement containing the function name is extracted from a function linked list, the statement being the target statement in the target method object.

[0125] For example, based on the function list's "Evaluation," the function name corresponding to "Evaluation" is obtained from the data dictionary as "CodeEvaluation." This allows multiple target statements containing "CodeEvaluation" to be identified in the function list. For example, one target statement may be "CodeEvaluation-value: A type: 0 alAssignment: 1, alOperator:." A search for the keyword "A" is performed among the multiple statements containing "CodeEvaluation." This identifies "CodeEvaluation-value: A type: 0 alAssignment: 1, alOperator:" as the target statement and displays it. Other statements not containing the keyword "A" are not target statements and are not displayed.

[0126] Figure 7 The block diagram of the keyword search device according to the embodiment of the present disclosure is schematically shown.

[0127] like Figure 7 As shown, the keyword search device 700 includes a first acquisition module 710 , a serialization module 720 , a second acquisition module 730 , a search module 740 and a display module 750 .

[0128] The first acquisition module 710 is used to acquire a search scope, wherein the search scope includes a target program package, a target program file, a target grammatical function, and a target keyword.

[0129] The serialization module 720 is configured to serialize the target program package to obtain at least one target method object.

[0130] The second acquisition module 730 is configured to acquire at least one line of target statement from at least one target method object according to the target grammar function.

[0131] The retrieval module 740 is configured to retrieve a target keyword in at least one target sentence line.

[0132] The display module 750 is used to display the target sentence containing the target keyword.

[0133] According to the embodiments of the present disclosure, because a technical means is adopted by obtaining a target statement that can realize the corresponding grammatical function in a method object, then searching for keywords in the target statement, and displaying the retrieved statements containing keywords, it at least partially overcomes the technical problem that when searching for code, the search scope is relatively wide and the desired search results cannot be obtained quickly and accurately, thereby effectively reducing unnecessary information in the search results, and effectively improving the accuracy of the search and work efficiency.

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

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

[0136] The second processing submodule is configured to process at least one line of method statement for each method data block to obtain a method object.

[0137] The first determining submodule is configured to determine a target program object from program objects according to a name of a target program file.

[0138] The first parsing submodule is configured to parse the target program object to obtain a method linked list, wherein the method linked list includes a name of at least one method data block.

[0139] The second determining submodule is configured to determine at least one target method object from the method objects according to a name of at least one method data block.

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

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

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

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

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

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

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

[0147] The second parsing unit is configured to parse at least one line of method statement using the policy chain to obtain at least one method class syntax tree.

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

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

[0150] The second recognition subunit is used to use multiple method parsers to recognize method statements in sequence for each line of method statements.

[0151] The second parsing subunit is configured to parse the method statement using the method parser that successfully identifies the method statement to generate a method class syntax tree.

[0152] According to an embodiment of the present disclosure, the second acquisition module 730 may include a second parsing submodule, an acquisition submodule, and an extraction submodule.

[0153] The second parsing submodule is used to parse at least one target method object to obtain at least one function linked list.

[0154] The acquisition submodule is used to obtain the function name corresponding to the target grammatical function from the data dictionary according to the target grammatical function.

[0155] The extraction submodule is used to extract the statement containing the function name from the at least one function linked list to obtain at least one line of target statement of the at least one target method object.

[0156] According to the modules, submodules, units, and subunits of the embodiments of the present invention, any multiple or at least part of the functions of any multiple thereof can be implemented in one module. According to the modules, submodules, units, and subunits of the embodiments of the present invention, any one or more thereof can be split into multiple modules for implementation. According to the modules, submodules, units, and subunits of the embodiments of the present invention, any one or more thereof 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 of any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware, and firmware or in an appropriate combination of any of them. Alternatively, according to the modules, submodules, units, and subunits of the embodiments of the present invention, one or more thereof can be at least partially implemented as a computer program module, which can perform the corresponding function when the computer program module is run.

[0157] For example, any multiple of the first acquisition module 710, the serialization module 720, the second acquisition module 730, the retrieval module 740, and the display module 750 may be combined into one module / submodule / unit / subunit for implementation, or any one of these modules / submodules / units / subunits may be split into multiple modules / submodules / units / subunits. Alternatively, at least part of the functionality of one or more of these modules / submodules / units / subunits may be combined with at least part of the functionality 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 710, the serialization module 720, the second acquisition module 730, the retrieval module 740, and the display module 750 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 in any other reasonable way of integrating or packaging the circuit, or in any one of the three implementation methods of software, hardware, and firmware, or in an appropriate combination of any of them. Alternatively, at least one of the first acquisition module 710, the serialization module 720, the second acquisition module 730, the retrieval module 740, and the display module 750 can be at least partially implemented as a computer program module, which can perform the corresponding function when the computer program module is executed.

[0158] It should be noted that the keyword retrieval system part in the embodiment of the present disclosure corresponds to the keyword retrieval method part in the embodiment of the present disclosure. The description of the keyword retrieval system part is specifically referred to the keyword retrieval method part, which will not be repeated here.

[0159] Figure 8 A block diagram of an electronic device suitable for implementing the above-described method according to an embodiment of the present disclosure is schematically shown. Figure 8 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0160] like Figure 8As shown, the computer electronic device 800 according to an embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. The processor 801 may, for example, include a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for executing different actions of the method flow according to an embodiment of the present disclosure.

[0161] Various programs and data required for the operation of the electronic device 800 are stored in the RAM 803. The processor 801, ROM 802, and RAM 803 are connected to each other via a bus 804. The processor 801 executes the various operations of the method flow according to the embodiment of the present disclosure by executing the programs in the ROM 802 and / or RAM 803. It should be noted that the programs may also be stored in one or more memories other than the ROM 802 and RAM 803. The processor 801 may also execute the various operations of the method flow according to the embodiment of the present disclosure by executing the programs stored in the one or more memories.

[0162] According to an embodiment of the present disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the I / O interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage portion 808 including a hard disk; and a communication portion 809 including a network interface card such as a LAN card or a modem. The communication portion 809 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed in the drive 810 as needed, so that a computer program read therefrom can be installed into the storage portion 808 as needed.

[0163] 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 includes 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 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, 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, device, apparatus, module, unit, etc. described above can be implemented by a computer program module.

[0164] 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 and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when executed, implements the method according to the embodiments of the present disclosure.

[0165] According to an embodiment of the present disclosure, a 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 can be used by or in conjunction with an instruction execution system, apparatus, or device.

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

[0167] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method provided by the embodiment of the present disclosure. When the computer program product is run on an electronic device, the program code is used to enable the electronic device to implement the keyword retrieval method provided by the embodiment of the present disclosure.

[0168] When the computer program is executed by the processor 801, the above functions defined in the system / device of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0169] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0170] 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 computer programs can be implemented using high-level procedural 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 a remote computing device, or entirely on a 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 via the Internet).

[0171] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, 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, program segment, or portion of code, which 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 boxes may occur in an order different from that marked in the accompanying drawings. For example, two boxes shown in succession may actually be executed substantially in parallel, or they may 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, as well as the combination of boxes in the block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or may be implemented using a combination of dedicated hardware and computer instructions. It will be understood by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or coupled in various ways, even if such combinations or couplings are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or coupled in various ways, and all such combinations and / or couplings fall within the scope of the present disclosure.

[0172] The embodiments of the present disclosure are described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be used in combination to advantage. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A keyword search method comprising: Acquiring a search scope, wherein the search scope includes a target program package, a target program file, a target grammatical function, and a target keyword; Serializing the target program package to obtain at least one target method object includes: using a plurality of program parsers and a plurality of method parsers in a policy chain to process a plurality of lines of definition statements and method statements of the target program package respectively to obtain at least one target method object, wherein the policy chain includes a plurality of program parsers established for program definition statements and method definition statements respectively, and a plurality of method parsers established for each grammatical function respectively, and the target program package includes an EGL program; Deserialize the target method object to obtain at least one function linked list, wherein the function linked list includes the grammatical function of each line of definition statement; According to the target grammatical function, obtaining a function name corresponding to the target grammatical function from a data dictionary; Extracting a statement containing the function name from the at least one function linked list to obtain at least one line of target statement of the at least one target method object; Retrieving the target keyword in the at least one target sentence; and Display target sentences containing the target keyword.

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 method data block; wherein the plurality of lines of definition statements include at least one line of program definition statement and at least one line of method definition statement, and the method data blocks and the method definition statements correspond one to one; wherein each method data block includes at least one line of method statement, and each line of method statement is used to implement a grammatical function; The step of serializing the target program package to obtain at least one target method object includes: For each program file, processing the multiple lines of definition statements to obtain a program object; For each method data block, processing the at least one line of method statement and the method definition statement to obtain a method 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 method linked list, wherein the method linked list includes a name of at least one method data block; and The at least one target method object is determined from the method objects based on the name of the at least one method data block.

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 the 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 strategy chain is used to parse the multiple lines of definition statements to obtain multiple program-class syntax trees, including: For each line of definition statement, sequentially use the multiple program parsers to identify the definition statement; and The program parser that successfully identifies the definition statement is used to parse 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 method statement to obtain a method object includes: Parsing the at least one line of method statements using the policy chain to obtain at least one method class syntax tree; and Serialize the at least one method class syntax tree to obtain the method object.

6. The method according to claim 5, in, The using the policy chain to parse the at least one line of method statement to obtain at least one method class syntax tree includes: For each line of method statements, sequentially use the multiple 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 a method class syntax tree.

7. A keyword search device comprising: A first acquisition module is used to acquire a search scope, wherein the search scope includes a target program package, a target program file, a target grammatical function, and a target keyword; a serialization module, configured to serialize the target program package to obtain at least one target method object, comprising: using a plurality of program parsers and a plurality of equation parsers in a policy chain to respectively process a plurality of lines of definition statements and method statements of the target program package to obtain at least one target method object, wherein the policy chain comprises a plurality of program parsers established for program definition statements and method definition statements, respectively, and a plurality of method parsers established for each grammatical function, and the target program package comprises an EGL program; The second acquisition module includes: A second parsing submodule is configured to deserialize the target method object to obtain at least one function linked list, wherein the function linked list includes the grammatical function of each line of definition statement; The acquisition submodule is used to obtain the function name corresponding to the target grammatical function from the data dictionary according to the target grammatical function; An extraction submodule, configured to extract a statement containing the function name from the at least one function linked list to obtain at least one line of target statement of the at least one target method object; a retrieval module, configured to retrieve the target keyword in the at least one target sentence line; and The display module is used to display the target sentence containing the target keyword.

8. An electronic device comprising: one or more processors; a memory for storing one or more instructions, 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 6.

9. 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 6.

10. 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 6 when executed.

Citation Information

Patent Citations

  • Data processing method and device

    CN106227668A