An information search method, device, equipment and medium for electronic automation design file library

The DSL construction syntax tree structure implemented through the YAML encoding language solves the problem of non-standardized technology library file management and search in chip back-end design, realizes efficient and accurate information search and management, and adapts to the chip process needs of fast updates.

CN119046233BActive Publication Date: 2025-02-18SHENZHEN HONGXIN MICRO NANO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411516146.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-02-18
Estimated Expiration
2044-10-29

AI Technical Summary

Technical Problem

During the chip back-end design process, it is difficult for the existing technology to efficiently manage and find non-standardized technical library files used by different chip processes and design companies, resulting in inconvenient information extraction and management, especially when chip process updates and iterations are rapid.

Method used

By using the DSL implemented in YAML encoding language to construct a syntax tree structure, the storage structure and extraction mode of key information in the file library are expressed hierarchically, and the separation of reading content and processing logic is achieved, making it easier for users to find information according to their needs.

Benefits of technology

It improves the information search efficiency and accuracy of the electronic automation design file library, simplifies the management and extraction process of library files, and adapts to the chip process requirements of rapid updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119046233B_ABST
    Figure CN119046233B_ABST
Patent Text Reader

Abstract

The present application provides an information search method, device, equipment and medium for an electronic automation design file library. Based on the YAML writing language, the content information and regular expressions of each file in the file library are configured with a DSL to define and generate an abstract syntax tree; based on the first information search request, the syntax tree is traversed and read to determine the target file corresponding to the first information search request in the syntax tree and the first initialization regular expression group; the first initialization regular expression group is merged to generate a composite regular expression group, and the target file is matched based on the composite regular expression group. If the match is successful, the information search result is determined and displayed to the target user. By using the DSL implemented in the YAML coding language to construct a syntax tree structure, the storage structure and extraction mode of key information in the file library are hierarchically expressed, and the accuracy and efficiency of information search are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information search technology, and in particular to an information search method, device, equipment and medium for an electronic automation design file library. Background Art

[0002] When chip backend engineers use EDA (Electronic Design Automation) software to design chip physical layout, they need to load a large number of technical library files. These files include important information such as physical information and timing information of the basic logic units of the chip, which are the basis for chip backend design. These files are often generated in a relatively fixed syntax format and stored in the form of text files. However, the file formats used by different chip processes and design companies are often not completely standardized, but there are certain differences from the standard format. In addition, during the chip design process, library files need to be replaced according to some special requirements, which makes it inconvenient to extract and manage information from library files. In addition, as chip process updates and iterations become faster and faster, the number of library files often increases, and the industry's demand for an efficient library file management mode is increasing. Therefore, how to improve the efficiency of information search in the electronic automation design file library has become a technical issue that cannot be underestimated. Summary of the invention

[0003] In view of this, the purpose of this application is to provide an information search method, device, equipment and medium for an electronic automation design file library. By using a DSL implemented by the YAML coding language to construct a syntax tree structure, the storage structure and extraction mode of key information in the file library are hierarchically expressed, and the separation of reading content and processing logic is achieved, which makes it convenient for users to search for the information to be read according to their needs during use, thereby improving the accuracy and efficiency of information search.

[0004] The present application embodiment provides an information search method for an electronic automation design file library, the information search method comprising:

[0005] Performing DSL configuration definition on the content information and regular expressions of each file in the electronic automation design file library based on the YAML writing language, and generating an abstract syntax tree of the electronic automation design file library;

[0006] Based on a first information search request of a target user, the abstract syntax tree is traversed and read to determine a target file corresponding to the first information search request in the abstract syntax tree and a first initialization regular expression group of the target file;

[0007] The first initialization regular expression group is merged to generate a composite regular expression group, and information matching is performed on the target file based on the composite regular expression group. If the match is successful, an information search result is determined, and the information search result is displayed to the target user.

[0008] In a possible implementation manner, the DSL configuration definition is performed on the content information and regular expression of each file in the electronic automation design file library based on the YAML writing language to generate an abstract syntax tree of the electronic automation design file library, including:

