A method of text search processing and related apparatus

By using the logical relationship between the keyword rule set and the preset search rule set to search for keywords in the log file, the problem of inaccurate search results caused by regular expressions is solved, and efficient and accurate keyword positioning and search results are achieved.

CN115997201BActive Publication Date: 2026-04-17HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2021-08-20
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies, when searching for keywords in log files based on regular expressions, are prone to jumping to other runtime path information, resulting in inaccurate search results that fail to meet users' search needs.

Method used

The keyword search is performed on multiple running path information by using keyword rules in the keyword rule set. The logical relationship in the preset search rule set is used to locate the keyword, avoiding global search and improving search efficiency and accuracy.

Benefits of technology

It enables efficient, fast, and accurate keyword searching in multi-path search scenarios, meeting users' search needs and reducing reliance on complex regular expressions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115997201B_ABST
    Figure CN115997201B_ABST
Patent Text Reader

Abstract

A method and related device for text search processing are disclosed. This method searches for keywords in multiple runtime path information using keyword rules from a keyword rule set, resulting in relatively accurate search results that meet user search needs. The method includes: obtaining first text, which includes one or more runtime path information; obtaining a preset search rule set, each preset search rule indicating a logical relationship between at least one keyword; searching for one or more second keywords based on the first keyword and the first preset search rule, where the first keyword is a keyword obtained from the first runtime path information, and the first runtime path information is any one of the one or more runtime path information; and determining a first search result based on the first keyword and the one or more second keywords. The method provided in this application can be applied to log text processing in electronic devices such as smart cars, terminals, and computers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information and communications technology (ICT), specifically to a method for text search processing and related equipment. Background Technology

[0002] Software code typically contains numerous branching structures. During the actual execution of the software code, running different branches records the corresponding execution path information in log files. When scanning and analyzing these log files, the execution path of the software code is usually identified based on keywords in the execution path information. This allows for the analysis of the actual execution behavior of the software code, enabling the implementation of appropriate quality control strategies.

[0003] However, common solutions rely on regular expressions to search for keywords in log files to generate search results. But since log files generated by software code over a period of time are all in the same file, searching for keywords from multiple execution paths using regular expressions is highly likely to jump from the current process's execution path to the execution path of other processes, leading to inaccurate search results and failing to meet user search needs. Summary of the Invention

[0004] This application provides a text search processing method and related equipment, which aims to search for keywords in multiple running path information through keyword rules in a keyword rule set, resulting in more accurate search results and meeting the user's search needs.

[0005] The first aspect of this application provides a method for text search processing, which can be applied to log analysis and processing scenarios. Additionally, this method can also be applied to devices such as terminal devices and vehicles. The method may include: obtaining a first text and a preset search rule set. The first text includes one or more operation path information, and the preset search rule set includes one or more preset search rules, each preset search rule indicating a logical relationship between at least one or more keywords. Then, based on the first keyword and the first preset search rule, one or more second keywords are searched. The first keyword is a keyword obtained based on the first operation path information, which is any one of one or more operation path information, and the first preset search rule is any one of one or more preset search rules corresponding to the first operation path information. Furthermore, a first search result is determined based on the first keyword and one or more second keywords, which indicates the operation behavior of the operation path corresponding to the first operation path information. Through this method, on the one hand, in a multi-path search scenario, keywords in multiple operation path information are searched using preset search rules in the preset search rule set. Users do not need to master complex regular expressions; they only need to understand the logical relationship between the multiple keywords to be searched. On the other hand, the first text with a large amount of data is divided into multiple sub-texts to be processed, each starting with the first keyword in each running path information. Moreover, each running path information corresponds to one or more preset search rules, which can efficiently, quickly and accurately search for the remaining keywords.

[0006] In some possible implementations, the method of searching for one or more second keywords based on a first keyword and a first preset search rule can be as follows: First, a first row value can be obtained, which identifies the row number where the first keyword is located. Then, based on the first row value and the first preset search rule, one or more second keywords are searched within a preset offset range. It should be noted that the preset offset range indicates the row offset value between one or more second keywords and the first keyword. Using the preset offset range, the search range containing the second keyword can be quickly determined. Thus, it is only necessary to search for second keywords that satisfy the preset search rule within the preset offset range, without needing to perform a global search, resulting in high search efficiency.

[0007] In some possible implementations, searching for one or more second keywords within a preset offset range based on the first row value and a first preset search rule includes: searching for a third keyword within the first preset offset range according to the first row value and the first preset search rule, where the third keyword is any one of the one or more second keywords, and the first preset offset range corresponds to the third keyword. Through this method, for any one of the one or more second keywords, i.e., the third keyword, a search can be performed within its corresponding first preset offset range, improving search efficiency.

[0008] In some possible implementations, the logical relationship includes at least one of the following: a first identifier, a second identifier, and a third identifier, wherein the first identifier indicates that one or more keywords exist within a preset offset range, the second identifier indicates that one of multiple keywords exists within the preset offset range, and the third identifier indicates that one or more keywords do not exist within the preset offset range.

[0009] In some possible implementations, the one or more second keywords further include a fourth keyword and a fifth keyword. The fourth keyword is searched based on a second preset offset range, which is obtained from the row offset value between the fourth keyword and the first keyword, where the fourth keyword is one or more second keywords; or, the second preset offset range is obtained from the row offset value between the fifth keyword and the fourth keyword, and the row offset value between the fourth keyword and the first keyword, where the fifth keyword is a keyword among the one or more second keywords that is different from the fourth keyword. Through the above methods, multiple ways to determine the second preset offset range are provided, applicable to various possible scenarios.

