A new media intelligent middle platform method, system, device and medium

CN121561074BActive Publication Date: 2026-10-16SHANGHAI WEIYI ENTERPRISE DEVELOPMENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511622625.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2026-10-16
Estimated Expiration
2045-11-07

AI Technical Summary

Technical Problem

[0003]然而,现有基于大模型的自动化文案生成技术仍存在多方面不足

Benefits of technology

本申请提供的一种新媒体智能化中台方法、系统、设备及介质,该方法通过在生成阶段引入可回退的受控生成机制与多轮受控生成机制,实现在无需额外模型训练的条件下,对大语言模型输出结果的结构、语义及格式进行全过程的技术约束。通过约束知识库的规则约束层与素材参考层,能够统一多媒体平台的格式规范与品牌语言标准;在推理过程中基于结构化提示信息和强约束输出模板实现逐字段即时校验与错误回退,从而保证生成内容在结构、语义及风格上的一致性与可控性。本申请能够显著提升生成文案的结构合规率与语义一致性,降低格式错误与违规用语出现概率,提升大模型生成结果在新媒体多平台环境下的稳定性和可解析性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121561074B_ABST
    Figure CN121561074B_ABST
Patent Text Reader

Abstract

The application provides a new media intelligent middle platform method, system, device and medium, the method comprises the following steps: constructing a machine-readable constraint knowledge base based on multiple new media platforms, brand and product information; generating structured prompt information and strong constraint output templates based on user requests and constraint knowledge base for dynamic prompt word arrangement, and generating output fields according to the two fields by a content generation model, performing field-level instant verification, executing field rebirth mechanism when the verification result is abnormal, and falling back to dynamic prompt word arrangement when the rebirth threshold is reached, and generating structured candidate text when all verification results are passed; obtaining a candidate content set by multiple rounds of controlled generation mechanism, quality evaluating each structured candidate text and constructing a comprehensive gate input vector, reordering the structured candidate text based on the vector, and obtaining the final output content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to artificial intelligence technology, and more particularly to a new media intelligent platform method, system, device and medium. Background Technology

[0002] With the rapid development of artificial intelligence and natural language processing technologies, automated content generation based on large-scale pre-trained language models (LLMs) has gradually become the mainstream technology for new media copywriting production. Through learning from massive corpora, large models can automatically generate semantically relevant text content after receiving input prompts, and are widely used in scenarios such as short video scripts, product promotional texts, event promotional titles, and summary generation. Compared to traditional template-based content production methods, large models possess stronger language understanding and generation capabilities, significantly reducing human creation costs while ensuring text diversity and naturalness, thereby improving the efficiency of new media content production and distribution.

[0003] However, existing automated copywriting generation technologies based on large models still have several shortcomings. First, the generated results are structurally unstable, and the format requirements of different platforms and brand specifications are difficult to unify, leading to issues such as missing fields, non-compliant formats, or semantic overreach in the generated copy. Second, the output of large models relies on static prompt word templates, lacking dynamic constraints and real-time verification mechanisms for the generation process, making it difficult to achieve structured control during the generation stage. Third, the generation quality lacks quantifiable evaluation and adaptive filtering, resulting in poor consistency and significant fluctuations in readability of the output results. These problems mean that the application of large models in the automated production of new media copy still faces technical bottlenecks due to insufficient compliance and stability. Summary of the Invention

[0004] This application provides a new media intelligent middleware platform method, system, device, and medium to solve the problems of the prior art.

[0005] Firstly, this application provides a new media intelligent middleware platform method, including: The constraint knowledge base is constructed based on information from multiple new media platforms, brands, and products, creating a machine-readable constraint knowledge base that includes a rule constraint layer and a material reference layer. The reversible controlled generation mechanism, during the inference phase of the content generation model, dynamically arranges prompt words based on user requests and the constraint knowledge base to generate structured prompt information and automatically generates a strongly constrained output template. The content generation model generates output fields field by field according to the structured prompt information and the strongly constrained output template, and performs field-level real-time validation on the output fields. When the validation result is abnormal, the field regeneration mechanism is executed, and when the regeneration threshold is reached, it reverts to the dynamic prompt word arrangement to regenerate the structured prompt information and the corresponding output fields. When the validation results of all output fields are passed, structured candidate text is generated. Multiple rounds of controlled generation are used to obtain multiple structured candidate texts based on the multi-round controlled generation mechanism, generate a candidate content set, perform quality evaluation on each structured candidate text and construct a comprehensive gating input vector, reorder the structured candidate texts in the candidate content set based on the comprehensive gating score, and obtain the final output content based on the reordering result.

[0006] In one possible design, the reversible controlled generation mechanism includes: Dynamic prompt word arrangement: Based on the user request, rule constraint information and material reference information, dynamic prompt words are arranged to generate structured prompt information that drives the reasoning of the content generation model; Strong constraint output template construction: A strong constraint output template is automatically generated based on the constraint fragments of the structured prompt information. Real-time validation involves inputting the structured prompt information and the strongly constrained output template into the content generation model. The content generation model generates output fields one by one according to the strongly constrained output template, and performs real-time validation at the field level for each output field. The field regeneration process further processes the verification results based on the field-level real-time validation. When the verification result is abnormal, the field regeneration mechanism is executed. When the verification results of all the output fields are passed, structured candidate text is generated.

[0007] In one possible design, the multi-round controlled generation includes: The content generation model uses a multi-round controlled generation mechanism to generate multiple structured candidate texts, and combines the multiple structured candidate texts into a candidate content set; For each structured candidate text in the candidate content set, a quality assessment is performed to generate a corresponding quality score vector; Based on the quality score vector of each structured candidate text, a comprehensive gating input vector is constructed for each structured candidate text; Based on the comprehensive gating score, the structured candidate texts in the candidate content set are reordered, and the final output content is selected.

[0008] In one possible design, the multi-round controlled generation mechanism is adapted to different types of content generation models; When the content generation model supports multiple sample outputs at once, multiple structured candidate texts can be generated in parallel with a single call to the content generation model. When the content generation model does not support multiple sample outputs at once, under the same strongly constrained output template and field-level real-time verification mechanism, multiple structured candidate texts are obtained through multiple rounds of generation, and the number of generation rounds is controlled by an early stopping strategy. The early stop strategy determines the termination time of the loop generation based on the target number of candidates, the maximum number of rounds threshold, and the time budget threshold.

[0009] In one possible design, the field regeneration mechanism includes: A preset rebirth threshold is set to count the number of times the field rebirth mechanism is executed; When the number of times the field regeneration mechanism is executed is greater than or equal to the regeneration threshold, and the field-level real-time validation result of the output field is a failure, it is determined whether the output field is a required field. If the output field is a required field, the current field-level real-time validation is terminated, and the system reverts to dynamic prompt word arrangement to regenerate the structured prompt information and corresponding output field. When the number of times the field regeneration mechanism is executed is less than the regeneration threshold, for the exception type of the output field, the corresponding error message is structurally injected back into the generation instruction of the current field, and before executing the regeneration instruction, the inference parameters of the content generation model are converged and adjusted.

[0010] In one possible design, the quality assessment includes generating a quality score vector, which consists of a consistency score, a structural compliance score, a readability score, and a stability score, wherein: The consistency score is used to characterize the semantic consistency between the structured candidate text and the structured prompt information; The structural compliance score is used to characterize the degree to which the structured candidate text conforms to the strongly constrained output template. The readability score is used to characterize the linguistic fluency and semantic coherence of the structured candidate text; The stability score is used to measure the semantic consistency and volatility of multiple rounds of generated results under the same structured prompt information.

