Context object assembly methods, apparatuses, media, and devices for content generation

By generating structured metadata for multi-source materials and organizing and dynamically trimming it in a hierarchical manner, the problem of information redundancy and conflict in the generation of complex content in existing technologies is solved, and efficient and stable content generation is achieved.

CN122432310APending Publication Date: 2026-07-21HANGZHOU SHENGCHENGJI TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU SHENGCHENGJI TECHNOLOGY CO LTD
Filing Date
2026-04-28
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing content generation systems suffer from information redundancy, conflicts, and noise accumulation in complex scenarios, making it impossible to achieve flexible reorganization and dynamic trimming. This results in off-topic generated results, missing constraints, and increased calling costs.

Method used

By converting multi-source materials into fragment objects, each fragment object is given structured metadata such as credibility, task relevance, budget weight, and its level. Then, it is sorted, conflict-handled, and dynamically trimmed according to preset rules to generate runtime context objects.

Benefits of technology

It improved the accuracy of information organization, enhanced the traceability and controllability of materials, improved the stability of context calling, reduced the probability of contradictory information entering the system, and improved the utilization efficiency of limited budgets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122432310A_ABST
    Figure CN122432310A_ABST
Patent Text Reader

Abstract

The application relates to a context object assembly method, device, medium and equipment for content generation, belongs to the technical field of text information processing, and comprises the following steps: accessing at least two types of heterogeneous material sources to obtain original materials; converting the original materials into a plurality of segment objects according to preset segmentation rules, wherein each segment object has an independent identifier; generating structured metadata for each segment object; distributing the segment objects to at least one layer of a fact layer, a task constraint layer, an expression reference layer, a case layer and a restriction layer according to preset hierarchical rules; sorting the segment objects according to a task target and segment metadata, and completing conflict processing according to a conflict resolution rule; performing dynamic cutting on the sorted segment objects under preset budget constraints; assembling the cut segment objects according to an assembly order to generate a runtime context object which can be directly called by a content generation model; and the application has the beneficial effect of improving the generation effect of complex content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of text information processing technology, and specifically relates to a method, apparatus, medium and device for assembling context objects for content generation. Background Technology

[0002] Existing content generation systems typically require input information from multiple sources, such as user-inputted task descriptions, historical interaction content, knowledge documents, case texts, style reference materials, external search results, and existing intermediate generated results. Current processing methods mainly fall into the following categories:

[0003] The system directly concatenates multiple source materials in sequence to generate a prompt word input model; after retrieving the materials, it returns several coarse-grained text fragments, which are then concatenated with the user input; fixed templates are preset for different tasks, and the generation model is called after inserting specific materials into the template.

[0004] While the aforementioned methods can achieve basic generation in simple scenarios, they have significant shortcomings in complex content generation tasks. Firstly, materials from different sources vary considerably in format, granularity, timeliness, and reliability, making direct splicing prone to information redundancy, conflicts, and noise accumulation. Secondly, existing solutions generally lack fragment-level object-oriented management of materials, failing to achieve flexible reorganization and dynamic trimming when tasks change, budgets are limited, or constraints shift. Especially in scenarios involving long text generation, complex task generation, and multi-round collaborative content modification, traditional contextual organization methods easily lead to off-topic results, missed constraints, increased calling costs, and decreased result stability. Summary of the Invention

[0005] This invention provides a method, apparatus, medium, and device for assembling context objects for content generation, which addresses the technical problem of poor performance in generating complex content in the prior art. By generating structured metadata containing credibility, task relevance, budget weight, and hierarchical level for each fragment object, the generation effect of complex content is improved.

[0006] To achieve the above objectives, the present invention is implemented through the following technical solution:

[0007] The method for assembling the context object for content generation includes the following steps:

[0008] Access at least two types of heterogeneous material sources to obtain the original materials;

[0009] The original footage is converted into multiple fragment objects according to preset segmentation rules, and each fragment object has an independent identifier.

[0010] Generate structured metadata for each fragment object, including credibility, task relevance, budget weight, and its hierarchy;