[0010] In some possible implementations, obtaining the first line value may include: obtaining second text, which is obtained by processing the first text using a hash algorithm. Then, the first line value is obtained based on the second text. Through the above method, processing the first text using a hash algorithm transforms the first text into second text that stores data line by line. This not only allows for quick identification of the line number containing the keyword in each running path information based on the second text, but also enables rapid vertical searching.

[0011] In some possible implementations, the keyword type includes string type and / or key-value pair type.

[0012] In some possible implementations, besides searching for one or more second keywords from the first running path information based on the first keyword and the first preset search rule, and thereby detecting the running behavior of the running path corresponding to the first running path information through the obtained first search result, the same operation can also be performed on the remaining running path information based on other preset search rules in the preset search rule set. That is, the text search processing method further includes: searching for one or more seventh keywords from the second running path information based on the sixth keyword and the second preset search rule, where the sixth keyword is a keyword obtained based on the second running path information, and the second preset search rule is any one of one or more preset search rules corresponding to the second running path information. Then, a second search result is determined based on the sixth keyword and one or more seventh keywords. This second search result is used to indicate the running behavior of the running path corresponding to the second running path information.

[0013] It should be noted that the second running path information is different from the first running path information. Furthermore, the second preset search rule may be the same as or different from the first preset search rule; this application does not impose any restrictions on this. Additionally, the sixth keyword and the first keyword may be the same as or different; this application also does not impose any restrictions on this.

[0014] Secondly, embodiments of this application provide a text search device. This text search device can be a terminal device, vehicle, intelligent car, computer, etc. The text search device includes an acquisition unit and a processing unit. The acquisition unit is used to acquire first text and a preset search rule set. The first text includes one or more operation path information, and the preset search rule set includes one or more preset search rules, each preset search rule indicating the logical relationship between multiple keywords included in the corresponding operation path information. The processing unit is used to search for one or more second keywords based on the first keyword and the first preset search rule, and to determine a first search result based on the first keyword and the one or more second keywords. It should be noted that the first keyword is a keyword obtained based on the first operation path information, the first operation path information is any one of the one or more operation path information, the first preset search rule is any one of the one or more preset search rules corresponding to the first operation path information, and the first search result is used to indicate the operation behavior of the operation path corresponding to the first operation path information.

[0015] In some possible implementations, the acquisition unit is used to acquire a first row value, which identifies the row number where the first keyword is located. The processing unit is used to search for one or more second keywords within a preset offset range based on the first row value and a first preset search rule, where the preset offset range indicates the row offset value between the one or more second keywords and the first keyword.

[0016] In some possible implementations, the processing unit is further configured to search for a third keyword within a first preset offset range based on the first row value and the first preset search rule, wherein the third keyword is any one of the one or more second keywords, and the first preset offset range corresponds to the third keyword.

[0017] In some possible implementations, the logical relationship includes at least one of the following: a first identifier, a second identifier, and a third identifier. The first identifier indicates that one or more keywords exist within a preset offset range, the second identifier indicates that one of multiple keywords exists within the preset offset range, and the third identifier indicates that one or more keywords do not exist within the preset offset range.

[0018] In some possible implementations, the one or more second keywords further include a fourth keyword and a fifth keyword. The processing unit is configured to search for the fourth keyword according to a second preset offset range, the second preset offset range being obtained from the row offset value between the fourth keyword and the first keyword, wherein the fourth keyword is one or more second keywords; or, the second preset offset range is obtained from the row offset value between the fifth keyword and the fourth keyword, and the row offset value between the fourth keyword and the first keyword, wherein the fifth keyword is a keyword among the one or more second keywords that is different from the fourth keyword.

[0019] In some possible implementations, the acquisition unit is used to obtain a second text, which is obtained by processing the first text using a hash algorithm, and to obtain the first line value based on the second text.

[0020] In some possible implementations, the keyword type includes string type and / or key-value pair type.

[0021] In some possible implementations, the processing unit is further configured to: search for one or more seventh keywords from the second running path information based on a sixth keyword and a second preset search rule, wherein the sixth keyword is a keyword obtained according to the second running path information, and the second preset search rule is any one of one or more preset search rules corresponding to the second running path information. Then, the processing unit further determines a second search result based on the sixth keyword and one or more seventh keywords, the second search result being used to indicate the running behavior of the running path corresponding to the second running path information.

[0022] A third aspect of this application provides a vehicle that may include: a memory for storing computer-readable instructions. It may also include a processor coupled to the memory for executing the computer-readable instructions in the memory to perform the methods described in the first aspect or any possible implementation thereof.

[0023] A fourth aspect of this application provides a server that may include: a memory for storing computer-readable instructions. It may also include a processor coupled to the memory for executing the computer-readable instructions in the memory to perform the methods described in the first aspect or any possible implementation thereof.

[0024] The fifth aspect of this application provides a computer-readable storage medium that, when instructions are executed on a computer device, causes the computer device to perform the method described in the first aspect or any possible implementation thereof.

[0025] The sixth aspect of this application provides a computer program product that, when run on a computer, enables the computer to perform the methods described in the first aspect or any possible implementation thereof.

[0026] A seventh aspect of this application provides a chip system that may include a processor for supporting a text search device in implementing the functions involved in the methods described in the first aspect or any possible implementation of the first aspect.

[0027] Optionally, in conjunction with the seventh aspect above, in a first possible implementation, the chip system may further include a memory for storing program instructions and data necessary for the text search device. This chip system may be composed of chips or may include chips and other discrete devices. The chip system may include application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices. Furthermore, the chip system may also include interface circuits, etc.

[0028] It should be noted that the beneficial effects of the embodiments of the second to sixth aspects of this application can be understood with reference to the embodiments of the first aspect, and will not be repeated here.

