A method and system for generating a live commentary script for a virtual character based on a tenant knowledge base

CN123020879APending Publication Date: 2026-10-30HANGZHOU XINGYUAN FUTURE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611195678.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-07
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0008]本发明的目的在于克服现有技术的不足,提供一种融合租户知识库人设直播解说词生成方法及系统,解决现有技术多租户数据串扰、人设适配性差、解说节奏僵化、文本不规范、内容不一致、并发调度混乱的技术问题,实现多租户物理隔离、人设专属适配、自适应精准抽帧、标准化高质量解说生成、多路直播稳定并发运行的技术效果

Benefits of technology

1、实现多租户数据物理隔离与专属人设定制化适配。本发明为每个租户配置独立的向量知识库,实现商品知识数据物理隔离,彻底杜绝多租户数据串扰问题;同时定制存储各租户专属解说风格、称谓、口头禅、禁用词汇,可精准适配不同品牌、商家的直播人设,解决通用模型解说风格同质化、不符合租户品牌定位的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123020879A_ABST
    Figure CN123020879A_ABST
Patent Text Reader

Abstract

The application provides a method and system for generating live commentary of a virtual host based on a fusion tenant knowledge base, and belongs to the technical field of artificial intelligence live content generation. The application configures a physically isolated independent vector knowledge base and a virtual host data for each tenant. An adaptive sniper frame extraction control based on voice broadcast duration feedback is adopted, combined with pre-inhibition verification and claim lock atomic scheduling to realize multi-path live parallel and single-path live series. The tenant commodity knowledge is searched and combined with the virtual host and multi-layer output constraint to call a visual large model to generate original commentary text. After text cleaning and time-limited deduplication, the broadcast audio is output, the knowledge base and the virtual host are synchronously supplied to a barrage question and answer module, and the output style and information are unified. The application realizes multi-tenant data isolation, virtual host customization adaptation, commentary rhythm adaptive regulation and control, and commentary text standard output, improves the stability of multi-path live concurrency, and is suitable for multi-tenant unmanned e-commerce live scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention provides a method and system for generating live commentary scripts that integrate tenant knowledge base personas, belonging to the field of artificial intelligence live content generation and application technology. Background Technology

[0002] With the rapid popularization of live-streaming e-commerce, digital virtual live-streaming, and automated unmanned live-streaming technologies, AI-powered automated narration has become a core technology for reducing live-streaming operation costs and achieving 24 / 7 uninterrupted live-streaming. Currently, most mainstream AI live-streaming narration solutions rely on general-purpose visual models to generate narration text, which can only achieve basic descriptions of the visual content, resulting in numerous shortcomings and deficiencies in actual commercial applications.

[0003] First, existing technologies lack multi-tenant data isolation and content adaptation capabilities. Commercial live streaming services are mostly based on multi-tenant shared service architectures. Different merchants and brand tenants have completely different product knowledge, live streaming styles, and script specifications. A general commentary model cannot be adapted to the unique persona of each tenant, which can easily lead to problems such as inconsistent commentary styles, mismatched product information, and scripts that do not conform to brand positioning. Furthermore, the mixed storage of multi-tenant data can easily cause information interference, which cannot meet the data isolation requirements of enterprise-level commercial live streaming.

[0004] Secondly, the existing frame-skipping triggering mechanism for live commentary lacks flexibility and results in a disordered broadcast rhythm. The traditional method of generating commentary by skipping frames at fixed intervals does not dynamically adjust the generation timing based on the duration of the voice broadcast, the state of the live audio buffer, and the load of background tasks. This easily leads to problems such as overlapping commentary phrases, audio accumulation, frequent repetitive broadcasts, and task congestion and lag. It cannot adapt to multi-channel concurrent live broadcast scenarios, and the rhythm of single-channel live commentary is stiff and has low consistency with the live broadcast picture.