[0011] In one possible design, the integrated gating input vector is used to calculate an integrated gating score based on a quality scoring vector; The comprehensive gating score is calculated based on a weighted fusion of consistency scores, structural compliance scores, readability scores, and stability scores, and the calculation formula is as follows:

[0012] Where γ1, γ2, γ3, and γ4 are the weighting coefficients for consistency score, structural compliance score, readability score, and stability score, respectively, and R i For consistency scoring, C i To score the structural compliance rate, L i For readability scoring, S i A stability score is given.

[0013] Secondly, this application provides a new media intelligent middleware system, including: The constraint knowledge base construction module builds a machine-readable constraint knowledge base based on information from multiple new media platforms, brands, and products. The constraint knowledge base includes a rule constraint layer and a material reference layer. The reversible controlled generation mechanism module, during the inference phase of the content generation model, dynamically arranges prompt words based on user requests and the constraint knowledge base to generate structured prompt information and automatically generates a strongly constrained output template. The content generation model generates output fields field by field according to the structured prompt information and the strongly constrained output template, and performs field-level real-time validation on the output fields. When the validation result is abnormal, the field regeneration mechanism is executed, and when the regeneration threshold is reached, it reverts to the dynamic prompt word arrangement to regenerate the structured prompt information and the corresponding output fields. When the validation results of all the output fields are passed, structured candidate text is generated. The multi-round controlled generation module acquires multiple structured candidate texts based on the multi-round controlled generation mechanism, generates a candidate content set, performs quality evaluation on each structured candidate text and constructs a comprehensive gating input vector, reorders the structured candidate texts in the candidate content set based on the comprehensive gating score, and obtains the final output content based on the reordering result.

[0014] Thirdly, this application provides an electronic device, comprising: Processor; and, Memory for storing the executable instructions of the processor; The processor is configured to perform any of the possible methods described in the first aspect by executing the executable instructions.

[0015] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement any of the possible methods described in the first aspect.

[0016] Compared with the prior art, this application has the following beneficial effects: This application provides a new media intelligent middleware platform method, system, device, and medium. This method introduces a rollback-capable controlled generation mechanism and a multi-round controlled generation mechanism during the generation phase, enabling full-process technical constraints on the structure, semantics, and format of the output results of a large language model without requiring additional model training. By constraining the rule constraint layer and material reference layer of the knowledge base, it can unify the format specifications and brand language standards of multimedia platforms. During the inference process, based on structured prompts and strongly constrained output templates, it achieves real-time field-by-field verification and error rollback, thereby ensuring the consistency and controllability of the generated content in terms of structure, semantics, and style. This application can significantly improve the structural compliance rate and semantic consistency of generated text, reduce the probability of format errors and prohibited language, and improve the stability and parsability of the large model's generated results in a new media multi-platform environment.

[0017] Furthermore, this application specifies detailed technical features such as dynamic prompt word arrangement, strong constraint output template construction, real-time verification, field regeneration mechanism, multi-round generation adaptation, and comprehensive gating scoring. Through the dynamic prompt word arrangement mechanism, hierarchical prompt information can be adaptively generated based on user requests and knowledge base content, achieving precise control over the generation context; the strong constraint output template enables automatic definition of field types and formats; field-level real-time verification and field regeneration mechanisms enable the model to have self-checking and repair capabilities, ensuring the integrity and consistency of output fields; the multi-round controlled generation mechanism is compatible with different types of generation models through early stopping strategies and model adaptation logic; quality scoring and comprehensive gating score calculation realize the quantitative evaluation and multi-dimensional optimization of the generation results. The synergistic effect of these features enables high-quality output under different model interfaces and content tasks, achieving structured, compliant, and stable output of the generated content. Attached Figure Description

[0018] 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.

[0019] Figure 1 This is a flowchart illustrating a new media intelligent middleware platform method according to an example embodiment of this application; Figure 2 This is a flowchart illustrating a reversible controlled generation mechanism according to an example embodiment of this application; Figure 3 This is a schematic diagram of a multi-round controlled generation process according to an example embodiment of this application; Figure 4This is a schematic diagram of the structure of a new media intelligent middleware system according to an example embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device according to an example embodiment of this application.

[0020] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0021] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0022] This embodiment proposes a new media intelligent middleware platform method, system, device, and medium, which is mainly applied to the automated production scenario of new media content. It is suitable for structured text generation tasks for multimedia platforms, such as short video scripts, tweet titles and summaries, and event promotional texts.

[0023] This embodiment constructs a machine-readable constraint knowledge base, injecting the format constraints, field specifications, and brand guidelines of multiple new media platforms into the generation stage in a structured form, thus forming unified structured prompt information.

[0024] During the generation process, a strongly constrained output template is automatically constructed based on this constraint knowledge base, and field-level real-time validation is performed during the inference phase to ensure the controllability and compliance of the generated content in terms of format, fields, and semantic boundaries.

[0025] Subsequently, a multi-round controlled generation mechanism is adopted to comprehensively evaluate and rearrange multiple structured candidate texts through consistency score (Ri), structural compliance score (Ci), readability score (Li), and stability score (Si), thereby obtaining a rearranged candidate set and the final output content, achieving multi-dimensional optimization of copywriting generation quality.

[0026] In this embodiment, the content generation model is a large language model based on the Transformer architecture, such as the GPT series models, LLaMA, Mistral, ChatGLM, Baichuan, etc., which supports function calling or constrained decoding. This embodiment can be directly adapted to the above-mentioned existing open-source or commercial models. Without additional pre-training or fine-tuning, the generation structure is optimized and consistency is improved through the joint control of structured prompt information and strongly constrained output templates. This reduces deployment and usage costs while maintaining model universality, and improves content production efficiency and output quality.

[0027] Figure 1 This is a flowchart illustrating a new media intelligent middleware platform method according to an example embodiment of this application. Figure 1 As shown, the new media intelligent middleware platform method provided in this embodiment includes: Step S101: Construction of the constraint knowledge base. A machine-readable constraint knowledge base is constructed based on information from multiple new media platforms, brands, and products. The constraint knowledge base includes a rule constraint layer and a material reference layer.

[0028] In this step, the constraint knowledge base is used to guide the subsequent generation of structured prompts and real-time field-level validation. The construction of the constraint knowledge base includes the construction of a rule constraint layer and a material reference layer. Specifically: Rule constraint layer construction: Structured rule constraints related to content generation are extracted from multiple new media platform interfaces, content publishing specifications, and brand configuration files. This structuring process uses regular expressions or keyword mapping algorithms to extract and validate rule fields. The rule constraint layer defines the format, tone, fields, and security specifications for content generation; it is the core set of control parameters. Rule constraint information includes: Platform format constraints are used to define the structural requirements and format limitations of different multimedia platforms in the content generation and publishing interface.

[0029] Platform format constraints can be automatically extracted from the open interface documents and content publishing specifications of various multimedia platforms, or generated according to the company's internal content compliance standards. These include the target output format type (structured text or natural language paragraph), output field naming rules, field types (such as string, numeric, time, or media link types), field length limits for each output field (max_len and min_len), and required field identifiers.

[0030] Platform security guidelines, including prohibited words, risky terms, and commercially sensitive words for each multimedia platform, are used to constrain the legality and compliance of content generation. Brand guidelines define the brand's consistent tone and language constraints in content creation, including tone and style requirements (such as formal, casual, objective, etc.), fixed disclaimers, and required terminology.