[0029] In the technical solution provided by this application embodiment, since each running path information corresponds to one or more preset search rules, and each preset search rule indicates the logical relationship between multiple keywords included in the running path information, after obtaining the first keyword in the first running path information, one or more second keywords can be searched according to the first keyword and the first preset search rule, and then the first search result can be determined according to the first keyword and one or more second keywords. On the one hand, in the scenario of multi-path search, by searching for keywords in multiple running path information through keyword rules in the keyword rule set, the user does not need to master complex regular expressions, but only needs to understand the logical relationship between multiple keywords to be searched. On the other hand, dividing the large amount of log text to be processed into multiple sub-texts to be processed starting from the first keyword in each running path information can efficiently, quickly and accurately search for the remaining keywords. Attached Figure Description

[0030] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application.

[0031] Figure 1 A diagram illustrating the search keywords used in the relevant solutions;

[0032] Figure 2 A flowchart illustrating a text search processing method provided in this application;

[0033] Figure 3A A schematic diagram illustrating a pre-defined logical relationship between multiple keywords provided in this application;

[0034] Figure 3B A schematic diagram of an interface for establishing search rules provided in this application;

[0035] Figure 4 This is a schematic diagram illustrating a search method applying the solution of this application;

[0036] Figure 5 This is a schematic diagram of the hardware structure of the communication device provided in the embodiments of this application;

[0037] Figure 6 This is a schematic diagram of the structure of a message processing device provided in an embodiment of this application. Detailed Implementation

[0038] This application provides a text search processing method and related equipment, which aims to search for keywords in multiple running path information through keyword rules in a keyword rule set, resulting in more accurate search results and meeting the user's search needs.

[0039] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. It should be understood that the terms "comprising" and "including" used in the specification and claims of this application indicate the presence of the described features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or sets thereof. It should also be understood that the terminology used in this specification is merely for the purpose of describing specific embodiments and is not intended to limit the scope of this application.

[0040] Software code typically contains numerous branching structures. During the actual execution of the software code, running different branches records the corresponding execution path information in log files. When scanning and analyzing log files, the execution path of the software code is generally identified based on keywords (KW) in the execution path information. This allows for the analysis of the actual execution behavior of the software code, enabling the implementation of appropriate quality strategies.

[0041] However, the common approach is to use regular expressions to search for keywords in log files to obtain search results. See also... Figure 1 This is a diagram illustrating the search keywords used in the relevant solutions. From Figure 1 It can be seen that the log text generated by the software code in two different execution processes (e.g., execution process 1 and execution process 2) is all in the same log file. Furthermore, if a user wants to search for logs generated in execution process 2 using keywords KW01, KW02, and KW03, based on traditional regular expressions, the search will most likely return line01.KW01 and line03.KW02 generated in execution process 1, and line09.KW03 generated in execution process 2. Clearly, when searching for keywords from multiple execution path information using regular expressions, there is a high probability that the search will jump from the execution path information in the current process 2 to the execution path information in other processes 1, resulting in inaccurate search results and failing to meet the user's search requirements.

[0042] Therefore, to address the technical problems arising from the aforementioned related solutions, this application provides a text search processing method. This method searches for keywords in multiple operational path information using keyword rules (KWR) within a keyword rules set (KWRS). The search results are relatively accurate and meet user search needs. This text search processing method can be applied to vehicles, terminal devices, servers, and other devices. Vehicles may include, but are not limited to, smart cars. Terminal devices may include, but are not limited to, personal computers, mobile phones, tablets, wearable smart devices, etc. This text search processing method can be applied to log analysis and processing scenarios. For example, it is applicable to the analysis and processing of software logs from in-vehicle products, logs generated during system operation, etc., and can also be applied to the analysis of logs from other product forms; no limitation is made here. Furthermore, this text search processing method can also be applied throughout the entire product lifecycle, as well as during development, debugging, maintenance, etc., without further explanation.

[0043] Figure 2 This is a flowchart illustrating a text search processing method provided in an embodiment of this application. Figure 2 The text search processing method shown can be applied to text search devices, which may include, but are not limited to, vehicles, terminal devices, servers, etc., and are not limited here. Figure 2 As shown, the text search processing method includes the following steps:

[0044] 201. Obtain the first text, which includes one or more running path information.

[0045] In this example, running the software code at different stages generates corresponding log text. Each log text includes one or more execution path information entries, and each execution path entry can contain multiple keywords. Therefore, for each execution stage, the first log text within that stage can be retrieved.

[0046] Furthermore, since the first text can be stored on a local server or other device, or uploaded and saved in the cloud, it can be obtained either from a local server or from the cloud. In practical applications, other acquisition methods may also exist, which are not limited here. In addition, the first text includes, but is not limited to, log text from vehicle power management, software logs from in-vehicle products, and logs generated during system operation, etc., which are not limited here.

[0047] It should be noted that the keyword type can include string and / or key-value (KV) type. The key-value type is a dictionary type with operators, and its general format is: key op value. For example: state = Init, date: 20201104. In practical applications, the keyword type may also be other types, which are not limited here.

[0048] 202. Obtain a set of preset search rules. The set of preset search rules includes one or more preset search rules, each of which is used to indicate the logical relationship between at least one keyword.

[0049] In this example, since each run path information may include multiple keywords, the logical relationship between at least one keyword in each run path information is set as a preset search rule. Thus, one run path information can correspond to one or more preset search rules, and these one or more preset search rules are combined to form the preset search rule set.