[0011] Based on preset hierarchical rules, the fragment objects are assigned to at least one of the following layers: fact layer, task constraint layer, expression reference layer, case layer, and restriction layer.

[0012] The fragment objects are sorted according to the task objectives and fragment metadata, and conflict resolution is completed according to the conflict resolution rules.

[0013] Perform dynamic cropping on sorted fragment objects under preset budget constraints;

[0014] The clipped fragment objects are assembled in the order of assembly to generate a runtime context object that can be directly called by the content generation model.

[0015] Optionally, heterogeneous material sources can be obtained in the following ways:

[0016] At least two types of data are obtained from the user's current input, historical interactions, knowledge base documents, case documents, style reference texts, external search results, rule constraint documents, and intermediate results generated by the system.

[0017] Optionally, the processing method for fragment objects includes the following steps:

[0018] Text-based materials are segmented by paragraphs, sentence groups, or semantic blocks;

[0019] Rule-based materials are segmented according to rule entries;

[0020] Table-type data is segmented by rows, columns, or logical units;

[0021] Case study materials are divided into case study units or structural segments.

[0022] Optionally, conflict resolution methods include the following:

[0023] When factual content conflicts, prioritize retaining the more credible segment;

[0024] When the credibility is similar, prioritize retaining the update time segment;

[0025] When rule constraints conflict with case descriptions, the rule constraint portion should be retained first.

[0026] When there is a conflict between mission-specific materials and general materials, mission-specific materials will be retained first.

[0027] Optionally, dynamic cropping can be handled based on priority as follows:

[0028] Prioritize retaining core factual layer fragments and task constraint layer fragments;

[0029] When budget is limited, prioritize cutting low-relevance segments from the case study layer;

[0030] The high-priority restriction layer forces the retention of content.

[0031] A context object assembly device for content generation includes:

[0032] The material access module is used to access at least two types of heterogeneous material sources and obtain the original materials.

[0033] The fragmentation module is used to divide the original footage into fragment objects with independent identifiers;

[0034] The metadata generation module is used to generate structured metadata for fragment objects;

[0035] The hierarchical organization module is used to assign fragment objects to the corresponding context hierarchy;

[0036] The sorting and conflict resolution module is used to sort fragment objects and eliminate content conflicts;

[0037] The dynamic trimming module is used to trim non-critical segments under budget constraints;

[0038] The context object generation module is used to assemble the filtered fragments into runtime context objects.

[0039] Optionally, the hierarchical organization module can be configured to divide fragment objects into a fact layer, a task constraint layer, an expression reference layer, a case layer, and a restriction layer, with each layer having an independent priority and pruning strategy.

[0040] Optionally, the budget constraints for the dynamic pruning module include at least one of the following: a maximum number of tokens, a maximum input length, a maximum call cost, and system latency requirements.

[0041] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is used to implement the above-described method for assembling context objects for content generation.

[0042] A content generation context object processing device, comprising:

[0043] Memory, processor, and computer programs stored in memory and capable of running on the processor;

[0044] When the processor executes the program, it implements the aforementioned context object assembly method for content generation.

[0045] The beneficial effects of this invention are:

[0046] Transforming multi-source materials from whole-document processing to fragment-level object-oriented management improves the accuracy of information organization; structured metadata description enhances the traceability and controllability of materials; hierarchical organization distinguishes factual information, constraint information, and expressive reference information, improving the stability of context calls; conflict resolution mechanisms reduce the probability of contradictory information entering the context simultaneously; dynamic pruning mechanisms under budget constraints improve the utilization efficiency of limited input budgets; and building runtime context objects facilitates cache reuse, debugging analysis, and subsequent human-computer collaborative modifications. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is a schematic diagram of the workflow of the method of the present invention;

[0049] Figure 2 This is a schematic diagram of the fragment conflict resolution process of the present invention;

[0050] Figure 3 This is a schematic diagram of the segment trimming process under budget constraints according to the present invention;

[0051] Figure 4 This is a schematic diagram of the runtime context object structure of the present invention;

[0052] Figure 5 This is a schematic diagram of the device structure of the present invention;

[0053] Figure 6 A schematic diagram of the device structure for generating context objects for the content of this invention;