[0005] Secondly, the accuracy and standardization of existing commentary text generation are insufficient. Commentary texts generated by general models often contain redundant content such as rigid listings of product parameters, inconsistent text lengths, and inclusion of reasoning statements, paragraph breaks, and numerical codes. Furthermore, the lack of standardized deduplication and cleaning mechanisms leads to the repeated output of the same phrases within a short period, severely impacting the viewer experience. In addition, current technology cannot achieve consistency in style and information between automatic commentary and live chat Q&A, resulting in fragmented and inconsistent live stream content.

[0006] Finally, the existing concurrent scheduling mechanism is imperfect. When multiple live streams run concurrently, problems such as task preemption and serial chaos easily occur. It cannot balance the efficient operation of multiple parallel streams with the orderly execution of single live stream tasks. The system stability and concurrency carrying capacity are difficult to meet the needs of large-scale commercial live streaming scenarios.

[0007] In summary, existing AI live commentary technologies suffer from technical defects such as poor multi-tenant adaptability, insufficient data isolation, uncontrollable commentary pace, messy text quality, weak content consistency, and unstable concurrent scheduling. There is an urgent need for a live commentary script generation solution that can achieve multi-tenant data isolation, user customization, adaptive pace control, and accurate and standardized text generation. Summary of the Invention

[0008] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method and system for generating live commentary scripts by integrating tenant knowledge base and character design. This solves the technical problems of multi-tenant data crosstalk, poor character design adaptability, rigid commentary rhythm, non-standard text, inconsistent content, and chaotic concurrent scheduling in the prior art. It achieves the technical effects of multi-tenant physical isolation, exclusive character design adaptation, adaptive and accurate frame extraction, standardized high-quality commentary generation, and stable concurrent operation of multiple live streams.

[0009] To address the aforementioned problems, the present invention proposes the following technical solution: a method for generating live-stream commentary scripts that integrate tenant knowledge base personas, comprising the following steps: S1. Initialize live stream parameters and multi-tenant exclusive data: For continuous decoding of a single live video stream, maintain the monotonically increasing current frame number cur_seq, and initialize the next sniper frame number next_trigger_seq to mark the trigger time for the next narration generation; configure a physically isolated independent vector knowledge base for each tenant, which stores the product knowledge vector of the corresponding tenant; enter exclusive persona data for each tenant, which includes narration style, audience titles, allowed catchphrases, and a list of prohibited words; S2. Execute adaptive sniper frame extraction control based on voice broadcast duration feedback: continuously parse the live stream and update the current frame number cur_seq in real time, first perform sniper pre-suppression verification; if all pre-suppression verifications pass, and the current frame number cur_seq ≥ the next sniper frame number next_trigger_seq, then encode the current frame to generate an image, initiate the narration generation task and record the current trigger frame number; after the narration text is synthesized, obtain the corresponding audio playback duration duration, and update the next sniper frame number next_trigger_seq according to the following relationship: next_trigger_seq = current trigger frame number + duration × video frame rate; if no valid narration text is generated in this sniper, then incrementally update the next sniper frame number using a preset fallback frame number; when multiple live streams are running concurrently, the task status verification, live stream locking, and marking processing are set as atomic operations through the claim lock, realizing parallel processing of multiple live streams and serial execution within a single live stream; S3. Integrating Tenant Product Knowledge and Persona to Generate Original Explanatory Text: The above valid explanatory text is used as the search query statement; when there is no pre-narration in the first frame of the live broadcast, the independent vector knowledge base corresponding to the current tenant is queried using preset general product search terms, and product knowledge fragments are retrieved using inner product similarity matching, and invalid knowledge with similarity below the preset threshold is removed; the retrieved product knowledge and tenant persona data are written together into the system prompt words, and multiple constraint rules are set in the system prompt words: First, product knowledge is only integrated into the explanation when the screen content is related to product knowledge, and it is forbidden to list product parameters in a rigid manner; Second, the visual large model is limited to outputting only single-sentence spoken text of 12 to 28 characters, the model reasoning and thinking output is turned off, and the output of analysis statements, number codes, and segmentation symbols is prohibited; the encoded keyframe image and the configured system prompt words are input together into the visual large model to output the original explanatory text; S4. Commentary text standardization and deduplication, voice broadcasting and data reuse feedback: Standardize and clean the original commentary text: remove reasoning tags, formatting symbols, prompt keywords, and guiding opening phrases, and extract the valid first sentence by using the punctuation at the end of the sentence as a separator; if the cleaned text is not long enough or still contains residual prompt content, it is judged as invalid commentary and discarded; compare the historical valid commentary text within a preset deduplication time window, and if the text content is completely consistent, skip the broadcast; send the cleaned and deduplicated valid commentary text into the TTS speech synthesis module to generate broadcast audio and mix it into the live stream, collect the audio duration and send it back to step S2 to update the next sniper frame number; the tenant's independent vector knowledge base and tenant persona data are synchronously provided to the bullet screen Q&A module for calling, so that the product information and language style output by the automatic on-screen commentary and bullet screen interactive Q&A remain consistent.