[0050] For example, regarding runtime path information A, the logical relationship between at least one keyword included in runtime path information A can be found in [reference needed]. Figure 3A To understand. For example Figure 3A As shown, the logical relationship can be: KW1 needs to appear in the running path information A, which can be identified by the symbol "AND"; either KW2a or KW2b needs to appear in the running path information A, which can be identified by the symbol "OR"; KW3 does not need to appear in the running path information A, which can be identified by the symbol "NOT"; KW4 needs to appear in the running path information A, indicating the end of the search in the running path information A, which can be identified by the symbol "AND". Based on this, we can... Figure 3A The logical relationship shown is configured as a preset search rule corresponding to the running path information A.

[0051] See Figure 3B This is a schematic diagram of an interface for establishing search rules provided in this application. Figure 3B As can be seen, the input windows for this preset search rule in the interactive display interface include a "Keyword Type" input window, a "Keyword" input window, a "Keyword Value" input window, a "Logical Relationship" input window, and a "Preset Offset Range" input window. Users can fill in the various keywords that satisfy the logical relationship according to their actual needs. Figure 3B In the corresponding input window, you will get a preset search rule.

[0052] For example, if a user needs to search for keywords in "vehicle power management log text" and wants to find results that meet the above criteria... Figure 3A The keywords for the logical relationships shown are, for example: KW1 is the vehicle, KW2a is the power source, KW2b is the remaining power, KW3 is management, and KW4 is consumption.

[0053] Therefore, the user can use the String type KW1 as the search entry for the running path information A in the "Log text of vehicle power management", and fill in the following in the "Keyword type" input window, "Keyword" input window, "Operator" input window, "Keyword value" input window, "Logical relationship" input window, and "Preset line offset range" input window respectively: String, KW1, "", vehicle, AND, 0.

[0054] Similarly, if a user wants to search for either keyword KW2a or KW2b within a preset offset range with a maximum row offset of 2, the user can add two keyword search windows. Specifically, for one keyword, the user enters the following in the "Keyword Type" input window, "Keyword" input window, "Operator" input window, "Keyword Value" input window, "Logical Relationship" input window, and "Preset Row Offset Range" input window: String, KW2a, "", Power, OR, 2. Similarly, for the other keyword, the user enters the following in the same window: String, KW2b, "", Remaining Battery Power, OR, 2.

[0055] Similarly, if a user wants to find the keyword "management" within a preset offset range with a maximum row offset of 5, they can add a new keyword search window and enter the following in the "Keyword Type" input window, "Keyword" input window, "Operator" input window, "Keyword Value" input window, "Logical Relationship" input window, and "Preset Row Offset Range" input window: KV, KW3, "", Management, NOT, 5.

[0056] In addition, users may also want to find the keyword "consumption" within a preset offset range with a maximum row offset of 7. In this case, users can enter the following in the "Keyword Type" input window, "Keyword" input window, "Operator" input window, "Keyword Value" input window, "Logical Relationship" input window, and "Preset Row Offset Range" input window respectively: String, KW4, "", Consumption, AND, 7.

[0057] In this way, after the user fills in the logical relationship between each keyword they need to search for in the interactive display interface, a preset search rule corresponding to that logical relationship can be generated. It should be noted that, for... Figure 3B The values ​​of the various input windows shown are merely illustrative and are not intended to be limiting in this application. The described preset offset range can be understood with reference to the content in step 203, which will not be elaborated here.

[0058] The preset search rule can be a piece of machine-executable code, including but not limited to formats such as XML, JSON, and YAML. For example, Figure 3B The preset search rules corresponding to the running path information A shown can be represented in XML format, as follows:

[0059]

[0060]

[0061] It should be noted that the above is based on only one perspective. Figure 3A The logical relationship shown is used as an example to describe a preset search rule corresponding to the running path information A in the vehicle power management log text. In practical applications, preset search rules corresponding to the running path information A can also be set based on other logical relationships. Furthermore, for multiple running path information entries, one or more preset search rules corresponding to each running path information entry can also refer to the above. Figure 3A The logical relationships shown are for understanding purposes only and will not be elaborated upon here.

[0062] 203. Based on the first keyword and the first preset search rule, search for one or more second keywords, where the first keyword is a keyword obtained based on the first running path information.

[0063] In this example, one or more corresponding preset search rules are configured for each run path information. Furthermore, when searching for keywords in each run path information, a preset search keyword must first be set as the search entry point for the current run path information. Therefore, a first keyword can be obtained based on the first run path information, or in other words, the preset search keyword in the first run path information can be determined as the first keyword. Then, after obtaining the first keyword, one or more second keywords can be searched from the first run path information based on the first keyword and the first preset search rule.

[0064] For example, suppose the first preset search rule is: Figure 3A and Figure 3BThe search rules shown are used, and the first running path information is running path information A in the log text of the vehicle's power management. At this time, the user can use KW1 in the preset search rules as the search entry point for running path information A, i.e., the first keyword. Thus, based on KW1 and the aforementioned... Figure 3A and Figure 3B The preset search rules shown can search for other keywords that match the preset search rules from the running path information A, namely one or more second keywords, such as KW2a or KW2b, and KW4.

[0065] In some possible examples, to quickly find the remaining keywords, a maximum row offset can be set for each keyword. For instance, in step 203, finding one or more second keywords can be done as follows: obtain a first row value, which identifies the row number where the first keyword is located. Then, based on the first row value and a first preset search rule, find one or more second keywords within a preset offset range.

[0066] It should be noted that the preset offset range indicates the line offset value between one or more second keywords and the first keyword. Alternatively, it can be understood as setting a line offset range for each second keyword, that is, using the line offset range to represent the line offset value between the current second keyword and the first keyword. In this way, only the remaining keywords need to be searched within a certain line offset range, eliminating the need for a full-text search and improving search efficiency. The described line offset range is an estimate and is not specified here.