[0031] In this step, after extracting the rule constraint information, standardization and merging operations are performed on it, and it is stored in the constraint knowledge base to complete the construction of the rule constraint layer.

[0032] The standardized operation employs regular expression parsing and key-value mapping to construct the rule constraint layer. The merge operation is used to integrate platform format constraints, platform security specifications, and brand guidelines.

[0033] It should be noted that when the rule constraint information is stored in the constraint knowledge base, a multi-key composite index structure is established based on the new media platform identifier, brand identifier, and version number for rapid retrieval and version matching. This multi-key composite index structure combines hash tables and inverted index technology to achieve rapid positioning based on platform and brand, as well as precise matching at the version level. The rule constraint layer information is stored in the form of structured files (JSON or YAML).

[0034] Material reference layer construction: The material reference layer provides factual support and semantic cues for the content generation model, including factual materials and semantic examples. These are extracted from data sources such as the client brand information database, product parameter database, company dynamics database, and a collection of historical high-quality copy samples. Through regular expression parsing and keyword mapping algorithms, key fields (such as brand name, product model, and copy title) in each data source are extracted and formatted, and uniformly mapped to a predefined data structure, forming a standardized set of material reference information. This material reference information includes: Factual materials are used in subsequent task layers to enable the content generation model to write specific and actionable content, including customer brand information (such as brand identity information, brand style information, and brand promotion elements), product parameters (such as product model, product specifications, and performance indicators), and company news (such as company activities, news, and cooperation announcements).

[0035] Semantic examples are used in the subsequent example layer to allow the content generation model to imitate the format and style, including historical high-quality copy samples, high-quality tweet templates, and excellent content examples from the platform.

[0036] It should be noted that before being stored in the constraint knowledge base, the reference material information undergoes format standardization (entity recognition and field mapping technology) and deduplication (based on content hashing or semantic similarity determination), and an index table is built according to content type for fast retrieval. The retrieval method is based on keyword matching or semantic similarity algorithms (such as cosine similarity or BM25), selecting material information related to the target brand and target product from the reference material layer, and injecting it into the content generation model along with the output of the rule constraint layer.

[0037] Both the rule constraint layer and the material reference layer use a key-value mapping (KEYMOR) structure for their data structures. Key fields include platform identifier, brand identifier, content type, and version number. This organization facilitates fast retrieval across the rule constraint layer and the material reference layer using a multi-key composite index structure, and supports combined retrieval of rule constraint information and material reference information.

[0038] Once the constraint rule base is established, when a user request (PromptPack) arrives, the system first retrieves the rule constraint information corresponding to the target platform and brand from the rule constraint layer. The retrieval method for the rule constraint layer is implemented using hash key matching or multi-key composite indexing.

[0039] If the user request (PromptPack) contains factual fields (such as "product information," "event theme," or "brand event"), the material reference layer retrieval process is triggered. The material reference layer retrieval method is based on keyword matching or semantic similarity matching algorithms (cosine similarity or BM25 algorithm). It selects material reference information related to the target brand and target product from the material reference layer and injects it into the content generation model along with the output of the rule constraint layer.

[0040] Step S102: A reversible controlled generation mechanism. During the inference phase of the content generation model, dynamic prompt words are arranged based on user requests and the constraint knowledge base to generate structured prompt information and automatically generate a strongly constrained output template. The content generation model generates output fields field by field according to the structured prompt information and the strongly constrained output template, and performs field-level real-time validation on the output fields. When the validation result is abnormal, a field regeneration mechanism is executed, and when the regeneration threshold is reached, it reverts to the dynamic prompt word arrangement to regenerate the structured prompt information and corresponding output fields. When the validation results of all output fields are passed, structured candidate text is generated.

[0041] In this step, a reversible, controlled generation mechanism is executed during the inference phase to ensure that the output of the content generation model meets the constraints in terms of structure, semantics, and format.

[0042] In existing content generation technologies based on large language models, prompt words are usually single-round static templates. The output of the large language model cannot be validated and corrected in real time at the field level during the content generation stage, resulting in frequent occurrences of formatting errors, prohibited words, and tone deviations.

[0043] To this end, this embodiment proposes a rollback-enabled controlled generation mechanism in the content generation stage. By introducing a multi-round automatic control process during the reasoning process, including dynamic prompt word arrangement, strong constraint output template construction, field-level real-time processing, and field regeneration processing, the content generation model is equipped with self-inspection, self-repair, and regeneration capabilities.

[0044] Unlike static prompt word engineering, the reversible controlled generation mechanism in this embodiment does not rely on manual intervention. Instead, it monitors the content generation quality in real time during the content generation model's inference process and automatically adjusts the structured prompt information or parameter settings based on the verification results until the generated result meets the strongly constrained output template and rule constraint information. This mechanism significantly improves the structural compliance rate and stability of the content generation model during the content generation stage.

[0045] Specifically, the system first loads rule constraint information and optional material reference information from the constraint knowledge base based on user requests (PromptPack), and then dynamically arranges structured prompt information based on these two elements. The structured prompt information includes a constraint layer, a task layer, and an example layer, which guide the content generation model to generate structured candidate text while adhering to the text format of the target platform, the tone of the target brand, and the requirements of factual materials.

[0046] Subsequently, a strongly constrained output template will be automatically generated based on the constraint fragments of the structured prompt information, which will be used as the output result of the constraint content generation model.

[0047] During the content generation process, the content generation model performs real-time field-level validation on each output field immediately after outputting it, including field existence detection, field type detection, length detection, forbidden word detection, tone detection, and terminology detection.

[0048] If the field-level instant validation passes, the output field is temporarily stored, and the generation of the next output field begins. If any validation fails, field regeneration is triggered to regenerate the unqualified output fields in order to gradually correct the generation deviation.

[0049] The "generate-verify-rollback" loop continues until all fields meet the constraints or reach the preset regeneration threshold.

[0050] The final output is a structured candidate text that meets the structured constraints and fixed format, which serves as the input for subsequent steps.

[0051] Through a reversible, controlled generation mechanism, this step achieves structured control and error self-correction of the content generation model output without requiring additional model training.

[0052] The reversible, controlled generation mechanism enables the generation process to "generate, verify, and correct simultaneously," effectively reducing the occurrence of formatting errors, prohibited words, and tone deviations. Compared to traditional single-round generation methods, this embodiment significantly improves the structural compliance, consistency, and stability of the generated results, providing high-quality candidate inputs for subsequent rounds of controlled generation.

[0053] Step S103: Multi-round controlled generation. Based on the multi-round controlled generation mechanism, multiple structured candidate texts are obtained to generate a candidate content set. The quality of each structured candidate text is evaluated and a comprehensive gating input vector is constructed. Based on the comprehensive gating score, the structured candidate texts in the candidate content set are reordered. Based on the reordering result, the final output content is obtained.

[0054] In this step, a multi-round controlled generation mechanism is executed during the inference phase of the content generation model. This improves the overall quality and consistency of the output content through multi-round generation and dynamic filtering, while maintaining the strongly constrained output template and field-level real-time verification mechanism. The multi-round controlled generation mechanism is adaptable to different types of content generation models. Specifically, when the content generation model supports multiple-sample output at once, multiple structured candidate texts are generated in parallel during a single inference iteration. When the content generation model does not support multiple-sample output at once, an early-stop strategy is used to control the number of rounds and the termination timing of the loop generation, generating multiple structured candidate texts in multiple rounds under the same constraints. Subsequently, the generated structured candidate texts are combined to form a candidate content set, and a quality evaluation is performed on each structured candidate text in the candidate content set, resulting in a quality score vector containing a consistency score (Ri), a structural compliance score (Ci), a readability score (Li), and a stability score (Si). A comprehensive gating score is calculated based on these scores, and the candidate content set is re-ranked based on the score results. The structured candidate text with the highest score is selected as the final output content.