[0010] Furthermore, the sniper pre-suppression verification in step S2 will skip the current frame and not initiate a commentary generation task if any of the following conditions are met: there is an unprocessed barrage Q&A task in the current live stream link; there are unfinished tasks or commentary generation processes being executed in the commentary task queue; or the total remaining duration of the audio to be played, calculated in real time, is greater than the preset buffer depth threshold.

[0011] Furthermore, in step S3, when searching based on inner product similarity, the top N product knowledge fragments ranked by similarity are returned, where N is a preset positive integer.

[0012] Furthermore, the deduplication time window is preset to 20 seconds.

[0013] Furthermore, a live commentary generation system integrating tenant knowledge base character design includes an adaptive sniping frame extraction module, a multi-tenant data storage module, a multimodal image and text generation module, an output normalization and deduplication module, a speech synthesis and broadcasting module, and a concurrency control module. The adaptive sniper frame extraction module is communicatively connected to the live stream input device, the concurrency control module, the multimodal image and text generation module, and the speech synthesis and broadcasting module. It incorporates a frame sequence number maintenance unit, a sniper trigger verification unit, a frame number feedback deduction unit, and a buffer depth monitoring unit. The frame sequence number maintenance unit generates and continuously updates the monotonically increasing current frame number. The sniper trigger verification unit performs sniper pre-suppression verification. The frame number feedback deduction unit calculates and updates the next sniper frame number based on the audio duration and video frame rate. The buffer depth monitoring unit continuously monitors the remaining duration of the audio to be played and performs generation-side throttling when the duration exceeds a threshold. The multi-tenant data storage module is connected to the multimodal image and text generation module and the bullet screen question and answer module, and includes a multi-tenant isolated vector knowledge base unit and a tenant persona storage unit. The multi-tenant isolated vector knowledge base unit allocates independent vector storage space for each tenant to achieve physical isolation of product vector data of different tenants and supports knowledge retrieval based on inner product similarity. The tenant persona storage unit persistently stores each tenant's commentary style, audience address, allowed catchphrases, and list of prohibited words. The multimodal image and text generation module receives keyframe images output by the adaptive sniper frame extraction module at its input end, and connects to the multi-tenant data storage module via bidirectional communication. It has a built-in knowledge base retrieval unit, prompt word construction unit, and visual large model calling unit. The knowledge base retrieval unit completes tenant product knowledge retrieval and low-similarity fragment filtering. The prompt word construction unit integrates product knowledge and tenant personas and writes them into multi-layer output constraint rules. The visual large model calling unit takes the keyframe images and system prompt words as input and outputs the original explanatory text. The input end of the output normalization and deduplication module is connected to the multimodal image and text generation module, and the output end is connected to the speech synthesis and broadcasting module and the adaptive sniper frame extraction module, respectively. It has a built-in text cleaning unit and a time-limited deduplication judgment unit. The text cleaning unit completes the removal of redundant content in the original text and the extraction of effective text. The time-limited deduplication judgment unit identifies and filters duplicate narration text within a preset time window. The speech synthesis and broadcasting module receives the valid narration text output by the output normalization and deduplication module, and has a built-in TTS speech synthesis unit and audio duration acquisition unit; the TTS speech synthesis unit generates broadcast audio and pushes it to the live output stream; the audio duration acquisition unit acquires the playback duration of the synthesized audio and sends it back to the adaptive sniper frame extraction module. The concurrency control module is communicatively connected to the adaptive sniper frame extraction module and has a built-in claim lock unit. It completes the scheduling of multiple live streaming tasks through atomic operations, ensuring serial processing of a single live stream and parallel operation of multiple live streams.