[0067] For example, one or more second keywords can be searched within a preset offset range based on the first row value and the first preset search rule. Alternatively, a third keyword can be searched within a first preset offset range based on the first row value and the first preset search rule, where the third keyword is any one of the one or more second keywords, and the first preset offset range corresponds to the third keyword.

[0068] For example, with Figure 3BTaking the preset search rules shown as an example, KW1 is the first keyword, and its own row offset range is 0. KW2a, as a second keyword to be searched, can be set to have a maximum row offset range of 2 from the row containing KW1. In this case, it is only necessary to search for KW2a in the two rows following KW1. Similarly, KW2b, KW3, and KW4, as other second keywords to be searched, can have their maximum row offset ranges from the row containing KW1 set to 2, 5, and 7, respectively. It should be noted that only the row offset range of 2 is used as an example to illustrate the row offset range between KW2a, KW2b and KW1. In practical applications, other row offset ranges can also be set, such as 4, 8, etc., without limitation here. In addition, the row offset ranges of KW3 and KW4 can also be set to other values, without limitation here. Furthermore, if the row offset range of KW2a is set to 0, it indicates that KW2a and KW1 are located in the same row of the running path information A. The rest, such as KW3 and KW4, can also be understood by referring to KW2a.

[0069] When a row offset range is set for each second keyword, the logical relationship can also be set to determine whether each keyword needs to appear within the corresponding row offset range. Specifically, the logical relationship can include at least one of the following: a first identifier, a second identifier, and a third identifier. The first identifier indicates that one or more of the keywords exist within the preset offset range, the second identifier indicates that one of the multiple keywords exists within the preset offset range, and the third identifier indicates that one or more of the keywords do not exist within the preset offset range.

[0070] It should be noted that the first identifier can be understood as the aforementioned Figure 3A In the "AND" symbol, the second identifier can be understood as... Figure 3A The "OR" in the text, as well as the third identifier, can also be understood as... Figure 3A The "NOT" in the text. In practical applications, the first, second, and third identifiers can also be represented by other identifiers, which are not specified here.

[0071] Additionally, in some examples, a preset offset range can be directly set for each second keyword. That is, if the one or more second keywords also include a fourth and a fifth keyword, then the preset offset range for each second keyword can be determined in the following two ways:

[0072] ① Search for the fourth keyword according to a second preset offset range. The second preset offset range is obtained from the row offset value between the fourth keyword and the first keyword. The fourth keyword is one or more second keywords. That is, a second preset offset range can be set directly for each fourth keyword. In this case, the second preset offset range is the row offset value between each fourth keyword and the first keyword. For example, if the fourth keyword to be searched is KW2a, then the row offset value between KW2a and KW1 can be set to 6, 7, 8, etc. In this case, the range of the second preset offset range can be 6 to 8. That is, in this case, it is only necessary to search for KW2a in the last 8 rows of the row where KW1 is located.

[0073] ② Alternatively, search for the fourth keyword based on the second preset offset range. The second preset offset range is obtained by the row offset value between the fifth keyword and the fourth keyword, and the row offset value between the fourth keyword and the first keyword. The fifth keyword is a keyword that is different from the fourth keyword among the one or more second keywords.

[0074] For example, if the fifth keyword to be searched is KW4, and the row offset values ​​between the fourth keyword KW2a and KW1 are known to be 6, 7, 8, etc. (i.e., the row offset range of KW2a is 6 to 8), then to set a row offset range for KW4, we can set the row offset value between KW4 and KW2a (e.g., 1 to 2) based on the row offset range set for the fourth keyword KW2a (i.e., 6 to 8) and the row offset value between KW4 and KW2a (i.e., 1 to 2). Thus, based on the row offset range set for the fourth keyword KW2a (i.e., 6 to 8) and the row offset value between KW4 and KW2a (i.e., 1 to 2), we can determine the second preset offset range between KW4 and KW1, which is 7 to 10.

[0075] The following explanation uses one or more execution path information (i.e., the first execution path information) as an example. The first file is processed using a hash algorithm to obtain the second text. Then, based on this second text, the first line value is obtained, and the first keyword of the line indicated by this first line value is used as the search entry point. Then, within a preset offset range, a search is performed according to a preset search rule corresponding to the first execution path information to find one or more second keywords that satisfy the preset search rule. It should be noted that the described hash algorithm includes, but is not limited to, the MD5 message-digest algorithm (MD5), MD4 algorithm, etc., but is not limited to these here.

[0076] For example, Figure 4 A schematic diagram illustrating a search method applying this application is shown. From Figure 4As can be seen, the first text, after being processed by a hash algorithm, can be transformed into the second text. It should be noted that this second text can be understood as a matrix-like text structure stored row by row. From this second text, the row containing the first keyword (e.g., KW1), such as No.1, No.5, No.9, etc., can be quickly identified. Then, using the first keyword in the row containing No.1, No.5, and No.9 as the search entry point, a segmented search and matching process is performed to find the second keyword, until all segments have been searched. Clearly, from... Figure 4 It can be seen that the second keyword found in segment 1 and segment 3 conforms to the preset search rule.

[0077] It should be noted that among multiple running path information, one can also refer to searching for one or more keywords from the first running path information for understanding, which will not be elaborated here.

[0078] 204. Determine the first search result based on the first keyword and one or more second keywords.

[0079] In this example, after finding one or more second keywords, the first keyword can be combined to determine the first search result. This could be the running scenario corresponding to the first running path information, or the exception information generated when running the first running path information. This first search result can reflect the running behavior of the running paths corresponding to one or more running path information. For example, the first search result can reveal which running paths have encountered errors or alarms. Furthermore, the system's operational status can be analyzed based on the error or alarm information corresponding to the running paths that have encountered errors or alarms.