[0054] Figure 7 This is a schematic diagram of the computer-readable storage medium structure of the present invention. Detailed Implementation

[0055] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0056] Example 1

[0057] like Figure 1 As shown, this embodiment provides a method for assembling context objects for content generation, including the following steps:

[0058] Access at least two types of heterogeneous material sources to obtain the original materials;

[0059] The original footage is converted into multiple fragment objects according to preset segmentation rules, and each fragment object has an independent identifier.

[0060] Generate structured metadata for each fragment object, including credibility, task relevance, budget weight, and its hierarchy;

[0061] Based on preset hierarchical rules, the fragment objects are assigned to at least one of the following layers: fact layer, task constraint layer, expression reference layer, case layer, and restriction layer.

[0062] The fragment objects are sorted according to the task objectives and fragment metadata, and conflict resolution is completed according to the conflict resolution rules.

[0063] Perform dynamic cropping on sorted fragment objects under preset budget constraints;

[0064] The clipped fragment objects are assembled in the order of assembly to generate a runtime context object that can be directly called by the content generation model.

[0065] Furthermore, the acquisition of heterogeneous material sources includes the following methods:

[0066] At least two types of data are obtained from the user's current input, historical interactions, knowledge base documents, case documents, style reference texts, external search results, rule constraint documents, and intermediate results generated by the system.

[0067] For the original source material, it is converted into multiple fragment objects according to preset segmentation rules. The segmentation method can vary depending on the type of source material. The processing method for fragment objects includes the following steps:

[0068] Text-based materials are segmented by paragraphs, sentence groups, or semantic blocks;

[0069] Rule-based materials are segmented according to rule entries;

[0070] Table-type data is segmented by rows, columns, or logical units;

[0071] Case study materials are divided into case study units or structural segments.

[0072] Each fragment object has a unique identifier for subsequent sorting, filtering, trimming, assembly, and traceability. See Table 1 below:

[0073] Table 1. Fields of Material Fragment Objects

[0074]

[0075] Structured metadata is generated for each fragment object. The metadata includes at least several of the following fields: fragment unique identifier; source type; source citation identifier; time information; credibility parameter; task relevance parameter; conflict flag; budget weight; hierarchy; and traceability identifier. The credibility parameter characterizes the reliability of the fragment's source; the task relevance parameter characterizes the degree of match between the fragment and the current task objective; and the budget weight indicates the fragment's retention priority under budget constraints, as shown in Table 2 below.

[0076] Table 2 Reference Table for Budget Weight Definitions

[0077]

[0078] Fragment objects are divided into different context layers according to a preset method. Preferably, the following layers are included:

[0079] Fact layer: Used to store objective knowledge, core facts, and necessary background information;

[0080] Task constraint layer: used to store word count, format, audience, taboos, and task requirements;

[0081] Expression reference layer: used to store style, tone, expression methods, and structural references;

[0082] Case layer: Used to store historical cases, sample texts, and results of similar tasks;

[0083] Restriction layer: Used to store compliance requirements, prohibited items, risk control items, etc.

[0084] Different priorities and different clipping strategies can be set for different levels.

[0085] Segments are sorted based on task objectives and fragment metadata. Sorting criteria include, but are not limited to:

[0086] The degree of matching with task keywords; the degree of matching with task type; the semantic relevance to the user's current goal; historical hit rate or usage effect; source credibility; and time freshness.

[0087] For conflicting segments, the main segment or candidate segments are selected to be retained based on conflict resolution rules. For example: segments with higher credibility take priority; segments with more up-to-date times take priority; segments directly constrained by the task take priority over general reference content; segments with explicit rules take priority over experience cases; and segments specific to the current task take priority over general segments.

[0088] like Figure 2 As shown, conflict resolution methods include the following:

[0089] When factual content conflicts, prioritize retaining the more credible segment;

[0090] When the credibility is similar, prioritize retaining the update time segment;

[0091] When rule constraints conflict with case descriptions, the rule constraint portion should be retained first.

[0092] When there is a conflict between mission-specific materials and general materials, mission-specific materials will be retained first.

