Voice interaction processing method and device, and medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2026-03-10
AI Technical Summary
通常情况下,交互时延越短用户体验感越好,但现有的语音交互中,交互时延通常无法满足用户的需求,用户在进行语音交互时体验感往往较差
[0045]This invention provides a voice interaction processing method, device, and medium. When receiving voice interaction data sent by a terminal at a preset frequency, text recognition is performed based on the voice interaction data to obtain recognized text information. The terminal records and generates voice interaction data at a preset frequency when it detects that a user has begun issuing a voice request. Based on the text information, it is determined whether a preset condition for ending voice detection is met. If the preset condition is not met, preprocessing is performed on the text information to obtain a corresponding preprocessing result, and the text information and the preprocessing result are cached. The preprocessing result is used to indicate the conversation response result corresponding to the text information. If the preset condition is met, the text information is compared with the previously cached historical text information and the corresponding preprocessing result to obtain the final processing result. This application effectively improves the overall response speed of voice interaction by processing the voice recognition process and the voice recognition result in parallel, reducing interaction latency and enhancing the user experience during voice interaction.
Smart Images

Figure CN121641027A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of smart home, in particular to a voice interaction processing method, device and medium. BACKGROUND
[0002] In a traditional voice interaction scenario, a voice terminal receives a user wake-up, and performs recording, and uploads the recording to a cloud. The cloud processes the recording into text, and performs intent analysis on the text, and obtains corresponding device control instructions and content text to be broadcast according to the intent analysis result. The control device executes the instructions, and converts the text into voice and sends it to the voice terminal for broadcast.
[0003] However, in voice interaction, interaction delay is a key indicator of user experience. Generally, the shorter the interaction delay, the better the user experience. However, in existing voice interaction, the interaction delay usually cannot meet the needs of users, and the user experience is often poor when performing voice interaction. SUMMARY
[0004] To solve the above problems, the present application provides a voice interaction processing method, device and medium.
[0005] In a first aspect, the present application provides a voice interaction processing method, comprising:
[0006] When receiving voice interaction data sent by a terminal at a preset frequency, performing text recognition according to the voice interaction data to obtain recognized text information, wherein the terminal records and generates voice interaction data at a preset frequency when detecting that a user starts to initiate voice interaction;
[0007] According to the text information, it is determined whether a preset condition for ending voice detection is met, the preset condition being used to indicate that the user has output an explicit device control intent;
[0008] If the preset condition is not met, pre-processing is performed according to the text information to obtain a corresponding pre-processing result, and the text information and the pre-processing result are cached, the pre-processing result being used to indicate a conversation response result corresponding to the text information;
[0009] If the preset condition is met, the text information is compared with historical text information cached last time, and a final processing result is obtained according to a comparison result, the pre-processing result being used to indicate a final conversation response result of the current voice interaction.
[0010] In a possible implementation manner, the determining whether the preset condition for ending voice detection is met according to the text information comprises:
[0011] performing semantic analysis on the text information to obtain a semantic analysis result, the semantic analysis result being one actual device control intent or multiple candidate device control intents;
[0012] If the semantic analysis result is one actual device control intent, it indicates that the preset condition for ending the human voice detection is met.
[0013] If the semantic analysis result is multiple candidate device control intents, it indicates that the preset condition for ending the human voice detection is not met.
[0014] In a possible implementation, the preprocessing according to the text information to obtain a corresponding preprocessing result comprises:
[0015] confirming whether there is last cached historical text information and corresponding preprocessing result after the user starts to issue a voice request;
[0016] If not, inputting the multiple candidate device control intents in the semantic analysis result into a prediction model to obtain a predicted device control intent output by the prediction model, the predicted device control intent being one of the multiple candidate device control intents;
[0017] obtaining a control instruction executable by a corresponding device according to the predicted device control intent;
[0018] obtaining a voice response content corresponding to the situation where the device normally completes the control instruction, the voice response content being content to be broadcast by the terminal to the user after the device normally completes the control instruction;
[0019] taking the predicted device control intent, the control instruction, and the voice response content as the preprocessing result.
[0020] In a possible implementation, the method further comprises:
[0021] If there is last cached historical text information and corresponding preprocessing result, confirming whether the historical text information and the text information are the same;
[0022] If the historical text information and the text information are different, confirming whether a predicted device control intent corresponding to the historical text information and a predicted device control intent of the text information are the same;
[0023] If the predicted device control intent corresponding to the historical text information and the predicted device control intent of the text information are different, performing the steps of obtaining the predicted device control intent, the corresponding control instruction, and the voice response content corresponding to the control instruction according to the text information to obtain the preprocessing result corresponding to the text information.
[0024] In a possible implementation, the method further includes:
[0025] If the historical text information is the same as the text information, or the historical text information is different from the text information but the corresponding predicted device control intention is the same, the corresponding pre-processing result of the historical text information is taken as the pre-processing result of the text information.
[0026] In a possible implementation, the comparing the text information with the last cached historical text information and the corresponding pre-processing result to obtain the final processing result includes:
[0027] If the text information is the same as the last cached historical text information, or the historical text information is different from the text information but the corresponding predicted device control intention of the historical text information is the same as the corresponding actual device control intention of the text information, the corresponding pre-processing result of the historical text information is taken as the final processing result.
[0028] If the text information is different from the historical text information, and the corresponding predicted device control intention and the actual device control intention are different, a control instruction corresponding to the actual device control intention is obtained, corresponding speech response content is obtained according to the control instruction, and the control instruction and the speech response content are taken as the final processing result.
[0029] In a possible implementation, the method further includes:
[0030] After the recognized text information is obtained, it is determined whether new text information is recognized within a first preset time length.
[0031] If not, a pre-processing result corresponding to the text information is obtained, and the pre-processing result is cached.
[0032] It is determined whether new text information is recognized within a second preset time length, and when new text information is recognized, a corresponding pre-processing result is obtained and cached until the second preset time length ends, the second preset time length being longer than the first preset time length.
[0033] The latest pre-processing result is taken as the final processing result.
[0034] In a possible implementation, after the final processing result is obtained, the method further includes:
[0035] The control instruction is sent to the corresponding device.
[0036] If the device returns information that the execution is normal, the speech response content is sent to the terminal, so that the terminal broadcasts information that the device execution is completed to the user.
[0037] If the device returns the information of the execution exception, an exception identifier of the device is acquired, a candidate voice response content corresponding to the exception identifier is acquired, and the terminal is sent to the terminal to make the terminal broadcast the information of the device execution exception to the user.
[0038] In a second aspect, the present application provides a voice interaction processing device, the device comprising:
[0039] An identification module is configured to perform text recognition according to voice interaction data sent by a terminal at a preset frequency when the voice interaction data is received, and acquire recognized text information, wherein the terminal records and generates voice interaction data at a preset frequency when it detects that a user initiates voice interaction;
[0040] A judgment module is configured to determine whether a preset condition for ending voice detection is met according to the text information, wherein the preset condition is used to indicate that the user has output an explicit device control intention;
[0041] A processing module is configured to perform preprocessing according to the text information to obtain a corresponding preprocessing result if the preset condition is not met, and cache the text information and the preprocessing result, wherein the preprocessing result is used to indicate a session response result corresponding to the text information;
[0042] The processing module is further configured to compare the text information with historical text information cached last time if the preset condition is met, and acquire a final processing result according to a comparison result, wherein the preprocessing result is used to indicate a final session response result of the current voice interaction.
[0043] In a third aspect, the present application provides a computer-readable storage medium, the computer-readable storage medium comprising a stored program, wherein the program is executed to perform the method of any one of the first aspect.
[0044] In a fourth aspect, the present application provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the method of any one of the first aspect by using the computer program.
[0045] This invention provides a voice interaction processing method, device, and medium. When receiving voice interaction data sent by a terminal at a preset frequency, text recognition is performed based on the voice interaction data to obtain recognized text information. The terminal records and generates voice interaction data at a preset frequency when it detects that a user has begun issuing a voice request. Based on the text information, it is determined whether a preset condition for ending voice detection is met. If the preset condition is not met, preprocessing is performed on the text information to obtain a corresponding preprocessing result, and the text information and the preprocessing result are cached. The preprocessing result is used to indicate the conversation response result corresponding to the text information. If the preset condition is met, the text information is compared with the previously cached historical text information and the corresponding preprocessing result to obtain the final processing result. This application effectively improves the overall response speed of voice interaction by processing the voice recognition process and the voice recognition result in parallel, reducing interaction latency and enhancing the user experience during voice interaction. Attached Figure Description
[0046] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0047] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 This application provides an example of an application scenario. Figure One ;
[0049] Figure 2 This application provides an example of an application scenario. Figure Two ;
[0050] Figure 3 This is the voice interaction processing method flow provided in the embodiments of this application. Figure One ;
[0051] Figure 4 This is the voice interaction processing method flow provided in the embodiments of this application. Figure Two ;
[0052] Figure 5 A diagram of a voice interaction processing device provided in an embodiment of this application;
[0053] Figure 6 A hardware schematic diagram of the electronic device provided in the embodiments of this application. Detailed Implementation
[0054] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0055] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0056] In today's smart home scenarios, users can issue various commands through voice terminals to control these devices or other home appliances. However, in traditional voice interaction systems, the processing boundaries at each stage are clearly defined. The end-to-end voice chain contains many business nodes, many of which handle specific logic for particular scenarios. Yet, these nodes still run sequentially along the critical path of voice interaction. This results in a gradual increase in latency for all requests as the complexity of voice services increases.
[0057] To address the aforementioned issues, this invention subdivides the business scenarios at each stage, designating business logic with a high processing volume as mainstream and critical business, and other business logic as non-critical business. Scenarios where non-critical business processes are time-consuming can be optimized and processed in parallel with critical business processes, thereby improving the overall interactive experience. Therefore, this application provides a voice interaction processing method. When receiving voice interaction data sent by a terminal at a preset frequency, text recognition is performed based on the voice interaction data to obtain recognized text information. Specifically, the terminal records and generates voice interaction data at a preset frequency when it detects that a user has begun issuing a voice request. Based on the text information, it is determined whether a preset condition for ending voice detection is met. If the preset condition is not met, preprocessing is performed on the text information to obtain a corresponding preprocessing result, and the text information and the preprocessing result are cached. The preprocessing result is used to indicate the session response result corresponding to the text information. If the preset condition is met, the text information is compared with previously cached historical text information and the corresponding preprocessing result to obtain the final processing result. This application improves the overall response speed of voice interaction by processing the voice recognition process and the voice recognition result in parallel, reducing the interaction latency and enhancing the user experience when performing voice interaction.
[0058] Figure 1 This application provides an example of an application scenario. Figure One .like Figure 1 As shown in the diagram, this sequence diagram illustrates the data processing in a current voice interaction process. When a user begins speaking, the voice terminal records the audio until it detects the end of the user's speech, entering a waiting phase to end voice detection. This waiting phase is typically used to prevent situations where the user might continue speaking after a pause, and the voice terminal cannot recognize it in time. Therefore, a preset waiting time is used for confirmation. When the waiting phase ends, a final recording packet is generated. The cloud receives this recording packet and performs text recognition to obtain the final text recognition result. Based on the text recognition result, semantic recognition is performed to obtain one or more possible alternative intentions of the user. Further, based on the context, the most likely intention is selected from the previously identified intentions to obtain the final semantic recognition result. Based on this final speech recognition result, the cloud processes the command, generating a control command recognizable by the target device. After verifying the command, it is issued. After controlling the target device, a voice message reflecting the control result is generated and broadcast via the voice terminal to inform the user of the target device control result or other preset prompts.
[0059] The voice interaction processing method provided in this application can be widely applied to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligence house ecosystems. Optionally, Figure 2 This application provides an example of an application scenario. Figure Two .like Figure 2 As shown in the diagram, this schematic illustrates the data processing timing diagram of the improved version of this application in the existing voice interaction process. When the user begins speaking, the voice terminal records the audio until the user's speech ends and / or text is detected based on the speech. After entering the waiting phase for the end of voice detection, the cloud first acquires the text data corresponding to the recorded data as an intermediate result for text recognition. Based on this intermediate result, subsequent semantic recognition and final intent confirmation are performed. Based on the final confirmed intent, preprocessing is performed to obtain the corresponding target device control command. After verification, the preprocessing result is cached. During the waiting phase for the end of voice detection, if text is detected based on speech to confirm whether preprocessing should be performed, multiple preprocessing results may exist. The latest preprocessing result is usually used for subsequent comparison and confirmation. At the end of the waiting phase for the end of voice detection, the final text recognition result corresponding to the user's speech data is obtained. Analysis is then performed to confirm whether the final text information and the latest preprocessing result correspond to the same text, semantics, or intent. If they are the same, the latest preprocessing result can be used as the final processing result to send control commands to the target device and to broadcast voice messages to the user via the voice terminal. Optionally, the aforementioned target device or voice terminal can be the same device or two different devices with the same cloud service. The target device or voice terminal is not limited to, but can include, smart air conditioners, smart range hoods, smart refrigerators, smart ovens, smart stoves, smart washing machines, smart water heaters, smart washing equipment, smart dishwashers, smart projectors, smart TVs, smart clothes racks, smart curtains, smart audio-visual systems, smart sockets, smart speakers, smart speakers, smart fresh air systems, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaners, smart window cleaning robots, smart mopping robots, smart air purifiers, smart steam ovens, smart microwave ovens, smart water heaters, smart air purifiers, smart water dispensers, smart door locks, etc. The following describes some embodiments of this application in detail with reference to the accompanying drawings. Where there is no conflict between the embodiments, the following embodiments and features can be combined with each other. Furthermore, the timing of the steps in the following method embodiments is merely an example and not a strict limitation.
[0060] Figure 3 This is the voice interaction processing method flow provided in the embodiments of this application. Figure One .like Figure 3 As shown, the method includes:
[0061] S301. When receiving voice interaction data sent by the terminal at a preset frequency, perform text recognition based on the voice interaction data to obtain the recognized text information.
[0062] The terminal records voice interaction data at a preset frequency when it detects that a user has started a voice interaction.
[0063] In this step, the terminal device begins recording when the user makes a voice request and generates voice interaction data at preset time intervals. Upon receiving this voice interaction data in real time, it is further processed to convert the recording into text. For example, the terminal device can initiate recording after detecting the user's voice and package the recording data into audio data packets at a fixed frequency (e.g., generating one voice interaction data packet per second). The voice interaction data is transmitted to a server or cloud, where the system uses speech recognition technology, such as an automatic speech recognition (ASR) system based on deep learning, to convert the recording data into text information.
[0064] It should be noted that the generation of voice interaction data is regular, periodic, and continuous. It is not conditional on whether the user speaks clearly; rather, recording begins as soon as human voice is detected, and voice interaction data is generated at a fixed frequency. When receiving voice interaction data from the terminal device, if recognizable text is detected within the currently received voice interaction data, the next step can be performed. The process of receiving voice interaction data and performing text recognition continues until the preset conditions for ending voice detection are met, at which point recording of the user and generation of voice interaction data cease. The recognized text can be an incomplete control command. When the semantic analysis resources are more intelligent, analysis can be performed on text containing only a single character or verb based on context, yielding multiple possible intents.
[0065] S302. Based on the text information, determine whether the preset conditions for ending voice detection are met.
[0066] The preset conditions are used to indicate that the user has output a clear intention to control the device.
[0067] In this step, the identified text information is analyzed to determine whether voice detection needs to continue or can be terminated. For example, it can be determined whether the user's voice input clearly expresses an intention; if so, voice detection can be terminated; otherwise, the user's voice input needs to be detected further.
[0068] For example, determining whether the preset conditions for ending voice detection are met based on the text information includes:
[0069] Perform semantic analysis on the text information to obtain semantic analysis results, wherein the semantic analysis results are an actual device control intent or multiple candidate device control intents;
[0070] If the semantic analysis result is an actual device control intention, it means that the preset condition for ending human voice detection has been met;
[0071] If the semantic analysis result shows multiple candidate device control intentions, it means that the preset conditions for ending human voice detection are not met.
[0072] It's important to note that the identified text information is input into a semantic analysis engine, such as a natural language processing-based intent recognition model, to extract the core intent of the text. If the semantic analysis result is a clear, actual device control intent (e.g., "turn on the light"), the user's request can be considered clear, and voice detection can end. If the semantic analysis result is multiple ambiguous candidate intents, such as "adjust the temperature" potentially including "raise the temperature" or "lower the temperature," then the user's request is not clear enough, and it's necessary to continue waiting or obtaining more information until a clear intent is obtained, at which point voice detection can end.
[0073] S303. If not, preprocess the text information to obtain the corresponding preprocessing result, and cache the text information and the preprocessing result.
[0074] The preprocessing result is used to indicate the session response result corresponding to the text information.
[0075] In this step, if the conditions for ending voice detection are not met, the current text information is preprocessed, and the preprocessing result is cached. The purpose of preprocessing is to prepare for further conversations or for command execution. Preprocessing may include: selecting the most likely user intent from multiple candidate device control intents for subsequent analysis; this most likely intent will be cached as part of the preprocessing result. Further, based on the most likely intent, a control command recognizable by the corresponding device to be controlled is generated and cached. And, based on the control command, a corresponding conversation response is generated to provide feedback to the user regarding device execution. That is, the preprocessing result can be generated and cached during the user command issuance phase; after the user command issuance phase ends, if the user intent has not changed compared to the preprocessing phase, the preprocessing result is used directly for response and feedback.
[0076] It should be understood that recognizing text, determining whether the preset conditions for ending voice detection are met, and preprocessing the recognized text is a continuous and cyclical process. The cyclical condition is that voice detection has not ended. This cyclical process stops when the currently recognized text meets the preset conditions for ending voice detection.
[0077] For example, the preprocessing based on the text information to obtain the corresponding preprocessing result includes:
[0078] Confirm whether there is previously cached historical text information and corresponding preprocessing results after the user initiates a voice request;
[0079] If not, the multiple candidate device control intentions in the semantic analysis results are input into the prediction model to obtain the predicted device control intention output by the prediction model. The predicted device control intention is one of the multiple candidate device control intentions.
[0080] Based on the predicted control intent of the device, obtain the corresponding control instructions that the device can execute;
[0081] The voice response content corresponding to the normal execution of the control command by the device is obtained. The voice response content is the content that the terminal needs to broadcast to the user after the device has normally executed the control command.
[0082] The predicted device control intent, control commands, and voice response content are used as preprocessing results.
[0083] It's important to note that when processing the currently recognized text, it's necessary to verify whether there is any previously recognized historical text information and corresponding preprocessing results from the time the user initiated the voice request until the present moment. If there is no historical information, it indicates that this is a completely new request processing process after the user started interacting. In this case, historical information cannot be relied upon, and preprocessing can only be performed based on the current information.
[0084] For example, multiple candidate device control intentions obtained from semantic analysis can be input into a trained prediction model. This prediction model can be based on machine learning (such as decision trees, random forests) or deep learning (such as RNNs, BERT), and the training objective is to predict the most likely user intention based on multiple possible input intentions. The prediction model outputs the most likely predicted device control intention. The predicted device control intention (e.g., "turn on the TV") is then mapped to the actual control command (e.g., sending a "power_on" signal to the TV). This mapping can be implemented using a device command library, which pre-stores all possible device commands and their corresponding operations. After the device executes the control command, the system needs to prepare a voice response to provide feedback to the user on the device's execution status, allowing the user to receive timely confirmation. Based on the command executed by the device, an appropriate voice response (e.g., "TV is on") can be selected from a predefined voice template library. This voice response can be pre-recorded or dynamically generated using TTS (Text-to-Speech) technology.
[0085] For example, the method further includes:
[0086] If there is previously cached historical text information and corresponding preprocessing results, then confirm whether the historical text information and the text information are the same;
[0087] If the historical text information and the text information are different, then it is confirmed whether the prediction device control intent corresponding to the historical text information and the prediction device control intent of the text information are the same;
[0088] If the predictive device control intent corresponding to the historical text information is different from the predictive device control intent of the text information, then according to the text information, the step of obtaining the predictive device control intent, the corresponding control command, and the voice response content corresponding to the control command is executed to obtain the preprocessing result corresponding to the text information.
[0089] For example, if the historical text information is the same as the text information, or if the historical text information is different from the text information but the corresponding prediction device control intent is the same, then the preprocessing result corresponding to the historical text information is used as the preprocessing result of the text information.
[0090] It should be noted that if the currently identified text information is consistent with previous historical information, or if the text is different but the intent is the same, the previous processing results can be directly reused to avoid repeated calculations and processing, thereby improving efficiency. If the current text information is different from historical information and the predicted device control intent is also different, preprocessing will be performed again to ensure that the latest preprocessing result is closest to the user's intent.
[0091] First, the currently recognized text information is compared with the cached historical text information to determine if they are identical. If they are identical, it indicates that the user may have repeated the same instruction, which can be achieved through a simple string comparison. If the historical text information differs from the current text information, their respective predicted device control intentions are further compared to see if they are the same. This is to check whether the user's expression conveys the same intention despite different wording. If the historical text information differs from the current text information and the corresponding predicted device control intention is also different, it indicates that the user may have issued a new instruction or a more accurate and different intention has been recognized. Therefore, the steps of obtaining the predicted device control intention, the corresponding control instruction, and the voice response content need to be repeated. If the historical text information is the same as the current text information, or they are different but the predicted device control intention is the same, the previous preprocessing results can be directly reused to save computing resources and speed up the response.
[0092] S304. If so, the text information is compared with the previously cached historical text information, and the final processing result is obtained based on the comparison result.
[0093] The preprocessing result is used to indicate the final session response result of the current voice interaction.
[0094] In this step, upon confirming that the preset conditions for ending voice detection are met, the current text information is compared with the previously cached historical text information and preprocessing results. For example, similarity calculations or other algorithms are used to determine the relationship between them. The comparison process can involve comparing the text and intent sequentially, performing a complete similarity comparison directly, or selectively comparing important parts; there are no restrictions here. If the final processing result is the previously cached preprocessing result, then the feedback content is generated in advance in parallel throughout the entire voice interaction data processing process, saving preprocessing time.
[0095] For example, comparing the text information with the previously cached historical text information and obtaining the final processing result based on the comparison result includes:
[0096] If the text information is the same as the previously cached historical text information, or if the historical text information is different from the text information, but the predicted device control intent corresponding to the historical text information is the same as the actual device control intent corresponding to the text information, then the preprocessing result corresponding to the historical text information will be used as the final processing result.
[0097] If the text information is different from the historical text information, and the corresponding predicted device control intent is different from the actual device control intent, then the control instruction corresponding to the actual device control intent is obtained; the corresponding voice response content is obtained according to the control instruction; and the control instruction and the voice response content are processed as the final result.
[0098] The voice interaction processing method provided in this application embodiment, when receiving voice interaction data sent by a terminal at a preset frequency, performs text recognition based on the voice interaction data to obtain recognized text information. Specifically, the terminal records and generates voice interaction data at a preset frequency when it detects that a user has begun issuing a voice request. Based on the text information, it determines whether a preset condition for ending voice detection is met. If the preset condition is not met, preprocessing is performed on the text information to obtain a corresponding preprocessing result, and the text information and the preprocessing result are cached. The preprocessing result is used to indicate the conversation response result corresponding to the text information. If the preset condition is met, the text information is compared with the previously cached historical text information and the corresponding preprocessing result to obtain the final processing result. This application effectively improves the overall response speed of voice interaction by processing the voice recognition process and the voice recognition result processing in parallel, shortening the interaction latency and enhancing the user experience during voice interaction.
[0099] Figure 4 This is the voice interaction processing method flow provided in the embodiments of this application. Figure Two .like Figure 4 As shown, in Figure 3 Based on the previous examples, another preprocessing procedure with differences is proposed. This includes:
[0100] S401. When receiving voice interaction data sent by the receiving terminal at a preset frequency, perform text recognition based on the voice interaction data to obtain the recognized text information.
[0101] S402. After acquiring the recognized text information, determine whether new text information has been recognized within the first preset time period.
[0102] S403. If so, repeat step S401.
[0103] S404. If not, obtain the preprocessing result corresponding to the text information and cache the preprocessing result.
[0104] It should be noted that S401 is the same as S301, and will not be described again here. The processing procedure in this embodiment is based on a time window mechanism. After acquiring the recognized text information, a short time window (first preset duration) is set to determine whether new text information continues to be received. The purpose is to determine whether the user is still speaking or inputting new instructions. The first preset duration is set relatively short to detect whether the user's voice input is complete. If new text information is recognized within the first preset duration, the system will continue to determine whether there is new input and repeat the above steps until there is no new input. By continuously extending the time window, continuous voice input can be processed, which is more effective for processing complex instructions or multiple instructions. Each time new text information is recognized, it is necessary to re-determine whether there is new input to ensure that the complete user intent is captured. When the user no longer inputs new content or instructions, the current input can be regarded as a complete voice instruction and preprocessed. The preprocessing result is cached to serve as the basis for subsequent judgments and operations.
[0105] S405. Within the second preset time period, confirm whether new text information is recognized, and when new text information is recognized, obtain the corresponding preprocessing result and cache it until the second preset time period ends.
[0106] Wherein, the second preset duration is longer than the first preset duration.
[0107] S406. Use the latest preprocessing result as the final processing result.
[0108] It should be noted that the system continues to monitor for new text input within a longer time window (the second preset duration). If new text input is detected, the system retrieves the corresponding preprocessed result and caches it until the second preset duration ends. The longer second preset duration aims to ensure that no important input is missed, even if the user may continue typing, and to ensure that continuous input is processed even if the user pauses briefly before resuming. After the second preset duration ends, the last generated preprocessed result is used as the final processing result for actual operation or user feedback, as the final preprocessed result typically represents the user's latest and final intent.
[0109] It should be noted that the difference between this embodiment and the previous embodiment is that the previous embodiment focused on intent judgment and preprocessing based on the text information of each voice interaction analysis. This embodiment, however, adopts a time window-based processing method, allowing multiple segments of user input to accumulate within a certain time period, collecting sufficient information before preprocessing. Furthermore, the previous embodiment decided whether to continue detecting user voice input based on the semantic analysis results of the text information, relying more on content-based judgment. This embodiment introduces a clear time window, controlling the processing flow through a preset duration to ensure that subsequent user input is not missed. In addition, the caching strategy of the previous embodiment was based on semantic analysis and comparison of historical information, relying more on content consistency. The caching strategy of this embodiment relies more on the time window; all content identified and processed within the time window is gradually cached, and the latest preprocessed result is selected at the end.
[0110] For example, in any of the above embodiments, after obtaining the final processing result, the process further includes:
[0111] Send the control command to the corresponding device;
[0112] If the device returns a message indicating that the execution has been completed normally, the voice response content is sent to the terminal so that the terminal can announce to the user that the device has completed the execution.
[0113] If the device returns an execution error message, then the error identifier of the device is obtained; the candidate voice response content corresponding to the error identifier is obtained and sent to the terminal, so that the terminal can broadcast the device execution error message to the user.
[0114] It should be noted that during preprocessing, the voice response content is usually what the corresponding device is supposed to play to the user upon completion of its execution. However, in some cases, network problems or device malfunctions may prevent the device from executing the response operation according to the instructions, causing the user request to fail. In such cases, the content to be played may not be present in the preprocessing results, so the specific reasons for the anomaly may vary. In these situations, it is necessary to further provide the user with possible device error information based on the specific anomaly, thus informing the user of the device's execution status and providing them with a reference for troubleshooting.
[0115] The voice interaction processing method provided in this application, by introducing a time window and a multi-stage preprocessing mechanism, can accurately capture the user's complete voice commands, avoid misoperation, improve recognition accuracy, optimize user experience, and reduce resource consumption.
[0116] Figure 5 A diagram of a voice interaction processing device provided in an embodiment of this application; as shown. Figure 5 As shown, the processing device 50 includes:
[0117] The recognition module 501 is used to perform text recognition based on the voice interaction data sent by the receiving terminal at a preset frequency when receiving voice interaction data at a preset frequency, and to obtain the recognized text information. The terminal records and generates voice interaction data at a preset frequency when it detects that the user has started to make a voice request.
[0118] The judgment module 502 is used to determine whether the preset conditions for ending human voice detection are met based on the text information.
[0119] The processing module 503 is used to preprocess the text information if the preset conditions are not met, so as to obtain the corresponding preprocessing result, and to cache the text information and the preprocessing result. The preprocessing result is used to indicate the session response result corresponding to the text information.
[0120] The processing module 503 is further configured to, if the preset conditions are met, compare the text information with the previously cached historical text information and the corresponding preprocessing results to obtain the final processing result.
[0121] Figure 6 A hardware schematic diagram of the electronic device provided in an embodiment of this application. For example... Figure 6 As shown, the electronic device 60 provided in this embodiment includes at least one processor 601 and a memory 602. The device 60 also includes a communication component 603. The processor 601, memory 602, and communication component 603 are connected via a bus 604.
[0122] In a specific implementation, at least one processor 601 executes computer execution instructions stored in the memory 602, causing at least one processor 601 to perform the above method.
[0123] The specific implementation process of processor 601 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0124] In the above Figure 6In the illustrated embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0125] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0126] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0127] This application also provides a computer-readable storage medium storing computer-executable instructions / computer programs, which, when executed by a processor, implement the method described above.
[0128] The aforementioned readable storage medium 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. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0129] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0130] The division of units described herein is merely a logical functional division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0131] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0132] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0133] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, 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 invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0134] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0135] The technical solutions of this application have been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it is readily understood by those skilled in the art that the scope of protection of this application is obviously not limited to these specific embodiments. The above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A voice interaction processing method, characterized by, The method comprises the following steps: When receiving voice interaction data sent by a terminal at a preset frequency, text recognition is performed according to the voice interaction data to obtain recognized text information, wherein the terminal records and generates voice interaction data at a preset frequency when detecting that a user initiates voice interaction; According to the text information, it is determined whether a preset condition for ending voice detection is met, and the preset condition is used to indicate that the user outputs an explicit device control intention; If the preset condition is not met, the text information is preprocessed according to the text information to obtain a corresponding preprocessing result, and the text information and the preprocessing result are cached, and the preprocessing result is used to indicate a conversation response result corresponding to the text information; If the preset condition is met, the text information is compared with the last cached historical text information, and a final processing result is obtained according to the comparison result, and the preprocessing result is used to indicate a final conversation response result of the current voice interaction.
2. The method of claim 1, wherein, The step of determining whether the preset condition for ending voice detection is met according to the text information comprises the following steps: Performing semantic analysis on the text information to obtain a semantic analysis result, wherein the semantic analysis result is an actual device control intention or multiple candidate device control intentions; If the semantic analysis result is an actual device control intention, it indicates that the preset condition for ending voice detection is met; If the semantic analysis result is multiple candidate device control intentions, it indicates that the preset condition for ending voice detection is not met.
3. The method of claim 2, wherein, The step of preprocessing the text information to obtain a corresponding preprocessing result comprises the following steps: Confirming whether there is last cached historical text information and corresponding preprocessing result after the user initiates a voice request; If not, input the multiple candidate device control intentions in the semantic analysis result into a prediction model to obtain a predicted device control intention output by the prediction model, wherein the predicted device control intention is one of the multiple candidate device control intentions; According to the predicted device control intention, a control instruction executable by a corresponding device is obtained; When the device normally executes the control instruction, the corresponding voice response content is obtained, and the voice response content is used to indicate the content that the terminal needs to broadcast to the user after the device normally executes the control instruction; The predicted device control intention, the control instruction and the voice response content are taken as the preprocessing result.
4. The method of claim 3, wherein, The method further comprises the following steps: If there is last cached historical text information and corresponding preprocessing result, it is confirmed whether the historical text information and the text information are the same; If the historical text information and the text information are different, it is confirmed whether the predicted device control intention corresponding to the historical text information and the predicted device control intention of the text information are the same; If the predicted device control intention corresponding to the historical text information and the predicted device control intention of the text information are different, the steps of obtaining the predicted device control intention, the corresponding control instruction and the voice response content corresponding to the control instruction are performed according to the text information to obtain the preprocessing result corresponding to the text information.
5. The method of claim 4, wherein, The method further comprises the following steps: If the historical text information is the same as the text information, or the historical text information is different from the text information but the corresponding predicted device control intention is the same, the pre-processing result corresponding to the historical text information is taken as the pre-processing result of the text information.
6. The method of claim 3, wherein, The comparison of the text information and the last cached historical text information and the acquisition of the final processing result according to the comparison result include: If the text information is the same as the last cached historical text information, or the historical text information is different from the text information but the predicted device control intention corresponding to the historical text information is the same as the actual device control intention corresponding to the text information, the pre-processing result corresponding to the historical text information is taken as the final processing result. If the text information is different from the historical text information and the corresponding predicted device control intention and the actual device control intention are different, the control instruction corresponding to the actual device control intention is acquired, the corresponding voice response content is acquired according to the control instruction, and the control instruction and the voice response content are taken as the final processing result.
7. The method of claim 1, wherein, The method further includes: After the text information is acquired, it is determined whether new text information is recognized within a first preset time period. If not, the pre-processing result corresponding to the text information is acquired, and the pre-processing result is cached. It is determined whether new text information is recognized within a second preset time period, and the corresponding pre-processing result is acquired and cached when new text information is recognized, until the second preset time period ends, and the second preset time period is longer than the first preset time period. The latest pre-processing result is taken as the final processing result.
8. The method according to any one of claims 1 to 7, characterized in that, After the final processing result is acquired, the method further includes: The control instruction is sent to the corresponding device. If the device returns information that has been normally executed, the voice response content is sent to the terminal, so that the terminal broadcasts information that the device has executed to the user. If the device returns information that the execution is abnormal, the abnormal identifier of the device is acquired, the candidate voice response content corresponding to the abnormal identifier is acquired, and the terminal is sent, so that the terminal broadcasts information that the device has executed to the user.
9. A computer readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program executes the method of any one of claims 1 to 7 when running.
10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1 to 7 through the computer program.
Citation Information
Patent Citations
Voice interaction method and device, terminal and server
CN109741753A
Voice interaction method and device, equipment and computer storage medium
CN112185371A
Voice interaction method and device, electronic equipment and computer readable medium
CN117956077A
Speech Decoder and Language Interpreter With Asynchronous Pre-Processing
US20180240466A1
Terminal device and server for voice control
WO2022268136A1