[0055] Through a multi-round controlled generation mechanism, this step enables multi-dimensional optimization of the generated results via diversified sampling and quantitative evaluation without retraining the model. Compared to traditional single-generation methods, this embodiment can improve the readability and overall consistency of the generated content while maintaining structural compliance and semantic stability, thereby providing higher-quality text output.

[0056] Figure 2 This is a flowchart illustrating a reversible, controlled generation mechanism according to an example embodiment of this application. Figure 2As shown, the reversible controlled generation mechanism provided in this embodiment includes: Step S1021: Dynamic prompt word arrangement. Based on the user request, rule constraint information and material reference information, dynamic prompt words are arranged to generate structured prompt information that drives the content generation model reasoning.

[0057] In this step, dynamic prompt word arrangement is used to structurally construct and dynamically synthesize prompt words during the content generation stage, thereby ensuring that the final output content meets the constraints of the target platform, target brand, and target product. Dynamic prompt word arrangement includes prompt hierarchy division and structured encapsulation.

[0058] Hint: Hierarchical division Based on the content in the user request, the target is generated, and the prompt words are hierarchically divided into a constraint layer, a task layer, and an example layer. Corresponding constraint fragments, material fragments, and example fragments are then extracted. The constraint layer is used to define the output structure, tone and style requirements, and security rules of the content generation model. Based on the target platform and target brand information in the user request, it reads the relevant rule constraint information from the rule constraint layer to form constraint fragments.

[0059] It should be noted that this embodiment uses a key-value mapping method to organize the rule constraint information into constraint fragments by using keys and values ​​for each field, for example: ConstraintFragment={"Title": {"max_len": 60, "tone": "formal"}, "Summary": {"max_len": 150, "forbidden": ["exaggerated","sensitive"]}, "Body": {"min_len": 200, "must_include": ["Disclaimer"]}}

[0060] The task layer describes the goals and semantic context of content generation. It detects whether the user request contains factual fields. When factual fields, such as product information, event themes, or brand information, are detected, corresponding factual materials are retrieved from the material reference layer of the constraint knowledge base to form factual material fragments.

[0061] Specifically, in order to retrieve factual material related to user requests from the constrained knowledge base, a two-stage retrieval mechanism is adopted, combining keyword matching and semantic similarity calculation to achieve efficient and accurate material screening.

[0062] First, based on the target brand, target product, and target company fields included in the user request (PromptPack), the system quickly retrieves corresponding factual material from the constraint knowledge base to form a candidate factual material set, and treats each factual material in the set as a candidate. These factual materials typically include customer brand information (such as brand identity information, brand style information, and brand promotional elements), product parameters (such as product model, product specifications, and performance indicators), and company news (such as company activities, news, and cooperation announcements).

[0063] Subsequently, the user request text and the candidate material text are respectively input into the same semantic encoder (e.g., BERT or Sentence-Transformer) for encoding to obtain a d-dimensional vector representation (e.g., d=768), and L2 normalization is performed.

[0064] The semantic relevance between the user request vector q and the candidate material vector e is calculated based on cosine similarity. The formula is as follows:

[0065] Where q and e are d-dimensional vectors obtained by the same semantic encoder (e.g., d=768).

[0066] When the similarity value Sim(q,e) is greater than or equal to the preset threshold τ_e (e.g., τ_e=0.8), the candidate material is determined to be semantically related to the user's request and is selected into the factual material set.

[0067] Candidate materials in the factual material collection are sorted according to topic relevance and chronological order to form material fragments, for example: TaskFragment={"Brand": "A technology company", Product: X200 ProductSpec: "Synchronous transmission", "PerformanceIndex": "Average transmission latency ≤20ms", "Event": "Technology upgrade released"}.