[0093] Given a contextual budget constraint, perform dynamic pruning on the sorted fragments. The budget constraint can be an upper limit on the number of tokens, an upper limit on the input length, an upper limit on the call cost, or a system latency requirement. See Table 3 below:

[0094] Table 3 Conflict Resolution Priority Rules

[0095]

[0096] Furthermore, in order to achieve conflict resolution, the conflict determination threshold is as shown in Table 4 below:

[0097] Table 4 Example of Conflict Detection Thresholds

[0098]

[0099] like Figure 3 As shown, preferably, according to the priority principle followed by the cutting order, the dynamic cutting process is as follows:

[0100] Prioritize retaining core factual segments;

[0101] Prioritize retaining task constraint layer fragments;

[0102] Retain necessary reference fragments within the budget;

[0103] If the budget is insufficient, prioritize pruning low-relevance segments in the case layer;

[0104] Finally, trim off non-critical reference content;

[0105] High-priority restricted content in the restriction layer is retained first.

[0106] Specifically, as shown in Table 5 below:

[0107] Table 5. Budget-Constrained Assembly Sequence Table

[0108]

[0109] During runtime context object generation, the clipped fragment objects are assembled according to a preset assembly order to form a runtime context object, such as... Figure 4As shown, the runtime context object includes at least: task identifier; task type; budget constraint information; fragment sets at each level; fragment assembly order; and traceability information. Specifically, see Table 6 below:

[0110] Table 6 Runtime Context Object Fields Table

[0111]

[0112] The present invention provides a runtime context object that can serve as an intermediate input structure for a content generation model and can also be cached for reuse in subsequent similar tasks.

[0113] Example 2

[0114] Based on Example 1, the task input by the user is received, and a long article for entrepreneurs is generated. The topic is the value and risk analysis of AI content generation entrepreneurship. The style should be rational, restrained and clearly structured, with about 3,000 words, and avoids vague expressions.

[0115] The following materials will also be integrated: records of users' historical conversations regarding their entrepreneurial decisions; past case studies; style reference texts; a risk control rule explanation; industry data obtained from external searches; and existing outline drafts from the system.

[0116] First, the above materials are fragmented to obtain multiple fragment objects. Then, metadata is generated for the fragment objects. Next, the materials are assigned to the fact layer, task constraint layer, expression reference layer, case layer, and restriction layer according to the rules. Then, the fragments are sorted by relevance and conflict is resolved according to the task objective. When the context input budget is limited, the content of the fact layer and task constraint layer is retained first, and some case layer content is trimmed. Finally, the runtime context object is assembled and passed to the content generation model to complete the generation of the target article.

[0117] Another implementation related to this embodiment is as follows: when two sources of data on the same industry exist, the first source is an older document and the second is a recent report, and the two sources are inconsistent in their data descriptions, the system determines that the second source is the primary segment based on time information and credibility parameters, and retains the first source as a candidate segment or discards it, thereby reducing information conflicts during the generation process.

[0118] Other implementations related to this embodiment include retaining only the core fact layer fragments and task constraint layer fragments when performing short summary tasks, and significantly pruning the expression reference layer and case layer to accommodate shorter output lengths and lower budget constraints.

[0119] Example 3

[0120] Based on Example 1, such as Figure 5As shown, this embodiment provides a context object assembly apparatus for content generation, including:

[0121] The material access module is used to access at least two types of heterogeneous material sources and obtain the original materials.

[0122] The fragmentation module is used to divide the original footage into fragment objects with independent identifiers;

[0123] The metadata generation module is used to generate structured metadata for fragment objects;

[0124] The hierarchical organization module is used to assign fragment objects to the corresponding context hierarchy;

[0125] The sorting and conflict resolution module is used to sort fragment objects and eliminate content conflicts;

[0126] The dynamic trimming module is used to trim non-critical segments under budget constraints;

[0127] The context object generation module is used to assemble the filtered fragments into runtime context objects.

[0128] Furthermore, the hierarchical organization module is configured to divide fragment objects into a fact layer, a task constraint layer, an expression reference layer, a case layer, and a restriction layer, with each layer having an independent priority and pruning strategy.