[0009] Performing DSL configuration on the content information of the file based on the YAML writing language to generate key nodes;

[0010] Performing DSL configuration on the attribute information of the content information based on the YAML writing language to generate an attribute sub-node; wherein the attribute information includes format storage information, display information, and regular expression information;

[0011] A DSL structure is formed by the multiple key nodes and the multiple attribute sub-nodes, and the DSL structure is processed to generate an abstract syntax tree divided into levels.

[0012] In a possible implementation manner, the traversing and reading the abstract syntax tree based on the first information search request of the target user, determining the target file corresponding to the first information search request in the abstract syntax tree and the first initialization regular expression group of the target file, includes:

[0013] Reading the abstract syntax tree based on the first information search request of the target user, determining a plurality of target key nodes of the target file corresponding to the first information search request in the abstract syntax tree and target attribute subnodes of the target key nodes;

[0014] Based on the target attribute sub-node, the first initialization regular expression group is determined.

[0015] In a possible implementation manner, performing information matching on the target file based on the compound regular expression group and determining an information search result if the match is successful includes:

[0016] Based on the compound regular expression group, each line of content information of the target file is traversed and matched according to the first information search request, and matching content corresponding to the expression sequence of the compound regular expression group is determined; wherein the expression sequence is the arrangement order of each regular expression in the first initialization regular expression group;

[0017] If the matching contents corresponding to the expression sequence are all empty, the matching fails, and the content information of the target file is matched again;

[0018] If any of the matching contents corresponding to the expression sequence is not empty, the match is successful and the information search result is determined.

[0019] In a possible implementation manner, the first initialization regular expression group is merged to generate a composite regular expression group, and information matching is performed on the target file based on the composite regular expression group. If the match is successful, after determining the information search result, the information search method further includes:

[0020] The combined first initialization regular expression group, the matching contents corresponding to the expression sequences of the compound regular expression group, and the compound regular expression group are stored in a database;

[0021] Detecting whether a second information search request for the target file and a second initialization regular expression group corresponding to the second information search request are consistent with the first information search request and the first initialization regular expression group;

[0022] If so, the information search result corresponding to the compound regular expression is used as the information search result of the second information search request.

[0023] In a possible implementation manner, after merging the first initialization regular expression group to generate a composite regular expression group, performing information matching on the target file based on the composite regular expression group, and determining the information search result if the match is successful, the information search method further includes:

[0024] Determine a target key node of the information search result in the abstract syntax tree;

[0025] The determined regular expression in the first initialization regular expression group of the target key node is deleted to complete the update of the first initialization regular expression group of the target key node; wherein the determined regular expression is the regular expression corresponding to the information search result.

[0026] The present application also provides an information search device for an electronic automation design file library, the information search device comprising:

[0027] A configuration module, used to perform DSL configuration definition on the content information and regular expression of each file in the electronic automation design file library based on the YAML writing language, and generate an abstract syntax tree of the electronic automation design file library;

[0028] A reading module, configured to traverse and read the abstract syntax tree based on a first information search request of a target user, and determine a target file corresponding to the first information search request in the abstract syntax tree and a first initialization regular expression group of the target file;

[0029] The matching module is used to merge the first initialization regular expression group to generate a composite regular expression group, perform information matching on the target file based on the composite regular expression group, and if the match is successful, determine the information search result, and display the information search result to the target user.

[0030] In a possible implementation manner, when the configuration module is used to perform DSL configuration definition on the content information and regular expression of each file in the electronic automation design file library based on the YAML writing language to generate an abstract syntax tree of the electronic automation design file library, the configuration module is specifically used to:

[0031] Performing DSL configuration on the content information of the file based on the YAML writing language to generate key nodes;

[0032] Performing DSL configuration on the attribute information of the content information based on the YAML writing language to generate an attribute sub-node; wherein the attribute information includes format storage information, display information, and regular expression information;

[0033] A DSL structure is formed by the multiple key nodes and the multiple attribute sub-nodes, and the DSL structure is processed to generate an abstract syntax tree divided into levels.