[0068] The example layer guides the content generation model to mimic the correct format. It retrieves relevant semantic examples from the material reference layer of the constraint knowledge base, extracts their structural features and expression patterns, and compresses them into no more than N simplified examples (e.g., N=3) to form example fragments. For example: ExampleFragment={"Title": "New Product Launch Announcement", Summary: "A technology company will release its next-generation content platform this week". "Body": "The event will take place on Friday afternoon at the Shanghai Exhibition Center."

[0069] Structured packaging: In this embodiment, to balance the influence of different levels of information in the content generation model, priority coefficients are configured for the constraint layer, task layer, and example layer, respectively: constraint layer priority coefficient α1=3, task layer priority coefficient α2=2, and example layer priority coefficient α3=1. The constraint layer weight w1, task layer weight w2, and example layer weight w3 are calculated based on these priority coefficients. Weights w1, w2, and w3 are used to control the presentation order, content proportion, and language emphasis of the three layers of information in the structured prompt information.

[0070] Specifically, when constructing structured prompts, the constraint layer is placed at the beginning of the prompt to define the output format and tone requirements; the task layer is placed in the middle to describe the generation goal and semantic context; and the example layer is placed at the end of the prompt as a format or style example. When generating the prompt content, the text length and expressiveness of each layer are adjusted according to their corresponding weights: the higher the weight, the larger the proportion of its content in the prompt and the clearer the wording.

[0071] The formula for calculating the weight is:

[0072] Where j∈{1,2,3}, β is the length penalty factor, and the calculated weight results satisfy w1>w2>w3, that is, the constraint layer has the highest priority in the prompt, followed by the task layer, and the example layer has the lowest weight.

[0073] The weights w1, w2, and w3 ensure that the content generation model pays more attention to structural and semantic constraints during the inference phase, thereby improving the consistency and structural compliance of the generated content.

[0074] The final generated structured hint message is as follows: PromptStruct={"constraint_section": ConstraintFragment, "task_section": TaskFragment, "example_section": ExampleFragment, "weight": [w1, w2, w3]}.

[0075] Among them, ConstraintFragment is the constraint fragment; TaskFragment is the source fragment; ExampleFragment is the example fragment.

[0076] The hierarchical division of prompts ensures that the prompts logically maintain the order of "constraint priority - task orientation - example guidance", avoiding structural drift in the generation stage.

[0077] Step S1022: Constructing a strong constraint output template. A strong constraint output template is automatically generated based on the constraint fragments of the structured prompt information.

[0078] In this step, the strongly constrained output template is used to constrain the output structure, content tone, and semantic boundaries in real time during the content generation model inference stage, preventing formatting errors, missing fields, or semantic out-of-bounds errors.

[0079] Before the content generation model performs inference, it automatically analyzes the field names, field types, required field identifiers, and field length limits of each output field based on the constraint layer in the structured prompts, and dynamically generates template definitions based on these constraint elements. It also dynamically generates strongly constrained output templates according to different target output format types. When the target output format type is structured text, JSON Schema is used to define the output field types, field length limits, and required field identifiers; When the target output format type is natural language paragraph, the output order and hierarchical structure are defined using BNF (Backus-Naur Form) syntax.

[0080] When generating strongly constrained output templates, the field extraction and template filling processes are automatically completed, including: Perform regularization parsing on the rule fields in the constraint layer; Generate corresponding key-value constraints based on field attributes; The template node is constructed by combining the field type, the field length limit of the output field (max_len and min_len), and the required field identifier; The generated strong constraint output template is a JSON or BNF file structure, which serves as the structured output constraint during inference. For example, a JSON Schema example: { "type": "object", "required": ["Title", "Body"], "properties": { "Title": {"type":"string", "maxLength":60}, "Summary": {"type":"string", "maxLength":150}, "Body": {"type":"string", "minLength":200} }, "additionalProperties": false }

[0081] Among them, required is a required field; maxLength and minLength indicate the field length limit of the output field; additionalProperties: false is used to prevent the generation of fields outside the strongly constrained output template.

[0082] It should be noted that the generation process of the strong constraint output template is completed automatically without manual intervention. During the automated generation of this strong constraint output template, the key-value mapping table and field attribute table of the constraint fragments are traversed to achieve automatic conversion from rule fields to template definitions.

[0083] Since the structural constraints of a strongly constrained output template depend only on the rule definition, the strongly constrained output template is constructed based solely on the constraint layer during generation, and is unrelated to the semantic content of the task layer or the example layer.

[0084] The strongly constrained output template will be passed to the content generation model along with the structured prompts and will take effect in real time during the content output stage, imposing structural constraints on the generated results.

[0085] This step enables automated constraints and real-time validation of output fields during the content generation stage, preventing issues such as non-compliant formats or missing fields.

[0086] Compared with the traditional method of manually defining templates, this step can dynamically generate templates according to different new media platforms and task types, which greatly improves the automation and structural consistency of constraint generation, thereby significantly improving the structural compliance rate and parsing stability of the output structured candidate text.

[0087] Step S1023: Real-time verification. The structured prompt information and the strongly constrained output template are input into the content generation model. The content generation model generates output fields one by one according to the strongly constrained output template, and performs field-level real-time verification on each output field.

[0088] In this step, the content generation model is a large language model based on the Transformer architecture with structural constraints, such as the GPT series models, LLaMA, Mistral, ChatGLM, and Baichuan. This type of model supports function calling or constrained decoding interfaces, enabling it to generate structured output during the inference phase based on strongly constrained output templates (JSON Schema or BNF rules). During the content generation phase, each output field is decoded and validated on a case-by-case basis.

[0089] Specifically, during the content generation phase, the content generation model outputs each field sequentially according to the output fields defined in the strongly constrained output template. Immediately after each output field is generated, a field-level real-time validation is performed to check the compliance of the output content for that field. If an output field fails validation, generation is not terminated; instead, a structured feedback injection operation is executed through the content generation model's constrained decoding API or function calling API.

[0090] Real-time field-level validation, including: Field Existence Check (FieldExistCheck): Identifies whether the output field is required based on the required field identifier in the platform format constraints. If it is required, it checks whether the output field value is empty. If it is not empty, the field existence check result is PASS; otherwise, the field existence check result is FIELD_ERROR.

[0091] TypeCheck: Based on the field types defined in the platform's format constraints, this function checks whether the output field type matches. Specifically, it performs type validation using a combination of regular expression matching and structured parsing. When the field value is a basic data type (such as string, integer, or boolean), regular expression matching is used for detection. When the field value is a complex structure (such as an array or object), a parser (such as JSON Schema validation or YAML structure parsing) is used to compare the field structure and determine if it meets the field type requirements. If the output field's type meets the requirements, the type check result is "Pass"; otherwise, the type check result is "TYPE_ERROR".

[0092] Length check (LenCheck): Checks whether the length of the output field is valid based on the field length limits (max_len and min_len) defined in the platform format constraints. If the generated field length is within the allowed range, the length check result is PASS; otherwise, the length check result is LEN_ERROR.

[0093] Forbidden Check: Based on the Aho-Corasick automaton algorithm, this function performs string matching to detect whether the output field contains prohibited words, risky terms, or commercially sensitive words from the target platform. This algorithm is a multi-pattern matching algorithm capable of large-scale forbidden word detection in O(n) complexity, making it suitable for real-time verification scenarios. If the output field does not contain prohibited words, risky terms, or commercially sensitive words, the forbidden word detection result is "PASS"; otherwise, the result is "FORBIDDEN_ERROR".

[0094] Tone Check: Based on the tone style requirements set in the brand guidelines (such as "formal," "relaxed," "objective," etc.), the tone tendency of the output field is determined by rules. Specifically, a set of keywords and a set of conflicting expressions are predefined for each tone style, and the difference score Δscore between the target tone keyword hit rate and the non-target tone conflict rate of the output field is calculated. When Δscore ≥ preset threshold τ_t, the tone of the output field is determined to be consistent with the target tone, and the tone check result is PASS; otherwise, the tone check result is TONE_ERROR.

[0095] Term Detection (MustIncludeCheck): Based on the fixed disclaimers and required terms defined in the brand specifications, this output field is checked for keyword matching. If both the fixed disclaimers and required terms are detected, the term detection result is PASS; otherwise, the term detection result is INCLUDE_ERROR.

[0096] Step S1024: Field regeneration processing. Further processing is performed based on the verification results of field-level real-time validation. When the verification result is abnormal, the field regeneration mechanism is executed. When the verification results of all the output fields are passed, structured candidate text is generated.

[0097] In this embodiment, after the content generation model generates output fields one by one according to the strongly constrained output template, each generated output field is subject to real-time field-level validation.

[0098] When the field existence detection result, field type detection result, length detection result, forbidden word detection result, tone detection result and terminology detection result are all passed (PASS), the field-level real-time validation result of the output field is successful (SUCCESS), and the field-level real-time validation of the next output field is performed. Otherwise, perform field regeneration processing; When all generated output fields pass the field-level instant validation and result in SUCCESS, output the structured candidate text and mark the current task status as SUCCESS. The structure of the structured candidate text CandidateSet is as follows: CandidateSet = { "Title": "...", "Summary": "...", "Body": "..."}.

[0099] Field regeneration is handled as follows: Set a preset regeneration threshold (e.g., regeneration threshold = 4) and count the number of times the field regeneration mechanism is executed; When the number of times the field regeneration mechanism is executed is greater than or equal to the regeneration threshold, and the field-level real-time validation result of the output field is FAIL, it is determined whether the output field is a required field. If the output field is a required field, the current field-level real-time validation is terminated, the process reverts to dynamic prompt word arrangement, the structured prompt information and corresponding output fields are regenerated, and the current task status is marked as rollback. When the number of times the field regeneration mechanism is executed is less than the regeneration threshold, for the exception type of the output field, the corresponding error message is structurally injected back into the generation instruction of the current field to guide the model to perform constrained regeneration. For example: Add a prompt "Length should be ≤ 60 characters" when the length detection is abnormal; When a field type detection error occurs, add the message "This field should be a string"; When a forbidden word detection error occurs, the message "{set of forbidden words} must not be included" is displayed. Add a prompt "Rewrite as formal tone" when tone detection is abnormal; When a terminology detection error occurs, add a prompt: "Please supplement the brand term ××".

[0100] Before executing the regeneration instructions, the inference parameters of the content generation model are converged to prevent repeated errors and improve generation stability. Specifically, this includes: The temperature T is decreased proportionally by β (0.6 ≤ β ≤ 0.9); Reduce the upper bound of sampling, top_p, by 0.05 to 0.2; Increase the duplicate penalty rep_penalty by 0.2 to 0.5.

[0101] Among them, temperature (T), sampling upper bound (top_p), and repetition penalty coefficient (rep_penalty) are the core control parameters in the inference stage of the content generation model, which are used to adjust the randomness and diversity of the output.

[0102] Temperature (T): This parameter controls the smoothness of the sampling distribution, and its value typically ranges from 0 to 1. A lower value results in a more concentrated output of the content generation model focusing on the words with the highest probabilities, leading to more stable generation results; a higher value results in greater randomness in the output. This embodiment achieves dynamic adjustment by calling the temperature control parameter in the content generation model's inference interface (such as the "temperature" parameter in the OpenAI API or HuggingFace).

[0103] Sampling upper bound (top_p): This is a sampling threshold based on the cumulative probability distribution, used to limit the set of words the model can select during generation. The value typically ranges from 0 to 1. When the top_p value decreases, the model samples only from a high-probability subset, thereby reducing randomness and improving semantic consistency. This parameter can be configured through the inference interface of the content generation model (e.g., the "top_p" parameter).

[0104] The repetition penalty coefficient (rep_penalty) is used to suppress the repetition of words or phrases in the generated results. Its value is typically greater than 1. As the value increases, the model applies a higher penalty weight to repeated words during sampling, resulting in more diverse and natural output. This parameter can be set through the repetition penalty parameters (such as "repetition_penalty" or "presence_penalty") in the inference interface.

[0105] It should be noted that the adjusted inference parameters will take effect during the next output field regeneration process, while other output fields that have passed the validation will remain frozen.

[0106] In this embodiment, structured back-injection refers to generating corresponding error correction constraint statements based on the anomaly type, and injecting the back-injection instructions into the model input stream through the constrained decoding API or function calling API of the content generation model, guiding the model to perform constrained regeneration of the current field.

[0107] By performing real-time validation and field regeneration, a controlled closed loop of field-level real-time validation, structured back injection, and regeneration can be achieved while maintaining the structure of the strongly constrained output template, ensuring the structural compliance and semantic consistency of the generated results.

[0108] Figure 3 This is a schematic diagram of a multi-round controlled generation process according to an example embodiment of this application. For example... Figure 3 As shown, the multi-round controlled generation method provided in this embodiment includes: Step S1031: The content generation model uses a multi-round controlled generation mechanism to generate multiple structured candidate texts, and combines the multiple structured candidate texts into a candidate content set.

[0109] In this step, a multi-round controlled generation mechanism is adapted to different types of content generation models; When the content generation model supports multiple sample outputs at once, multiple structured candidate texts can be generated in parallel with a single call to the content generation model. When the content generation model does not support multiple sample outputs at once, under the same strongly constrained output template and field-level real-time verification mechanism, multiple structured candidate texts are obtained through multiple rounds of generation, and the number of generation rounds is controlled by an early stopping strategy. The early termination strategy determines the termination timing of loop generation based on the target number of candidates, the maximum number of rounds threshold, and the time budget threshold. Specifically: When the content generation model supports multiple sample outputs at once, setting the target number of candidates n=X, a single call to the content generation model directly yields no fewer than X structured candidate texts that have undergone real-time field-level validation. These multiple structured candidate texts are then combined to form a candidate set. This type of content generation model only requires one execution round to obtain multiple structured candidate texts.

[0110] When the content generation model does not support multiple samples output at once, an early stopping strategy is used to control the number of rounds of cyclic sampling and the termination condition.

[0111] The early-stop strategy involves executing a loop under the same strongly constrained output template and field-level real-time validation mechanism, generating multiple structured candidate texts over multiple rounds. Specifically, a predetermined target number of candidates K (e.g., K is 3-5), a maximum round threshold R_max (e.g., R_max≤10), and a time budget threshold T_budget (e.g., T_budget≤5s) are set. Multiple structured candidate texts are generated over multiple rounds, with each round calling the content generation model to generate one structured candidate text that undergoes field-level real-time validation. The structured candidate texts generated in each round are deduplicated using key field fingerprints (such as hashes or vector similarities of the title, abstract, and body text) to update the candidate content set.

[0112] The early stopping strategy controls the termination condition of the loop generating structured candidate text as follows: The number of structured follow-up texts collected is greater than or equal to the target number of candidates; The number of rounds currently executed is greater than or equal to the maximum number of rounds threshold; The execution time currently consumed is greater than or equal to the time budget threshold; No new structured candidate texts were added to the candidate content set in m consecutive rounds (e.g., m=2).

[0113] After obtaining multiple structured candidate texts, they are combined into multiple candidate content sets, represented as Pool={CandidateSet1,CandidateSet2,...,CandidateSet...} n}, where CandidateSet i This is the i-th structured candidate text that has undergone real-time field-level validation.