[0080] It should be noted that the first search result will change depending on the first preset search rule. For example, for the same running path information A, there are two first preset search rules (i.e., search rule A and search rule B). If search rule A and search rule B are different, then the other second keywords found in running path information A according to search rule A will also be different from the second keywords found in running path information A according to search rule B, thus determining a different first search result.

[0081] The above mainly describes how to find one or more keywords from the perspective of any one of the one or more operation path information (i.e., the first operation path information). When the first text includes multiple operation path information, the user wants to find the corresponding keywords from each of these multiple operation path information to achieve analysis of the entire first text. Therefore, in some other possible embodiments, the text search processing method may further include: searching for one or more seventh keywords from the second operation path information based on the sixth keyword and the second preset search rule. Then, a second search result is determined based on the sixth keyword and the one or more seventh keywords, and the second search result is used to indicate the operation behavior of the operation path corresponding to the second operation path information.

[0082] It should be noted that the sixth keyword is a preset search keyword in the second running path information. This sixth keyword can be understood with reference to the first keyword in the aforementioned first running path information, and will not be elaborated upon here. Furthermore, this sixth keyword may be the same as or different from the first keyword; no limitation is made here. Additionally, the second running path information can also be understood as any one of one or more running path information. However, it should be noted that this second running path information is different from the first running path information. Furthermore, the second preset search rule is any one of one or more preset search rules corresponding to the second running path information. The described second preset search rule can also be understood with reference to the aforementioned first preset search rule, and will not be elaborated upon here.

[0083] In this embodiment, since each running path information corresponds to one or more preset search rules, and each preset search rule indicates the logical relationship between at least one keyword, after obtaining the first keyword based on the first running path information, one or more second keywords can be found based on the first keyword and the first preset search rule, and then the first search result can be determined based on the first keyword and one or more second keywords. On the one hand, in a multi-path search scenario, by searching for keywords in multiple running path information through keyword rules in the keyword rule set, the user does not need to master complex regular expressions, but only needs to understand the logical relationship between the multiple keywords to be searched. On the other hand, by dividing the large amount of first text into multiple sub-texts to be processed starting from the first keyword in each running path information, and since each running path information corresponds to one or more preset search rules, the remaining keywords can be searched efficiently, quickly, and accurately.

[0084] The foregoing mainly describes the solutions provided by the embodiments of this application from a methodological perspective. It is understood that the text search device described above includes hardware structures and / or software modules corresponding to the execution of each function in order to achieve the aforementioned functions. Those skilled in the art should readily recognize that, in conjunction with the functions described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0085] From the perspective of physical devices, the above-mentioned text search device can be implemented by a single physical device, or by multiple physical devices working together, or it can be a logical functional unit within a single physical device. This application does not specifically limit this.

[0086] For example, the aforementioned text search device can be derived from... Figure 5 It is implemented using communication devices. Figure 5 This is a schematic diagram of the hardware structure of a communication device provided in an embodiment of this application. The communication device includes at least one processor 501, a memory 502, and a transceiver 503.

[0087] The processor 501 can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program according to the present application. The processor 501 is capable of performing operations such as judgment, analysis, and calculation, including searching for one or more second keywords based on a first keyword and a first preset search rule. Furthermore, the processor 501 also includes determining a first search result based on the first keyword and one or more second keywords.

[0088] Transceiver 503, using any transceiver-like device, is used to communicate with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc. Transceiver 503 can be connected to processor 501. This transceiver 503 can acquire first text and a preset set of search rules, etc.

[0089] Memory 502 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 502 may exist independently or may be connected to processor 501. Memory 502 may also be integrated with processor 501.

[0090] The memory 502 stores computer execution instructions for implementing the scheme of this application, and its execution is controlled by the processor 501. The processor 501 executes the computer execution instructions stored in the memory 502, thereby implementing the text search processing method provided in the above-described method embodiments of this application.

[0091] In one possible implementation, the computer execution instructions in the embodiments of this application may also be referred to as application code, and the embodiments of this application do not specifically limit this.

[0092] In a specific implementation, as one example, the processor 501 may include one or more CPUs, for example... Figure 5 CPU0 and CPU1 in the CPU.

[0093] From the perspective of functional units, this application can divide the text search device into functional units according to the above method embodiments. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one functional unit. The integrated functional unit can be implemented in hardware or in software.

[0094] For example, when dividing the functional units using an integrated approach. Figure 6 A schematic diagram of the structure of a text search device provided in an embodiment of this application is shown. Figure 6 As shown, one embodiment of the text search device of this application may include: an acquisition unit 601 and a processing unit 602.

[0095] The acquisition unit 601 is used to acquire the first text, which includes one or more running path information. For specific implementation details, please refer to the preceding description. Figure 2 The detailed explanation of step 201 is not repeated here.

[0096] The acquisition unit 601 is also used to acquire a preset search rule set, which includes one or more preset search rules, each preset search rule indicating a preset logical relationship between at least one keyword. For specific implementation details, please refer to the foregoing. Figure 2 The detailed explanation of step 202 is not repeated here.

[0097] Processing unit 602 is configured to search for one or more second keywords based on a first keyword and a first preset search rule. The first keyword is a keyword obtained from first running path information, the first running path information is any one of the one or more running path information, and the first preset search rule is any one of the one or more preset search rules corresponding to the first running path information. For specific implementation details, please refer to the foregoing. Figure 2 The detailed explanation of step 203 is not repeated here.

[0098] Processing unit 602 is also used to determine a first search result based on the first keyword and one or more second keywords. For specific implementation details, please refer to the foregoing. Figure 2 The detailed explanation of step 204 is not repeated here.

