Role and scene consistency alignment method
By building a structured character and scene setting library and combining it with a large language model and version number system, we solved the problem of character and scene consistency in the large language model when processing ultra-long texts, achieved efficient alignment and dynamic updating of information across chapters, and improved the coherence and logic of the adaptation.
Patent Information
- Application Number
- CN202510970105.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-09-12
AI Technical Summary
Large language models face context window limitations when processing extremely long texts, resulting in information fragmentation and difficulty in maintaining long-term consistency between characters and scene environments. The lack of efficient structured mechanisms to support cross-chapter alignment leads to inconsistencies and information loss in the adaptation results.
Build a structured character setting library and scene setting library, use a large language model for scanning and analysis, combine semantic similarity calculations, perform consistent references, local updates, and new entity management, and ensure information consistency and updatability through a version number system.
Significantly improve cross-chapter consistency, break through context length limitations, achieve dynamic evolution support, improve adaptation quality and reliability, reduce manual maintenance costs, and provide a structured knowledge representation foundation.
Smart Images

Figure CN120633658A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of film and television production, and in particular to a method for aligning consistency between characters and scenes. Background Art
[0002] Large language models (LLMs) perform well when processing short texts, but face a core challenge when processing very long texts (such as online novels): the inherent context window limitations of LLMs prevent them from processing the entire text at once, resulting in information fragmentation. This fragmentation is particularly severe in tasks that require maintaining long-term consistency, such as script adaptation, and is manifested in the following ways:
[0003] It is difficult to accurately extract the key characters and their attributes, scene environments and their characteristics involved in a single chapter.
[0004] It is difficult to effectively ensure that character attributes (such as personality, abilities, status, relationships) and scene characteristics (such as location, time, atmosphere) remain consistent within a chapter, between adjacent chapters, and across non-continuous chapters.
[0005] The lack of an efficient and reliable structured mechanism to support the dynamic extraction, update, version control and cross-chapter alignment of entity information throughout very long texts makes the adaptation results prone to inconsistencies, information loss or delayed updates.
[0006] Therefore, it is necessary to provide a method for aligning the consistency of characters and scenes to ensure the high consistency and updatability of characters and scene environments when processing very long texts in chapters. Summary of the Invention
[0007] The purpose of the present invention is to provide a method for aligning the consistency of characters and scenes, which is used to ensure the high consistency and updatability of characters and scene environments when processing ultra-long texts in chapters.
[0008] In order to solve the problems existing in the prior art, the present invention provides a method for aligning the consistency of a character and a scene, comprising the following steps:
[0009] Build a structured character setting library, which uses a predefined structured format to store global character information;
[0010] Build a structured scene setting library, which uses a predefined structured format to store global scene information;
[0011] Input the content of the current chapter, use the large language model, follow the predefined structured format of the character setting library and scene setting library, scan and analyze the content of the current chapter to identify the character list and scene list;
[0012] Input the character list and the scene list, and perform a search in the character setting library and the scene setting library based on semantic similarity calculation to obtain candidate character settings and candidate scene settings that are most relevant to the current chapter content and already exist in the knowledge base;
[0013] Input the content of the current chapter, candidate character settings, and candidate scene settings, use the large language model for refined extraction, perform consistent references, local updates, and add new entities, and output the final confirmed character list and scene list for the current chapter. Each entity is accompanied by its processing status and corresponding information.
[0014] Optionally, in the method for aligning the consistency of the character and the scene, the consistency reference is as follows:
[0015] If the candidate character setting and candidate scene setting are completely applicable to the current chapter and do not require any modification, the large language model outputs the name of the entity and leaves the description field empty, indicating that the existing version information in the knowledge base is directly used.
[0016] Optionally, in the character and scene consistency alignment method, the local update is as follows:
[0017] If the current section content reveals new states, attributes, relationships, and / or details about the entity, the large language model outputs the name of the entity and provides a clear and structured description field containing only new or changed information.
[0018] Optionally, in the method for aligning the consistency of the character and the scene,
[0019] Based on the newly added or changed information, the system will create and store a new version containing the new information for the entity in the knowledge base. The new version will update the version number and corresponding fields in the structured information of the corresponding knowledge base.
[0020] Optionally, in the method for aligning the consistency between the character and the scene, the following entities are added:
[0021] If the current chapter introduces a completely new character or scene that does not exist in the global knowledge base, the large language model will fully output the name and structured description of the entity.
[0022] Optionally, in the method for aligning the consistency of the character and the scene,
[0023] The system adds the name and structured complete description of the entity as the initial version to the structured information of the corresponding knowledge base.
[0024] Optionally, in the method for aligning the consistency of the character and the scene,
[0025] The processing states attached to the entity include consistent reference, partial update and new entity, and the corresponding information attached to the entity includes empty description, updated description and complete description.
[0026] Compared with the prior art, the present invention has the following advantages:
[0027] (1) Significantly improve cross-chapter consistency: By using a structured knowledge base as "external memory" and a strict version management mechanism, the problem of strong consistency of character attributes (personality, ability, status, relationship) and scene features within the chapter, between adjacent chapters, and across non-continuous chapters is effectively solved, significantly reducing inconsistencies.
[0028] (2) Breaking through the context length limitation: Using an external knowledge base to store and retrieve global entity information enables the large language model to focus on local processing of the current chapter, effectively overcoming the bottleneck of the large language model's native context window in processing ultra-long texts.
[0029] (3) Support for dynamic evolution: A clear “local update” mechanism and version number system can accurately capture, record, and disseminate the dynamic changes in character status and scene details as the plot progresses, ensuring that the knowledge base status is synchronized with the story development in real time.
[0030] (4) Improve the quality and reliability of adaptation: Provide highly accurate, consistent and up-to-date basic information about characters and scenes for subsequent automated script adaptation steps (such as dialogue generation, plot arrangement, and storyboard design), greatly improving the overall coherence, logic and credibility of the final generated content.
[0031] (5) Reduce manual maintenance costs: The automated and structured extraction, update, and alignment process significantly reduces the manual verification and correction work required to maintain consistency during the adaptation of long texts.
[0032] (6) Advantages of structured processing: Structured knowledge representation and update mechanisms lay a solid foundation for more complex automated processing (such as relational reasoning and conflict detection). BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A flowchart of an alignment method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0034] The following is a more detailed description of the specific embodiments of the present invention with reference to schematic diagrams. The advantages and features of the present invention will become more apparent from the following description. It should be noted that the drawings are greatly simplified and not to exact scale, and are only used for the purpose of conveniently and clearly illustrating the embodiments of the present invention.
[0035] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like to indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0036] Hereinafter, if the method described herein includes a series of steps, the order in which the steps are presented herein is not necessarily the only order in which the steps may be performed, and some of the steps described may be omitted and / or some other steps not described herein may be added to the method.
[0037] In existing technologies, large language models (LLMs) perform well in processing short texts, but face core challenges when processing extremely long texts (such as online novels): the inherent context window limitation of LLMs makes it impossible to process the entire text at once, resulting in information fragmentation.
[0038] In order to solve the problems existing in the prior art, the present invention provides a method for aligning the consistency of characters and scenes, such as Figure 1 As shown, the method includes the following steps:
[0039] S1: Build a structured character setting library. The structured character setting library uses a predefined structured format to store global character information.
[0040] In one embodiment, the character settings are as follows:
[0041] {
[0042] "Name":"Zhang San",
[0043] "Gender":"Male",
[0044] "Current Version": "v001201203", / / Core: uniquely identifies the version number of the state snapshot;
[0045] "Level":"Golden Immortal",
[0046] "Affiliated faction": "Pukomon",
[0047] "Core background story":"xxx",
[0048] "Key Relationship": ["Li Si (ally)"],
[0049] "Recent important status / event": "Injured in chapter XX" / / Optional, auxiliary search
[0050] };
[0051] S2: Build a structured scene setting library, which uses a predefined structured format to store global scene information;
[0052] In one embodiment, the scenario is set as follows:
[0053] {
[0054] "Scene Name": "Qingyun Mountain Peak",
[0055] "Geographic location": "Main peak of Qingyun Mountain Range",
[0056] "Current Version": "v001201205",
[0057] "Main features": ["Snow all year round", "Rich spiritual energy"],
[0058] "Related forces": ["Qingyun Sect"],
[0059] "Important historical event": "The site of the decisive battle between good and evil a hundred years ago"
[0060] }
[0061] S3: Input the content of the current chapter, use the optimized / prompted large language model, strictly follow the predefined structured format of the character setting library and scene setting library, scan and analyze the content of the current chapter to identify the character list (including the key attribute fragments mentioned in this chapter) and the scene list (including the key feature fragments mentioned in this chapter); this step focuses on identifying the entities that appear in this chapter and their basic information in the context of this chapter.
[0062] S4: Input the character list and scene list, and based on semantic similarity calculation (e.g., using an embedded vector model to calculate cosine similarity, or using LLM to determine relevance), search the globally maintained character setting library and scene setting library to obtain candidate character settings and scene settings that are most relevant to the current chapter content and already exist in the knowledge base (including their complete structured information and current version number). This step associates the current chapter content with the global context of the work (stored in the knowledge base).
[0063] S5: Input the current chapter's content, candidate character settings, and candidate scene settings (including complete structure and version information). Use the optimized / prompted large language model for refined extraction, perform consistent references, partial updates, and new entities. Output the final confirmed character and scene lists for the current chapter. Each entity is accompanied by its processing status and corresponding information, as well as structured information that needs to be updated (generated a new version) or added to the knowledge base. The entity-related processing status includes consistent references, partial updates, and new entities, and the entity-related information includes empty descriptions, updated descriptions, and complete descriptions.
[0064] (1) The consistency citation is as follows:
[0065] If the candidate character setting and candidate scene setting are completely applicable to the current chapter and do not require any modification, the large language model outputs the name of the entity and leaves the description field empty (or marked as "referenced from library vXXX"), indicating that the existing version information in the knowledge base is directly used.
[0066] (2) Partial updates are as follows:
[0067] If the current section reveals new states, attributes, relationships, and / or details about the entity (but its core identity remains unchanged), the large language model outputs the entity's name and provides a clear, structured description containing only the newly added or changed information (with the update points clearly marked). Based on the newly added or changed information, the system creates and stores a new version of the entity in the knowledge base (e.g., v001201203 becomes v001201204) containing the new information. The new version will update the version number and corresponding fields in the structured information of the corresponding knowledge base.
[0068] (3) New entities are added as follows:
[0069] If the current chapter introduces a completely new character or scene that does not exist in the global knowledge base, the large language model will fully output the entity's name and structured description. The system will add the entity's name and structured description as the initial version (such as v001201206) to the structured information of the corresponding knowledge base.
[0070] The present invention proposes a role and scene consistency alignment method based on a large language model and a structured knowledge base, which is used to ensure the high consistency and updatability of character roles and scene environments when processing ultra-long texts in chapters.
[0071] In summary, the present invention has the following advantages compared with the prior art:
[0072] (1) Significantly improve cross-chapter consistency: By using a structured knowledge base as "external memory" and a strict version management mechanism, the problem of strong consistency of character attributes (personality, ability, status, relationship) and scene features within the chapter, between adjacent chapters, and across non-continuous chapters is effectively solved, significantly reducing inconsistencies.
[0073] (2) Breaking through the context length limitation: Using an external knowledge base to store and retrieve global entity information enables the large language model to focus on local processing of the current chapter, effectively overcoming the bottleneck of the large language model's native context window in processing ultra-long texts.
[0074] (3) Support for dynamic evolution: A clear “local update” mechanism and version number system can accurately capture, record, and disseminate the dynamic changes in character status and scene details as the plot progresses, ensuring that the knowledge base status is synchronized with the story development in real time.
[0075] (4) Improve the quality and reliability of adaptation: Provide highly accurate, consistent and up-to-date basic information about characters and scenes for subsequent automated script adaptation steps (such as dialogue generation, plot arrangement, and storyboard design), greatly improving the overall coherence, logic and credibility of the final generated content.
[0076] (5) Reduce manual maintenance costs: The automated and structured extraction, update, and alignment process significantly reduces the manual verification and correction work required to maintain consistency during the adaptation of long texts.
[0077] (6) Advantages of structured processing: Structured knowledge representation and update mechanisms lay a solid foundation for more complex automated processing (such as relational reasoning and conflict detection).
[0078] The above description is merely a preferred embodiment of the present invention and does not limit the present invention in any way. Any person skilled in the art who, without departing from the scope of the present invention, makes any equivalent substitution, modification, or other changes to the technical solution and technical content disclosed in the present invention shall be deemed to be within the scope of the present invention and still fall within the scope of protection of the present invention.
Claims
1. A method for aligning consistency between a character and a scene, characterized in that: The following steps are involved: Build a structured character setting library, which uses a predefined structured format to store global character information; Build a structured scene setting library, which uses a predefined structured format to store global scene information; Input the content of the current chapter, use the large language model, follow the predefined structured format of the character setting library and scene setting library, scan and analyze the content of the current chapter to identify the character list and scene list; Input the character list and the scene list, and perform a search in the character setting library and the scene setting library based on semantic similarity calculation to obtain candidate character settings and candidate scene settings that are most relevant to the current chapter content and already exist in the knowledge base; Input the content of the current chapter, candidate character settings, and candidate scene settings, use the large language model for refined extraction, perform consistent references, local updates, and add new entities, and output the final confirmed character list and scene list for the current chapter. Each entity is accompanied by its processing status and corresponding information.
2. The method for aligning the consistency of a character and a scene according to claim 1, wherein: The conformance citation is as follows: If the candidate character setting and candidate scene setting are completely applicable to the current chapter and do not require any modification, the large language model outputs the name of the entity and leaves the description field empty, indicating that the existing version information in the knowledge base is directly used.
3. The method for aligning the consistency of a character and a scene according to claim 2, wherein: The local updates are as follows: If the current section content reveals new states, attributes, relationships, and / or details about the entity, the large language model outputs the name of the entity and provides a clear and structured description field containing only new or changed information.
4. The method for aligning the consistency of a character and a scene according to claim 3, wherein: Based on the newly added or changed information, the system will create and store a new version containing the new information for the entity in the knowledge base. The new version will update the version number and corresponding fields in the structured information of the corresponding knowledge base.
5. The method for aligning the consistency of a character and a scene according to claim 4, wherein: The following entities are newly added: If the current chapter introduces a completely new character or scene that does not exist in the global knowledge base, the large language model will fully output the name and structured description of the entity.
6. The method for aligning the consistency of a character and a scene according to claim 5, wherein: The system adds the name and structured complete description of the entity as the initial version to the structured information of the corresponding knowledge base.
7. The method for aligning the consistency of a character and a scene according to claim 6, wherein: The processing states attached to the entity include consistent reference, partial update and new entity, and the corresponding information attached to the entity includes empty description, updated description and complete description.