[0014] Furthermore, the multi-tenant isolated vector knowledge base unit distinguishes different tenant data through independent storage space, and the product knowledge retrieval between each tenant does not cause information interference.

[0015] Due to the adoption of the above technical solution, the beneficial effects of the present invention, a method and system for generating live commentary scripts that integrates tenant knowledge base personas, are as follows: 1. Achieve physical isolation of multi-tenant data and customized adaptation of personalization. This invention configures an independent vector knowledge base for each tenant, achieving physical isolation of product knowledge data and completely eliminating the problem of crosstalk between multi-tenant data; at the same time, it customizes and stores each tenant's exclusive commentary style, title, catchphrase, and prohibited words, which can accurately adapt to the live broadcast persona of different brands and merchants, solving the problem of homogenized commentary styles in general models and not conforming to the tenant's brand positioning.

[0016] 2. An adaptive frame-skipping mechanism is constructed to achieve dynamic and controllable narration rhythm. This invention abandons the traditional fixed-period frame-skipping mode and dynamically extrapolates the next narration trigger frame number based on the actual playback duration of TTS audio and the video frame rate. Combined with pre-suppression verification, audio buffer depth monitoring, and task status detection, intelligent throttling is achieved, effectively avoiding narration overlap, audio accumulation, and task congestion. The narration rhythm matches the changes in the live broadcast, resulting in a natural and smooth experience.

[0017] 3. Significantly improves the standardization and accuracy of the commentary text. This invention strictly limits the number of words, sentence structure, and output format of the commentary text through multi-layer model output constraint rules, and prohibits redundant reasoning content and symbols; coupled with standardized text cleaning and a 20-second timed deduplication mechanism, it completely solves the problems of invalid commentary, repetitive broadcasts, and messy wording, and outputs concise, standardized, and live broadcast text that is suitable for live broadcast scenarios.

[0018] 4. Achieve a high degree of content uniformity across all live streaming scenarios. This invention synchronously shares tenant knowledge base and persona data with the automatic on-screen narration and bullet screen Q&A modules, ensuring complete consistency in product information and language style across live stream narration and bullet screen Q&A. This solves the problems of fragmented content and disjointed styles in existing live stream technologies, enhancing the overall professionalism of the live stream and the viewer experience.

[0019] 5. Optimize multi-channel live streaming concurrent scheduling capabilities and improve system stability. This invention achieves task scheduling and control through atomic operations of claim locks, ensuring the efficient parallel operation of multiple live streams and the sequential and orderly execution of single live stream tasks, avoiding task preemption and chaotic conflicts, and significantly improving the system's carrying capacity and operational stability in large-scale commercial live streaming scenarios. Attached Figure Description

[0020] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart illustrating the overall process of a method and system for generating live commentary scripts that integrates tenant knowledge base and persona.

[0021] Figure 2 This invention provides a system module architecture diagram for a method and system for generating live commentary scripts that integrates tenant knowledge base and persona.

[0022] Figure 3 This invention provides an adaptive sniping frame extraction control flowchart for a method and system for generating live commentary scripts based on tenant knowledge bases.

[0023] Figure 4 This invention provides a flowchart illustrating the process of generating live commentary scripts for a user-defined live stream using a user-defined knowledge base and a user-defined persona.

[0024] Figure 5 This is a schematic diagram illustrating the multi-channel concurrent claim lock scheduling of a method and system for generating live commentary scripts based on a tenant knowledge base, as described in this invention. Detailed Implementation