[0099] In some optional embodiments, the processing unit 602 is configured to: obtain a first row value, and based on the first row value and a first preset search rule, search for one or more second keywords within a preset offset range. The first row value identifies the row number where the first keyword is located, and the preset offset range indicates the row offset value between the one or more second keywords and the first keyword. For specific implementation details, please refer to the foregoing. Figure 2 The detailed explanation of step 203 is not repeated here.

[0100] In some alternative embodiments, the processing unit 602 is further configured to search for a third keyword within a first preset offset range based on the first row value and the first preset search rule, wherein the third keyword is any one of the one or more second keywords, and the first preset offset range corresponds to the third keyword. For specific implementation details, please refer to the foregoing. Figure 2 The detailed explanation of step 203 is not repeated here.

[0101] In some alternative embodiments, the logical relationship includes a first identifier, a second identifier, and / or a third identifier, wherein the first identifier indicates that one or more keywords exist within a preset offset range, the second identifier indicates that one of multiple keywords exists within the preset offset range, and the third identifier indicates that one or more keywords do not exist within the preset offset range.

[0102] In some alternative embodiments, the one or more second keywords further include a fourth keyword and a fifth keyword. The processing unit 602 is configured to search for the fourth keyword according to a second preset offset range, the second preset offset range being obtained from the row offset value between the fourth keyword and the first keyword, wherein the fourth keyword is one or more second keywords; or, the second preset offset range is obtained from the row offset value between the fifth keyword and the fourth keyword, and the row offset value between the fourth keyword and the first keyword, wherein the fifth keyword is a keyword among the one or more second keywords that is different from the fourth keyword.

[0103] In some alternative embodiments, the acquisition unit 601 is configured to: acquire a second text, which is obtained by processing the first text using a hash algorithm; and acquire the first line value based on the second text.

[0104] In some alternative embodiments, the keyword type includes string type and / or key-value pair type.

[0105] In some other possible implementations, the processing unit 602 is further configured to: search for one or more seventh keywords from the second running path information based on a sixth keyword and a second preset search rule, wherein the sixth keyword is a keyword obtained according to the second running path information, and the second preset search rule is any one of one or more preset search rules corresponding to the second running path information. Then, the processing unit 602 further determines a second search result based on the sixth keyword and one or more seventh keywords, the second search result being used to indicate the running behavior of the running path corresponding to the second running path information.

[0106] The text search device provided in this application embodiment is used to perform... Figure 2 The methods in the corresponding method embodiments are as follows, therefore the embodiments of this application can be referred to. Figure 2 The relevant parts of the corresponding method embodiments should be understood. Furthermore, this text search device may include, but is not limited to, vehicles, terminal devices, servers, etc.

[0107] In this embodiment, the text search device is presented as an integrated unit comprised of functional units. Here, "functional unit" can refer to an application-specific integrated circuit (ASIC), a processor and memory executing one or more software or firmware programs, integrated logic circuitry, and / or other devices that can provide the aforementioned functions. In a simple embodiment, those skilled in the art will recognize that the text search device can employ... Figure 5 As shown in the figure.

[0108] for example, Figure 5 The processor 501 can invoke computer execution instructions stored in the memory 502 to cause the text search device to perform... Figure 2 The method executed by the text search device in the corresponding method embodiment.

[0109] Specifically, Figure 6 The function / implementation process of the processing unit 602 can be achieved through... Figure 5 The processor 501 in the memory 502 calls the computer execution instructions stored in the memory to achieve this. Figure 6 The function / implementation process of the acquisition unit 601 can be achieved through... Figure 5 It is implemented using the transceiver device 503.

[0110] In this application Figure 5The various components in the device are communicatively connected, that is, the processing unit (or processor), storage unit (or memory), and transceiver device (transceiver) communicate with each other through internal connection paths to transmit control and / or data signals. The above-described method embodiments of this application can be applied to a processor, or the steps of the above-described method embodiments can be implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above-described method embodiments can be completed by the integrated logic circuit in the processor or by instructions in the form of software. The processor mentioned above may be a central processing unit (CPU), a network processor (NP) or a combination of CPU and NP, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in this application can be directly manifested as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules within the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the aforementioned method. Although only one processor is shown in the figure, the device may include multiple processors or the processor may include multiple processing units. Specifically, the processor can be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor.

[0111] Memory is used to store computer instructions executed by the processor. Memory can be a storage circuit or a memory. Memory can be volatile memory or non-volatile memory, or it can include both volatile and non-volatile memory. Non-volatile memory can be read-only memory, programmable read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, or flash memory. Volatile memory can be random access memory, used as an external cache. Memory can be independent of the processor or it can be a storage unit within the processor; this is not limited here. Although only one memory is shown in the figure, the device may include multiple memories or the memory may include multiple storage units.

[0112] A transceiver is used to enable content interaction between the processor and other units or network elements. Specifically, the transceiver can be a communication interface of the device, a transceiver circuit or communication unit, or a transceiver transceiver. The transceiver can also be the processor's communication interface or transceiver circuit. Optionally, the transceiver can be a transceiver chip. The transceiver can also include a sending unit and / or an acquiring unit. In one possible implementation, the transceiver can include at least one communication interface. In another possible implementation, the transceiver can also be a unit implemented in software. In various embodiments of this application, the processor can interact with other units or network elements through the transceiver. For example, the processor acquires or receives content from other network elements through the transceiver. If the processor and the transceiver are physically separate components, the processor can interact with other units of the device without going through the transceiver.

[0113] In one possible implementation, the processor, memory, and transceiver can be interconnected via a bus. This bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. The bus can be categorized as an address bus, data bus, control bus, etc.

[0114] In this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being better or more advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0115] In the various embodiments of this application, numerous examples have been provided for ease of understanding. However, these examples are merely illustrations and do not imply the best way to implement this application.

[0116] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, they can be implemented in whole or in part in the form of a computer program product.