[0034] An embodiment of the present application also provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the information search method for the electronic automation design file library as described above are performed.

[0035] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the information search method for the electronic automation design file library as described above are executed.

[0036] The embodiment of the present application provides an information search method, device, equipment and medium for an electronic automation design file library, the information search method comprising: performing DSL configuration definition on the content information and regular expression of each file in the electronic automation design file library based on the YAML writing language, generating an abstract syntax tree of the electronic automation design file library; traversing and reading the abstract syntax tree based on the first information search request of the target user, determining the target file corresponding to the first information search request in the abstract syntax tree and the first initialization regular expression group of the target file; merging the first initialization regular expression group to generate a composite regular expression group, matching the target file based on the composite regular expression group, and if the match is successful, determining the information search result, and displaying the information search result to the target user. By using the DSL implemented by the YAML coding language to construct a syntax tree structure, the storage structure and extraction mode of key information in the file library are hierarchically expressed, and the separation of reading content and processing logic is realized, which is convenient for users to search for the information to be read according to their needs during use, and improves the accuracy and efficiency of information search.

[0037] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 One of the flow charts of an information search method for an electronic automation design file library provided in an embodiment of the present application;

[0040] Figure 2 A second flowchart of an information search method for an electronic automation design file library provided in an embodiment of the present application;

[0041] Figure 3 One of the structural schematic diagrams of an information search device for an electronic automation design file library provided in an embodiment of the present application;

[0042] Figure 4 A second structural diagram of an information search device for an electronic automation design file library provided in an embodiment of the present application;

[0043] Figure 5A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.

[0045] First, the application scenarios to which the present application is applicable are introduced. The present application can be applied in the field of information search technology.

[0046] According to research, when chip backend engineers use EDA (Electronic Design Automation) software to design chip physical layout, they need to load a large number of technical library files. These files include important information such as physical information and timing information of the basic logic units of the chip, which is the basis for chip backend design. These files are often generated in a relatively fixed syntax format and stored in the form of text files. However, the file formats used by different chip processes and design companies are often not completely standardized, but there are certain differences from the standard format. In addition, during the chip design process, library files need to be replaced according to some special requirements, which makes it inconvenient to extract and manage information from library files. In addition, as chip process updates and iterations become faster and faster, the number of library files often increases, and the industry's demand for an efficient library file management mode is increasing. Therefore, how to improve the efficiency of information search in the electronic automation design file library has become a technical issue that cannot be underestimated.

[0047] Based on this, an embodiment of the present application provides an information search method for an electronic automation design file library. By constructing a syntax tree structure using a DSL implemented by the YAML coding language, the storage structure and extraction mode of key information in the file library are hierarchically expressed, and the separation of reading content and processing logic is achieved, which makes it convenient for users to search for the information to be read as needed during use, thereby improving the accuracy and efficiency of information search.

[0048] See also Figure 1 , Figure 1This is one of the flow charts of a method for searching information in an electronic automation design file library provided in an embodiment of the present application. Figure 1 As shown in , the information search method provided by the embodiment of the present application includes:

[0049] S101: performing DSL configuration definition on content information and regular expressions of each file in the electronic automation design file library based on the YAML writing language, and generating an abstract syntax tree of the electronic automation design file library.

[0050] In this step, the content information of each file in the electronic automation design file library and multiple regular expressions corresponding to each file are defined by DSL configuration according to the YAML writing language to generate an abstract syntax tree of the electronic automation design file library.

[0051] Among them, DSL (Domain-specific Language) is a language applied in the context of a specific domain, which can efficiently solve problems in the applicable domain. When the vocabulary and grammar are specified in detail, DSL can concisely express relatively complex meanings. Serialization languages ​​such as YAML can clearly define structures with obvious hierarchical relationships, which are suitable for defining the hierarchical relationships of EDA library files and completing information extraction and analysis.

[0052] In a possible implementation, a DSL configuration definition is performed on the content information and regular expression of each file in the electronic automation design file library based on the YAML writing language to generate an abstract syntax tree of the electronic automation design file library, including:

[0053] A: Perform DSL configuration on the content information of the file based on the YAML writing language to generate key nodes.

[0054] Here, the content information of the file is configured with DSL according to the YAML writing language to generate key nodes.

[0055] B: Perform DSL configuration on the attribute information of the content information based on the YAML writing language to generate attribute sub-nodes; wherein the attribute information includes format storage information, display information and regular expression information.

[0056] Here, the attribute information of the content information is configured with DSL according to the YAML writing language to generate attribute sub-nodes.

[0057] Among them, the regular expressions of each node in a file used in the initial configuration are the same.

[0058] Among them, the attribute subnode is the child node of the key node. In the YAML configuration, the key node can be used to define a new node, and the attribute subnode can define the attributes of each node. In addition, the key node can also be used as an attribute subnode. For example, the node defined by the key node is considered to be an attribute information (subnode) of the upper node. When reading a file, the node defined by the key node is stored in the form of a key-value pair (for the presence of child nodes, the value may be a dictionary consisting of a series of other key-value pairs), and the attribute subnode defines the behavior of the file content extraction function when processing the file content.

[0059] C: constructing a DSL structure with the plurality of key nodes and the plurality of attribute sub-nodes, and processing the DSL structure to generate an abstract syntax tree divided into levels.

[0060] Here, a DSL structure is formed by a plurality of nodes and a plurality of sub-nodes, the DSL structure is processed, an abstract syntax tree divided into levels is generated, and the abstract syntax tree is cached.

[0061] In the present application, the logic and configuration are separated, and the content information of the read file, the format in which the content information is stored, and the display format of the read result can all be customized by the user by modifying the DSL configuration file.

[0062] S102: traverse and read the abstract syntax tree based on a first information search request of a target user, and determine a target file corresponding to the first information search request in the abstract syntax tree and a first initialization regular expression group of the target file.

[0063] In this step, the syntax tree is traversed and read according to the first information search request of the target user, and the target file corresponding to the first information search request in the abstract syntax tree and the first initialization regular expression group of the target file are determined.

[0064] The first initialization regular expression group is composed of a plurality of regular expressions.

[0065] In a possible implementation manner, the traversing and reading the abstract syntax tree based on the first information search request of the target user, determining the target file corresponding to the first information search request in the abstract syntax tree and the first initialization regular expression group of the target file, includes:

[0066] (1): Based on the first information search request of the target user, the abstract syntax tree is read to determine a plurality of target key nodes of the target file corresponding to the first information search request in the abstract syntax tree and target attribute subnodes of the target key nodes.

[0067] Here, the abstract syntax tree is read according to the first information search request of the target user, and a target key node corresponding to the first information search request in the abstract syntax tree is determined.

[0068] (2): Based on the target attribute sub-node, determine the first initialization regular expression group.

[0069] Here, a first initialization regular expression group is determined according to the target attribute child node.

[0070] S103: merging the first initialization regular expression group to generate a composite regular expression group, performing information matching on the target file based on the composite regular expression group, and if the match is successful, determining an information search result, and displaying the information search result to the target user.

[0071] In this step, the first initialization regular expression group is merged to generate a composite regular expression group, and information matching is performed on the target file according to the composite regular expression group. If the match is successful, the information search result is determined and displayed to the target user.

[0072] Among them, since there are more than one regular expressions that need to be matched for each line of file content, if traversal is performed for matching, the number of regular matches will be greatly increased, and the total number may reach more than ten times the number of file lines, which has a great impact on the computing performance. Therefore, before performing regular matching, the present invention first synthesizes all regular expressions that need to be matched into a composite regular expression and compiles it into a Pattern object, and then uses the composite expression for matching. For example, the regular expressions are a(\d+), b(\d+), c(\d+) and d(\d+), respectively, then the composite regular expression group is: P=(a(\d+))|(b(\d+))|(c(\d+))|(d(\d+)).

[0073] In a possible implementation manner, performing information matching on the target file based on the compound regular expression group and determining an information search result if the match is successful includes:

[0074] i: Based on the compound regular expression group, each line of content information of the target file is traversed and matched according to the first information search request, and matching content corresponding to the expression sequence of the compound regular expression group is determined; wherein the expression sequence is the arrangement order of each regular expression in the first initialization regular expression group.

[0075] Here, each line of content information of the target file is traversed and matched according to the compound regular expression group according to the first information search request to determine the matching content corresponding to the expression sequence of the compound regular expression group.

[0076] The expression sequence is the arrangement order of each regular expression in the first initialization regular expression group.

[0077] Here, the matching content is the matching content corresponding to each regular expression in the compound regular expression group. For example, if the above compound regular expression group p is used to match each line of the read file, the matching content in the return value of Python's re.findall method corresponds to the query result of each regular expression, and the position in the return value is also different. The position depends on the number of capture groups in the expression. Therefore, you only need to know the sequence of expressions in the DSL to calculate the unique correspondence between the position of non-empty content in the matching result and the specific regular expression.

[0078] ii: If the matching contents corresponding to the expression sequence are all empty, the matching fails, and the content information of the target file is matched again.

[0079] Here, if the matching contents corresponding to the expression sequence are all empty, the matching fails, and the content information of the target file is matched again.

[0080] iii: If any of the matching contents corresponding to the expression sequence is not empty, the match is successful and the information search result is determined.

[0081] Here, if any of the matching contents corresponding to the expression sequence is not empty, the match is successful and the information search result is determined.

[0082] In a possible implementation manner, the first initialization regular expression group is merged to generate a composite regular expression group, and information matching is performed on the target file based on the composite regular expression group. If the match is successful, after determining the information search result, the information search method further includes:

[0083] I: storing the merged first initialization regular expression group, the matching contents corresponding to the expression sequences of the compound regular expression group, and the compound regular expression group in a database.

[0084] Here, the combined first initialization regular expression group, the matching contents corresponding to the expression sequence of the compound regular expression group, and the compound regular expression group are stored in a database.

[0085] II: Detect whether the second information search request of the target file and the second initialization regular expression group corresponding to the second information search request are consistent with the first information search request and the first initialization regular expression group.

[0086] Here, it is detected whether the second information search request of the target file and the second initialization regular expression group corresponding to the second information search request are consistent with the first information search request and the first initialization regular expression group.

[0087] III: If so, the information search result corresponding to the compound regular expression is used as the information search result of the second information search request.

[0088] Here, if they are consistent, the information search result corresponding to the compound regular expression is directly used as the information search result of the second information search request, without the need to calculate the corresponding relationship or merge the expressions, but only to extract from the database.

[0089] In this application, a compound regular expression group is used for matching, and then which independent regular expression matches the relevant content is determined based on the matching results. Test results show that the time taken for compound regular expression group matching is much less than that of each regular expression in the original initialization regular expression group being matched independently, and the expression groups used for matching and their corresponding compound expressions are cached in memory as Python dictionaries to avoid repeated regular expression merging and compilation operations.

[0090] In a possible implementation manner, after merging the first initialization regular expression group to generate a composite regular expression group, performing information matching on the target file based on the composite regular expression group, and determining the information search result if the match is successful, the information search method further includes:

[0091] (I): Determine the target key node of the information search result in the abstract syntax tree.

[0092] (ii): deleting the determined regular expression in the first initialization regular expression group of the target key node to complete the update of the first initialization regular expression group of the target key node; wherein the determined regular expression is the regular expression corresponding to the information search result.

[0093] Here, the determined regular expressions in the first initialization regular expression group of the target key node are deleted to complete the update of the first initialization regular expression group of the target key node, thereby achieving that new content that may appear in the matching process will not appear again.

[0094] The determined regular expression is a regular expression corresponding to the non-empty matching content in the compound regular expression group.

[0095] For further information, see Figure 2 , Figure 2 This is a flowchart of a method for searching information in an electronic automation design file library provided in an embodiment of the present application. Figure 2 As shown, the user configures the file according to the YAML writing language to obtain an abstract syntax tree, reads the configured YAML according to the user's first information search request to determine the initialization regular expression group, merges the initialization regular expression group to obtain a composite regular expression group, obtains the target file from the electronic automation design file library, uses the composite regular expression group to traverse and match the target file, and detects whether the match is successful. If successful, the matching result is determined and saved, and then the initialization regular expression group is updated according to the matching result. If unsuccessful, the match is performed again.