[0114] It should be noted that when implementing the early stopping strategy, the target candidate number K, the maximum number of rounds threshold R_max, and the time budget threshold T_budget are used as inference control parameters. These parameters are passed to the content generation model interface by the external control logic and implemented through the loop sampling control logic supported by the publicly available large language model inference framework (such as OpenAI API, Transformers inferencer, or vLLM engine) to dynamically control the number of generation rounds and the termination condition.

[0115] The multi-round controlled generation mechanism can automatically select a single multi-sample or early stopping strategy based on the content generation model interface capabilities, generating multiple structured candidate texts without retraining the model, ensuring that the candidate set has both structural compliance and semantic diversity.

[0116] Step S1032: Perform quality assessment on each structured candidate text in the candidate content set and generate a corresponding quality score vector.

[0117] In this step, the quality assessment includes generating a quality score vector, which consists of a consistency score, a structural compliance score, a readability score, and a stability score. Each individual score is a numerical quantitative indicator with a value range of [0,1], used to characterize the quality performance of the candidate text in each dimension. The quality score is used to measure the comprehensive quality of the structured candidate text in terms of semantic consistency, structural compliance, language fluency, and generation stability, providing a quantitative basis for subsequent gating score calculation.

[0118] The quality rating vector is:

[0119] Where i is the i-th structured candidate text in the candidate content set; R i For consistency score; C i Score the structural compliance rate; L i Score for readability; S i A stability score is given.

[0120] The calculation methods for each score include: Consistency score (R i ): In this embodiment, the consistency score is used to characterize the semantic consistency between the structured candidate text and the structured prompt information.

[0121] The content generation model is a large language model based on the Transformer architecture, such as the GPT series models, LLaMA, Mistral, ChatGLM, Baichuan, etc., which supports function calling or constrained decoding.

[0122] Mainstream large language models based on the Transformer architecture, such as the GPT series models, LLaMA, Mistral, ChatGLM, and Baichuan, typically provide logprobs or output_scores interfaces through APIs or inference engines (such as OpenAI API, Transformers, and vLLM). In this embodiment, structured prompt information (including task layer, constraint layer, and example layer) generated according to user requests, along with the corresponding structured candidate text, is input into the content generation model. The generation confidence score of the structured candidate text is obtained through the logprobs or output_scores interface of the content generation model. This generation confidence score reflects the probability of the content generation model generating structured candidate text given the structured prompt information. A higher generation confidence score indicates stronger semantic consistency between the structured candidate text and the structured prompt information. Then, based on this generation confidence score, a consistency index for the structured candidate text is calculated.

[0123] Among them, P i P represents the generation confidence of the i-th structured candidate text generated by the content generation model given structured prompts; max and P min These are the maximum and minimum generation confidence scores of the generated content in the current candidate content set, respectively.

[0124] The consistency index is linearly normalized (Min–Max Normalization) to obtain the consistency score R. i :

[0125] Among them, Con i Let Con be the consistency metric for the i-th structured candidate text; max and Con min These are the maximum and minimum values ​​of the consistency index for all structured candidate texts in the current candidate content set, used to determine the interval boundaries of linear normalization (Min–Max Normalization).

[0126] Consistency score R i The value range is [0,1]. The larger the value, the higher the semantic consistency between the structured candidate text and the structured prompt information.

