A knowledge matching method, vehicle and storage medium
Patent Information
- Application Number
- CN202611081780.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-20
- Publication Date
- 2026-11-03
AI Technical Summary
In existing technologies, knowledge matching methods based on large language models and vectorization schemes have excessive computational overhead in vehicle deployment scenarios, failing to meet the requirements for real-time performance and low power consumption.
A matching knowledge base is constructed, including an instruction association library and a semantic hierarchical relationship library. Through search and hierarchical association replacement operations, the input instruction text is transformed into query conditions, reducing computational complexity and improving matching speed.
It significantly reduces the computational complexity of knowledge matching, improves matching speed and generalization ability, and meets the real-time and interpretability requirements of vehicle functions.
Smart Images

Figure CN123030732A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, specifically to a knowledge matching method, a vehicle, and a storage medium. Background Technology
[0002] Natural language processing (NLP), as a core technology for human-computer interaction, has been widely applied in intelligent customer service, voice assistants, and in-vehicle interaction. In in-vehicle interaction scenarios, users typically input natural language commands via voice or text. The vehicle's infotainment system needs to parse and perform knowledge matching on the user's input to find and execute the corresponding operation steps, thereby controlling vehicle functions. This interaction process places high demands on the accuracy of command understanding and the real-time performance of knowledge matching.
[0003] In related technologies, knowledge matching typically employs either large language model-based or vectorization-based approaches. Large language model-based approaches utilize neural network models with a large number of parameters to perform deep semantic computation on user input commands, generating and outputting corresponding operation steps. Vectorization-based approaches, on the other hand, use deep learning models to map user input commands and text from the vehicle's pre-built knowledge base into high-dimensional floating-point vectors. Knowledge matching and retrieval are then performed by calculating the distance between these vectors, obtaining and outputting the corresponding operation steps.
[0004] However, the related technologies suffer from a technical problem where the computational overhead for knowledge matching is mismatched with the vehicle deployment scenario. Specifically, both the aforementioned large language model scheme and vectorization scheme heavily rely on floating-point intensive operations, requiring significant computing power and memory consumption for knowledge matching. However, automotive-grade computing platforms are limited in computing power, memory, and power consumption, making it difficult to support the real-time operation of such highly complex algorithms in offline environments, and thus failing to meet the real-time and low-power requirements of in-vehicle deployment.
[0005] It should be noted that the information disclosed in the background section of this application is intended only to enhance the understanding of the general background of this application, and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0006] This application provides a knowledge matching method, a vehicle, and a storage medium to address the mismatch between the computational overhead of knowledge matching and the vehicle deployment scenario in related technologies.
[0007] In a first aspect, embodiments of this application provide a knowledge matching method applied to vehicles, the method comprising: A matching knowledge base is constructed, which includes an instruction association library and a semantic hierarchy relation library; the instruction association library is used to store instruction text and corresponding operation steps; the semantic hierarchy relation library is used to store target words and corresponding hierarchical related words. The input instruction text is used as the query condition to search in the instruction association library, and the target operation steps are obtained and output. If the target operation step is not found, perform a hierarchical association replacement operation on the input instruction text according to the semantic hierarchy relation library to obtain the replacement instruction text; The replacement instruction text is used as a query condition to search in the instruction association library, and the target operation steps are obtained and output.
[0008] In this embodiment of the application, by constructing a matching knowledge base, the input instruction text can be directly used as the query condition when performing knowledge matching. The operation steps are searched in the instruction association library of the matching knowledge base, which transforms the complex knowledge matching process into an efficient database search operation, thereby significantly reducing the computational complexity of knowledge matching and greatly improving the matching speed.
[0009] Simultaneously, during knowledge matching, a semantic hierarchical relational database is used for hierarchical association and replacement. This replaces shallow semantic words in the input command text with corresponding higher-level related words (i.e., deep semantic words), and then re-searches based on the replaced command text. This enables the mapping of users' natural language commands to standard operation commands, effectively improving the generalization ability of knowledge matching without introducing additional floating-point intensive operations.
[0010] Furthermore, the knowledge matching operation is based on search and replace operations, which significantly improves the interpretability of the knowledge matching algorithm and meets the auditability requirements of vehicle functional safety.
[0011] In one possible implementation, the matching knowledge base further includes a thesaurus, which stores the target word and its corresponding synonyms. The step of performing a hierarchical association and replacement operation on the input instruction text based on a semantic hierarchy relational database to obtain the replacement instruction text includes: The input instruction text is replaced by performing a hierarchical association replacement operation based on a semantic hierarchy relation library, and / or by performing a synonym replacement operation based on a thesaurus, to obtain the replacement instruction text.
[0012] In this embodiment, considering the semantic differences and semantic hierarchy differences in the user's input command text, complex semantic transformations can be achieved by combining synonym replacement operations and hierarchical association replacement operations. This can cover a wider range of user expression forms, thereby effectively improving the knowledge matching success rate and the generalization ability of the matching algorithm.
[0013] In one possible implementation, the step of performing a hierarchical association replacement operation on the input instruction text based on a semantic hierarchy relational library, and / or performing a synonym replacement operation on the input instruction text based on a thesaurus, to obtain the replaced instruction text, includes: The input instruction text is segmented into words to obtain a segmentation sequence; Based on the search results in the thesaurus and semantic hierarchy relation database for each word in the word segmentation sequence, the replaceable and non-replaceable word segments in the word segmentation sequence are determined. For at least one replaceable word segment, based on the synonyms of the replaceable word segment in the thesaurus or the hierarchical related words of the replaceable word segment in the semantic hierarchy relation library, the replaceable word segment is subjected to synonym replacement or hierarchical related word replacement operation to obtain the replaced word segment; By combining the replaced word segment with the non-replaceable word segment, the replacement instruction text is obtained.
[0014] In this embodiment, by segmenting and searching the input command text, replaceable and non-replaceable word segments can be accurately distinguished. This largely avoids blind global replacement and reduces unnecessary search paths and computational overhead. By combining synonym replacement and hierarchical association replacement independently or in combination, various different replacement word segments can be generated, covering different expressions. Recombining these can improve the success rate of knowledge matching.
[0015] One possible implementation also includes: If the replacement instruction text has undergone a hierarchical association replacement operation, then obtain the word segmentation before and after the hierarchical association replacement, and determine whether the target operation step contains the word segmentation after the change. If included, the modified word segmentation in the target operation step will be replaced with the original word segmentation.
[0016] In this embodiment of the application, the above-mentioned secondary verification mechanism can effectively avoid execution failure caused by random changes in the target operation steps while ensuring that the operation steps are associated with the user input instructions.
[0017] In the embodiments of this application, the above-described restoration operation can restore the target operation steps that have undergone hierarchical association replacement operation due to knowledge matching needs to the operation steps of the specific object originally mentioned by the user, thereby improving the correlation between the target steps and the input instruction text, as well as the accuracy of the target step determination.
[0018] One possible implementation also includes: The text matching confidence level is determined based on the cumulative number of times the replacement instruction text generated by the target operation steps is found, and the type of word replacement operation used to generate the replacement instruction text. Based on the text matching confidence level, determine whether to output the target operation steps.
[0019] In this embodiment, by distinguishing operation types, different decay factors (such as synonymous decay factors and abstract decay factors) can be assigned to different types of replacement operations, thereby more accurately quantifying and evaluating the credibility of the current matching result relative to the user's original intent; by distinguishing the cumulative number of times, credibility is negatively correlated with the cumulative number of times. Furthermore, by determining whether to output the target operation step based on the text matching confidence, low-credibility matching results caused by multiple replacements can be largely avoided, improving the reliability of outputting the target step.
[0020] In one possible implementation, determining whether to output the target operation step based on the text matching confidence score includes: If the input instruction text is obtained based on the user's voice instruction, then the user's acoustic intent is evaluated based on the time-domain and frequency-domain characteristics of the voice instruction to obtain the intensity of the acoustic intent. The overall confidence level is determined by weighting the acoustic intent intensity with the text matching confidence level. Based on the overall confidence level, determine whether to output the target operation step.
[0021] In this embodiment, the acoustic intent strength is determined by further combining voice commands, and a comprehensive confidence score is obtained by weighting the acoustic intent strength with the text matching confidence score, thereby improving the accuracy of confidence score determination. This multimodal fusion confidence score evaluation method integrates text semantics and acoustic features, effectively compensating for the shortcomings of single-dimensional evaluation and improving the reliability of the output target operation steps.
[0022] In one possible implementation, before determining the overall confidence level based on a weighted value of the acoustic intent intensity and the text matching confidence level, the method further includes: Based on the vehicle's motion state and the level of noise inside the vehicle, a first weight corresponding to the acoustic intent intensity and a second weight corresponding to the text matching confidence are determined.
[0023] In this embodiment, based on the aforementioned first and second weights, the decision weight of the acoustic modality can be automatically increased and the text matching confidence weight reduced in high-speed and high-noise environments. In quiet and static environments, accurate text semantic matching is relied upon as the primary decision signal (increasing the text matching confidence weight). This adaptive mechanism effectively improves the overall performance consistency of the system in diverse in-vehicle scenarios (from quiet garages to high-speed wind noise).
[0024] In one possible implementation, building the instruction association library includes: Store the training instruction text and corresponding operation steps in the instruction association library; The training instruction text is segmented into words to obtain the training word segmentation sequence; For each training word in the training word segmentation sequence, synonyms and hierarchical related words are searched in the thesaurus and the semantic hierarchy relation database, respectively. Generate a set of candidate replacement words corresponding to the training word segmentation based on the synonyms and the hierarchical related words; Based on the candidate replacement word set corresponding to each training word in the word segmentation sequence, Cartesian product operation is performed to obtain the extended instruction text corresponding to the training instruction text; The extended instruction text is associated with the operation steps and stored in the instruction association library.
[0025] In this embodiment, the construction of the instruction association library generates as comprehensive instruction text as possible. The systematic combined expansion of the thesaurus and semantic hierarchy relation library using Cartesian product significantly outperforms manual enumeration. That is, only one instruction text needs to be input to automatically generate expanded instruction text. This largely avoids the maintainability issues of manual exhaustive rule enumeration and improves the granularity of the instruction association library construction.
[0026] Furthermore, when receiving input command text during the subsequent knowledge matching stage, only a database lookup in the command association library is required. By moving the intelligence required for knowledge matching to the offline construction stage of the command association library, the online computing overhead of the in-vehicle equipment is effectively reduced, and the response speed is improved.
[0027] In one possible implementation, the synonym substitution has a higher priority than the hierarchical association substitution.
[0028] In this embodiment, by defining the priority of synonym replacement as higher than that of hierarchical association replacement, it can be ensured that the replaced instruction text is as close as possible to the user's original expression intent, reducing semantic deviation and mismatch risk caused by excessive abstraction; while improving the generalization ability of instruction matching, the accuracy of the matching results is guaranteed as much as possible.
[0029] Secondly, embodiments of this application provide a vehicle, including: A controller; the controller is used to perform the method described in any one of the first aspects.
[0030] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any one of the aspects. Attached Figure Description
[0031] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application; Figure 2 This is a schematic diagram of a knowledge matching method provided in an embodiment of this application; Figure 3 This application provides a flowchart illustrating a method for obtaining replacement instruction text in an embodiment of the present application. Figure 4 A schematic diagram of the restoration operation process of a target step provided in an embodiment of this application; Figure 5 This application provides a schematic flowchart of a text matching confidence assessment method. Figure 6 A schematic diagram of a comprehensive confidence assessment method provided in this application embodiment; Figure 7 A schematic flowchart illustrating a method for constructing an instruction association library, provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0033] To better understand the technical solution of this application, the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0034] It should be understood that the described embodiments are merely some, not all, of the embodiments in this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0035] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0036] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0037] See Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. For example... Figure 1 As shown, the application scenario includes a vehicle 100, which includes a controller 101 and carries a user 102.
[0038] Specifically, user 102 sends instructions to controller 101 (such as natural language commands like "set the air conditioning to 24 degrees" or "turn on the driver's seat heating" via voice or touch input). When controller 101 receives the natural language command from user 102, it typically needs to call the corresponding knowledge matching algorithm to generate and output the corresponding operation steps based on the natural language command text, thereby controlling the relevant functions of the vehicle.
[0039] In related technologies, knowledge matching typically employs either large language model-based or vectorization-based approaches. Large language model-based approaches utilize neural network models with a large number of parameters to perform deep semantic computation on user input commands, generating and outputting corresponding operation steps. Vectorization-based approaches, on the other hand, use deep learning models to map user input commands and text from the vehicle's pre-built knowledge base into high-dimensional floating-point vectors. Knowledge matching and retrieval are then performed by calculating the distance between these vectors, obtaining and outputting the corresponding operation steps.
[0040] However, the related technologies suffer from a technical problem where the computational overhead for knowledge matching is mismatched with the vehicle deployment scenario. Specifically, both the aforementioned large language model scheme and vectorization scheme heavily rely on floating-point intensive operations, requiring significant computing power and memory consumption for knowledge matching. However, automotive-grade computing platforms are limited in computing power, memory, and power consumption, making it difficult to support the real-time operation of such highly complex algorithms in offline environments and failing to meet the real-time and low-power requirements of in-vehicle deployment.
[0041] To address the aforementioned issues, this application provides a knowledge matching method. By constructing a matching knowledge base, the input instruction text can be directly used as a query condition during knowledge matching. The operation steps are then searched in the instruction association library of the matching knowledge base, transforming the complex knowledge matching process into an efficient database search operation. This significantly reduces the computational complexity of knowledge matching and greatly improves the matching speed.
[0042] Simultaneously, during knowledge matching, a semantic hierarchical relational database is used for hierarchical association and replacement. This replaces shallow semantic words in the input command text with corresponding abstract higher-level related words (i.e., deep semantic words), and then re-searches based on the replaced command text. This enables the mapping of users' natural language commands to standard operation commands, effectively improving the generalization ability of knowledge matching without introducing additional floating-point intensive operations.
[0043] Furthermore, the knowledge matching operation is based on search and replace operations, which significantly improves the interpretability of the knowledge matching algorithm and meets the auditability requirements of vehicle functional safety.
[0044] Specifically, the following detailed description is provided in conjunction with the accompanying drawings and specific embodiments.
[0045] See Figure 2 This is a schematic diagram of a knowledge matching method provided in an embodiment of this application. Figure 2 As shown, the method specifically includes the following steps.
[0046] Step S201: Construct a matching knowledge base.
[0047] In this embodiment of the application, in order to achieve low-computational-cost knowledge matching locally on the vehicle, a matching knowledge base can be pre-built. This matching knowledge base includes an instruction association library and a semantic hierarchical relationship library.
[0048] The instruction association library stores instruction text and corresponding operation steps. The relationship between instruction text and operation steps can be understood as a mapping from natural language intent to vehicle control execution logic. Specifically, instruction text can be natural language expressions input by the user, representing the user's control intent; operation steps can be specific control commands or action sequences that the vehicle controller can recognize and execute.
[0049] In one possible implementation, the instruction association library can be constructed in the form of a relational data table. For example, the instruction association library can contain three fields: Knowledge_ID (knowledge identifier), Text_orig (instruction text), and Action (operation steps).
[0050] The Knowledge_ID field serves as a unique identifier for each record in the instruction association library, used for indexing and management within the database; the Text_orig field stores the original instruction text of the knowledge, such as "open the car door" or "adjust the temperature"; and the Action field stores the vehicle control operation steps corresponding to the original instruction text, such as "unlock the car door" or "execute the temperature control logic".
[0051] Understandably, after the instruction association library is built, it can support multiple search methods using the instruction text field as the query condition. For example, it can support exact hash search, which matches the input instruction text exactly against the instruction text field; it can also support fuzzy combination search, which performs word segmentation on the input instruction text and then matches it against the instruction text field based on the inclusion relationship of multiple keywords. By using multiple search methods, it is possible to balance matching accuracy and flexibility to a certain extent.
[0052] Furthermore, the semantic hierarchy relational database is used to store target words and their corresponding hierarchical related words.
[0053] In this context, the relationship between the target word and the hierarchical connectives can be expressed as a hierarchical relationship. Specifically, the hierarchical connectives can be the superordinate concepts of the target word, and the target word can be the subordinate concepts of the hierarchical connectives.
[0054] For example, the hierarchical related term (superordinate concept) corresponding to the target term "tailgate" can be "vehicle body control components"; the hierarchical related term corresponding to the target term "window" can be "window components". By establishing this hierarchical semantic relationship, a data foundation can be provided for subsequent replacement of specific hierarchical associations.
[0055] In one possible implementation, the semantic hierarchy relational database can be constructed based on an abstract hierarchical tree data structure. The abstract hierarchical tree can be used to record the hierarchical semantic relationships between words.
[0056] Its logical structure can be represented as one or more tree-like hierarchical structures, and the mapping unit can be represented as {child node word → parent node word}. Here, the parent node word can be the superordinate concept of the child node word, i.e., the hierarchical related words mentioned above. Correspondingly, the child node word can correspond to the target word mentioned above.
[0057] For example, the hierarchical related words corresponding to the target word "car door" can be "vehicle body control components"; the hierarchical related words corresponding to the target word "tailgate" can also be "vehicle body control components"; the hierarchical related words corresponding to the target words "car window" and "sunroof" can both be "car window components".
[0058] Furthermore, the abstract hierarchy tree can also support multi-level abstract relationships, meaning that a target word can be mapped upwards multiple times to obtain higher-level abstract words. For example, the target word "tailgate" can first be mapped to the hierarchical related word "vehicle body control components," and "vehicle body control components" can be further mapped to the higher-level hierarchical related word "body parts."
[0059] In practical applications, an abstract hierarchical tree can be automatically generated based on the ontology library of the current domain (such as the vehicle component hierarchical ontology).
[0060] It should be noted that those skilled in the art can adjust the construction method of the above-mentioned instruction association library and semantic hierarchy relation library according to actual needs, such as using graph databases or other data structures. This application embodiment does not impose specific restrictions on this.
[0061] Step S202: Use the input instruction text as a query condition to search in the instruction association library, obtain and output the target operation steps.
[0062] Specifically, after the instruction association library is built, in order to achieve efficient searching, the input instruction text can be used as the query condition to directly perform the search operation in the instruction association library.
[0063] The input command text can be text directly entered by the user, or it can be converted from the user's voice command input, touch command input, etc.
[0064] In this embodiment of the application, the above search process can be an exact search (such as using a hash search). Specifically, the hash value of the input instruction text can be calculated using a hash algorithm, and the hash value can be used as an index to perform a hash search in the instruction association library.
[0065] Understandably, since the time complexity of hash lookup is typically O(1), it can quickly determine whether the instruction library contains an instruction text that is completely identical to the input instruction text. If a matching knowledge is found in the instruction library (i.e., a completely identical text record is found), the operation steps corresponding to that knowledge record can be directly obtained as the target operation steps, and these target operation steps can be output to the corresponding function execution unit of the vehicle, thereby enabling the function execution unit to respond to the user's instruction and perform the corresponding operation.
[0066] It should be noted that those skilled in the art can adjust the above search method according to actual needs, such as using a balanced search tree search or fuzzy search, and the embodiments of this application do not impose absolute limitations on this.
[0067] Step S203: If the target operation step is not found, perform a hierarchical association replacement operation on the input instruction text according to the semantic hierarchy relation library to obtain the replacement instruction text.
[0068] In this embodiment, if the target operation step is not found in the instruction association library, it means that the corresponding instruction text does not exist in the instruction association library. In this case, in order to improve the scenario adaptability of knowledge matching, a hierarchical association replacement operation can be performed on the input instruction text according to the semantic hierarchy association library.
[0069] Specifically, the input instruction text can be treated as a whole string, and the target words stored in the semantic hierarchy relational database can be traversed to determine whether the string of input instruction text contains a certain target word in the semantic hierarchy relational database. Alternatively, the input instruction text can be segmented to obtain a segmented sequence, and each word in the segmented sequence can be matched with the target words in the semantic hierarchy relational database to determine whether a certain target word in the semantic hierarchy relational database exists in the segmented sequence.
[0070] For a target word contained in the input instruction text, a hierarchical association replacement operation can be performed on the target word based on preset rules (such as depth-first search or breadth-first search with pruning strategies). Based on the hierarchical related words (parent node words) corresponding to the target word in the semantic hierarchy relation library, the target word in the input instruction text is replaced, thereby obtaining the replaced instruction text.
[0071] Of course, those skilled in the art can adjust the above replacement strategy according to actual needs, such as adopting a heuristic search strategy. This application does not impose specific restrictions on this.
[0072] Step S204: Use the replacement instruction text as a query condition to search in the instruction association library, obtain and output the target operation steps.
[0073] Specifically, after the hierarchical association replacement operation in step S203 above, a replacement instruction text containing the related words at the higher level can be obtained. In order to obtain the operation steps corresponding to this replacement instruction text, the replacement instruction text can be used as a new query condition to perform a search operation again in the instruction association database.
[0074] For a detailed description of this step, please refer to step S202 above. For the sake of brevity, it will not be repeated here.
[0075] In this embodiment of the application, by constructing a matching knowledge base, the input instruction text can be directly used as the query condition when performing knowledge matching. The operation steps are searched in the instruction association library of the matching knowledge base, which transforms the complex knowledge matching process into an efficient database search operation, thereby significantly reducing the computational complexity of knowledge matching and greatly improving the matching speed.
[0076] Simultaneously, during knowledge matching, a semantic hierarchical relational database is used for hierarchical association and replacement. This replaces shallow semantic words in the input command text with corresponding abstract higher-level related words (i.e., deep semantic words), and then re-searches based on the replaced command text. This enables the mapping of users' natural language commands to standard operation commands, effectively improving the generalization ability of knowledge matching without introducing additional floating-point intensive operations.
[0077] Furthermore, the knowledge matching operation is based on search and replace operations, which significantly improves the interpretability of the knowledge matching algorithm and meets the auditability requirements of vehicle functional safety.
[0078] By transforming the semantic understanding problem into a word replacement and search problem supported by a knowledge base, the knowledge matching stage only requires a combination of deterministic table lookup (hash lookup, O(1) time complexity) and string replacement, which largely avoids the large-scale matrix multiplication, activation function calculation, and attention mechanism operations in deep learning models. It is estimated that on automotive-grade embedded processors (such as the ARM Cortex-A series, with a main frequency of 1.0-2.0GHz), the end-to-end latency of a single knowledge matching operation can be controlled to the millisecond level, with power consumption far lower than running any Transformer-type model, meeting automotive-grade real-time requirements.
[0079] In practical applications, in order to improve the generalization ability and success rate of knowledge matching, one possible implementation is that the matching knowledge base also includes a thesaurus, which is used to store the target word and its corresponding synonyms.
[0080] Specifically, the target word and its synonyms can exhibit a symmetrical synonym mapping relationship. If word A maps to word B, then word B can also map to word A. In other words, the two can be interchanged in a specific business context. For example, the synonyms for the target word "open" can be "open" or "open it briefly"; the synonyms for the target word "car window" can be "window" or "window window"; and the synonyms for the target word "vehicle" can be "car" or "vehicle".
[0081] In practical applications, a hash table structure can be used to construct a thesaurus. Specifically, the key of the hash table can be the target word, and the value can be a pointer or reference to the list of synonyms. This structure ensures that the time complexity of querying a single target word is O(1), thus meeting the high-efficiency query requirements in low-computing-power environments.
[0082] It should be noted that the synonym mapping relationships in the thesaurus can be configured by domain experts (such as automotive functional safety engineers) or generated in other ways, and this application embodiment does not impose specific restrictions on this.
[0083] Based on this, the replacement text can be obtained by combining a thesaurus and a semantic hierarchy relation library. In one possible implementation, the input instruction text is subjected to hierarchical association replacement operation based on the semantic hierarchy relation library, and / or a synonym replacement operation is performed on the input instruction text based on the thesaurus, to obtain the replacement instruction text.
[0084] Specifically, the synonym replacement operation can be described as follows: after identifying the transformable word position in the input command text, if the target word corresponding to the word position has a synonym in the thesaurus, the original word in the input command text can be replaced based on the found synonym.
[0085] By combining synonym substitution and hierarchical substitution, the system can handle both synonymous but different instructions (e.g., replacing "open the window" with "open the car window") and instructions with different concrete and abstract expressions (e.g., replacing "open the tailgate" with "open the vehicle body control components").
[0086] In this embodiment, considering the semantic differences and semantic hierarchy differences in the user's input command text, complex semantic transformations can be achieved by combining synonym replacement operations and hierarchical association replacement operations. This can cover a wider range of user expression forms, thereby effectively improving the knowledge matching success rate and the generalization ability of the matching algorithm.
[0087] See Figure 3 This is a flowchart illustrating a method for obtaining replacement instruction text provided in an embodiment of this application. Figure 3 As shown, the method specifically includes the following steps.
[0088] Step S301: Perform word segmentation on the input instruction text to obtain the word segmentation sequence.
[0089] To accurately locate the replaceable words in the input command text, the input command text can be segmented.
[0090] Specifically, Chinese word segmentation algorithms, such as dictionary-based maximum forward matching or the Jieba word segmentation engine, can be used to segment words and obtain the segmented word sequence.
[0091] For example, the instruction text "open the car door" can be segmented into a word sequence [open, car door] using a word segmentation algorithm.
[0092] Furthermore, preprocessing operations can be performed before or after word segmentation. These operations include removing high-frequency stop words (such as "please", "help me", "that", etc.), removing punctuation marks, and standardizing English capitalization to reduce noise interference.
[0093] In practical applications, users may input multiple intents in the command text, such as "open the car window and turn up the air conditioning temperature". In this case, the input can be split into multiple clauses based on conjunctions (such as "and", "then", "at the same time") after word segmentation, and the subsequent knowledge matching process can be performed on each clause separately, thereby achieving parallel execution.
[0094] Step S302: Based on the search results of each segment in the word segmentation sequence in the thesaurus and semantic hierarchy relation database, determine the replaceable and non-replaceable segmentations in the word segmentation sequence.
[0095] In this embodiment, based on the word segmentation sequence obtained by the above steps, each word in the word segmentation sequence can be searched in a thesaurus and a semantic hierarchy relation database. If the word exists in the thesaurus or the semantic hierarchy relation database, it is said that the word is a replaceable word; otherwise, it is said that the word is a non-replaceable word.
[0096] It is understandable that replaceable word segmentation refers to word segmentation that exists in the thesaurus or semantic hierarchy relation database, and therefore can be replaced based on the thesaurus or semantic hierarchy relation database; while non-replaceable word segmentation does not exist in either the thesaurus or semantic hierarchy relation database, and therefore cannot be replaced.
[0097] Step S303: For at least one replaceable word segment, perform synonym replacement or hierarchical association replacement operations on the replaceable word segment according to the synonym words corresponding to the replaceable word segment in the thesaurus, or the hierarchical association words corresponding to the replaceable word segment in the semantic hierarchy relation library, to obtain the replaced word segment.
[0098] In this embodiment of the application, after the replaceable word segments are determined, one or more word positions can be selected from the replaceable word segments to perform the replacement operation according to a preset search strategy (such as a breadth-first search strategy or a depth-first search plus pruning strategy).
[0099] For the selected replaceable word segment, you can search for its corresponding synonym in the thesaurus to perform a synonym replacement operation; or search for its corresponding hierarchical related words (i.e., parent node words) in the semantic hierarchy relation library to perform a hierarchical related replacement operation.
[0100] In practical applications, synonym replacement and hierarchical association replacement operations can be used simultaneously in the same transformation step; that is, different transformation types can be applied to different replaceable word segments. Through the above operations, the original word segment can be replaced with synonyms or hierarchically related words, thereby obtaining the replaced word segment.
[0101] To ensure that the replaced instruction text is as close as possible to the user's original intention and to reduce the risk of semantic deviation and mismatch caused by excessive abstraction, in one possible implementation, the priority of synonym replacement is higher than that of hierarchical association replacement.
[0102] Specifically, during the replacement process, if a replaceable word has candidate words in both the thesaurus and the semantic hierarchy relation database, the synonym replacement operation can be used first.
[0103] Understandably, since synonyms have the same meaning in a specific business context, the semantic change of the replaced text is minimal, and the matched operation steps usually better meet the user's actual needs. Only when the replacement instruction text generated based on synonym replacement still fails to match the target operation step in the instruction association library should a hierarchical association replacement operation be attempted for broader semantic generalization. Through this priority setting, the generalization ability of instruction knowledge matching is improved while ensuring the accuracy of the matching results as much as possible.
[0104] Step S304: Combine the replaced word segment with the non-replaceable word segment to obtain the replacement instruction text.
[0105] Specifically, the replaced word segments and the unreplaced non-replaced word segments are reassembled according to their original word order to generate new text as the replacement instruction text. This replacement instruction text can then be used as a new query condition for matching and searching in the instruction association database.
[0106] In this embodiment, by segmenting and searching the input command text, replaceable and non-replaceable word segments can be accurately distinguished. This largely avoids blind global replacement and reduces unnecessary search paths and computational overhead. By combining synonym replacement and hierarchical association replacement independently or in combination, various different replacement word segments can be generated, covering different expressions. Recombining these can improve the success rate of knowledge matching.
[0107] To improve the success rate of knowledge matching, one possible implementation includes, after using the replacement instruction text as a query condition to search in the instruction association library, obtaining and outputting the target operation steps, the following: If the target operation step is not found, the input instruction text is subjected to hierarchical association replacement operation again according to the semantic hierarchy relation library, and / or the input instruction text is subjected to synonym replacement operation according to the thesaurus, to obtain the replacement instruction text after the second replacement; the replacement instruction text after the second replacement is used as the query condition to search in the instruction association library, and the target operation step is obtained and output.
[0108] Specifically, considering that the replacement instruction text generated by a single replacement operation may still fail to match the instruction association library, if the target operation step is not found, a hierarchical association replacement operation can be performed on the input instruction text based on the semantic hierarchy relation library, and / or a synonym replacement operation can be performed on the input instruction text based on the thesaurus, to obtain the replacement instruction text after the second replacement; subsequently, the replacement instruction text after the second replacement is used as a new query condition to search again in the instruction association library, obtain and output the target operation step.
[0109] In one possible implementation, to reduce computational power while ensuring the generalization ability of knowledge matching, a maximum number of attempts can be set (e.g., a default value of 3). After each search fails, the currently generated replacement instruction text can be used as the base text for the next replacement operation, and the transformation history can be recorded.
[0110] If the accumulated number of attempts does not reach the maximum number of attempts, the replacement and search loop operation continues. If the target operation step is not found even after reaching the maximum number of attempts, the loop can be terminated and a preset matching failure indication (such as the text "Unable to understand the instruction") can be output, or the alternative fallback strategy can be switched to (such as prompting the user to change the wording). The embodiments of this application do not impose absolute restrictions on the specific fallback strategy.
[0111] Furthermore, during the multi-step iterative replacement process, a priority search order can be set. Since synonym replacement results in less semantic deviation, while hierarchical replacement results in relatively larger semantic deviation, synonym replacement should be attempted first. Hierarchical replacement should only be attempted if the replacement instruction text generated by synonym replacement fails to match.
[0112] Understandably, this priority setting can further reduce semantic uncertainty in the matching path, improve matching accuracy, reduce unnecessary search steps, and improve matching efficiency in low-computing-power environments.
[0113] In practical applications, the failed text can be recorded after each matching failure. By periodically analyzing the patterns in these failed texts, potential new synonyms and hierarchical relationships can be automatically discovered, and then stored in the corresponding knowledge base after being submitted to domain experts for review. This closed-loop update mechanism enables the matching knowledge base to continuously optimize itself and adapt to new user expression habits.
[0114] In this embodiment of the application, the above-mentioned iterative mechanism enables multiple explorations of the input instruction text under limited computing resources, thereby significantly improving the instruction matching success rate in complex scenarios.
[0115] In practical applications, in order to improve the correlation between the target step and the input instruction text, the replacement instruction text that has undergone hierarchical correlation transformation can be restored.
[0116] See Figure 4 This is a schematic diagram illustrating the restoration operation flow of a target step provided in an embodiment of this application. Figure 4 As shown, the method specifically includes the following steps.
[0117] Step S401: If the replacement instruction text has undergone hierarchical association replacement operation, obtain the word segmentation before and after the change that participated in the hierarchical association replacement, and determine whether the target operation step contains the word segmentation after the change.
[0118] Specifically, in hierarchical word replacement, the user-inputted specific object (pre-change word segmentation) is usually replaced with the higher-level related words (post-change word segmentation). In order to accurately restore the result to the specific object originally mentioned by the user after a successful match, it is first necessary to obtain the pre-change and post-change word segments as the basis for subsequent replacement.
[0119] In practical applications, the matched target operation steps may or may not contain the modified word segmentation. To avoid invalid execution, a judgment is needed. Specifically, if it contains the modified word segmentation, it means the target operation step was generated based on the modified word segmentation and can be restored; if it does not contain the modified word segmentation, it means the target operation step does not contain the modified word segmentation and therefore cannot be restored.
[0120] In this embodiment of the application, during the process of performing the hierarchical association replacement operation, detailed information about the transformation can be recorded, such as recording the word segmentation before the change (e.g., the original input specific words) and the word segmentation after the change (e.g., the replaced hierarchical association words). For example, the replacement record may include the word segmentation before the change, the word segmentation after the change, the word replacement type (hierarchical association replacement or synonym replacement), and the position index corresponding to the word segmentation (the position of the word segmentation in the word segmentation sequence).
[0121] Once the replacement instruction text matches the instruction association library and the target operation step is obtained, the pre-change and post-change word segments involved in the hierarchical association replacement in the replacement record can be obtained, and it can be determined whether the string corresponding to the final obtained target operation step contains the post-change word segment.
[0122] Step S402: If included, replace the modified segmentation in the target operation step with the original segmentation.
[0123] Specifically, if the determination result indicates that the target operation step contains the modified word segmentation, then the modified word segmentation in the target operation step can be replaced based on the original word segmentation. Through this restoration operation, the abstract operation steps can be restored to operation steps targeting the user's original mentioned object.
[0124] For example, if the user inputs the command text "open the tailgate", the aforementioned knowledge matching process replaces "tailgate" with "vehicle body control components" through a hierarchical association replacement operation, and the target operation step is "unlock vehicle body control components". Without restoration, it would be impossible to distinguish whether the user wants to unlock the door, tailgate, or other body control components. By performing the above restoration operation, replacing "vehicle body control components" back with "tailgate" in the target operation step, the operation step "unlock tailgate" that accurately points to the user's intent can be obtained.
[0125] In the embodiments of this application, the above-described restoration operation can restore the target operation steps that have undergone hierarchical association replacement operation due to knowledge matching needs to the operation steps of the specific object originally mentioned by the user, thereby improving the correlation between the target steps and the input instruction text, as well as the accuracy of the target step determination.
[0126] In practical applications, if there are multiple replacement records in a loop, the restoration operation can be performed sequentially from the end to the beginning of the record time.
[0127] In one possible implementation, it can be further determined whether the restored operation steps exist in the instruction association library.
[0128] Specifically, in the above steps, hierarchical association replacement restores the higher-level related words in the target operation steps to the specific words actually mentioned by the user, thus obtaining the restored operation steps (e.g., restoring "unlock vehicle body control components" to "unlock tailgate"). To avoid sending instructions lacking underlying execution logic support to the execution unit, verification can be performed again based on the instruction association library.
[0129] If the restored operation steps exist in the instruction association library, it means that independent control logic has been pre-stored for this specific object (such as the tailgate). In this case, outputting the restored operation steps can ensure that the execution result best matches the user's intention. Otherwise, it means that no instruction has been preset for this specific object. In this case, the operation steps before restoration are retained and output.
[0130] In this embodiment of the application, the above-mentioned secondary verification mechanism can effectively avoid execution failure caused by random changes in the target operation steps while ensuring that the operation steps are associated with the user input instructions.
[0131] In practical applications, the semantics of the replacement instruction text may deviate from the original semantics of the user-input instruction text. To mitigate the execution risks caused by such semantic deviations, the reliability of the knowledge matching can be determined, and the output of the target operation steps can be based on this reliability.
[0132] See Figure 5This is a schematic diagram of a text matching confidence assessment method provided in an embodiment of this application. Figure 5 As shown, the method specifically includes the following steps.
[0133] Step S501: Determine the text matching confidence level based on the cumulative number of replacement instruction texts generated by the target operation steps and the word replacement operation type used to generate the replacement instruction texts.
[0134] The cumulative number of generated replacement instruction texts refers to the total number of word replacement operations performed during the multi-step iterative search process, from the original input instruction text to the final successful search for the target text; in other words, the number of times replacement instruction texts are generated. A higher cumulative number indicates a greater risk of semantic deviation between the currently matched replacement instruction text and the user's original input instruction text.
[0135] The word replacement operations used to generate the replacement instruction text include synonym replacement, hierarchical association replacement, and no replacement. Synonym replacement results in less semantic deviation; while hierarchical association replacement, because it replaces words in the instruction text with abstract higher-level related words, results in relatively greater semantic deviation.
[0136] In the embodiments of this application, by distinguishing operation types, different degrees of attenuation factors can be assigned to different types of replacement operations (such as the synonym attenuation factor being greater than the hierarchical association attenuation factor), thereby more accurately quantifying and evaluating the credibility of the current matching result relative to the user's original intent, i.e., the text matching confidence.
[0137] Specifically, the following rules can be used to determine the confidence level of text matching.
[0138] If the input command text is found directly in the command association library without any word replacement, the text matching confidence can be set to the highest value (e.g., 1.0), indicating that it perfectly matches the user's intent.
[0139] If the target operation step is found using only synonym replacement, the text matching confidence can be negatively correlated with the cumulative number of synonym replacements, K. For example, a synonym decay factor γ can be used to calculate the text matching confidence, which can be expressed as C1 = γ. K The synonymous attenuation factor γ is a preset value that can be set between 0.92 and 0.98.
[0140] If the target operation step is found using hierarchical association replacement, the text matching confidence score can be negatively correlated with both the cumulative number of hierarchical association replacements and the cumulative number of synonym replacements. For example, the text matching confidence score can be calculated using both the hierarchical association attenuation factor and the synonym attenuation factor, expressed as C1 = δ.L × γ K Where L is the total number of hierarchical association replacement operations in generating the replacement instruction text, K is the total number of synonym replacement operations, and δ is the preset hierarchical association attenuation factor, which is less than the synonym attenuation factor γ and can be set between 0.80 and 0.90.
[0141] Furthermore, if the target operation step is not found, the text matching confidence level can be directly determined to be zero.
[0142] It should be noted that those skilled in the art can adjust the above method for determining text matching confidence according to actual needs, and the embodiments of this application do not impose specific limitations on this.
[0143] Step S502: Determine whether to output the target operation steps based on the text matching confidence.
[0144] Specifically, the text matching confidence level can be compared with a preset confidence threshold to determine whether to output the found target operation steps.
[0145] If the text matching confidence score is greater than the preset confidence score threshold, the target operation step can be determined to be output; otherwise, it will not be output. This can largely avoid low-confidence matching results caused by multiple replacements and improve the reliability of the output target step.
[0146] In the embodiments of this application, by distinguishing operation types, different decay factors (such as synonymous decay factors and abstract decay factors) can be assigned to different types of replacement operations, thereby more accurately quantifying and evaluating the credibility of the current matching result relative to the user's original intent; by distinguishing the cumulative number of times, the credibility is negatively correlated with the cumulative number of times.
[0147] Furthermore, by basing the text matching confidence level on the determination of whether to output the target operation step, the system can largely avoid low-confidence matching results caused by multiple replacements, thereby improving the reliability of outputting the target step.
[0148] In practical applications, to improve the accuracy of credibility determination, the overall confidence level can be determined by combining text matching confidence level and acoustic intent strength.
[0149] See Figure 6 This is a schematic diagram of a comprehensive confidence assessment method provided in an embodiment of this application. Figure 6 As shown, the method specifically includes the following steps.
[0150] Step S601: If the input instruction text is obtained based on the user's voice instruction, then the user's acoustic intent is evaluated based on the time domain and frequency domain characteristics of the voice instruction to obtain the intensity of the acoustic intent.
[0151] In practical applications, the sources of input command text may include multiple modalities. If the input command text is obtained based on the user's voice command, i.e., the current interaction modality is voice input, the voice interaction scenario is relatively complex, and the user may unintentionally include words similar to control commands in their daily conversations or self-talk in the car. Therefore, the user's operational intent can be evaluated by combining the acoustic characteristics of the voice command (voice signal).
[0152] Temporal features can include short-time energy, short-time average zero-crossing rate, and speech rate (words / second), which can be extracted from the speech signal using statistical methods. Frequency domain features can include fundamental frequency (reflecting pitch), fundamental frequency variance (reflecting the amplitude of pitch variation), and Mel-frequency cepstral coefficients.
[0153] Specifically, once it is determined that the input instruction text is obtained from the user's voice command, the time domain features and frequency domain features of the voice command can be extracted, and these features can be input into a preset lightweight evaluation model or rule engine for comprehensive analysis, thereby obtaining the acoustic intent intensity.
[0154] For example, the aforementioned time-domain and frequency-domain features can be combined into a fixed-dimensional acoustic feature vector (such as an approximately 20-dimensional acoustic feature vector). Specifically, the speech signal is pre-emphasized to compensate for the attenuation of high-frequency components; Hamming windows are used for framing (e.g., the frame length can be 25ms and the frame shift can be 10ms), and the Mel frequency cepstral coefficients of each frame are extracted (which can be obtained by the logarithmic energy transformation of the Mel filter bank followed by the discrete cosine transform); then, the short-time energy mean, fundamental frequency mean, and fundamental frequency variance of the entire speech signal are extracted (fundamental frequency estimation can be performed using the autocorrelation method or the cepstral method); and the speech rate (number of effective syllables / effective speech duration) is estimated by detecting silence segments and counting effective speech frames.
[0155] Furthermore, the combined acoustic feature vector can be input into a pre-trained lightweight binary classifier, and the output scalar value ranging from 0 to 1 can be used as the acoustic intent strength. The higher the acoustic intent strength, the stronger, more determined, and more clearly intentional the user's tone is (e.g., faster speech, louder voice, and rising intonation); conversely, it is more likely to be hesitant, tentative, or casual (e.g., slower speech, soft voice, and flat intonation).
[0156] It should be noted that the acoustic feature extraction in this embodiment only involves traditional signal processing methods (such as Fourier transform, short-time analysis, etc.) and does not require the online participation of a deep learning model. Although the lightweight binary classifier collects a large number of speech samples with different tone intensities and performs manual annotation to train the model weights offline during the system development phase, its computational load is small during the inference phase (i.e., when the vehicle is running online), which fully complies with the computing power constraints of the vehicle edge device. In this way, the user's true intent can be effectively distinguished without increasing the vehicle's computing burden.
[0157] Of course, those skilled in the art can adjust the above method for determining the intensity of acoustic intent according to actual needs, and the embodiments of this application do not impose specific limitations on this.
[0158] Step S602: Determine the overall confidence level based on the weighted value of acoustic intent intensity and text matching confidence.
[0159] In this embodiment of the application, by weighting the acoustic intent intensity with the text matching confidence, a comprehensive confidence level that can reflect the intensity of user intent and take into account the accuracy of semantic matching can be obtained.
[0160] The weight values corresponding to acoustic intent intensity and text matching confidence can be preset values (e.g., both are 0.5).
[0161] In practical applications, the acoustic environment inside a vehicle is typically dynamic. For example, when a vehicle is traveling at high speed or playing music, increased background noise can lead to a decrease in speech recognition accuracy. If a fixed weight with high confidence in text matching is still assigned in this situation, the overall confidence assessment may fail due to biases in the recognized text. Therefore, a dynamic weight adjustment mechanism based on vehicle state adaptation can be adopted.
[0162] In practical applications, in order to improve the scene adaptability of the comprehensive confidence determination, one possible implementation is to determine the first weight corresponding to the acoustic intent intensity and the second weight corresponding to the text matching confidence, based on the vehicle's motion state and the level of in-vehicle noise.
[0163] The vehicle's motion state can include its speed, acceleration, and gear position (such as drive or park). Different motion states are usually accompanied by different levels of noise.
[0164] In-vehicle noise level refers to the intensity of sound in the vehicle's interior environment that interferes with the user's speech. This can include tire noise and wind noise generated by the vehicle's movement, the volume of the in-vehicle multimedia system (such as audio and video), and the volume of conversations among other occupants.
[0165] In practical applications, when the vehicle is in a state of high motion (e.g., high speed, greater than 80 km / h) or the noise level inside the vehicle is high, it indicates a noisy cabin environment. In such an environment, the voice signal captured by the microphone is easily masked, leading to a decrease in speech recognition accuracy and a reduction in the reliability of text matching confidence. Furthermore, if the user has a strong intention to control the vehicle, they will usually unconsciously increase the volume or change their tone; therefore, the intensity of acoustic intent can objectively reflect the user's true intention to a certain extent.
[0166] In this embodiment of the application, when the vehicle's speed is high or the noise level inside the vehicle is high, the second weight corresponding to the text matching confidence can be reduced, and the first weight corresponding to the acoustic intent intensity can be increased accordingly, thereby basically avoiding the misjudgment and discarding of valid instructions due to environmental noise.
[0167] When the vehicle's movement is relatively gentle (e.g., speed less than 5 km / h) and the in-vehicle noise level is low, the environment is quiet, and the accuracy of speech recognition is high. In this case, the second weight corresponding to the text matching confidence can be increased, using the accurate semantic matching result as the main decision basis for the overall confidence, while the first weight of acoustic intent intensity can be decreased.
[0168] Furthermore, to better capture changes in user emotions, one possible implementation is to increase the first weight (e.g., by 0.05 each time, with an upper limit of 0.8) if a high intensity of acoustic intent is detected multiple times within a preset time window, reflecting a potentially urgent or strong user need for action; if there is no user interaction for a period of time, the first and second weights can be restored to their initial values.
[0169] In this embodiment, based on the aforementioned first and second weights, the decision weight of the acoustic modality can be automatically increased and the text matching confidence weight reduced in high-speed and high-noise environments. In quiet and static environments, accurate text semantic matching is relied upon as the primary decision signal (increasing the text matching confidence weight). This adaptive mechanism effectively improves the overall performance consistency of the system in diverse in-vehicle scenarios (from quiet garages to high-speed wind noise).
[0170] Step S603: Based on the overall confidence level, determine whether to output the target operation steps.
[0171] Specifically, the overall confidence level can be compared with a preset overall confidence level threshold (such as 0.5-0.7) to determine whether to output the found target operation steps.
[0172] If the overall confidence level is greater than the preset overall confidence level threshold, the target operation step can be determined to be output; otherwise, no output is output, or a preset mild prompt (such as "Please say it again" or "What do you mean?") is returned. This can largely avoid low-confidence matching results caused by multiple replacements and improve the reliability of the output target step.
[0173] Understandably, this approach involves extracting acoustic features from raw speech using signal processing methods (without requiring a neural network), evaluating intent strength using a lightweight classifier with only a few parameters, and dynamically weighting and fusing acoustic confidence and text confidence as an execution gating mechanism. This method can distinguish between genuine commands and weak intent expressions such as idle chatter or hesitation, reducing false triggering rates, without significantly increasing the system's computational and storage burden, thus maintaining its lightweight characteristics.
[0174] In this embodiment, the acoustic intent strength is determined by further combining voice commands, and a comprehensive confidence score is obtained by weighting the acoustic intent strength with the text matching confidence score, thereby improving the accuracy of confidence score determination. This multimodal fusion confidence score evaluation method integrates text semantics and acoustic features, effectively compensating for the shortcomings of single-dimensional evaluation and improving the reliability of the output target operation steps.
[0175] To facilitate understanding, the following explanation will be provided with specific examples.
[0176] In practical applications, a driver might casually say "It's a bit hot" while chatting in the car. The input text is matched to the target operation step of cooling the air conditioner through two steps of synonym replacement, with a text matching confidence level of 0.88. Due to the low energy and steady speech rate of the voice signal, the acoustic intent intensity is only 0.25. Using the default second weight of 0.6 and the first weight of 0.4, the overall confidence level is 0.628. Since this is less than the preset threshold of 0.70, the target operation step is not output to avoid accidental triggering.
[0177] When the driver urgently shouts, "It's too hot, turn on the air conditioning!", the text matching confidence score is 0.95, and the acoustic intent strength is 0.92. Using the same weights, the overall confidence score is 0.938, which is greater than the threshold of 0.70. Therefore, the target operation steps are output, and cooling is implemented.
[0178] In other scenarios, the weights can be adaptively adjusted based on the vehicle's motion and the level of noise inside the vehicle. Assume the preset rule is that when the vehicle is traveling at high speed, the second weight is determined to be 0.4 and the first weight to be 0.6; when stationary, the second weight is determined to be 0.8 and the first weight to be 0.2.
[0179] For example, when the vehicle is traveling at high speed and the interior noise is high, if a user says "turn on the radio," the input command text is misinterpreted as "turn on the cigarette receiver," resulting in a text matching confidence level of 0. However, the acoustic intent strength is 0.85, and the overall confidence level is calculated to be 0.51. Based on the high acoustic intent strength, it can be determined that there is a command intent, and then the correction logic is entered to confirm the voice.
[0180] When the vehicle is stationary and in a quiet environment, if the user clearly says "turn on the radio," the text matching confidence score is 1.0, the acoustic intent strength is 0.78, and the overall confidence score is 0.956. This value is greater than the threshold, so the target operation step is output.
[0181] In practical applications, constraints can be imposed on the construction method of the instruction association library to improve the accuracy of knowledge matching.
[0182] See Figure 7 This is a schematic diagram illustrating a method for constructing an instruction association library according to an embodiment of this application. Figure 7 As shown, the method specifically includes the following steps.
[0183] Step S701: Store the training instruction text and the corresponding operation steps in the instruction association library.
[0184] Training instruction text refers to template text used to build the instruction association library. Specifically, in order for the vehicle to accurately respond to various control needs, standard or common instruction texts can be pre-set as benchmark data; these benchmark texts are the training instruction texts. The corresponding operation steps refer to the specific control actions that the vehicle system actually needs to perform after receiving the corresponding instruction (such as controlling the air conditioning to turn on, adjusting the temperature to a specific value, controlling the windows to rise or fall, etc.).
[0185] Specifically, the training instruction text and its corresponding operation steps entered by developers or users can be obtained, and the training instruction text and operation steps can be stored as basic data entries in the instruction association library for subsequent expansion and matching.
[0186] Step S702: Perform word segmentation on the training instruction text to obtain the training word segmentation sequence.
[0187] Specifically, the training instruction text can be segmented to obtain a training word sequence. The word segmentation process can employ dictionary-based maximum forward matching or Chinese word segmentation algorithms such as the Jieba word segmentation engine to divide continuous text into word sequences with independent semantics.
[0188] Step S703: For each training word in the training word segmentation sequence, search for synonyms and hierarchical related words in the thesaurus and semantic hierarchy relation database respectively.
[0189] In this embodiment, vocabulary expansion can be performed for each training word in the sequence. Specifically, for each training word, its corresponding synonyms can be searched in a thesaurus; at the same time, the higher-level related words of the training word can be queried in a semantic hierarchy relation database.
[0190] For a detailed description of synonyms and hierarchical related words, please refer to the above text. For the sake of brevity, it will not be repeated here.
[0191] To improve scenario adaptability, in practical applications, cosine similarity between unseen words and existing words in the vector space can be calculated based on pre-trained word vector models (such as Word2Vec or GloVe). Words with similarity exceeding the threshold are automatically recommended as candidate synonyms and added to the synonym database after expert review.
[0192] It should be noted that even with the above-mentioned word vector assistance, the use of these word vectors is limited to the offline knowledge base construction stage and does not intervene in the online recognition and matching process, thus not increasing the vehicle's loading and computing burden.
[0193] Step S704: Generate a set of candidate replacement words corresponding to the training word segmentation based on synonyms and hierarchical related words.
[0194] Specifically, the found synonyms and hierarchical related words can be combined with the training word segment itself to form the candidate replacement word set corresponding to the training word segment. For example, for the training word segment "open", if the found synonyms include "open" and "open once", then the candidate replacement word set corresponding to the training word segment can be {open, open, open once}.
[0195] Step S705: Perform Cartesian product operation on the candidate replacement word set corresponding to each training word in the word segmentation sequence to obtain the extended instruction text corresponding to the training instruction text.
[0196] To exhaustively enumerate all possible expressions of the training instruction text, a Cartesian product operation can be performed based on the candidate replacement word set corresponding to each training word segment.
[0197] Understandably, the Cartesian product operation can combine candidate replacement word sets at different word positions to generate all possible word sequences. Concatenating each generated word sequence yields the extended instruction text corresponding to the training instruction text.
[0198] For example, if the training word segmentation sequence is [open, car door], where the candidate replacement word set for "open" is {open, open, open once}, and the candidate replacement word set for "car door" is {car door, vehicle body control component}, then 3×2=6 texts can be generated through Cartesian product operation, of which the 5 texts other than the original text "open car door" are the extended instruction texts.
[0199] In one possible implementation, the instruction association library can also be pre-annotated with semantic slots.
[0200] Semantic slots are placeholders used to identify entity information or operation objects in instruction text. Specifically, instruction text can be split into fixed action parts and variable object parts. The fixed action parts remain unchanged as non-slot words, while the variable object parts are extracted and labeled as semantic slots, and the words corresponding to the variable object parts are the slot values.
[0201] For example, the training instruction text "open tailgate" can be labeled as "open [object: tailgate]", where "open" is a non-slot word, "[object: tailgate]" is a semantic slot, and "tailgate" is a slot value.
[0202] During the training phase, only slot values are expanded using synonyms and hierarchical related words, rather than the entire word sequence Cartesian product expansion. This significantly reduces the number of generated knowledge entries and controls storage space. Similarly, during the knowledge matching phase, only the identified slot values are transformed for matching, while non-slot words remain unchanged.
[0203] Step S706: Associate the extended instruction text with the operation steps and store it in the instruction association library.
[0204] In this embodiment of the application, each extended instruction text can be mapped to the operation steps corresponding to the original training instruction text in step S701, and the mapping relationship can be stored in the instruction association library.
[0205] In this embodiment, the construction of the instruction association library generates as comprehensive instruction text as possible. The systematic combined expansion of the thesaurus and semantic hierarchy relation library using Cartesian product significantly outperforms manual enumeration. That is, only one instruction text needs to be input to automatically generate expanded instruction text. This largely avoids the maintainability issues of manual exhaustive rule enumeration and improves the granularity of the instruction association library construction.
[0206] Furthermore, when receiving input command text during the subsequent knowledge matching stage, only a database lookup in the command association library is required. By moving the intelligence required for knowledge matching to the offline construction stage of the command association library, the online computing overhead of the in-vehicle equipment is effectively reduced, and the response speed is improved.
[0207] To facilitate understanding, the following explanation will be provided with specific examples.
[0208] Assume the thesaurus stores corresponding relationships, for example: "open" corresponds to "open" or "open once"; "car window" corresponds to "window" or "window". The semantic hierarchy relation database stores hierarchical relationships, such as "tailgate" and "car door" both having "vehicle body control components" as their hierarchical related words; "left front car window" and "sunroof" both having "car window components" as their hierarchical related words.
[0209] Assume that the current instruction association library already contains the training instruction text "open the window" and its corresponding operation step "execute window lowering". When a new training instruction text "close the tailgate" and its corresponding operation step "execute tailgate locking" are received, "close the tailgate" and "execute tailgate locking" are first stored in the instruction association library as the basic mapping relationship.
[0210] Simultaneously, the training instruction text "Close Tailgate" is segmented into words to obtain the training word sequence [Close, Tailgate]. For the training word "Close," no synonyms were found in the thesaurus or the semantic hierarchy relation database; therefore, its corresponding candidate replacement word set is {Close}. For the training word "Tailgate," no synonyms were found in the thesaurus, but its corresponding hierarchical related word was found in the semantic hierarchy relation database as "Vehicle Body Control Components"; therefore, its corresponding candidate replacement word set is {Tailgate, Vehicle Body Control Components}.
[0211] Furthermore, a Cartesian product operation is performed on the two candidate replacement word sets to generate extended instruction text. The generated sequence includes "close tailgate" (i.e., the original training instruction text) and "close vehicle body control components". A mapping relationship is established between the extended instruction text "close vehicle body control components" and the operation step "execute tailgate locking" and stored in the instruction association library. Through the above process, the instruction text related to tailgate locking in the instruction association library is expanded into two equivalent expressions: "close tailgate" and "close vehicle body control components".
[0212] In practical applications, the entire process of decision-making regarding hierarchical association replacement, synonym replacement, restoration operations, and changes to target operation steps in the above embodiments can be stored. This allows developers and security auditors to pinpoint the root cause of knowledge matching failures (such as missing synonym relationships or improper semantic hierarchy design), enabling rapid correction and verification. This ensures the interpretability and auditability of knowledge matching.
[0213] In this embodiment, both the matching knowledge base and the knowledge matching logic can be deployed in the local storage of the vehicle terminal. The entire knowledge training and recognition process can be completed without relying on cloud services. The user's voice data and historical interaction records will not be transmitted externally, meeting automotive-grade privacy protection requirements and avoiding the risks of network latency and network outages associated with cloud solutions.
[0214] Corresponding to the above embodiments, this application also provides a vehicle, which includes a controller for performing some or all of the steps in the above method embodiments.
[0215] Corresponding to the above embodiments, this application also provides an electronic device.
[0216] See Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 8 As shown, the electronic device 800 may include a processor 801, a memory 802, and a communication unit 803. These components communicate via one or more buses. Those skilled in the art will understand that the electronic device structure shown in the figure does not constitute a limitation on the embodiments of this application. It may be a bus topology or a star topology, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0217] The communication unit 803 is used to establish a communication channel, thereby enabling the electronic device to communicate with other devices.
[0218] The processor 801, serving as the control center of the electronic device, connects various parts of the electronic device 800 via various interfaces and lines. It executes software programs and / or modules stored in the memory 802, and calls data stored in the memory 802, to perform various functions and / or process data within the electronic device 800. The processor 801 can be composed of integrated circuits (ICs), such as a single packaged IC or multiple packaged ICs with the same or different functions connected together. For example, the processor 801 may consist only of a central processing unit (CPU). In this embodiment, the CPU may have a single processing core or include multiple processing cores.
[0219] Memory 802 is used to store the execution instructions of processor 801. Memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0220] When the execution instructions in memory 802 are executed by processor 801, the electronic device 800 is able to perform some or all of the steps in the above method embodiments.
[0221] Corresponding to the above embodiments, this application also provides a computer-readable storage medium, wherein the computer-readable storage medium may store a program, wherein when the program runs, it can control the device where the computer-readable storage medium is located to execute some or all of the steps in the above method embodiments. In specific implementation, the computer-readable storage medium may be a disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0222] Corresponding to the above embodiments, this application also provides a computer program product containing executable instructions that, when executed on a computer, cause the computer to perform some or all of the steps in the above method embodiments.
[0223] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, or the existence of B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects have an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0224] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented using electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software 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.
[0225] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0226] In the several embodiments provided in this application, any function, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, read-only memory (ROM) or random access memory (RAM), a magnetic disk, or an optical disk.
[0227] The above description is merely a specific embodiment of this application. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application. The protection scope of this application shall be determined by the scope of the appended claims.
Claims
1. A knowledge matching method, characterized in that, Applied to vehicles, the method includes: A matching knowledge base is constructed, which includes an instruction association library and a semantic hierarchy relation library; the instruction association library is used to store instruction text and corresponding operation steps; the semantic hierarchy relation library is used to store target words and corresponding hierarchical related words. The input instruction text is used as the query condition to search in the instruction association library, and the target operation steps are obtained and output. If the target operation step is not found, perform a hierarchical association replacement operation on the input instruction text according to the semantic hierarchy relation library to obtain the replacement instruction text; The replacement instruction text is used as a query condition to search in the instruction association library, and the target operation steps are obtained and output.
2. The method according to claim 1, characterized in that, The matching knowledge base also includes a thesaurus, which stores target words and their corresponding synonyms. The step of performing a hierarchical association and replacement operation on the input instruction text based on a semantic hierarchy relational database to obtain the replacement instruction text includes: The input instruction text is replaced by performing a hierarchical association replacement operation based on a semantic hierarchy relation library, and / or by performing a synonym replacement operation based on a thesaurus, to obtain the replacement instruction text.
3. The method according to claim 2, characterized in that, The step of performing a hierarchical association replacement operation on the input instruction text based on a semantic hierarchy relational database, and / or performing a synonym replacement operation on the input instruction text based on a thesaurus, to obtain the replaced instruction text, includes: The input instruction text is segmented into words to obtain a segmentation sequence; Based on the search results in the thesaurus and semantic hierarchy relation database for each word in the word segmentation sequence, the replaceable and non-replaceable word segments in the word segmentation sequence are determined. For at least one replaceable word segment, based on the synonyms of the replaceable word segment in the thesaurus or the hierarchical related words of the replaceable word segment in the semantic hierarchy relation library, the replaceable word segment is subjected to synonym replacement or hierarchical related word replacement operation to obtain the replaced word segment; By combining the replaced word segment with the non-replaceable word segment, the replacement instruction text is obtained.
4. The method according to claim 2, characterized in that, Also includes: If the replacement instruction text has undergone a hierarchical association replacement operation, then obtain the word segmentation before and after the hierarchical association replacement, and determine whether the target operation step contains the word segmentation after the change. If included, the modified word segmentation in the target operation step will be replaced with the original word segmentation.
5. The method according to claim 2, characterized in that, Also includes: The text matching confidence level is determined based on the cumulative number of times the replacement instruction text generated by the target operation steps is found, and the type of word replacement operation used to generate the replacement instruction text. Based on the text matching confidence level, determine whether to output the target operation steps.
6. The method according to claim 5, characterized in that, The step of determining whether to output the target operation step based on the text matching confidence score includes: If the input instruction text is obtained based on the user's voice instruction, then the user's acoustic intent is evaluated based on the time-domain and frequency-domain characteristics of the voice instruction to obtain the intensity of the acoustic intent. The overall confidence level is determined by weighting the acoustic intent intensity with the text matching confidence level. Based on the overall confidence level, determine whether to output the target operation step.
7. The method according to claim 6, characterized in that, Before determining the overall confidence level based on the weighted value of the acoustic intent intensity and the text matching confidence level, the method further includes: Based on the vehicle's motion state and the level of noise inside the vehicle, a first weight corresponding to the acoustic intent intensity and a second weight corresponding to the text matching confidence are determined.
8. The method according to claim 2, characterized in that, Building the instruction association library includes: Store the training instruction text and corresponding operation steps in the instruction association library; The training instruction text is segmented into words to obtain the training word segmentation sequence; For each training word in the training word segmentation sequence, synonyms and hierarchical related words are searched in the thesaurus and the semantic hierarchy relation database, respectively. Generate a set of candidate replacement words corresponding to the training word segmentation based on the synonyms and the hierarchical related words; Based on the candidate replacement word set corresponding to each training word in the word segmentation sequence, Cartesian product operation is performed to obtain the extended instruction text corresponding to the training instruction text; The extended instruction text is associated with the operation steps and stored in the instruction association library.
9. The method according to claim 2, characterized in that, The priority of the synonym replacement is higher than the priority of the hierarchical association replacement.
10. A vehicle, characterized in that, include: A controller; the controller is used to perform the method according to any one of claims 1-9.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1 to 9.