[0096] The present application provides an information search method for an electronic automation design file library, the information search method comprising: performing DSL configuration definition on the content information and regular expression of each file in the electronic automation design file library based on the YAML writing language, generating an abstract syntax tree of the electronic automation design file library; traversing and reading the abstract syntax tree based on the first information search request of the target user, determining the target file corresponding to the first information search request in the abstract syntax tree and the first initialization regular expression group of the target file; merging the first initialization regular expression group to generate a composite regular expression group, matching the target file information based on the composite regular expression group, and if the match is successful, determining the information search result, and displaying the information search result to the target user. By using the DSL implemented by the YAML coding language to construct a syntax tree structure, the storage structure and extraction mode of key information in the file library are hierarchically expressed, and the separation of reading content and processing logic is realized, which is convenient for users to search for the information to be read according to their needs during use, and improves the accuracy and efficiency of information search.

[0097] See also Figure 3 , Figure 4 , Figure 3 One of the structural schematic diagrams of an information search device for an electronic automation design file library provided in an embodiment of the present application; Figure 4 This is a second structural diagram of an information search device for an electronic automation design file library provided in an embodiment of the present application. Figure 3 As shown in , the information search device 300 includes:

[0098] The configuration module 310 is used to perform DSL configuration definition on the content information and regular expression of each file in the electronic automation design file library based on the YAML writing language, and generate an abstract syntax tree of the electronic automation design file library;

[0099] A reading module 320 is used to traverse and read the abstract syntax tree based on a first information search request of a target user, and determine a target file corresponding to the first information search request in the abstract syntax tree and a first initialization regular expression group of the target file;

[0100] The matching module 330 is used to merge the first initialization regular expression group to generate a composite regular expression group, perform information matching on the target file based on the composite regular expression group, and if the match is successful, determine the information search result, and display the information search result to the target user.

[0101] Furthermore, when the configuration module is used to perform DSL configuration definition on the content information and regular expression of each file in the electronic automation design file library based on the YAML writing language to generate an abstract syntax tree of the electronic automation design file library, the configuration module is specifically used to:

[0102] Performing DSL configuration on the content information of the file based on the YAML writing language to generate key nodes;

[0103] Performing DSL configuration on the attribute information of the content information based on the YAML writing language to generate an attribute sub-node; wherein the attribute information includes format storage information, display information, and regular expression information;

[0104] A DSL structure is formed by the multiple key nodes and the multiple attribute sub-nodes, and the DSL structure is processed to generate an abstract syntax tree divided into levels.

[0105] Further, when the reading module is used to traverse and read the abstract syntax tree based on the first information search request of the target user, and determine the target file corresponding to the first information search request in the abstract syntax tree and the first initialization regular expression group of the target file, the reading module is specifically used to:

[0106] Reading the abstract syntax tree based on the first information search request of the target user, determining a plurality of target key nodes of the target file corresponding to the first information search request in the abstract syntax tree and target attribute subnodes of the target key nodes;

[0107] Based on the target attribute sub-node, the first initialization regular expression group is determined.

[0108] Further, when the matching module is used to perform information matching on the target file based on the composite regular expression group and determine the information search result if the match is successful, the matching module is specifically used to:

[0109] Based on the compound regular expression group, each line of content information of the target file is traversed and matched according to the first information search request, and matching content corresponding to the expression sequence of the compound regular expression group is determined; wherein the expression sequence is the arrangement order of each regular expression in the first initialization regular expression group;

[0110] If the matching contents corresponding to the expression sequence are all empty, the matching fails, and the content information of the target file is matched again;

[0111] If any of the matching contents corresponding to the expression sequence is not empty, the match is successful and the information search result is determined.

[0112] Further, such as Figure 4 As shown, the information search device 300 further includes a storage module 340, and the storage module 340 is used to:

[0113] The combined first initialization regular expression group, the matching contents corresponding to the expression sequences of the compound regular expression group, and the compound regular expression group are stored in a database;

[0114] Detecting whether a second information search request for the target file and a second initialization regular expression group corresponding to the second information search request are consistent with the first information search request and the first initialization regular expression group;

[0115] If so, the information search result corresponding to the compound regular expression is used as the information search result of the second information search request.

[0116] Further, such as Figure 4 As shown, the information search device 300 further includes an updating module 350, and the updating module 350 is used to:

[0117] Determine a target key node of the information search result in the abstract syntax tree;

[0118] The determined regular expression in the first initialization regular expression group of the target key node is deleted to complete the update of the first initialization regular expression group of the target key node; wherein the determined regular expression is the regular expression corresponding to the information search result.

[0119] The present application provides an information search device for an electronic automation design file library, the information search device comprising: a configuration module, which is used to perform DSL configuration definition on the content information and regular expression of each file in the electronic automation design file library based on the YAML writing language, and generate an abstract syntax tree of the electronic automation design file library; a reading module, which is used to traverse and read the abstract syntax tree based on the first information search request of the target user, and determine the target file corresponding to the first information search request in the abstract syntax tree and the first initialization regular expression group of the target file; a matching module, which is used to merge the first initialization regular expression group to generate a composite regular expression group, and perform information matching on the target file based on the composite regular expression group. If the match is successful, the information search result is determined, and the information search result is displayed to the target user. By using the DSL implemented by the YAML coding language to construct a syntax tree structure, the storage structure and extraction mode of key information in the file library are expressed hierarchically, and the separation of reading content and processing logic is realized, which is convenient for users to search for information to be read according to needs during use, and improves the accuracy and efficiency of information search.

[0120] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown in , the electronic device 500 includes a processor 510 , a memory 520 and a bus 530 .

[0121] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 is running, the processor 510 communicates with the memory 520 via the bus 530. When the machine-readable instructions are executed by the processor 510, the above-mentioned Figure 1 as well as Figure 2 The steps of the method for searching for information in the electronic automation design file library in the method embodiment shown in the figure, and the specific implementation manner can be referred to the method embodiment, which will not be described in detail here.

[0122] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 as well as Figure 2 The steps of the method for searching for information in the electronic automation design file library in the method embodiment shown in the figure, and the specific implementation manner can be referred to the method embodiment, which will not be described in detail here.

[0123] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0124] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0125] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0126] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0127] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

[0128] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for searching information in an electronic automation design document library, characterized in that: The information search method comprises: Performing DSL configuration definition on the content information and regular expressions of each file in the electronic automation design file library based on the YAML writing language, and generating an abstract syntax tree of the electronic automation design file library; Based on a first information search request of a target user, the abstract syntax tree is traversed and read to determine a target file corresponding to the first information search request in the abstract syntax tree and a first initialization regular expression group of the target file; The first initialization regular expression group is merged to generate a composite regular expression group, and information matching is performed on the target file based on the composite regular expression group. If the match is successful, an information search result is determined, and the information search result is displayed to the target user; The information matching of the target file based on the compound regular expression group is performed, and if the match is successful, the information search result is determined, including: Based on the compound regular expression group, each line of content information of the target file is traversed and matched according to the first information search request, and matching content corresponding to the expression sequence of the compound regular expression group is determined; wherein the expression sequence is the arrangement order of each regular expression in the first initialization regular expression group; If the matching contents corresponding to the expression sequence are all empty, the matching fails, and the content information of the target file is matched again; If any of the matching contents corresponding to the expression sequence is not empty, the match is successful and the information search result is determined.

2. The information search method according to claim 1, characterized in that: The DSL configuration definition is performed on the content information and regular expression of each file in the electronic automation design file library based on the YAML writing language to generate an abstract syntax tree of the electronic automation design file library, including: Performing DSL configuration on the content information of the file based on the YAML writing language to generate key nodes; Performing DSL configuration on the attribute information of the content information based on the YAML writing language to generate an attribute sub-node; wherein the attribute information includes format storage information, display information, and regular expression information; A DSL structure is formed by the multiple key nodes and the multiple attribute sub-nodes, and the DSL structure is processed to generate an abstract syntax tree divided into levels.

