A voiceprint risk level-based dynamic dialogue generation method and system
Patent Information
- Application Number
- CN202611031475.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-10-23
AI Technical Summary
该方案的局限性在于:声纹识别结果直接作为身份标签输出,未对识别结果的可靠性进行量化与分级;当声纹模型输出误判结果时,下游应用无条件遵从错误标签,缺乏对声纹不确定性的容错机制
本发明通过获取声纹识别输出的最高置信度、置信度差值及音频时长等多维信号,利用多阈值联合判定规则将语音输入划分为不同风险等级,并据此动态选取和填充场景提示词模板注入大语言模型,使得对话系统能够根据声纹识别的可靠性自动调整回复策略:在高确信场景下支持自然交互与关系表达,在中度风险场景下限制敏感信息调用,在高度不确定及异常场景下强制采用保守回应,从而有效解决了现有技术因缺乏声纹不确定性感知而导致的误判风险问题,显著提升了人机交互的安全性与用户体验的连贯性。
Smart Images

Figure CN122967644A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, specifically to a dynamic dialogue generation method and system based on voiceprint risk levels. Background Technology
[0002] Currently, in AI hardware products with voice interaction capabilities, such as smart speakers and companion robots, voiceprint recognition technology is usually only used as a preliminary tool for identity verification.
[0003] For example, CN122135743A discloses a speaker recognition and emotion perception method based on AR glasses. This scheme acquires multi-channel speech signals through a microphone array, and after preprocessing such as beamforming, noise reduction, speech enhancement, and voice endpoint detection (VAD), it runs an ECAPA-TDNN voiceprint recognition model in the cloud to obtain speaker embedding vectors. Combined with an AAM-Softmax training mechanism, it identifies gender, age, and speaker identity. Its application scenario is real-time voice interaction on AR glasses. The limitations of this scheme are: the voiceprint recognition result is directly output as an identity label without quantifying or classifying the reliability of the recognition result; when the voiceprint model outputs a misjudgment, downstream applications unconditionally follow the incorrect label, lacking a fault-tolerance mechanism for voiceprint uncertainty.
[0004] For example, CN122090522A discloses a speaker recognition method for long videos that are not yet online. This scheme extracts multimodal features (textual information, visual identity information, auditory content information, and physical action information) from the video to be recognized, constructs target prompts by structuring each modal information, and then uses a large language model to identify the speaker and predict the target speaker corresponding to the dialogue. Its application scenario is the annotation of characters in long video content. The limitation of this scheme is that while its goal is to use a large language model to help improve the accuracy of speaker recognition, it does not address the impact of the uncertainty of voiceprint recognition results on downstream dialogue behavior, nor does it provide a mechanism for automatically adjusting dialogue strategies based on voiceprint reliability.
[0005] For example, CN122019570A discloses a method for collecting dialogue information in a large-scale model that integrates business queries. This method receives initial user input and initializes session variables. It loads predefined prompt word templates and combines them with session state to fill placeholders and generate call prompt words. It then calls a large-scale model to extract candidate structured variables. When a business query needs to be executed, it performs multi-level fuzzy queries based on precise, fuzzy, and auxiliary matching priorities, and adjusts the dialogue strategy according to the results. When updating session variables, it calculates the confidence score of the active list to determine the target item. Its application scenario is information collection in complex multi-turn business dialogues. The limitations of this method are: its confidence score calculation targets the matching degree of business variables (such as whether slot filling is accurate), rather than the speaker identity confidence score output by the voiceprint recognition model; the adjustment of the dialogue strategy does not address the uncertainty of voiceprints, and it cannot solve the response strategy problem in scenarios of speaker identity misjudgment.
[0006] In summary, existing technical solutions mostly involve simply chaining a voiceprint recognition module with a large language model (LLM) dialogue generation module: the voiceprint recognition module outputs a binary identity label (such as "match" or "not match"), and the large language model passively receives this label and generates a response based on it. However, this approach has significant limitations: First, voiceprint recognition results often lack quantitative assessment of recognition reliability, and the system cannot distinguish between high-confidence identity confirmation and low-confidence fuzzy matching; second, the dialogue strategy is rigid, and the large language model uses the same response style regardless of the confidence level of the voiceprint recognition result. This can lead to the system using affectionate terms or calling upon long-term memory when the voiceprint recognition uncertainty is high, resulting in the risk of misjudgment; finally, existing systems lack a mechanism to dynamically adjust dialogue behavior based on voiceprint recognition quality. Once a deviation occurs in recognition, users will experience a disconnect in their experience and may even face security risks. Therefore, the urgent technical problem to be solved in existing technologies is: how to enable the dialogue generation system to perceive the recognition risk level when there is uncertainty in the voiceprint recognition result, and dynamically adjust the dialogue strategy accordingly to avoid the negative experience caused by misjudgment. Summary of the Invention
[0007] This invention aims to provide a dynamic dialogue generation method and system based on voiceprint risk level, and to solve the problem of how to enable the dialogue generation system to perceive and identify risk level when there is uncertainty in the voiceprint recognition result, and dynamically adjust the dialogue strategy accordingly to avoid the bad experience caused by misjudgment.
[0008] To achieve the above objectives, the technical solution adopted by this invention is: a dynamic dialogue generation method based on voiceprint risk level, comprising the following steps: Obtain the highest confidence level of the voiceprint recognition output The confidence difference d and the current audio input duration t; Based on the preset multi-threshold joint judgment rule, according to the highest confidence level The confidence difference d and audio duration t are used to classify each voice input into one of four risk levels: L1 high confidence scenario, L2 medium risk scenario, L3 high uncertainty scenario or L4 abnormal scenario. Based on the determined risk level, select the corresponding scenario prompt word template from four preset scenario prompt word templates; Replace the placeholder variable for the speaker recognition result name in the scene prompt word template with the actual speaker recognition result name for the current round to obtain the filled scene prompt words; The filled scene prompts are injected into the base system prompts of the large language model to obtain the final system prompts. The large language model is then controlled to generate response text that matches the risk level based on the final system prompts.
[0009] Preferably, classifying each voice input into one of four risk levels—L1 high-confidence scenario, L2 moderate-risk scenario, L3 high-uncertainty scenario, or L4 abnormal scenario—includes: If the audio duration t is less than the preset minimum valid audio duration value If the confidence score data is abnormal, it is determined to be an L4 abnormal scenario; If the audio duration t is not less than the minimum valid value of the audio duration If the confidence level data is normal, then further determine: if the confidence level difference d is not greater than the preset confidence level difference threshold. Or the audio duration t satisfies ,in If the preset lower bound threshold for audio duration is used, it is determined to be an L3 highly uncertain scenario; If the confidence difference d is greater than the confidence difference threshold Furthermore, the audio duration t is not less than the lower bound threshold of the audio duration. Then, further determine: if the highest confidence level is... satisfy ,in The preset confidence lower bound threshold, If the upper bound of the confidence level is preset, it is determined to be an L2 moderate risk scenario; If the highest confidence level Not less than the upper bound threshold of the confidence level If so, it is determined to be an L1 high-confidence scenario; If any of the above judgment conditions are not met, it is judged as an L4 abnormal scenario.
[0010] Preferably, the four sets of scene prompt word templates include: The scene cue word templates corresponding to L1 high-confidence scenarios allow the use of affectionate terms, relational expressions, and long-term memory retrieval; The scenario prompt template for L2 medium-risk scenarios restricts specific titles and relational expressions, but allows for natural transitions in dialogue; The scene prompt word template for L3 highly uncertain scenarios completely prohibits titles, relational words, and interpersonal pronouns, and only responds to the literal meaning; The scenario prompt template for L4 abnormal scenarios only allows the simplest concluding or confirmatory response, without expanding on any topic.
[0011] Preferably, the highest confidence level of the obtained voiceprint recognition output is... The confidence difference d and the current audio input duration t include: Voiceprint features are extracted from the input audio to obtain the speaker's voiceprint embedding vector. The voiceprint embedding vector is then compared with the registered voiceprint templates to output the matching confidence score for each candidate speaker. The highest confidence level is calculated from the matching confidence scores of each candidate speaker. And the confidence difference d, wherein the confidence difference d is the absolute value of the difference between the highest confidence level and the second highest confidence level; The duration of the current speech input is detected in parallel to obtain the audio duration t.
[0012] Preferably, when multiple speaker identities are detected in the current voice dialogue, the step of injecting the filled scene cue words into the basic system cue words of the large language model includes: Add multi-speaker introduction information to the basic system prompts. This multi-speaker introduction information includes the relationship between each speaker and the caller, as well as their gender information, to help the large language model correctly apply response strategies while distinguishing different speakers.
[0013] Preferably, for input rounds triggered by physical interaction, the step of injecting the filled scene prompts into the basic system prompts of the large language model further includes: The corresponding voiceprint recognition results are marked as not being used for identity verification, and the simplest response strategy at the L4 abnormal scenario level is forcibly injected into the basic system prompts for this round.
[0014] Preferably, the voiceprint feature extraction is achieved using the ECAPA-TDNN voiceprint recognition model.
[0015] Preferably, injecting the filled scene prompts into the basic system prompts of the large language model further includes: Insert the filled-in scene prompts into the response strategy paragraph of the base system prompts to obtain the final system prompts.
[0016] On the other hand, this invention proposes a dynamic dialogue generation system based on voiceprint risk levels, comprising: The audio acquisition module is used to acquire user voice input; The voiceprint feature extraction module is used to extract voiceprint features from the input audio, obtain the speaker's voiceprint embedding vector, compare the voiceprint embedding vector with the registered voiceprint template, and output the matching confidence score of each candidate speaker. The confidence calculation module is used to calculate the highest confidence score from the matching confidence scores of each candidate speaker. And the confidence difference d, wherein the confidence difference d is the absolute value of the difference between the highest confidence level and the second highest confidence level; The audio duration detection module is used to detect the duration of the current voice input and obtain the audio duration t; The multi-dimensional signal joint determination module is used to determine the signal based on a preset multi-threshold joint determination rule and the highest confidence level. The confidence difference d and audio duration t are used to classify each voice input into one of four risk levels: L1 high confidence scenario, L2 medium risk scenario, L3 high uncertainty scenario or L4 abnormal scenario. The template selection module is used to select the corresponding scene prompt word template from four preset scene prompt word templates based on the determined risk level. The prompt word filling and injection module is used to replace the speaker recognition result name placeholder variable in the scene prompt word template with the actual speaker recognition result name of the current round to obtain the filled scene prompt word, and inject the filled scene prompt word into the basic system prompt word of the large language model to obtain the final system prompt word; A large language model is used to generate response text that matches the risk level based on the final system prompts; The response output module is used to output the response text to the speech synthesis module or present it to the user in text form.
[0017] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention acquires multi-dimensional signals such as the highest confidence level, confidence difference, and audio duration of the voiceprint recognition output. It then uses a multi-threshold joint judgment rule to classify voice input into different risk levels and dynamically selects and fills scene prompt word templates into a large language model. This enables the dialogue system to automatically adjust its response strategy based on the reliability of voiceprint recognition: supporting natural interaction and relational expression in high-confidence scenarios, restricting access to sensitive information in medium-risk scenarios, and forcing a conservative response in highly uncertain and abnormal scenarios. This effectively solves the problem of misjudgment risk caused by the lack of voiceprint uncertainty perception in existing technologies, and significantly improves the security of human-computer interaction and the consistency of user experience. Attached Figure Description
[0018] Figure 1 This is a flowchart of the dynamic dialogue generation method based on voiceprint risk level according to the present invention. Figure 2 This is a block diagram of the dynamic dialogue generation system based on voiceprint risk level according to the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0020] It should be noted that if the embodiments of the present invention involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of the components in a specific posture. If the specific posture changes, the directional indicators will also change accordingly.
[0021] Furthermore, if the embodiments of this invention involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the use of "and / or" or "and / or" throughout the text includes three parallel solutions. For example, "A and / or B" includes solution A, solution B, or a solution where both A and B are satisfied simultaneously. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0022] Please see Figure 1 This invention provides a dynamic dialogue generation method based on voiceprint risk level, comprising the following steps: Obtain the highest confidence level of the voiceprint recognition output The confidence difference d and the current audio input duration t; specifically including: Voiceprint features are extracted from the input audio to obtain the speaker's voiceprint embedding vector. This embedding vector is then compared with a registered voiceprint template, and a matching confidence score for each candidate speaker is output. The highest confidence score is calculated from the matching confidence scores of each candidate speaker. The system detects the duration of the current voice input and obtains the audio duration t. Voiceprint feature extraction is implemented using the ECAPA-TDNN voiceprint recognition model.
[0023] By employing the ECAPA-TDNN voiceprint recognition model to extract features from the input audio and compare them with registered templates, the system can accurately output the matching confidence scores of each candidate speaker. It can then calculate the difference between the highest and second-highest confidence scores. Combined with the parallel detection of the speech input duration, this achieves a leap from single-label to multi-dimensional quantitative evaluation of voiceprint recognition reliability. This provides accurate, objective, and real-time data support for subsequent dynamic dialogue strategy adjustments based on risk levels, effectively avoiding misjudgments in dialogue caused by ambiguous or abnormal recognition results.
[0024] Based on the preset multi-threshold joint judgment rule, according to the highest confidence level The confidence difference d and audio duration t are used to classify each voice input into one of four risk levels: L1 high confidence scenario, L2 moderate risk scenario, L3 high uncertainty scenario, or L4 abnormal scenario; specifically including: If the audio duration t is less than the preset minimum valid audio duration value If the confidence score data is abnormal, it is determined to be an L4 abnormal scenario; If the audio duration t is not less than the minimum valid value of the audio duration If the confidence level data is normal, then further determine: if the confidence level difference d is not greater than the preset confidence level difference threshold. Or the audio duration t satisfies ,in If the preset lower bound threshold for audio duration is used, it is determined to be an L3 highly uncertain scenario; If the confidence difference d is greater than the confidence difference threshold Furthermore, the audio duration t is not less than the lower bound threshold of the audio duration. Then, further determine: if the highest confidence level is... satisfy ,in The preset confidence lower bound threshold, If the upper bound of the confidence level is preset, it is determined to be an L2 moderate risk scenario; If the highest confidence level Not less than the upper bound threshold of the confidence level If so, it is determined to be an L1 high-confidence scenario; If any of the above judgment conditions are not met, it is judged as an L4 abnormal scenario.
[0025] The multi-threshold joint judgment rule integrates multiple indicators such as confidence difference, audio duration, and absolute confidence value to achieve a refined classification of the reliability of voiceprint recognition results. It can accurately distinguish between high-confidence identity confirmation, medium-risk fuzzy matching, highly uncertain scenarios, and abnormal inputs, thus providing the system with a clear decision basis. It effectively avoids the rigidity and misjudgment of single threshold judgment and ensures the accurate adaptation of dialogue strategies under different recognition qualities.
[0026] Based on the determined risk level, a corresponding scenario prompt template is selected from four preset scenario prompt templates; the four scenario prompt templates include: The scenario prompt template for L1 high-confidence scenarios allows the use of affectionate terms, relational expressions, and long-term memory recall; the scenario prompt template for L2 moderate-risk scenarios restricts specific terms of address and relational expressions, but allows natural conversational transitions; the scenario prompt template for L3 highly uncertain scenarios completely prohibits terms of address, relational words, and interpersonal pronouns, and only responds with literal meaning; the scenario prompt template for L4 abnormal scenarios only allows the simplest transitions or confirmatory responses, without expanding on any topic.
[0027] Replace the placeholder variable for the speaker recognition result name in the scene prompt word template with the actual speaker recognition result name for the current round to obtain the filled scene prompt words; The filled scene prompts are injected into the base system prompts of the large language model to obtain the final system prompts. The large language model is then controlled to generate response text that matches the risk level based on the final system prompts.
[0028] Furthermore, when multiple speaker identities are detected in the current voice dialogue, the step of injecting the filled scene prompt words into the basic system prompt words of the large language model includes: adding multi-speaker introduction information to the basic system prompt words. The multi-speaker introduction information includes the relationship and gender information of each speaker to the caller, so as to assist the large language model in correctly applying the response strategy while distinguishing different speakers.
[0029] Furthermore, for input rounds triggered by physical interaction, the step of injecting the filled scene prompts into the basic system prompts of the large language model also includes: marking the corresponding voiceprint recognition result as not performing identity determination, and forcibly injecting the simplest response strategy at the L4 abnormal scene level into the basic system prompts of that round.
[0030] Specifically, injecting the filled-in scene prompts into the basic system prompts of the large language model also includes inserting the filled-in scene prompts into the response strategy paragraph of the basic system prompts to obtain the final system prompts.
[0031] By dynamically replacing speaker placeholders and injecting multi-role relationships and gender features, the system significantly enhances the identity perception and contextual understanding capabilities of large language models in complex multi-person dialogue scenarios, effectively avoiding response confusion. At the same time, it forces the application of the simplest response strategy for specific inputs such as physical interactions to abnormal scenarios, greatly reducing the risk of misjudgment and response latency. The design of accurately embedding scenario prompts into the response strategy paragraphs ensures that the system can adaptively adjust the response style according to the real-time risk level, thereby ensuring natural and smooth interaction while achieving precise control over high-risk scenarios and efficient processing of normal dialogues.
[0032] On the other hand, this invention proposes a dynamic dialogue generation system based on voiceprint risk levels, comprising: The audio acquisition module is used to capture user voice input and transmit the raw audio stream to various modules in the voiceprint signal processing layer. This module is deployed on the microphone array of the AI hardware terminal and supports real-time voice stream acquisition.
[0033] The voiceprint feature extraction module is used to extract voiceprint features from the input audio, obtain the speaker's voiceprint embedding vector, compare the voiceprint embedding vector with the registered voiceprint template, and output the matching confidence score of each candidate speaker; this module can be implemented based on mainstream voiceprint models such as ECAPA-TDNN.
[0034] The confidence calculation module is used to calculate the highest confidence score from the matching confidence scores of each candidate speaker. And the confidence difference d, wherein the confidence difference d is the absolute value of the difference between the highest confidence level and the second highest confidence level; this module is the producer of the key signals required for risk level classification, and its output directly drives the downstream joint judgment.
[0035] The audio duration detection module detects the duration of the current voice input and obtains the audio duration t; it works in parallel with the confidence calculation module. The output of this module serves as the third dimension for risk level determination—extremely short audio clips (such as t < 500ms) are usually insufficient to provide reliable voiceprint features and will be directly identified as abnormal scenarios.
[0036] The multi-dimensional signal joint determination module is used to determine the signal based on a preset multi-threshold joint determination rule and the highest confidence level. The confidence difference d and audio duration t are used to classify each voice input into one of four risk levels: L1 high confidence scenario, L2 medium risk scenario, L3 high uncertainty scenario, or L4 abnormal scenario. This module transforms voiceprint recognition from a binary identity determination of "who is speaking" to a risk level output of "how reliable the judgment is", which is a prerequisite for realizing subsequent hierarchical control.
[0037] The template selection module is used to select the corresponding scenario prompt word template from four preset scenario prompt word templates according to the determined risk level. Each template specifies the identity recognition rules and response behavior constraints that the large language model should follow under the risk level, which are gradually tightened from L1, which allows full identity expression (nickname, long-term memory, relational expression) to L4, which completely suppresses identity information (disables titles, only the simplest response).
[0038] The prompt word filling and injection module is used to replace the speaker recognition result name placeholder variable in the scene prompt word template with the actual speaker recognition result name of the current round to obtain the filled scene prompt word, and inject the filled scene prompt word into the basic system prompt word of the large language model to obtain the final system prompt word; this module is also responsible for the unified processing of the basic information module related to the speaker identity in the system prompt word, eliminating the binary judgment traces in the traditional scheme.
[0039] The large language model is used to generate response text that matches the risk level based on the final system prompt words. Under the guidance of the system prompt words, the large language model autonomously generates responses based on the semantic context of the dialogue. In the L1 scenario, it can call up nicknames and long-term memory, and in the L4 scenario, it only performs the simplest response.
[0040] The response output module is used to output the response text to the speech synthesis module or present it to the user in text form.
[0041] The workflow of this system is as follows: After receiving user voice input, the system executes two processing chains in parallel: one extracts the audio duration t, and the other extracts voiceprint features using a voiceprint model and calculates the highest confidence level. The difference between the confidence level and d.
[0042] (2) The multi-dimensional signal joint judgment module first checks the abnormal conditions: if the audio duration t < 500ms, or the confidence data is missing / abnormal, it is directly judged as an L4 abnormal scenario.
[0043] (3) If no abnormal condition is triggered, the following rules shall be applied sequentially: If the confidence difference d does not exceed the preset threshold or audio duration If the highest confidence level is reached, it is classified as an L3 highly uncertain scenario; otherwise, if the highest confidence level is reached, it is classified as an L3 highly uncertain scenario. and If it is determined to be a Level 2 moderate risk scenario; otherwise, if The case is classified as an L1 high-confidence scenario; all other cases are classified as L4.
[0044] (4) Select the corresponding scenario prompt word template according to the risk level, and replace the placeholder variables such as speaker name in the template with the actual value of the current round.
[0045] (5) The filled scene prompt words are injected into the system prompt words of the big language model. Under the constraint of the system prompt words, the big language model generates a response text that matches the current risk level.
[0046] Risk level determination rules (Equations 1a–1e); Let the current voiceprint signal triplet be... Risk levels R are determined in the following order of priority: d, t, and d. (1a) If Or if the confidence data is abnormal, then ; (1b) Otherwise, if or ,but ; (1c) Otherwise, if and ,but ; (1d) Otherwise, if ,but ; (1e) Other cases, ; Let the basic system prompt be The set of scene prompt word templates is If the current speaker recognition result name is n, then the injected system prompt word for: ; in This shows the scene prompt template after it has been filled in. insert The specified location (i.e., the response strategy section of SystemPrompt), where R represents the risk level to be determined.
[0047] The technical solution of the present invention will be further described below in conjunction with specific scenarios.
[0048] Scenario 1: Voiceprint dialogue scenario for AI-accompanied hardware products; In the application scenarios of AI companion hardware products (such as intelligent companion robots), the device uses voiceprint recognition to determine whether the current speaker is the "caller" of the device (i.e. the main user of the device).
[0049] Scenario Description: Assume the device has registered the caller's voiceprint template. During a voice conversation: Scenario A: The summoner says "The weather is so nice today" in a normal volume for about 3 seconds. The voiceprint model outputs the highest confidence level. The confidence level difference d = 0.72, and the audio duration t = 3000 ms. The determination is based on equation (1a–1e): and and and (0.88 ≥ 0.75), classified as a high-confidence L1 scenario. The system selects an L1 template and injects it into SystemPrompt, allowing the large language model to use the caller's affectionate address and long-term memory. Example response from the large language model: "Yes, the sun is shining brightly today! You said you wanted to go for a walk in the park last time, do you want to go now?" Scenario B: The same summoner, with a hoarse voice due to a cold, says, "Um...I want to drink water," with an audio duration of t=1800ms. The voiceprint model outputs the highest confidence level. (Confidence level decreased due to voice change), confidence difference d = 0.35. Determined according to equation (1a–1e): , , , This scenario was classified as a moderate-risk L2 scenario. The system selected an L2 template and injected it into SystemPrompt. The large language model maintained a natural tone without using specific titles when the speaker's identity was uncertain. Example response: "Okay, I'll get you a glass of water. Drink slowly, don't rush." Scenario C: Several people are talking in the living room. A voice is captured by the microphone: "What do you think of this?", but the speaker is far away and the environment is noisy. The audio duration is t=1200ms. The speakerprint model outputs the highest confidence level. The confidence level difference d = 0.12. According to equation (1a–1e): This scenario is classified as an L3 highly uncertain scenario. The system selects an L3 template and injects it into SystemPrompt. The large language model completely ignores the speaker's identity and only responds with the literal content for safety. Example response: "This looks pretty good." Scenario D: A burst of background noise is captured by the microphone, with an audio duration of only t=300ms. Determine the outcome according to equation (1a–1e): This is directly classified as an L4 anomaly scenario. The system selects an L4 template and injects it into SystemPrompt; the large language model only provides a minimal response. Example response: "Hmm?" Through the aforementioned hierarchical control mechanism, under actual deployment conditions where the voiceprint recognition accuracy is approximately 80%–89%, the overall dialogue control rate (i.e., the proportion of AI responses that meet expectations in both correct and incorrect voiceprint scenarios) can be increased from approximately 70% without a strategy to approximately 99%, and the control rate in voiceprint misjudgment scenarios can be increased from approximately 70% to over 91%, significantly improving the problem of fragmented dialogue experience caused by voiceprint misjudgment.
[0050] Scenario 2: Handling scenarios with multiple speakers; In a home environment, there may be scenarios where the summoner and family members use the system together. The system has registered the voiceprint templates of the summoner and several family members.
[0051] When the system detects that multiple speaker identities are involved in the current voice dialogue (i.e., the short-term memory corresponding to this round of dialogue contains multiple different name values), after the template selection module selects the scene prompt word template, the prompt word filling and injection module will also add multi-speaker introduction information (including the relationship between each speaker and the caller, gender, etc.) to SystemPrompt to help the large language model correctly apply the response strategy while distinguishing different speakers.
[0052] For input rounds triggered by physical interaction (such as touch devices), the system marks the corresponding voiceprint recognition result as "someone" (without identity determination), and at the same time, forces the injection of the simplest response strategy at the L4 level into the SystemPrompt of that round to avoid the risk of identity assumptions arising from the initiator's inability to be determined due to physical interaction.
[0053] The above description is merely an exemplary embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural transformations made using the contents of the present invention specification and drawings under the technical concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.
Claims
1. A dynamic dialogue generation method based on voiceprint risk level, characterized in that, Includes the following steps: Obtain the highest confidence level of the voiceprint recognition output The confidence difference d and the current audio input duration t; Based on the preset multi-threshold joint judgment rule, according to the highest confidence level The confidence difference d and the audio duration t are used to classify each voice input into one of four risk levels: L1 high confidence scenario, L2 medium risk scenario, L3 high uncertainty scenario or L4 abnormal scenario. Based on the determined risk level, select the corresponding scenario prompt word template from four preset scenario prompt word templates; Replace the placeholder variable for the speaker recognition result name in the scene prompt word template with the actual speaker recognition result name for the current round to obtain the filled scene prompt words; The filled scene prompts are injected into the base system prompts of the large language model to obtain the final system prompts. The large language model is then controlled to generate response text that matches the risk level based on the final system prompts.
2. The dynamic dialogue generation method based on voiceprint risk level according to claim 1, characterized in that, The classification of each voice input into one of four risk levels—L1 high-confidence scenario, L2 moderate-risk scenario, L3 high-uncertainty scenario, or L4 abnormal scenario—includes: If the audio duration t is less than the preset minimum valid audio duration value If the confidence score data is abnormal, it is determined to be an L4 abnormal scenario; If the audio duration t is not less than the minimum valid value of the audio duration If the confidence level data is normal, then further determine: if the confidence level difference d is not greater than the preset confidence level difference threshold. Or the audio duration t satisfies ,in If the preset lower bound threshold for audio duration is used, it is determined to be an L3 highly uncertain scenario; If the confidence difference d is greater than the confidence difference threshold Furthermore, the audio duration t is not less than the lower bound threshold of the audio duration. Then, further determine: if the highest confidence level is... satisfy ,in The preset confidence lower bound threshold, If the upper bound of the confidence level is preset, it is determined to be an L2 moderate risk scenario; If the highest confidence level Not less than the upper bound threshold of the confidence level If so, it is determined to be an L1 high-confidence scenario; If any of the above judgment conditions are not met, it is judged as an L4 abnormal scenario.
3. The dynamic dialogue generation method based on voiceprint risk level according to claim 1, characterized in that, The four sets of scene prompt word templates include: The scene cue word templates corresponding to L1 high-confidence scenarios allow the use of affectionate terms, relational expressions, and long-term memory retrieval; The scenario prompt template for L2 medium-risk scenarios restricts specific titles and relational expressions, but allows for natural transitions in dialogue; The scene prompt word template for L3 highly uncertain scenarios completely prohibits titles, relational words, and interpersonal pronouns, and only responds to the literal meaning; The scenario prompt template for L4 abnormal scenarios only allows the simplest concluding or confirmatory response, without expanding on any topic.
4. The dynamic dialogue generation method based on voiceprint risk level according to claim 1, characterized in that, The highest confidence level of the voiceprint recognition output is obtained. The confidence difference d and the current audio input duration t include: Voiceprint features are extracted from the input audio to obtain the speaker's voiceprint embedding vector. The voiceprint embedding vector is then compared with the registered voiceprint templates to output the matching confidence score for each candidate speaker. The highest confidence level is calculated from the matching confidence scores of each candidate speaker. And the confidence difference d, wherein the confidence difference d is the absolute value of the difference between the highest confidence level and the second highest confidence level; The duration of the current speech input is detected in parallel to obtain the audio duration t.
5. The dynamic dialogue generation method based on voiceprint risk level according to claim 1, characterized in that, When multiple speaker identities are detected in the current voice dialogue, the step of injecting the filled scene cue words into the base system cue words of the large language model includes: Add multi-speaker introduction information to the basic system prompts. This multi-speaker introduction information includes the relationship between each speaker and the caller, as well as their gender information, to help the large language model correctly apply response strategies while distinguishing different speakers.
6. The dynamic dialogue generation method based on voiceprint risk level according to claim 1, characterized in that, For input rounds triggered by physical interactions, the step of injecting the filled scene prompts into the basic system prompts of the large language model further includes: The corresponding voiceprint recognition results are marked as not being used for identity verification, and the simplest response strategy at the L4 abnormal scenario level is forcibly injected into the basic system prompts for this round.
7. The dynamic dialogue generation method based on voiceprint risk level according to claim 1, characterized in that, The voiceprint feature extraction is achieved using the ECAPA-TDNN voiceprint recognition model.
8. The dynamic dialogue generation method based on voiceprint risk level according to claim 1, characterized in that, The process of injecting the filled scene prompts into the base system prompts of the large language model also includes: Insert the filled-in scene prompts into the response strategy paragraph of the base system prompts to obtain the final system prompts.
9. A dynamic dialogue generation system based on voiceprint risk level for implementing the method as described in any one of claims 1-8, characterized in that, include: The audio acquisition module is used to acquire user voice input; The voiceprint feature extraction module is used to extract voiceprint features from the input audio, obtain the speaker's voiceprint embedding vector, compare the voiceprint embedding vector with the registered voiceprint template, and output the matching confidence score of each candidate speaker. The confidence calculation module is used to calculate the highest confidence score from the matching confidence scores of each candidate speaker. And the confidence difference d, wherein the confidence difference d is the absolute value of the difference between the highest confidence level and the second highest confidence level; The audio duration detection module is used to detect the duration of the current voice input and obtain the audio duration t; The multi-dimensional signal joint determination module is used to determine the signal based on a preset multi-threshold joint determination rule and the highest confidence level. The confidence difference d and audio duration t are used to classify each voice input into one of four risk levels: L1 high confidence scenario, L2 medium risk scenario, L3 high uncertainty scenario or L4 abnormal scenario. The template selection module is used to select the corresponding scene prompt word template from four preset scene prompt word templates based on the determined risk level. The prompt word filling and injection module is used to replace the speaker recognition result name placeholder variable in the scene prompt word template with the actual speaker recognition result name of the current round to obtain the filled scene prompt word, and inject the filled scene prompt word into the basic system prompt word of the large language model to obtain the final system prompt word; A large language model is used to generate response text that matches the risk level based on the final system prompts; The response output module is used to output the response text to the speech synthesis module or present it to the user in text form.
Citation Information
Patent Citations
Large model dialogue information collection method and system fusing business query
CN122019570A
Speaker identification method and device for non-online long video, equipment and medium
CN122090522A
Speaker recognition and emotion perception method based on AR glasses
CN122135743A