[0127] Structural compliance score (C) i ): In this embodiment, the structural compliance score is used to characterize the degree to which the structured candidate text conforms to the strongly constrained output template.

[0128] Based on the statistical results of the pass and fail of each input field during the generation of this structured candidate text, a structure compliance score is calculated:

[0129] Where, N pass N is the number of passes for all fields of the structured candidate text. total This represents the total number of fields generated for the structured candidate text.

[0130] Readability score (L) i ): In this embodiment, the readability score is used to characterize the linguistic fluency and semantic coherence of the structured candidate text. The readability score is calculated based on the confidence of the token-level output during the content generation process, to characterize the linguistic smoothness and contextual continuity of the generated structured candidate text. A token refers to the smallest processing unit obtained after the original text is segmented by the tokenizer or encoder of the content generation model. Large language models based on the Transformer architecture (such as the GPT series, LLaMA, Mistral, ChatGLM, Baichuan, etc.) all have built-in tokenization and encoding mechanisms in their inference framework, which can be directly implemented through the model's built-in interfaces (such as tokenizer.encode / decode or logprobs / output_scores) to perform token segmentation and probability calculation.

[0131] Lexical units represent the internal processing granularity during the input and generation of a large language model, and are at a different level of abstraction than the output fields used to organize the output results in this embodiment. Output fields are semantic units within strongly constrained output templates, while lexical units are technical processing units of the large language model.

[0132] Specifically, when the content generation model outputs structured candidate text field by field based on structured prompts, it obtains the log probability of each token in the structured candidate text by calling the logprobs or output_scores interface provided by the content generation model, and calculates the perplexity (PPL) metric based on this. The calculation formula is as follows:

[0133] Where, N i The number of output terms for the structured candidate text; logp t Let be the logarithmic probability of the t-th word.

[0134] The perplexity index is inversely normalized to obtain the readability score (L). i ):

[0135] Among them, PPL i PPL is the perplexity metric for the i-th structured candidate text. max and PPL min These are the maximum and minimum values ​​of the perplexity index in the current candidate content set, respectively.

[0136] After inverse normalization, the readability score (L) i The value range of ) is [0,1], and the readability score (L) is... iThe larger the value of ), the more fluent and coherent the structured candidate text is at the language level.

[0137] Stability score (S) i ): In this embodiment, the stability score is used to measure the semantic consistency and volatility of multiple rounds of generated results under the same structured prompt information. To ensure comparability, the stability score is uniformly performed under the same structured prompt information condition. Specifically, for the candidate content set Pool={CandidateSet1,CandidateSet2,...,CandidateSet...} n In this process, key fields (such as title, abstract, and body text) are extracted from each structured candidate text, and then concatenated into a single text segment in a fixed order, denoted as Concat. i Concat i The text is converted into a vector representation using a simple text vectorization method (such as character / word-based TF-IDF or n-gram statistics), denoted as V. i .

[0138] Calculate the mean cosine similarity between the i-th structured candidate text and other structured candidate texts to obtain the stability index Stab. i :

[0139] Where K is the number of all structured candidate texts in the candidate content set; i and j are the indices of the structured candidate texts; V i and V j These are the vector representations of the i-th and j-th structured candidate texts, respectively.

[0140] For the stability index Stab i Linear normalization (Min–Max Normalization) is performed to obtain the stability score S. i :

[0141] Among them, Stab i Stab is the stability metric for the i-th structured candidate text. max and Stab min These are the maximum and minimum values ​​of the stability index of all structured candidate texts in the current candidate content set (generated under the same structured prompt information), used to determine the upper and lower bounds of the interval for linear normalization (Min–Max Normalization).

[0142] S i The value range of S is [0,1].i A higher value indicates that the structured candidate text has higher semantic consistency and stability in multiple rounds of generation.

[0143] Step S1033: Based on the quality score vector of each structured candidate text, construct a comprehensive gating input vector for each structured candidate text.

[0144] In this step, the comprehensive gating input vector is used to calculate the comprehensive gating score based on the quality scoring vector; the comprehensive gating score is calculated based on a weighted fusion of each consistency score, structural compliance score, readability score, and stability score, and its calculation formula is as follows:

[0145] Wherein, γ1, γ2, γ3, and γ4 are the weighting coefficients for the consistency score, structural compliance score, readability score, and stability score, respectively, and these weighting coefficients can be pre-configured based on empirical parameters; R i For consistency score; C i Score the structural compliance rate; L i Score for readability; S i A stability score is given.

[0146] The overall gating score reflects the overall quality level of the structured candidate text and is used for subsequent reordering of the candidate content set.

[0147] Step S1034: Based on the comprehensive gating score, reorder the structured candidate texts in the candidate content set and select the final output content.

[0148] In this step, the candidate content set is sorted in descending order based on the comprehensive gating score to generate a rearranged candidate set, and one or more structured candidate texts with the highest comprehensive gating score are selected from the rearranged candidate set.

[0149] If there is only one structured candidate text with the highest overall gating score in the rearranged candidate set, then that structured candidate text is selected as the final output content.

[0150] When there are multiple structured candidate texts with the highest comprehensive gating scores in the rearranged candidate set, a random perturbation selection mechanism is used to select one of the structured candidate texts as the final output content.

[0151] The random perturbation selection mechanism involves introducing a small random bias (noise term) among structured candidate texts with the same overall gating score, performing a lightweight sort, and then selecting the structured candidate text with the highest overall gating score. This random perturbation selection mechanism belongs to the currently available stochastic perturbation method.

[0152] Figure 4 This is a schematic diagram of the structure of a new media intelligent middleware system according to an example embodiment of this application. For example... Figure 4 As shown, the new media intelligent middleware system 400 provided in this embodiment includes: a constraint knowledge base construction module 410, a rollback-enabled controlled generation mechanism module 420, and a multi-round controlled generation module 430.

[0153] The constraint knowledge base construction module builds a machine-readable constraint knowledge base based on information from multiple new media platforms, brands, and products. The constraint knowledge base includes a rule constraint layer and a material reference layer. The reversible controlled generation mechanism module, during the inference phase of the content generation model, dynamically arranges prompt words based on user requests and the constraint knowledge base to generate structured prompt information and automatically generates a strongly constrained output template. The content generation model generates output fields field by field according to the structured prompt information and the strongly constrained output template, and performs field-level real-time validation on the output fields. When the validation result is abnormal, the field regeneration mechanism is executed, and when the regeneration threshold is reached, it reverts to the dynamic prompt word arrangement to regenerate the structured prompt information and the corresponding output fields. When the validation results of all the output fields are passed, structured candidate text is generated. The multi-round controlled generation module acquires multiple structured candidate texts based on the multi-round controlled generation mechanism, generates a candidate content set, performs quality evaluation on each structured candidate text and constructs a comprehensive gating input vector, reorders the structured candidate texts in the candidate content set based on the comprehensive gating score, and obtains the final output content based on the reordering result.

[0154] Figure 5 This is a schematic diagram of the structure of an electronic device according to an example embodiment of this application. For example... Figure 5 As shown, the electronic device 500 provided in this embodiment includes: a processor 501 and a memory 502; wherein: Memory 502 is used to store computer programs, and the memory may also be flash memory.

[0155] Processor 501 is used to execute the execution instructions stored in the memory to implement the various steps in the above method. For details, please refer to the relevant descriptions in the preceding method embodiments.

[0156] Alternatively, the memory 502 can be either standalone or integrated with the processor 501.

[0157] When the memory 502 is a device independent of the processor 501, the electronic device 500 may further include: Bus 503 is used to connect the memory 502 and the processor 501.