[0129] Budget constraints for the dynamic pruning module include at least one of the following: maximum number of tokens, maximum input length, maximum call cost, and system latency requirements.

[0130] like Figure 6 As shown, this embodiment provides a content generation context object processing device, including:

[0131] Memory, processor, and computer programs stored in memory and capable of running on the processor;

[0132] When the processor executes the program, it implements the aforementioned context object assembly method for content generation.

[0133] In addition, such as Figure 7 As shown, this embodiment also provides a computer-readable storage medium (i.e., a memory module) storing a computer program thereon, which, when executed by a processor, is used to implement the above-described method for assembling context objects for content generation.

[0134] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope described in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for assembling context objects for content generation, characterized in that, Includes the following steps: Access at least two types of heterogeneous material sources to obtain the original materials; The original material is converted into multiple fragment objects according to a preset segmentation rule, and each fragment object has an independent identifier. Generate structured metadata for each fragment object, including credibility, task relevance, budget weight, and its hierarchy; Based on preset hierarchical rules, the fragment objects are assigned to at least one of the following layers: fact layer, task constraint layer, expression reference layer, case layer, and restriction layer. The fragment objects are sorted according to the task objectives and fragment metadata, and conflict resolution is completed according to the conflict resolution rules. Perform dynamic cropping on sorted fragment objects under preset budget constraints; The clipped fragment objects are assembled in the order of assembly to generate a runtime context object that can be directly called by the content generation model.

2. The method for assembling context objects for content generation according to claim 1, characterized in that, The heterogeneous material source is obtained in the following ways: At least two types of data are obtained from the user's current input, historical interactions, knowledge base documents, case documents, style reference texts, external search results, rule constraint documents, and intermediate results generated by the system.

3. The method for assembling context objects for content generation according to claim 1, characterized in that, The method for processing the fragment object includes the following steps: Text-based materials are segmented by paragraphs, sentence groups, or semantic blocks; Rule-based materials are segmented according to rule entries; Table-type data is segmented by rows, columns, or logical units; Case study materials are divided into case study units or structural segments.

4. The method for assembling context objects for content generation according to claim 1, characterized in that, The conflict resolution method includes the following approaches: When factual content conflicts, prioritize retaining the more credible segment; When the credibility is similar, prioritize retaining the update time segment; When rule constraints conflict with case descriptions, the rule constraint portion should be retained first. When there is a conflict between mission-specific materials and general materials, mission-specific materials will be retained first.

5. The method for assembling context objects for content generation according to claim 1, characterized in that, The dynamic cropping is processed according to priority as follows: Prioritize retaining core factual layer fragments and task constraint layer fragments; When budget is limited, prioritize cutting low-relevance segments from the case study layer; The high-priority restriction layer forces the retention of content.

6. A context object assembly apparatus for content generation, configured to perform the context object assembly method for content generation according to any one of claims 1-5, characterized in that, include: The material access module is used to access at least two types of heterogeneous material sources and obtain the original materials. The fragmentation module is used to divide the original footage into fragment objects with independent identifiers; The metadata generation module is used to generate structured metadata for fragment objects; The hierarchical organization module is used to assign fragment objects to the corresponding context hierarchy; The sorting and conflict resolution module is used to sort fragment objects and eliminate content conflicts; The dynamic trimming module is used to trim non-critical segments under budget constraints; The context object generation module is used to assemble the filtered fragments into runtime context objects.

7. The context object assembly apparatus for content generation according to claim 6, characterized in that, The hierarchical organization module is configured to divide fragment objects into a fact layer, a task constraint layer, an expression reference layer, a case layer, and a restriction layer, with each layer having an independent priority and pruning strategy.

8. The context object assembly apparatus for content generation according to claim 6, characterized in that, The budget constraints of the dynamic pruning module include at least one of the following: a maximum number of tokens, a maximum input length, a maximum call cost, and a system latency requirement.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it is used to implement the context object assembly method for content generation according to any one of claims 1-5.

10. A content generation context object processing device, characterized in that, include: Memory, processor, and computer program stored in the memory and executable on the processor; When the processor executes the program, it implements the context object assembly method for content generation according to any one of claims 1-5.