[0025] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] Example 1 This embodiment discloses a method for generating live-stream commentary scripts that integrates tenant knowledge base personas, applied to multi-tenant unmanned e-commerce live-streaming AI-automated commentary scenarios. The specific implementation steps are as follows: S1. Initialize Live Stream Parameters and Multi-Tenant Dedicated Data: Select two independent e-commerce live stream video streams for continuous decoding. Each live stream independently maintains a monotonically increasing current frame number cur_seq. Initially, the next trigger frame number next_trigger_seq is initialized to 0 to mark the triggering time of the first commentary generation. For multiple live stream tenants, each tenant is allocated a physically isolated independent vector knowledge base. The storage space of different tenant knowledge bases is independent and the data is completely isolated. The knowledge vectors of the corresponding tenants, such as product parameters, product selling points, and applicable scenarios, are stored separately. At the same time, the exclusive persona data of each tenant is entered in batches. The persona data strictly includes four core dimensions: exclusive commentary style, fixed audience titles, allowed catchphrases, and customized list of prohibited words. The persona data of different tenants is stored independently and is not reused.

[0027] S2. Execute adaptive sniper frame extraction control based on voice broadcast duration feedback: The live stream continuously parses the live stream throughout the entire operation, updating the current frame number cur_seq in real time. After each frame number update, sniper pre-suppression verification is performed first, with strict matching rules: If there are unprocessed bullet screen Q&A tasks in the current live stream link, or incomplete / in-process generation tasks in the commentary task queue, or the total remaining duration of the audio to be played in real time exceeds the preset buffer depth threshold (5 seconds in this embodiment), if any of the conditions are met, the current frame is skipped directly, and no commentary generation task is initiated; only when all pre-suppression verifications pass, and the current frame number cur_seq ≥ the next sniper frame number next_trigger_seq, is the current live keyframe encoded to generate an image, the commentary generation task is formally initiated, and the trigger frame number of this task is accurately recorded.

[0028] After the narration text is synthesized using TTS, the actual playback duration of the corresponding audio is accurately collected. Following the defined core formula: next_trigger_seq = current trigger frame number + duration × video frame rate (in this embodiment, the standard video frame rate is 25 frames / s), the next trigger frame number is dynamically updated to achieve adaptive matching between the narration trigger timing and the voice broadcast duration. If no compliant and valid narration text is generated after the current trigger, a fallback mechanism is activated, incrementally updating next_trigger_seq using a preset fallback frame count of 30 frames to prevent prolonged periods without narration output during the live stream.

[0029] For multi-channel concurrent live streaming scenarios, the "task status verification, live stream locking, and processing status marking" are encapsulated into atomic operations by claiming locks, which strictly implements the scheduling logic of parallel processing of multiple live streams and serial execution within a single live stream, thus eliminating task conflicts and preemption issues.

[0030] S3. Integrating Tenant Product Knowledge and Persona to Generate Original Explanatory Text: This step's retrieval logic is executed in layers: When there is no preceding valid explanatory text in the first frame of the live stream, the system's preset general product search terms are used as the query statement; in non-first frame scenarios, the previous successfully broadcast valid explanatory text is used as the default retrieval query statement. The independent vector knowledge base specific to the current tenant is called, and the inner product similarity matching algorithm is used to retrieve product knowledge fragments, eliminating invalid or mismatched knowledge content with a similarity lower than the preset threshold of 0.7; at the same time, according to the defined rules, after the retrieval is completed, the top 5 high-quality product knowledge fragments ranked by similarity are returned, where N is 5.

[0031] The selected product knowledge fragments and tenant-specific persona data are integrated and written into the system prompts. Simultaneously, the aforementioned multi-layered constraint rules are applied: the first layer is content constraint, which only incorporates product knowledge when the live stream content is highly relevant to the retrieved product knowledge, prohibiting the forced piling up or listing of product parameters; the second layer is format constraint, which strictly limits the visual model to outputting only 12-28 character single-sentence spoken text, forcibly disabling the model's internal reasoning and output logic, and prohibiting the output of redundant content such as analytical statements, numerical codes, segmentation symbols, and line breaks. Finally, the encoded keyframe images and the compliantly configured system prompts are input into the visual model to output standardized original explanatory text.