3. The information search method according to claim 1, characterized in that: The traversing and reading the abstract syntax tree based on the first information search request of the target user to determine the target file corresponding to the first information search request in the abstract syntax tree and the first initialization regular expression group of the target file include: Reading the abstract syntax tree based on the first information search request of the target user, determining a plurality of target key nodes of the target file corresponding to the first information search request in the abstract syntax tree and target attribute subnodes of the target key nodes; Based on the target attribute sub-node, the first initialization regular expression group is determined.

4. The information search method according to claim 1, characterized in that: The first initialization regular expression group is merged to generate a composite regular expression group, and the target file is matched with information based on the composite regular expression group. If the match is successful, after determining the information search result, the information search method further includes: The combined first initialization regular expression group, the matching contents corresponding to the expression sequences of the compound regular expression group, and the compound regular expression group are stored in a database; Detecting whether a second information search request for the target file and a second initialization regular expression group corresponding to the second information search request are consistent with the first information search request and the first initialization regular expression group; If so, the information search result corresponding to the compound regular expression group is used as the information search result of the second information search request.

5. The information search method according to claim 1, characterized in that: After merging the first initialization regular expression group to generate a composite regular expression group, performing information matching on the target file based on the composite regular expression group, and determining an information search result if the match is successful, the information search method further includes: Determine a target key node of the information search result in the abstract syntax tree; The determined regular expression in the first initialization regular expression group of the target key node is deleted to complete the update of the first initialization regular expression group of the target key node; wherein the determined regular expression is the regular expression corresponding to the information search result.

6. An information search device for an electronic automation design file library, characterized in that: The information searching device comprises: A configuration module, used to perform DSL configuration definition on the content information and regular expression of each file in the electronic automation design file library based on the YAML writing language, and generate an abstract syntax tree of the electronic automation design file library; A reading module, configured to traverse and read the abstract syntax tree based on a first information search request of a target user, and determine a target file corresponding to the first information search request in the abstract syntax tree and a first initialization regular expression group of the target file; A matching module, configured to merge the first initialization regular expression group to generate a composite regular expression group, perform information matching on the target file based on the composite regular expression group, and if the match is successful, determine an information search result, and display the information search result to the target user; When the matching module is used to match the target file information based on the composite regular expression group and determine the information search result if the match is successful, the matching module is specifically used to: Based on the compound regular expression group, each line of content information of the target file is traversed and matched according to the first information search request, and matching content corresponding to the expression sequence of the compound regular expression group is determined; wherein the expression sequence is the arrangement order of each regular expression in the first initialization regular expression group; If the matching contents corresponding to the expression sequence are all empty, the matching fails, and the content information of the target file is matched again; If any of the matching contents corresponding to the expression sequence is not empty, the match is successful and the information search result is determined.

7. The information search device according to claim 6, characterized in that: When the configuration module is used to perform DSL configuration definition on the content information and regular expression of each file in the electronic automation design file library based on the YAML writing language to generate an abstract syntax tree of the electronic automation design file library, the configuration module is specifically used to: Performing DSL configuration on the content information of the file based on the YAML writing language to generate key nodes; Performing DSL configuration on the attribute information of the content information based on the YAML writing language to generate an attribute sub-node; wherein the attribute information includes format storage information, display information, and regular expression information; A DSL structure is formed by the multiple key nodes and the multiple attribute sub-nodes, and the DSL structure is processed to generate an abstract syntax tree divided into levels.

8. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the information search method for the electronic automation design file library as described in any one of claims 1 to 5.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for searching for information in an electronic automation design file library as claimed in any one of claims 1 to 5 are executed.

Citation Information

Patent Citations

  • Text matching method and device

    CN114510922A

  • Source code information retrieval method and device, electronic equipment, storage medium and product

    CN114880357A