[0158] This embodiment also provides a readable storage medium storing a computer program, which, when executed by at least one processor of an electronic device, enables the electronic device to perform the methods provided in the various embodiments described above.

[0159] This embodiment also provides a program product including a computer program stored in a readable storage medium. At least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to cause the electronic device to perform the methods provided in the various embodiments described above.

[0160] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the foregoing claims.

[0161] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.

Claims

1. A new media intelligent middleware platform method, characterized in that, include: The constraint knowledge base is constructed based on information from multiple new media platforms, brands, and products, creating a machine-readable constraint knowledge base that includes a rule constraint layer and a material reference layer. The reversible controlled generation mechanism, during the inference phase of the content generation model, dynamically arranges prompt words based on user requests and the constraint knowledge base to generate structured prompt information and automatically generates a strongly constrained output template. The content generation model generates output fields field by field according to the structured prompt information and the strongly constrained output template, and performs field-level real-time validation on the output fields. When the validation result is abnormal, the field regeneration mechanism is executed, and when the regeneration threshold is reached, it reverts to the dynamic prompt word arrangement to regenerate the structured prompt information and the corresponding output fields. When the validation results of all output fields are passed, structured candidate text is generated. Multiple rounds of controlled generation are used to obtain multiple structured candidate texts based on the multi-round controlled generation mechanism, generate a candidate content set, perform quality evaluation on each structured candidate text and construct a comprehensive gating input vector, reorder the structured candidate texts in the candidate content set based on the comprehensive gating score, and obtain the final output content based on the reordering result. The field regeneration mechanism includes: A preset rebirth threshold is set to count the number of times the field rebirth mechanism is executed; When the number of times the field regeneration mechanism is executed is greater than or equal to the regeneration threshold, and the field-level real-time validation result of the output field is a failure, it is determined whether the output field is a required field. If the output field is a required field, the current field-level real-time validation will be terminated, and the system will revert to dynamic prompt word arrangement to regenerate the structured prompt information and corresponding output field. When the number of times the field regeneration mechanism is executed is less than the regeneration threshold, for the exception type of the output field, the corresponding error message is injected back into the generation instruction of the current field in a structured manner, and before executing the regeneration instruction, the inference parameters of the content generation model are converged and adjusted. The content generation model is a large language model based on the Transformer architecture, which supports function calls or restricted decoding interface functions.

2. The new media intelligent middleware platform method according to claim 1, characterized in that, The reversible controlled generation mechanism includes: Dynamic prompt word arrangement: Based on the user request, rule constraint information and material reference information, dynamic prompt words are arranged to generate structured prompt information that drives the reasoning of the content generation model; Strong constraint output template construction: A strong constraint output template is automatically generated based on the constraint fragments of the structured prompt information. Real-time validation involves inputting the structured prompt information and the strongly constrained output template into the content generation model. The content generation model generates output fields one by one according to the strongly constrained output template, and performs real-time validation at the field level for each output field. The field regeneration process further processes the verification results based on the field-level real-time validation. When the verification result is abnormal, the field regeneration mechanism is executed. When the verification results of all the output fields are passed, structured candidate text is generated.

3. The new media intelligent middleware platform method according to claim 1, characterized in that, The multi-round controlled generation includes: The content generation model uses a multi-round controlled generation mechanism to generate multiple structured candidate texts, and combines the multiple structured candidate texts into a candidate content set; For each structured candidate text in the candidate content set, a quality assessment is performed to generate a corresponding quality score vector; Based on the quality score vector of each structured candidate text, a comprehensive gating input vector is constructed for each structured candidate text; Based on the comprehensive gating score, the structured candidate texts in the candidate content set are reordered, and the final output content is selected.

4. The new media intelligent middleware platform method according to claim 1, characterized in that, The multi-round controlled generation mechanism is adapted to different types of content generation models; When the content generation model supports multiple sample outputs at once, multiple structured candidate texts can be generated in parallel with a single call to the content generation model. When the content generation model does not support multiple sample outputs at once, under the same strongly constrained output template and field-level real-time verification mechanism, multiple structured candidate texts are obtained through multiple rounds of generation, and the number of generation rounds is controlled by an early stopping strategy. The early stop strategy determines the termination time of the loop generation based on the target number of candidates, the maximum number of rounds threshold, and the time budget threshold.

5. The new media intelligent middleware platform method according to claim 1, characterized in that, The quality assessment includes generating a quality score vector, which consists of a consistency score, a structural compliance score, a readability score, and a stability score, wherein: The consistency score is used to characterize the semantic consistency between the structured candidate text and the structured prompt information; The structural compliance score is used to characterize the degree to which the structured candidate text conforms to the strongly constrained output template. The readability score is used to characterize the linguistic fluency and semantic coherence of the structured candidate text; The stability score is used to measure the semantic consistency and volatility of multiple rounds of generated results under the same structured prompt information.

6. The new media intelligent middleware platform method according to claim 5, characterized in that, The integrated gating input vector is used to calculate the integrated gating score based on the quality scoring vector; The comprehensive gating score is calculated based on a weighted fusion of consistency scores, structural compliance scores, readability scores, and stability scores, and the calculation formula is as follows: Where γ1, γ2, γ3, and γ4 are the weighting coefficients for consistency score, structural compliance score, readability score, and stability score, respectively, and R i For consistency scoring, C i To score the structural compliance rate, L i For readability scoring, S i A stability score is given.

7. A new media intelligent middleware system, characterized in that, include: The constraint knowledge base construction module builds a machine-readable constraint knowledge base based on information from multiple new media platforms, brands, and products. The constraint knowledge base includes a rule constraint layer and a material reference layer. The reversible controlled generation mechanism module, during the inference phase of the content generation model, dynamically arranges prompt words based on user requests and the constraint knowledge base to generate structured prompt information and automatically generates a strongly constrained output template. The content generation model generates output fields field by field according to the structured prompt information and the strongly constrained output template, and performs field-level real-time validation on the output fields. When the validation result is abnormal, the field regeneration mechanism is executed, and when the regeneration threshold is reached, it reverts to the dynamic prompt word arrangement to regenerate the structured prompt information and the corresponding output fields. When the validation results of all the output fields are passed, structured candidate text is generated. The multi-round controlled generation module obtains multiple structured candidate texts based on the multi-round controlled generation mechanism, generates a candidate content set, performs quality evaluation on each structured candidate text and constructs a comprehensive gating input vector, reorders the structured candidate texts in the candidate content set based on the comprehensive gating score, and obtains the final output content based on the reordering result. The field regeneration mechanism includes: A preset rebirth threshold is set to count the number of times the field rebirth mechanism is executed; When the number of times the field regeneration mechanism is executed is greater than or equal to the regeneration threshold, and the field-level real-time validation result of the output field is a failure, it is determined whether the output field is a required field. If the output field is a required field, the current field-level real-time validation will be terminated, and the system will revert to dynamic prompt word arrangement to regenerate the structured prompt information and corresponding output field. When the number of times the field regeneration mechanism is executed is less than the regeneration threshold, for the exception type of the output field, the corresponding error message is injected back into the generation instruction of the current field in a structured manner, and before executing the regeneration instruction, the inference parameters of the content generation model are converged and adjusted. The content generation model is a large language model based on the Transformer architecture, which supports function calls or restricted decoding interface functions.

8. An electronic device, characterized in that, include: processor; as well as, Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 6 by executing the executable instructions.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Database table field description intelligent generation and dynamic maintenance method based on RAG and large model

    CN120764654A

  • Prompt word compiling and generating method and system for large language model

    CN120848895A