A vehicle user text data keyword matching method and device
By optimizing keyword matching through a finite state automaton model, the problem of low efficiency in existing technologies is solved, and efficient keyword matching and improved data timeliness are achieved.
Patent Information
- Application Number
- CN202210685487.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-15
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-06-15
AI Technical Summary
Existing technologies are inefficient and time-consuming when matching keywords in large texts, and cannot guarantee the timeliness of data.
The finite state automaton model is used to optimize the keyword matching process through node transfer connection lines, reduce repeated scanning, and improve matching efficiency.
It greatly improves the efficiency of keyword matching, reduces computing power consumption, and improves the timeliness of data.
Smart Images

Figure CN115238028B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of vehicle-mounted keyword extraction, and in particular to a vehicle-use user text data keyword matching method and vehicle-use user text data keyword matching device, and a vehicle-use user text keyword acquisition method. Background Art
[0002] With the popularity of vehicle networks in recent years, a large amount of vehicle data has been generated. Matching and classifying this data according to specific keywords is a key task in actual data development.
[0003] Existing technical problems:
[0004] 1. Common algorithms are very inefficient for keyword search and matching in large texts. When matching large amounts of text with multiple keywords, the text is scanned for each keyword, resulting in a time complexity of O(n*m), which consumes a significant amount of time and hardware resources.
[0005] 2. Currently, data is stored in the data warehouse before subsequent related operations are carried out, and the timeliness of related business cannot be effectively guaranteed.
[0006] Therefore, it is hoped that there will be a technical solution to solve or at least alleviate the above-mentioned deficiencies in the prior art. Summary of the Invention
[0007] The object of the present invention is to provide a vehicle user text data keyword matching method to solve at least one of the above technical problems.
[0008] One aspect of the present invention provides a method for matching keywords in user text data for a vehicle, the method comprising:
[0009] Acquire a keyword database, wherein the keyword database includes keywords;
[0010] A finite state automaton is constructed based on each of the keywords, and the finite state automaton includes:
[0011] Retrieval response nodes, the retrieval response nodes including an initial node, at least one first node and at least one second node, each retrieval response node being provided with at least one response instruction information;
[0012] Search condition connection lines, each search condition connection line includes a search condition, the search condition connection line includes a starting connection point and a pointing connection point, the initial node is connected to the starting connection point of at least one search condition connection line; the first node is connected to the starting connection point of at least one search condition connection line and to the pointing connection point of at least one search condition connection line; the second node is connected to the pointing connection point of at least one search condition connection line, and when the search condition is met, the response instruction information of the node connected to the pointing connection point of the search condition connection line is obtained;
[0013] Node transfer connection lines, each node transfer connection line includes a transfer condition, the node transfer connection line includes a transfer start connection point and a transfer point connection point, the node transfer connection line is used to connect a second node with a first node or a second node or to connect a first node with another first node, and among the second node and the first node or the second node connected by the same node transfer connection line, the search condition connection line connected to the second node and one of the search condition connection lines connected to the first node or another second node have the same judgment condition; among the two first nodes connected by the same node transfer connection line, a search condition connection line connected to one of the first nodes and one of the search condition connection lines connected to the other first node have the same judgment condition, and when the transfer condition is met, the response instruction information of the node connected to the transfer point connection point of the node transfer connection line is obtained;
[0014] The search conditions of each search condition connection line in the connection path formed between the node connected to the transfer point connection point and the initial node in the node transfer connection line are called the first chain search condition combination;
[0015] The search condition possessed by each search condition connection line in the connection path formed between the node connected to the transfer starting connection point and the initial node in the node transfer connection line is called the second chain search condition combination;
[0016] Each search condition in the first chain search condition combination can find the same search condition in each search condition in the second chain combination, and the judgment order between each search condition in the second chain combination that is the same as the search condition in the first chain search condition combination is the same as the judgment order of each search condition in the first chain search condition combination;
[0017] Among the search conditions in the second chain search condition combination, some of the search conditions are the same as the search conditions in the first chain search condition combination, and a node transfer connection line corresponding to any one of the search conditions in the partial search conditions has the same connection node as one of the node transfer connection lines corresponding to the other search conditions in the partial search conditions;
[0018] Get the text to be retrieved;
[0019] Inputting the text to be searched into the finite state automaton, thereby obtaining response instruction information obtained after satisfying at least one of a search condition and a transfer condition;
[0020] Obtain keywords to be output according to the response instruction information.
[0021] Optionally, the text to be retrieved includes text features to be retrieved;
[0022] The search conditions include:
[0023] Determine whether the text feature to be retrieved is the same as the preset text feature. If so,
[0024] Determine whether the search conditions are met.
[0025] Optionally, the response instruction information includes:
[0026] Output instruction, when the search corresponding node has the output instruction, obtain the preset text features in all search conditions between the initial node and the search corresponding node;
[0027] Sort the obtained preset text features in the order from the initial node to the search corresponding node with the output instruction, thereby obtaining the preset text features with position information;
[0028] Each preset text feature with position information is output as output information.
[0029] Optionally, the response instruction information further includes:
[0030] Continue judgment instruction, when the search response node has a continue judgment instruction, obtain the search condition of the search condition connection line connected to the search response node through the starting connection point, the search condition is called the continue judgment condition;
[0031] The text to be retrieved after obtaining the continue judgment instruction is judged according to the continue judgment condition.
[0032] Optionally, the response instruction information further includes:
[0033] Transfer instruction, when the search response node has a transfer instruction, obtaining the transfer condition of the node transfer connection line connected to the search response node through the transfer start connection point;
[0034] The text to be retrieved after obtaining the transfer instruction is judged according to the transfer condition.
[0035] Optionally, the second node has at least an output instruction;
[0036] The initial node only has a continue judgment instruction.
[0037] The present application also provides a vehicle user text data keyword matching device, the vehicle user text data keyword matching device comprising:
[0038] A keyword database acquisition module, the keyword database acquisition module is used to acquire a keyword database, the keyword database includes keywords;
[0039] A finite state automaton generation module, wherein the finite state automaton generation module is used to construct a finite state automaton according to each of the keywords, and the finite state automaton includes:
[0040] Retrieval response nodes, the retrieval response nodes including an initial node, at least one first node and at least one second node, each retrieval response node being provided with at least one response instruction information;
[0041] Search condition connection lines, each search condition connection line includes a search condition, the search condition connection line includes a starting connection point and a pointing connection point, the initial node is connected to the starting connection point of at least one search condition connection line; the first node is connected to the starting connection point of at least one search condition connection line and to the pointing connection point of at least one search condition connection line; the second node is connected to the pointing connection point of at least one search condition connection line, and when the search condition is met, the response instruction information of the node connected to the pointing connection point of the search condition connection line is obtained;
[0042] Node transfer connection lines, each node transfer connection line includes a transfer condition, the node transfer connection line includes a transfer start connection point and a transfer point connection point, the node transfer connection line is used to connect a second node with a first node or a second node or to connect a first node with another first node, and among the second node and the first node or the second node connected by the same node transfer connection line, the search condition connection line connected to the second node and one of the search condition connection lines connected to the first node or another second node have the same judgment condition; among the two first nodes connected by the same node transfer connection line, a search condition connection line connected to one of the first nodes and one of the search condition connection lines connected to the other first node have the same judgment condition, and when the transfer condition is met, the response instruction information of the node connected to the transfer point connection point of the node transfer connection line is obtained;
[0043] The search conditions of each search condition connection line in the connection path formed between the node connected to the transfer point connection point and the initial node in the node transfer connection line are called the first chain search condition combination;
[0044] The search condition possessed by each search condition connection line in the connection path formed between the node connected to the transfer starting connection point and the initial node in the node transfer connection line is called the second chain search condition combination;
[0045] Each search condition in the first chain search condition combination can find the same search condition in each search condition in the second chain combination, and the judgment order between each search condition in the second chain combination that is the same as the search condition in the first chain search condition combination is the same as the judgment order of each search condition in the first chain search condition combination;
[0046] Among the search conditions in the second chain search condition combination, some of the search conditions are the same as the search conditions in the first chain search condition combination, and a node transfer connection line corresponding to any one of the search conditions in the partial search conditions has the same connection node as one of the node transfer connection lines corresponding to the other search conditions in the partial search conditions;
[0047] A module for obtaining text to be retrieved, wherein the module is used to obtain text to be retrieved;
[0048] A matching module, the matching module is used to input the text to be searched into the finite state automaton, thereby obtaining response instruction information obtained after satisfying the search condition and / or the transfer condition;
[0049] The module for obtaining keywords to be output is used to obtain keywords to be output according to the response instruction information.
[0050] The present application also provides a method for obtaining vehicle user text keywords, the method comprising:
[0051] The in-vehicle entertainment host obtains one or more texts to be retrieved within a preset time period;
[0052] The in-vehicle entertainment host transmits the acquired one or more texts to be retrieved to the cloud server;
[0053] The cloud server obtains the keywords to be output according to the vehicle user text data keyword matching method described above.
[0054] Optionally, in the process of the cloud server acquiring keywords to be output according to the vehicle user text data keyword matching method as described above, the server processes multiple texts to be retrieved in parallel.
[0055] Optionally, the vehicle user text keyword acquisition method further includes:
[0056] The cloud server obtains identification information of the in-vehicle entertainment host that sends the text to be retrieved;
[0057] The identification information is associated with the to-be-output keyword and stored in a user habit database.
[0058] Beneficial effects
[0059] The vehicle user text data keyword matching method of the present application designs a finite state automaton, in which a node transfer connection line is provided. Under the action of the node transfer connection line, during the keyword matching process, if some text features to be retrieved meet the transfer conditions of the node transfer connection line, there is no need to start matching from the initial node, thereby saving time and computing power, and can greatly improve the timeliness of the data. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 4 is a flowchart of a vehicle user text data keyword matching method according to an embodiment of the present application.
[0061] Figure 2 It is a schematic diagram of an electronic device capable of implementing the vehicle user text data keyword matching method of the present application according to an embodiment of the present application.
[0062] Figure 3 Schematic diagram of a finite state machine according to an embodiment of the present application. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solutions and advantages of the implementation of this application clearer, the technical solutions in the embodiments of this application will be described in more detail below in conjunction with the drawings in the embodiments of this application. In the drawings, the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The described embodiments are part of the embodiments of this application, not all of the embodiments. The embodiments described below with reference to the drawings are exemplary and are intended to be used to explain this application, and should not be understood as limitations on this application. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. The embodiments of this application are described in detail below in conjunction with the drawings.
[0064] Figure 1 4 is a flowchart of a vehicle user text data keyword matching method according to an embodiment of the present application.
[0065] like Figure 1The vehicle user text data keyword matching method shown includes:
[0066] Step 1: Obtain a keyword database, wherein the keyword database includes keywords;
[0067] Step 2: Construct a finite state automaton based on each of the keywords, wherein the finite state automaton includes:
[0068] Retrieval response nodes, the retrieval response nodes including an initial node, at least one first node and at least one second node, each retrieval response node being provided with at least one response instruction information;
[0069] Search condition connection lines, each search condition connection line includes a search condition, the search condition connection line includes a starting connection point and a pointing connection point, the initial node is connected to the starting connection point of at least one search condition connection line; the first node is connected to the starting connection point of at least one search condition connection line and to the pointing connection point of at least one search condition connection line; the second node is connected to the pointing connection point of at least one search condition connection line, and when the search condition is met, the response instruction information of the node connected to the pointing connection point of the search condition connection line is obtained;
[0070] Node transfer connection lines, each node transfer connection line includes a transfer condition, the node transfer connection line includes a transfer start connection point and a transfer point connection point, the node transfer connection line is used to connect a second node with a first node or a second node or to connect a first node with another first node, and among the second node and the first node or the second node connected by the same node transfer connection line, the search condition connection line connected to the second node and one of the search condition connection lines connected to the first node or another second node have the same judgment condition; among the two first nodes connected by the same node transfer connection line, a search condition connection line connected to one of the first nodes and one of the search condition connection lines connected to the other first node have the same judgment condition, and when the transfer condition is met, the response instruction information of the node connected to the transfer point connection point of the node transfer connection line is obtained;
[0071] The search conditions of each search condition connection line in the connection path formed between the node connected to the transfer point connection point and the initial node in the node transfer connection line are called the first chain search condition combination;
[0072] The search condition possessed by each search condition connection line in the connection path formed between the node connected to the transfer starting connection point and the initial node in the node transfer connection line is called the second chain search condition combination;
[0073] Each search condition in the first chain search condition combination can find the same search condition in each search condition in the second chain combination, and the judgment order between each search condition in the second chain combination that is the same as the search condition in the first chain search condition combination is the same as the judgment order of each search condition in the first chain search condition combination;
[0074] Among the search conditions in the second chain search condition combination, some of the search conditions are the same as the search conditions in the first chain search condition combination, and a node transfer connection line corresponding to any one of the search conditions in the partial search conditions has the same connection node as one of the node transfer connection lines corresponding to the other search conditions in the partial search conditions;
[0075] Step 3: Get the text to be retrieved;
[0076] Step 4: inputting the text to be searched into the finite state automaton, thereby obtaining response instruction information obtained after satisfying at least one of the search condition and the transfer condition;
[0077] Step 5: Obtain keywords to be output according to the response instruction information.
[0078] The vehicle user text data keyword matching method of the present application designs a finite state automaton, in which a node transfer connection line is provided. Under the action of the node transfer connection line, during the keyword matching process, if some text features to be retrieved meet the transfer conditions of the node transfer connection line, there is no need to start matching from the initial node, thereby saving time and computing power, and can greatly improve the timeliness of the data.
[0079] In this embodiment, the text to be retrieved includes text features to be retrieved;
[0080] The search conditions include:
[0081] Determine whether the text feature to be retrieved is the same as the preset text feature. If so,
[0082] Determine whether the search conditions are met.
[0083] It is understandable that the preset text features in various search conditions may be the same or different.
[0084] In this embodiment, the response instruction information includes:
[0085] Output instruction, when the search corresponding node has the output instruction, obtain the preset text features in all search conditions between the initial node and the search corresponding node;
[0086] Sort the obtained preset text features in the order from the initial node to the search corresponding node with the output instruction, thereby obtaining the preset text features with position information;
[0087] Each preset text feature with position information is output as output information.
[0088] In this embodiment, the response instruction information further includes:
[0089] Continue judgment instruction, when the search response node has a continue judgment instruction, obtain the search condition of the search condition connection line connected to the search response node through the starting connection point, the search condition is called the continue judgment condition;
[0090] The text to be retrieved after obtaining the continue judgment instruction is judged according to the continue judgment condition.
[0091] In this embodiment, the response instruction information further includes:
[0092] Transfer instruction, when the search response node has a transfer instruction, obtaining the transfer condition of the node transfer connection line connected to the search response node through the transfer start connection point;
[0093] The text to be retrieved after obtaining the transfer instruction is judged according to the transfer condition.
[0094] In this embodiment, the second node has at least an output instruction;
[0095] The initial node only has a continue judgment instruction.
[0096] The present application is further described in detail below by way of examples. It should be understood that the examples do not constitute any limitation to the present application.
[0097] In this example, the text to be retrieved is the data string "ushers", and the keywords in the keyword database include "he / she / his / hers".
[0098] See also Figure 3 , this application is based on the finite state automaton composed of keywords in the keyword database. Figure 3 shown.
[0099] See also Figure 3 ,exist Figure 3 In the figure, the circles numbered 1 to 9 are retrieval response nodes, among which the circle numbered 0 represents the initial node. Among the other circles, the hollow circles (numbered 1, 3, 4, 6, 8) are the first nodes, and the solid circles (numbered 2, 5, 7, 9) are the second nodes.
[0100] See also Figure 3 ,exist Figure 3 In the figure, each solid line is a search condition line, where the end with an arrow is the point to the connection point, and the other end is the starting connection point. Figure 3 It can be seen that the initial node is connected to the starting connection point of at least one retrieval condition connection line (i.e., connected to retrieval condition connection line 11 and retrieval condition connection line 12); the first node is connected to the starting connection point of at least one retrieval condition connection line and is connected to the pointing connection point of at least one retrieval condition connection line (for example, the node with serial number 4 is connected to the pointing connection point of retrieval condition connection line 16 and is also connected to the starting connection point of retrieval condition connection line 18); the second node is connected to the pointing connection point of at least one retrieval condition connection line (for example, the node with serial number 5 is connected to the pointing connection point of retrieval condition connection line 18). When the retrieval condition is met, the response instruction information of the node connected to the pointing connection point of the retrieval condition connection line is obtained. For example, in this embodiment, the retrieval condition includes: judging whether the text feature to be retrieved is the same as the preset text feature. For example, the retrieval condition of retrieval condition connection line 18 is: judging whether the text feature to be retrieved is the same as the preset text feature e. If they are the same, the retrieval condition of retrieval condition connection line 18 is met.
[0101] See also Figure 3 ,exist Figure 3In the figure, each dotted line is a node transfer line, each node transfer line includes a transfer condition, the node transfer line includes a transfer start point and a transfer point, the node transfer line is used to connect a second node to a first node or a second node (for example, a node with a sequence number of 5 is connected to a node with a sequence number of 2, or a node with a sequence number of 7 is connected to a node with a sequence number of 3) or to connect a first node to another first node (for example, a node with a sequence number of 4 is connected to a node with a sequence number of 1), the second node and the first node or the second node connected by the same node transfer line, the search condition line connected to the second node and one of the search condition lines connected to the first node or the second node have the same judgment condition (for example, the node with a sequence number of 5 is connected to the node with a sequence number of 2, it can be seen that the judgment condition of the search condition line 18 of the sequence number of 5 is to judge whether the text feature to be retrieved is the same as the search condition line 18 of the first node or the second node). Whether the preset text feature e is the same, and the search condition connection line 13 with serial number 2, its judgment condition is also to judge whether the text feature to be retrieved is the same as the preset text feature e); among the two first nodes connected by the same node transfer connection line, a search condition connection line connected to one of the first nodes and one of the search condition connection lines connected to the other first node have the same judgment condition. When the transfer condition is met, the response instruction information of the node connected to the transfer pointing connection point of the node transfer connection line is obtained. In this embodiment, the transfer condition is that after the text to be retrieved runs through the finite state automaton of this application to the search response node connected to the transfer starting connection point of the node transfer connection line, it still has the text feature to be retrieved and needs to be compared, but there is no search condition connection line behind the response node to be retrieved, or there is a search condition connection line, but the next search condition connection line is not met, the transfer condition is met.
[0102] For example, the text to be searched in this application is "ushers". When input into the finite state automaton, the text feature u to be searched is first searched, and then the text feature u is searched. Figure 3It can be seen that the judgment conditions between the initial node and the node with sequence number 1 and the node with sequence number 2 are not satisfied. Therefore, the judgment is performed from the second letter s of the text to be retrieved, which is "ushers". As can be seen from the figure, it satisfies the judgment call of the search condition connection line 12, and the response instruction information on the node with sequence number 3 is obtained. In this embodiment, the response instruction information on the node with sequence number 3 is a continue judgment instruction, so the third letter h of "ushers" is judged. As can be seen from the figure, it satisfies the judgment call of the search condition connection line 16, and the response instruction information on the node with sequence number 4 is obtained. In this embodiment, the response instruction information on the node with sequence number 4 is a continue judgment instruction, so the fourth letter e of "ushers" is obtained for judgment. As can be seen from the figure, it satisfies the judgment call of the search condition connection line 16, and the response instruction information on the node with sequence number 4 is obtained. In this embodiment, the response instruction information on the node with sequence number 4 includes an output instruction and a transfer instruction. Since there is an output instruction, the preset text feature (i.e., she) in all the search conditions between the initial node and the corresponding search node is taken;
[0103] The obtained preset text features are sorted in the order from the initial node to the search corresponding node with the output instruction (ie, sorted in the order of s, h, e), thereby obtaining the preset text features (she) with position information.
[0104] In addition, since sequence number 4 also includes a transfer instruction, it is necessary to determine whether the transfer condition is met. Figure 3 It can be seen that there are text features to be retrieved after the "e" of "ushers", and there is no search condition connection line after the node with sequence number 4. Therefore, if the transfer condition is met, the response instruction information of the node with sequence number 2 is obtained. In this embodiment, the response instruction information of the node with sequence number 2 is a continue judgment instruction and an output instruction. In this embodiment, when the output instruction is output, a condition must be met, that is, it cannot be obtained through the node transfer connection line. In this embodiment, since the response instruction information of the node with sequence number 2 is obtained through the node transfer connection line, only the continue judgment instruction is obtained. At this time, it is sufficient to judge whether the search condition connection line 14 is met.
[0105] In this embodiment, the search condition combination possessed by each search condition connection line in the connection path formed between the node connected to the transfer pointing connection point and the initial node in the node transfer connection line becomes the first chain search condition combination. Taking the node transfer connection line 24 as an example, the node connected to the transfer pointing connection point of the node transfer connection line 24 is the node with serial number 2, and the connection path formed between the node with serial number 2 and the initial node is the search condition connection line 13 and the search condition connection line 11. The search condition combination possessed by the search condition connection line 13 and the search condition connection line 11 becomes the first chain search condition combination (that is, the search condition of the search condition connection line 13 is to determine whether the text feature to be retrieved is the same as the preset text feature e, and the search condition of the search condition connection line 11 is to determine whether the text feature to be retrieved is the same as the preset text feature h), that is, the first chain search condition combination is to determine whether the text feature to be retrieved is the same as the preset text feature e and to determine whether the text feature to be retrieved is the same as the preset text feature h.
[0106] The search conditions possessed by each search condition connection line in the connection path formed between the node connected to the transfer starting connection point and the initial node in the node transfer connection line are called the second chain search condition combination; taking the node transfer connection line 24 as an example, the node connected to the transfer starting connection point of the node transfer connection line 24 is the node with serial number 5, and the connection path formed between the node with serial number 5 and the initial node is the search condition connection line 18, the search condition connection line 16, and the search condition connection line 12. The search condition combination possessed by the search condition connection line 18, the search condition connection line 16, and the search condition connection line 12 becomes the second chain search condition combination (that is, the search condition of the search condition connection line 18 is to determine whether the text feature to be retrieved is the same as the preset text feature e, the search condition of the search condition connection line 16 is to determine whether the text feature to be retrieved is the same as the preset text feature h, and the search condition of the search condition connection line 12 is to determine whether the text feature to be retrieved is the same as the preset text feature s).
[0107] Each search condition in the first chain search condition combination can find the same search condition in each search condition in the second chain combination, and the judgment order between each search condition in the second chain combination that is the same as the search condition in the first chain search condition combination is the same as the judgment order of each search condition in the first chain search condition combination;
[0108] Among the search conditions in the second chain search condition combination, some of the search conditions are the same as the search conditions in the first chain search condition combination, and a node transfer connection line corresponding to any one of the search conditions in the partial search conditions has the same connection node as one of the node transfer connection lines corresponding to the other search conditions in the partial search conditions;
[0109] From the above, it can be seen that the search conditions of search condition connection line 18 are the same as the search conditions of search condition connection line 13, and the search conditions of search condition connection line 16 are the same as the search conditions of search condition connection line 11, and the judgment order is also the same. That is, from the first chain, it can be seen that the search conditions of search condition connection line 11 are judged first and then the search conditions of search condition connection line 13 are judged. From the second chain, it can be seen that the search conditions of search condition connection line 16 are judged first and then the search conditions of search condition connection line 18 are judged.
[0110] The present application also provides a vehicle user text data keyword matching device, the vehicle user text data keyword matching device includes a keyword database acquisition module, a finite state automaton generation module, a to-be-retrieved text acquisition module, a matching module, and a to-be-output keyword acquisition module, the keyword database acquisition module is used to acquire a keyword database, the keyword database including keywords;
[0111] The finite state automaton generation module is used to construct a finite state automaton according to each of the keywords, and the finite state automaton includes:
[0112] Retrieval response nodes, the retrieval response nodes including an initial node, at least one first node and at least one second node, each retrieval response node being provided with at least one response instruction information;
[0113] Search condition connection lines, each search condition connection line includes a search condition, the search condition connection line includes a starting connection point and a pointing connection point, the initial node is connected to the starting connection point of at least one search condition connection line; the first node is connected to the starting connection point of at least one search condition connection line and to the pointing connection point of at least one search condition connection line; the second node is connected to the pointing connection point of at least one search condition connection line, and when the search condition is met, the response instruction information of the node connected to the pointing connection point of the search condition connection line is obtained;
[0114] A node transfer connection line, each node transfer connection line includes a transfer condition, the node transfer connection line includes a transfer start connection point and a transfer point connection point, the node transfer connection line is used to connect a second node to a first node or to connect a first node to another first node, and among the second node and the first node connected by the same node transfer connection line, the search condition connection line connected to the second node and one of the search condition connection lines connected to the first node have the same judgment condition; among the two first nodes connected by the same node transfer connection line, a search condition connection line connected to one of the first nodes and one of the search condition connection lines connected to the other first node have the same judgment condition, and when the transfer condition is met, obtaining response instruction information of the node connected to the transfer point connection point of the node transfer connection line;
[0115] The search conditions of each search condition connection line in the connection path formed between the node connected to the transfer point connection point and the initial node in the node transfer connection line are called the first chain search condition combination;
[0116] The search condition possessed by each search condition connection line in the connection path formed between the node connected to the transfer starting connection point and the initial node in the node transfer connection line is called the second chain search condition combination;
[0117] Each search condition in the first chain search condition combination can find the same search condition in each search condition in the second chain combination, and the judgment order between each search condition in the second chain combination that is the same as the search condition in the first chain search condition combination is the same as the judgment order of each search condition in the first chain search condition combination;
[0118] Among the search conditions in the second chain search condition combination, some of the search conditions are the same as the search conditions in the first chain search condition combination, and a node transfer connection line corresponding to any one of the search conditions in the partial search conditions has the same connection node as one of the node transfer connection lines corresponding to the other search conditions in the partial search conditions;
[0119] The module for obtaining text to be retrieved is used to obtain text to be retrieved;
[0120] The matching module is used to input the text to be retrieved into the finite state automaton, thereby obtaining the response instruction information obtained after satisfying the retrieval condition and / or the transfer condition;
[0121] The module for obtaining keywords to be output is used to obtain keywords to be output according to the response instruction information.
[0122] The present application also provides a method for obtaining vehicle user text keywords, the method comprising:
[0123] The in-vehicle entertainment host obtains one or more texts to be retrieved within a preset time period;
[0124] The in-vehicle entertainment host transmits the acquired one or more texts to be retrieved to the cloud server;
[0125] The cloud server obtains the keywords to be output according to the vehicle user text data keyword matching method described above.
[0126] In this embodiment, when the cloud server obtains keywords to be output according to the vehicle user text data keyword matching method as described above, the server processes multiple texts to be retrieved in parallel.
[0127] In this embodiment, the vehicle user text keyword acquisition method further includes:
[0128] The cloud server obtains identification information of the in-vehicle entertainment host that sends the text to be retrieved;
[0129] The identification information is associated with the to-be-output keyword and stored in a user habit database.
[0130] This application has the following advantages:
[0131] Based on a further improvement to the Aho-Corasick matching algorithm, this algorithm's time complexity is independent of the number of keywords, only the length of the text. Matching is completed by scanning the text only once. Its time complexity is O(n), which is better than O(n*m), increasing matching efficiency by a factor of m.
[0132] 2. The improved algorithm is applied before entering the data warehouse, and real-time matching of data streams is used to greatly improve the timeliness of the data.
[0133] It is understandable that the above description of the method is also applicable to the description of the device.
[0134] The present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the computer program, the above-mentioned vehicle user text data keyword matching method is implemented.
[0135] The present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it can implement the above-mentioned vehicle user text data keyword matching method.
[0136] Figure 2 This is an exemplary structural diagram of an electronic device capable of implementing the vehicle user text data keyword matching method provided in accordance with one embodiment of the present application.
[0137] like Figure 2 As shown, the electronic device includes an input device 501, an input interface 502, a central processing unit 503, a memory 504, an output interface 505, and an output device 506. The input interface 502, the central processing unit 503, the memory 504, and the output interface 505 are interconnected via a bus 507. The input device 501 and the output device 506 are connected to the bus 507 via the input interface 502 and the output interface 505, respectively, and are then connected to other components of the electronic device. Specifically, the input device 504 receives input information from the outside and transmits the input information to the central processing unit 503 via the input interface 502; the central processing unit 503 processes the input information based on the computer-executable instructions stored in the memory 504 to generate output information, temporarily or permanently stores the output information in the memory 504, and then transmits the output information to the output device 506 via the output interface 505; the output device 506 outputs the output information to the outside of the electronic device for use by the user.
[0138] That is to say, Figure 2 The electronic device shown may also be implemented as comprising: a memory storing computer executable instructions; and one or more processors, which can implement the combination of the computer executable instructions when executing the computer executable instructions. Figure 1 The described vehicle uses a user text data keyword matching method.
[0139] In one embodiment, Figure 2 The electronic device shown can be implemented to include: a memory 504 configured to store executable program code; and one or more processors 503 configured to run the executable program code stored in the memory 504 to execute the vehicle user text data keyword matching method in the above embodiment.
[0140] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0141] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0142] Computer-readable media include permanent and non-permanent, removable and non-removable media, and media can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), data versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0143] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0144] In addition, it is obvious that the word "comprising" does not exclude other units or steps. Multiple units, modules or devices recited in the device claims can also be implemented by one unit or the entire device through software or hardware.
[0145] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and a part of the module, program segment or code includes one or more executable instructions for realizing the prescribed logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes identified in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or overall flow chart can be implemented using a dedicated hardware-based system that performs the prescribed function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0146] The processor referred to in this embodiment may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0147] The memory can be used to store computer programs and / or modules. The processor implements various functions of the device / terminal equipment by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area. The program storage area can store an operating system and at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created based on the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory can include high-speed random access memory and non-volatile memory, such as a hard disk, internal memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0148] In this embodiment, if the module / unit integrated in the device / terminal equipment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Among them, the computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. Although the present application is disclosed as above with reference to preferred embodiments, it is not intended to limit the present application. Any person skilled in the art may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
[0149] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0150] In addition, it is obvious that the word "comprising" does not exclude other units or steps. Multiple units, modules or devices recited in the device claims can also be implemented by one unit or the entire device through software or hardware.
[0151] Although the present invention has been described in detail above using general descriptions and specific embodiments, it will be apparent to those skilled in the art that modifications and improvements may be made based on the present invention. Therefore, such modifications and improvements, which do not depart from the spirit of the present invention, are intended to be within the scope of protection claimed herein.
Claims
1. A vehicle user text data keyword matching method, characterized in that: The vehicle user text data keyword matching method includes: Acquire a keyword database, wherein the keyword database includes keywords; A finite state automaton is constructed based on each of the keywords, and the finite state automaton includes: Retrieval response nodes, the retrieval response nodes including an initial node, at least one first node and at least one second node, each retrieval response node being provided with at least one response instruction information; Search condition connection lines, each search condition connection line includes a search condition, the search condition connection line includes a starting connection point and a pointing connection point, the initial node is connected to the starting connection point of at least one search condition connection line; the first node is connected to the starting connection point of at least one search condition connection line and to the pointing connection point of at least one search condition connection line; the second node is connected to the pointing connection point of at least one search condition connection line, and when the search condition is met, the response instruction information of the node connected to the pointing connection point of the search condition connection line is obtained; Node transfer connection line, each node transfer connection line includes a transfer condition, the node transfer connection line includes a transfer starting connection point and a transfer pointing connection point, the node transfer connection line is used to connect a second node with a first node or another second node or to connect a first node with another first node, among the second node and the first node or another second node connected by the same node transfer connection line, the search condition connection line connected by the second node as the pointing connection point and one of the search condition connection lines connected by the first node or another second node as the pointing connection point have the same search condition; among a first node and another first node connected by the same node transfer connection line, a search condition connection line connected by one of the first node pointing connection points and one of the search condition connection lines connected by the other first node as the pointing connection point have the same search condition, when the transfer condition is met, obtaining the response instruction information of the node connected by the transfer pointing connection point of the node transfer connection line; The search conditions of each search condition connection line in the connection path formed between the node connected to the transfer point connection point and the initial node in the node transfer connection line are called the first chain search condition combination; The search condition possessed by each search condition connection line in the connection path formed between the node connected to the transfer starting connection point and the initial node in the node transfer connection line is called the second chain search condition combination; Among the search conditions in the second chain search condition combination, some search conditions are the same as the search conditions in the first chain search condition combination; Each search condition in the first chain search condition combination can find the same search condition in each search condition in the second chain combination, and the judgment order between each search condition in the second chain combination that is the same as the search condition in the first chain search condition combination is the same as the judgment order of each search condition in the first chain search condition combination; Get the text to be retrieved; Inputting the text to be searched into the finite state automaton, thereby obtaining response instruction information obtained after satisfying at least one of a search condition and a transfer condition; Obtain keywords to be output according to the response instruction information.
2. The vehicle user text data keyword matching method according to claim 1, characterized in that: The text to be retrieved includes text features to be retrieved; The search conditions include: Determine whether the text feature to be retrieved is the same as the preset text feature. If so, Determine whether the search conditions are met.
3. The vehicle user text data keyword matching method according to claim 2, characterized in that: The response instruction information includes: Output instruction, when the search response node has the output instruction, obtain the preset text features in all search conditions between the initial node and the search response node; Sort the obtained preset text features in the order from the initial node to the search corresponding node with the output instruction, thereby obtaining the preset text features with position information; Each preset text feature with position information is output as output information.
4. The vehicle user text data keyword matching method according to claim 3, characterized in that: The response instruction information further includes: Continue judgment instruction, when the search response node has a continue judgment instruction, obtain the search condition of the search condition connection line connected to the search response node through the starting connection point, the search condition is called the continue judgment condition; The text to be retrieved after obtaining the continue judgment instruction is judged according to the continue judgment condition.
5. The vehicle user text data keyword matching method according to claim 4, characterized in that: The response instruction information further includes: Transfer instruction, when the search response node has a transfer instruction, obtaining the transfer condition of the node transfer connection line connected to the search response node through the transfer start connection point; The text to be retrieved after obtaining the transfer instruction is judged according to the transfer condition.
6. The vehicle user text data keyword matching method according to claim 5, characterized in that: The second node has at least an output instruction; The initial node only has a continue judgment instruction.
7. A vehicle user text data keyword matching device, characterized in that: The vehicle user text data keyword matching device includes: A keyword database acquisition module, the keyword database acquisition module is used to acquire a keyword database, the keyword database includes keywords; A finite state automaton generation module, wherein the finite state automaton generation module is used to construct a finite state automaton according to each of the keywords, and the finite state automaton includes: Retrieval response nodes, the retrieval response nodes including an initial node, at least one first node and at least one second node, each retrieval response node being provided with at least one response instruction information; Search condition connection lines, each search condition connection line includes a search condition, the search condition connection line includes a starting connection point and a pointing connection point, the initial node is connected to the starting connection point of at least one search condition connection line; the first node is connected to the starting connection point of at least one search condition connection line and to the pointing connection point of at least one search condition connection line; the second node is connected to the pointing connection point of at least one search condition connection line, and when the search condition is met, the response instruction information of the node connected to the pointing connection point of the search condition connection line is obtained; Node transfer connection lines, each node transfer connection line includes a transfer condition, the node transfer connection line includes a transfer start connection point and a transfer point connection point, the node transfer connection line is used to connect a second node with a first node or a second node or to connect a first node with another first node, and among the second node and the first node or the second node connected by the same node transfer connection line, the search condition connection line connected to the second node and one of the search condition connection lines connected to the first node or another second node have the same judgment condition; among the two first nodes connected by the same node transfer connection line, a search condition connection line connected to one of the first nodes and one of the search condition connection lines connected to the other first node have the same judgment condition, and when the transfer condition is met, the response instruction information of the node connected to the transfer point connection point of the node transfer connection line is obtained; The search conditions of each search condition connection line in the connection path formed between the node connected to the transfer point connection point and the initial node in the node transfer connection line are called the first chain search condition combination; The search condition possessed by each search condition connection line in the connection path formed between the node connected to the transfer starting connection point and the initial node in the node transfer connection line is called the second chain search condition combination; Each search condition in the first chain search condition combination can find the same search condition in each search condition in the second chain combination, and the judgment order between each search condition in the second chain combination that is the same as the search condition in the first chain search condition combination is the same as the judgment order of each search condition in the first chain search condition combination; Among the search conditions in the second chain search condition combination, some search conditions are the same as the search conditions in the first chain search condition combination; A module for obtaining text to be retrieved, wherein the module is used to obtain text to be retrieved; A matching module, the matching module is used to input the text to be searched into the finite state automaton, thereby obtaining response instruction information obtained after satisfying the search condition and / or the transfer condition; The module for obtaining keywords to be output is used to obtain keywords to be output according to the response instruction information.
8. A method for obtaining keywords from vehicle user text, characterized in that: The vehicle user text keyword acquisition method includes: The in-vehicle entertainment host obtains one or more texts to be retrieved within a preset time period; The in-vehicle entertainment host transmits the acquired one or more texts to be retrieved to the cloud server; The cloud server obtains the keywords to be output according to the vehicle user text data keyword matching method according to any one of claims 1 to 6.
9. The vehicle user text keyword acquisition method according to claim 8, characterized in that: When the cloud server acquires keywords to be output according to the vehicle user text data keyword matching method according to any one of claims 1 to 6, the cloud server processes multiple texts to be retrieved in parallel.
10. The vehicle user text keyword acquisition method according to any one of claims 8 or 9, characterized in that: The vehicle user text keyword acquisition method further includes: The cloud server obtains identification information of the in-vehicle entertainment host that sends the text to be retrieved; The identification information is associated with the to-be-output keyword and stored in a user habit database.
Citation Information
Patent Citations
Algorithm suitable for quick keyword retrieval
CN110362669A
Data retrieval method and device, electronic equipment and storage medium
CN111309970A