[0032] S4. Text Cleaning and Deduplication, Voice Broadcasting and Data Reuse Feedback: The original narration text output by the model undergoes standardized cleaning, precisely removing model inference tags, various formatting symbols, key prompts, and generic introductory phrases. The first valid paragraph is extracted using Chinese sentence-ending punctuation as the sole separator. After cleaning, validity is validated. If the text length is less than 12 characters or contains residual key prompts, it is directly deemed invalid, the generated result is discarded, and broadcasting is not performed.

[0033] A preset 20-second deduplication time window is opened. Within this window, the previously broadcast valid narration text is iterated and compared. If the current cleaned text is completely identical to the historical text, the broadcast process is skipped to avoid duplicate broadcasts. The finally cleaned and deduplicated valid narration text is sent to the TTS speech synthesis module to generate standardized broadcast audio, which is then mixed into the live output stream. Simultaneously, the precise playback duration of this synthesized audio is collected and sent back to the S2 frame extraction control stage for dynamically updating the next target frame number, forming a closed-loop adaptive control. In addition, the tenant's independent vector knowledge base and tenant-specific persona data are synchronously shared with the bullet screen Q&A module to ensure consistency in product information output and language style between the automatic narration of the live screen and the bullet screen interactive Q&A.

[0034] Example 2: This embodiment discloses a live-stream commentary generation system that integrates tenant knowledge base personas, used to match and implement the generation method of Embodiment 1. The system includes six core modules, and each module and its subordinate units are precisely adapted to the defined structure. The specific collaborative operation mode is as follows: Adaptive Sniper Frame Extraction Module: This module is the core scheduling front-end of the system, communicating bidirectionally with the live stream input device, concurrency control module, multimodal image and text generation module, and speech synthesis and broadcasting module. Its four subordinate units each have their own responsibilities: the frame sequence number maintenance unit continuously decodes the live stream, generating and updating the monotonically increasing current frame number in real time; the sniper trigger verification unit precisely executes the defined pre-suppression verification logic; the frame number feedback deduction unit strictly calculates and updates the next sniper frame number according to the formula based on the TTS audio playback duration and video frame rate; and the buffer depth monitoring unit continuously calculates the remaining total duration of the audio to be played, performing generation-side throttling when it exceeds a preset threshold to avoid task backlog.

[0035] Multi-tenant Data Storage Module: This module connects the multimodal image and text generation module and the bullet screen Q&A module, and includes two core units. The multi-tenant isolated vector knowledge base unit allocates independent vector storage space to each tenant, achieving physical isolation and preventing crosstalk between product vector data from different tenants, and supports the aforementioned inner product similarity knowledge retrieval function. The tenant persona storage unit persistently stores the commentary style, audience titles, allowed catchphrases, and prohibited word lists for all tenants, providing exclusive persona constraints for commentary generation.

[0036] The multimodal image and text generation module receives keyframe images from the frame extraction module at its input end and bidirectionally connects to the multi-tenant data storage module. The knowledge base retrieval unit performs tenant product knowledge retrieval, completing low-similarity fragment filtering and Top-N high-quality knowledge selection. The prompt word construction unit automatically integrates the filtered product knowledge with tenant persona data and writes it into the multi-layer model output constraint rules. The visual large model calling unit loads keyframe images and customized system prompt words, stably outputting compliant original explanatory text.

[0037] Output normalization and deduplication module: The input end connects to the multimodal image and text generation module, and the output end connects to the speech synthesis and broadcasting module and the adaptive sniper frame extraction module respectively. The text cleaning unit automatically removes redundant tags, symbols, and clichés from the original text and extracts the effective narration content; the time-limited deduplication judgment unit accurately identifies and filters duplicate narration text based on the above-mentioned limited 20-second preset time window, eliminating the problem of short-term repeated broadcasts.

[0038] The speech synthesis and broadcasting module receives the deduplicated and valid narration text. The TTS speech synthesis unit converts the text into natural broadcast audio and pushes it to the live output stream simultaneously. The audio duration acquisition unit accurately acquires the actual playback duration of each broadcast audio segment and sends it back to the adaptive sniper frame extraction module to provide data support for dynamic frame number updates and form a closed-loop control.