[0117] A computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, they generate, in whole or in part, the processes or functions according to embodiments of this application. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

[0118] The technical solutions provided in this application have been described in detail above. Specific examples have been used in this application to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method of text search, characterized by, include: Obtain the first text, which includes one or more runtime path information; Obtain a set of preset search rules, which includes one or more preset search rules. Each running path information corresponds to one or more preset search rules, and each preset search rule is used to indicate the logical relationship between at least one keyword. Searching for one or more second keywords based on a first keyword and a first preset search rule, wherein the first keyword is a keyword obtained based on first running path information, the first running path information is any one of the one or more running path information, and the first preset search rule is any one of the one or more preset search rules corresponding to the first running path information; wherein, searching for one or more second keywords based on the first keyword and the first preset search rule includes: obtaining a first row value, the first row value being used to identify the row number where the first keyword is located; and searching for one or more second keywords within a preset offset range based on the first row value and the first preset search rule, the preset offset range indicating the row offset value between one or more second keywords and the first keyword; A first search result is obtained based on the first keyword and one or more second keywords.

2. The method of claim 1, wherein, Based on the first row value and the first preset search rule, search for one or more second keywords within a preset offset range, including: Based on the first row value and the first preset search rule, a third keyword is searched within a first preset offset range. The third keyword is any one of the one or more second keywords, and the first preset offset range corresponds to the third keyword.

3. The method of any one of claims 1-2, wherein, The logical relationship includes at least one of the following: a first identifier, a second identifier, and a third identifier, wherein the first identifier indicates that one or more of the keywords exist within the preset offset range, the second identifier indicates that one of the multiple keywords exists within the preset offset range, and the third identifier indicates that one or more of the keywords do not exist within the preset offset range.

4. The method according to any one of claims 1 to 2, characterized in that, The method further includes: The one or more second keywords also include fourth and fifth keywords; The fourth keyword is searched according to a second preset offset range, where the second preset offset range is obtained from the row offset between the fourth keyword and the first keyword, and the fourth keyword is one or more of the second keywords; or... The second preset offset range is obtained by the row offset value between the fifth keyword and the fourth keyword, and the row offset value between the fourth keyword and the first keyword, wherein the fifth keyword is a keyword that is different from the fourth keyword among the one or more second keywords.

5. The method according to any one of claims 1 to 2, characterized in that, The process of obtaining the first row value includes: Obtain the second text, which is obtained by processing the first text using a hash algorithm; The first line value is obtained based on the second text.

6. The method according to any one of claims 1 to 2, characterized in that, The keyword type includes string type and / or key-value pair type.

7. A text search device, characterized in that, include: The acquisition unit is used to acquire first text, which includes one or more running path information. The acquisition unit is used to acquire a preset search rule set, which includes one or more preset search rules, each of which is used to indicate a logical relationship between at least one or more keywords. The processing unit is configured to search for one or more second keywords based on a first keyword and a first preset search rule. The first keyword is a keyword obtained based on first running path information, which is any one of the one or more running path information. The first preset search rule is any one of the one or more preset search rules corresponding to the first running path information. The acquisition unit is configured to acquire a first row value, which identifies the row number where the first keyword is located. The processing unit is configured to search for one or more second keywords within a preset offset range based on the first row value and the first preset search rule. The preset offset range indicates the row offset value between one or more second keywords and the first keyword. The processing unit is configured to obtain a first search result based on the first keyword and one or more second keywords.

8. The text search device according to claim 7, characterized in that, The processing unit is further configured to search for a third keyword within a first preset offset range based on the first row value and the first preset search rule, wherein the third keyword is any one of the one or more second keywords, and the first preset offset range corresponds to the third keyword.

9. The text search device according to any one of claims 7 to 8, characterized in that, The logical relationship includes a first identifier, a second identifier, and / or a third identifier. The first identifier indicates that one or more of the keywords exist within the preset offset range. The second identifier indicates that one of the multiple keywords exists within the preset offset range. The third identifier indicates that one or more of the keywords do not exist within the preset offset range.

10. The text search device according to any one of claims 7 to 8, characterized in that, The one or more second keywords also include fourth and fifth keywords; The processing unit is configured to search for the fourth keyword according to a second preset offset range, wherein the second preset offset range is obtained by the row offset value between the fourth keyword and the first keyword, and the fourth keyword is one or more of the second keyword; Alternatively, the second preset offset range is obtained by the row offset value between the fifth keyword and the fourth keyword, and the row offset value between the fourth keyword and the first keyword, wherein the fifth keyword is a keyword different from the fourth keyword among the one or more second keywords.

11. The text search device according to any one of claims 7 to 8, characterized in that, The acquisition unit is used for: Obtain the second text, which is obtained by processing the first text using a hash algorithm; The first line value is obtained based on the second text.

12. The text search device according to any one of claims 7 to 8, characterized in that, The keyword type includes string type and / or key-value pair type.

13. A vehicle, characterized in that, include: The vehicle includes a memory and a processor coupled to the memory; wherein the memory is used to store computer-readable instructions; and the processor is used to execute the computer-readable instructions in the memory to perform the method described in any one of claims 1 to 6.

14. A server, characterized in that, include: The server includes a memory and a processor coupled to the memory; wherein the memory is used to store computer-readable instructions; and the processor is used to execute the computer-readable instructions in the memory to perform the method described in any one of claims 1 to 6.

15. A computer-readable storage medium, characterized in that, When the instructions are executed on a computer device, the computer device causes the computer device to perform the method described in any one of claims 1 to 6.

16. A computer program product, when run on a computer, enables the computer to perform the method described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Programming optimization method of executable program

    CN107239317A

  • Content searching method and device

    CN109992647A