[0039] Concurrency Management Module: Dedicated to the adaptive sniper frame extraction module, with a built-in claim lock unit, it encapsulates multi-channel live streaming task status verification, stream locking, status marking and other operations into atomic operations, completely solving the problems of task preemption and serial chaos, and stably achieving the concurrent scheduling effect of multi-channel live streaming running in parallel and single-channel live streaming executing serially, ensuring the system's operational stability under high load.

[0040] The present invention and its embodiments have been described above. This description is not restrictive. In short, if a person skilled in the art is inspired by this description and designs a method and embodiment similar to the technical solution without departing from the spirit of the present invention, such method and embodiment should be protected within the scope of the present invention.

Claims

1. A method for generating live-stream commentary scripts that integrates tenant knowledge base personas, characterized in that, Includes the following steps: S1. Initialize live stream parameters and multi-tenant exclusive data: For continuous decoding of a single live video stream, maintain the monotonically increasing current frame number cur_seq, and initialize the next sniper frame number next_trigger_seq to mark the trigger time for the next narration generation; configure a physically isolated independent vector knowledge base for each tenant, which stores the product knowledge vector of the corresponding tenant; enter exclusive persona data for each tenant, which includes narration style, audience titles, allowed catchphrases, and a list of prohibited words; S2. Execute adaptive sniper frame extraction control based on voice broadcast duration feedback: continuously parse the live stream and update the current frame number cur_seq in real time, first perform sniper pre-suppression verification; if all pre-suppression verifications pass, and the current frame number cur_seq ≥ the next sniper frame number next_trigger_seq, then encode the current frame to generate an image, initiate the narration generation task and record the current trigger frame number; after the narration text is synthesized, obtain the corresponding audio playback duration duration, and update the next sniper frame number next_trigger_seq according to the following relationship: next_trigger_seq = current trigger frame number + duration × video frame rate; if no valid narration text is generated in this sniper, then incrementally update the next sniper frame number using a preset fallback frame number; when multiple live streams are running concurrently, the task status verification, live stream locking, and marking processing are set as atomic operations through the claim lock, realizing parallel processing of multiple live streams and serial execution within a single live stream; S3. Integrating Tenant Product Knowledge and Persona to Generate Original Explanatory Text: The above valid explanatory text is used as the search query statement; when there is no pre-narration in the first frame of the live broadcast, the independent vector knowledge base corresponding to the current tenant is queried using preset general product search terms, and product knowledge fragments are retrieved using inner product similarity matching, and invalid knowledge with similarity below the preset threshold is removed; the retrieved product knowledge and tenant persona data are written together into the system prompt words, and multiple constraint rules are set in the system prompt words: First, product knowledge is only integrated into the explanation when the screen content is related to product knowledge, and it is forbidden to list product parameters in a rigid manner; Second, the visual large model is limited to outputting only single-sentence spoken text of 12 to 28 characters, the model reasoning and thinking output is turned off, and the output of analysis statements, number codes, and segmentation symbols is prohibited; the encoded keyframe image and the configured system prompt words are input together into the visual large model to output the original explanatory text; S4. Commentary text standardization and deduplication, voice broadcasting and data reuse feedback: Standardize and clean the original commentary text: remove reasoning tags, formatting symbols, prompt keywords, and guiding opening phrases, and extract the valid first sentence by using the end punctuation as a separator; if the cleaned text is not long enough or still contains residual prompt content, it is judged as invalid commentary and discarded; compare the historical valid commentary text within a preset deduplication time window, and if the text content is completely identical, skip the broadcast; send the cleaned and deduplicated valid commentary text into the TTS speech synthesis module to generate broadcast audio and mix it into the live stream, and collect the audio duration and send it back to step S2 to update the next sniper frame number; The tenant-independent vector knowledge base and tenant persona data are synchronously provided to the bullet screen Q&A module for use, so that the product information and language style output by the automatic on-screen explanation and bullet screen interactive Q&A remain consistent.

2. The method for generating live commentary scripts for integrated tenant knowledge bases according to claim 1, characterized in that: The sniper pre-suppression verification described in step S2 will skip the current frame and not initiate a commentary generation task if any of the following conditions are met: there are pending bullet screen Q&A tasks in the current live stream link; there are incomplete tasks or commentary generation processes being executed in the commentary task queue. The total remaining duration of the audio to be played, calculated in real time, is greater than the preset buffer depth threshold.

3. The method for generating live commentary scripts for integrated tenant knowledge bases as described in claim 1, characterized in that: In step S3, when performing the inner product similarity retrieval, the top N product knowledge fragments ranked by similarity are returned, where N is a preset positive integer.

4. The method for generating live commentary scripts for integrated tenant knowledge bases as described in claim 1, characterized in that: The deduplication time window is preset to 20 seconds.

5. A system for generating live-stream commentary scripts that integrates tenant knowledge base and character persona, characterized in that: It includes an adaptive sniping frame extraction module, a multi-tenant data storage module, a multimodal image and text generation module, an output normalization and deduplication module, a speech synthesis and broadcasting module, and a concurrency control module; The adaptive sniper frame extraction module is communicatively connected to the live stream input device, the concurrency control module, the multimodal image and text generation module, and the speech synthesis and broadcasting module. It has a built-in frame sequence number maintenance unit, a sniper trigger verification unit, a frame number feedback and deduction unit, and a buffer depth monitoring unit. The frame sequence number maintenance unit is used to generate and continuously update the monotonically increasing current frame number. The sniper trigger verification unit is used to perform sniper pre-suppression verification. The frame number feedback deduction unit calculates and updates the next sniper frame number based on the audio duration and video frame rate; the buffer depth monitoring unit counts the remaining duration of the audio to be played in real time and performs generation-side throttling when it exceeds the threshold. The multi-tenant data storage module is connected to the multimodal image and text generation module and the bullet screen question and answer module, and includes a multi-tenant isolated vector knowledge base unit and a tenant persona storage unit. The multi-tenant isolated vector knowledge base unit allocates independent vector storage space for each tenant to achieve physical isolation of product vector data of different tenants and supports knowledge retrieval based on inner product similarity. The tenant persona storage unit persistently stores each tenant's commentary style, audience address, allowed catchphrases, and list of prohibited words. The multimodal image and text generation module receives keyframe images output by the adaptive sniper frame extraction module at its input end, and connects to the multi-tenant data storage module via bidirectional communication. It has a built-in knowledge base retrieval unit, prompt word construction unit, and visual large model calling unit. The knowledge base retrieval unit completes tenant product knowledge retrieval and low-similarity fragment filtering. The prompt word construction unit integrates product knowledge and tenant personas and writes them into multi-layer output constraint rules. The visual large model calling unit takes the keyframe images and system prompt words as input and outputs the original explanatory text. The input end of the output normalization and deduplication module is connected to the multimodal image and text generation module, and the output end is connected to the speech synthesis and broadcasting module and the adaptive sniper frame extraction module, respectively. It has a built-in text cleaning unit and a time-limited deduplication judgment unit. The text cleaning unit completes the removal of redundant content in the original text and the extraction of effective text. The time-limited deduplication judgment unit identifies and filters duplicate narration text within a preset time window. The speech synthesis and broadcasting module receives the valid narration text output by the output normalization and deduplication module, and has a built-in TTS speech synthesis unit and audio duration acquisition unit; the TTS speech synthesis unit generates broadcast audio and pushes it to the live output stream; the audio duration acquisition unit acquires the playback duration of the synthesized audio and sends it back to the adaptive sniper frame extraction module. The concurrency control module is communicatively connected to the adaptive sniper frame extraction module and has a built-in claim lock unit. It completes the scheduling of multiple live streaming tasks through atomic operations, ensuring serial processing of a single live stream and parallel operation of multiple live streams.

6. The system for generating live commentary scripts for integrated tenant knowledge base personas according to claim 5, characterized in that: The multi-tenant isolated vector knowledge base unit distinguishes different tenant data through independent storage space, and the product knowledge retrieval between each tenant does not cause information interference.