A multi-stage AI generated content consistency maintenance method and system based on an event-driven architecture

CN122797518APending Publication Date: 2026-09-22UNICOM WOYUEDU TECH CULTURE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611284312.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-24
Publication Date
2026-09-22

AI Technical Summary

Technical Problem

[0005]有鉴于此,本申请的目的在于提供一种基于事件驱动架构的多阶段AI生成内容一致性维护方法及系统,以改善现有技术中存在的多阶段AI生成内容模块间变更传导断裂、一致性维护依赖人工排查的技术问题

Benefits of technology

本申请提供的基于事件驱动架构的多阶段AI生成内容一致性维护方法及系统,首先,通过构建跨模块数据对象之间的依赖关系图谱,实现了数据对象间引用关系的系统化管理;其次,通过响应于检测到上游数据对象的变更,基于正向索引递归计算受影响的下游数据对象的影响闭包,实现了变更影响范围的自动分析;然后,通过生成语义影响分析事件,实现了变更信息的结构化传递;之后,通过为受影响对象列表中的每个数据对象维护一致性状态标记,实现了细粒度的变更管理;最后,通过响应于用户确认更新,基于上下文锁定策略对状态为SOURCE_CHANGED的数据对象进行局部重生成,并对局部重生成的结果执行一致性校验,实现了上下文感知的局部更新。基于上述内容,由于引入了事件驱动架构和依赖关系图谱,使得上游数据变更能够被下游模块主动感知,如此,可以自动分析变更影响范围并标记受影响内容,进而能够仅对受影响局部进行精细化更新,从而改善了现有技术中存在的多阶段AI生成内容模块间变更传导断裂、一致性维护依赖人工排查的技术问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122797518A_ABST
    Figure CN122797518A_ABST
Patent Text Reader

Abstract

The application provides a multi-stage AI generated content consistency maintenance method and system based on an event-driven architecture, and relates to the technical field of artificial intelligence. The method constructs a dependency graph between cross-module data objects, including a forward index and a reverse index; when a change in an upstream data object is detected, the influence closure of affected downstream objects is calculated recursively based on the forward index, and a semantic influence analysis event containing an affected object list is generated; a consistency state flag is maintained for each object, including CLEAN, SOURCE_CHANGED, UPDATING and CONFLICT; in response to user confirmation of an update, the objects in the SOURCE_CHANGED state are locally regenerated according to a context locking strategy, and consistency verification is performed, thereby improving the problem of change transmission fracture between multi-stage AI generated content modules and the problem of consistency maintenance relying on manual investigation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method and system for maintaining consistency of multi-stage AI-generated content based on an event-driven architecture. Background Technology

[0002] With the rapid iteration of large language model technology, AI-assisted long text creation systems have been widely explored and applied in industry and academia. Currently, AI-assisted long text creation systems generally adopt a "staged generation" strategy, breaking down the complex creation task into multiple stages such as creative setting, structural planning, and text generation, each handled by different functional modules.

[0003] In existing technologies, multi-stage AI generation systems based on sequential pipelines are the most common technical solutions. The architecture of such systems is characterized by a typical "request-response" pattern, where data relationships between modules are static and unidirectional. For example, the outline module references content from the beat table corresponding to a beat, and the script module references content from the outline corresponding to a scene. However, this referencing typically exists in the form of text embeddings, lacking the ability to proactively detect changes to the referenced source data. When upstream data objects are modified during later creation processes, downstream modules cannot proactively detect the change; users must manually recall and determine which downstream content was affected and check them one by one. In long text creation, this reliance on manual methods is highly prone to omissions, leading to inconsistencies such as plot contradictions and character behavior.

[0004] In other words, existing technologies suffer from technical problems such as broken transmission of changes between multi-stage AI-generated content modules and reliance on manual checks for consistency maintenance. Summary of the Invention

[0005] In view of this, the purpose of this application is to provide a method and system for maintaining the consistency of multi-stage AI-generated content based on an event-driven architecture, so as to improve the technical problems of broken change transmission between multi-stage AI-generated content modules and the reliance on manual inspection for consistency maintenance in the prior art.

[0006] To achieve the above objectives, this application adopts the following technical solution: A multi-stage AI-generated content consistency maintenance method based on an event-driven architecture includes: constructing a dependency graph between cross-module data objects, the dependency graph including a forward index and a reverse index; in response to detecting a change in an upstream data object, recursively calculating the impact closure of the affected downstream data objects based on the forward index; generating a semantic impact analysis event, the event including a list of affected objects in the impact closure; maintaining a consistency state marker for each data object in the list of affected objects, the state marker including CLEAN, SOURCE_CHANGED, UPDATING, and CONFLICT; in response to user confirmation of update, locally regenerating the data object with the state SOURCE_CHANGED based on a context locking strategy, and performing consistency verification on the result of the local regeneration.

[0007] In a preferred embodiment of this application, the step of constructing a dependency graph between cross-module data objects in the above method includes: maintaining a forward index and a reverse index in the form of an adjacency list, wherein the forward index uses any data object identifier as the key to store a list of all downstream data object identifiers that reference the data object; and the reverse index uses any data object identifier as the key to store a list of all upstream data object identifiers that the data object references.

[0008] In a preferred embodiment of this application, the method described above calculates the impact closure as follows: starting from the upstream data object that has changed, recursively traverse all reachable downstream nodes along the forward index. During the traversal, nodes that have already been added to the impact closure are not traversed again until no new nodes are added.

[0009] In a preferred embodiment of this application, the semantic impact analysis event in the above method further includes a change source object identifier, change field details, and a description of the impact cause; the event is asynchronously broadcast to downstream modules via an event bus in a publish-subscribe mode.

[0010] In a preferred embodiment of this application, the transition rules for the consistency state marker in the above method include: when an upstream change event is received, the state switches from CLEAN to SOURCE_CHANGED; when the user confirms the update, the state switches from SOURCE_CHANGED to UPDATING; when the user retains the original content, the state switches back from SOURCE_CHANGED to CLEAN; when local regeneration is completed and verification passes, the state switches from UPDATING to CLEAN; when verification fails, the state switches from UPDATING to CONFLICT; and when the user manually resolves the conflict, the state reverts from CONFLICT back to CLEAN.

[0011] In a preferred embodiment of this application, the context locking strategy in the above method includes: constructing positive constraints derived from the updated upstream data object; constructing negative constraints derived from content adjacent to the current data object and in a CLEAN state; assembling the positive constraints, the negative constraints, and the format constraints into a prompt word; and calling a large language model to perform local regeneration.

[0012] In a preferred embodiment of this application, the consistency verification in the above method includes at least one of the following rules: reference validity check, which checks whether the entity identifier of the set referenced in the regenerated content is valid; role state consistency check, which checks whether the role behavior in the regenerated content contradicts the role attributes in the set; temporal consistency check, which checks whether the temporal logic of the regenerated content is consistent with the set number constraint of the upstream beat table; and adjacent content coherence assessment, which sends the regenerated content and adjacent unchanged content to the language model to obtain a coherence score, and marks it as a verification failure when the score is lower than a preset threshold.

[0013] This application also provides a multi-stage AI-generated content consistency maintenance system based on an event-driven architecture, comprising: a dependency graph management module for constructing a dependency graph between cross-module data objects, the dependency graph including a forward index and a reverse index; an event listening and change capture module for recursively calculating the impact closure of affected downstream data objects based on the forward index in response to detecting changes in upstream data objects, and generating a semantic impact analysis event, the event including a list of affected objects in the impact closure; an event processing and consistency state management module for maintaining a consistency state marker for each data object in the list of affected objects, the state marker including CLEAN, SOURCE_CHANGED, UPDATING, and CONFLICT; a local regeneration engine module for performing local regeneration of data objects with a state of SOURCE_CHANGED based on a context locking strategy in response to user confirmation of updates; and a consistency verification module for performing consistency verification on the results of the local regeneration.

[0014] Based on the above, this application also provides an electronic device, including: a memory for storing a computer program; and a processor connected to the memory for executing the computer program stored in the memory to implement the above-described method.

[0015] Based on the above, this application also provides a computer-readable storage medium storing a computer program, which executes the various steps of the above-described method when it runs.

[0016] Beneficial effects: This application provides a multi-stage AI-generated content consistency maintenance method and system based on an event-driven architecture. First, it achieves systematic management of reference relationships between data objects by constructing a dependency graph between data objects across modules. Second, it automatically analyzes the scope of change impact by recursively calculating the impact closure of affected downstream data objects based on a forward index in response to detected changes in upstream data objects. Then, it achieves structured transmission of change information by generating semantic impact analysis events. Next, it achieves fine-grained change management by maintaining a consistency status marker for each data object in the affected object list. Finally, it achieves context-aware local updates by partially regenerating data objects with a SOURCE_CHANGED status based on a context-locking strategy in response to user confirmation of updates and performing consistency checks on the results of the partial regeneration. Based on the above, the introduction of an event-driven architecture and dependency graph enables downstream modules to proactively perceive upstream data changes. This allows for automatic analysis of the scope of change impact and marking of affected content, enabling refined updates only to the affected areas. This improves upon the technical problems of broken change propagation between multi-stage AI-generated content modules and reliance on manual investigation for consistency maintenance in existing technologies. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.

[0018] Figure 1 A structural block diagram of an electronic device provided in an embodiment of this application.

[0019] Figure 2 This is a flowchart illustrating the multi-stage AI-generated content consistency maintenance method based on an event-driven architecture, as provided in an embodiment of this application.

[0020] Figure 3 A block diagram illustrating a multi-stage AI-generated content consistency maintenance system based on an event-driven architecture, as provided in an embodiment of this application. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0022] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0023] like Figure 1 As shown in the illustration, this application provides an electronic device. The electronic device may include a memory and a processor. The memory stores a computer program, and the processor executes the computer program stored in the memory to implement the multi-stage AI-generated content consistency maintenance method based on an event-driven architecture provided in this application.

[0024] Optionally, the memory may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory, erasable read-only memory, electrically erasable read-only memory, etc.

[0025] Optionally, the processor may include at least one of a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic devices.

[0026] Understandable. Figure 1 The structure shown is for illustrative purposes only; the electronic device may also include components that are more advanced than those shown. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0027] Combination Figure 2 This application also provides a method for maintaining consistency of multi-stage AI-generated content based on an event-driven architecture, applicable to the aforementioned electronic devices. The following will discuss... Figure 2 The specific process shown will be explained in detail.

[0028] S1, construct a dependency graph between cross-module data objects, the dependency graph including forward index and reverse index.

[0029] In this embodiment, before performing multi-stage AI generation, the system first constructs a dependency graph covering the data objects of each module. This graph forms the foundation of the entire event-driven architecture, providing a traversable data structure for subsequent impact analysis.

[0030] For example, the core data objects of each module in the system include setting entities, beat table entries, outline entries, and script segments. The setting entity contains a globally unique identifier, entity type, and a set of attribute fields; the beat table entry contains beat number, beat name, starting episode number, ending episode number, and beat description; the outline entry contains its beat identifier, episode number, outline content, and a list of associated setting entity identifiers; and the script segment contains its outline entry identifier, scene number, scene title, action description, and dialogue list. The data flow is from setting to beat table, beat table to outline, and outline to script.

[0031] The system maintains two query indexes in the form of adjacency lists. The forward index records which downstream objects reference each upstream data object; the key is the data object identifier, and the value is a list of all downstream object identifiers referencing that identifier, used to quickly trace the scope of changes from upstream to downstream. The reverse index records which upstream objects each downstream data object references; the key is the data object identifier, and the value is a list of all upstream object identifiers referenced by that object, used to trace the source of dependencies from downstream to upstream. When a data object is created, modified, or deleted, the system automatically and incrementally updates these two index tables without requiring a full rebuild.

[0032] S2, in response to detecting a change in an upstream data object, recursively calculate the impact closure of the affected downstream data object based on the forward index.

[0033] In this embodiment, when any data object x in the system is modified, its impact closure I(x) is defined as the set of all downstream nodes reachable by recursively traversing the forward index from x. The calculation formula is as follows: ; ; when The recursion terminates at this time. Here, F(id) represents the list of downstream object identifiers corresponding to the identifier id in the forward index. This closure precisely identifies the range of all downstream data objects affected by upstream changes.

[0034] S3, Generate a semantic impact analysis event, the event including a list of affected objects in the impact closure.

[0035] In this embodiment, the system introduces an event bus between modules as an asynchronous communication infrastructure for change notifications between modules. The event bus adopts a publish-subscribe pattern, where any module can act as a publisher to publish events to the event bus or register callback handling functions for specific event types as a subscriber. The event bus asynchronously pushes events to all modules that have subscribed to the corresponding event type, and change notifications do not block ongoing editing operations by the user.

[0036] The semantic impact analysis event object contains the following core fields: sourceId (identifier of the upstream data object that has changed), sourceType (type of the upstream data object, with values ​​of beat, outline, or setting), changedFields (list of changed fields, each containing the field name, old value, and new value), impactedItems (list of identifiers of affected downstream objects calculated by the impact closure algorithm), impactReason (text describing the impact reason, automatically generated by the system based on the changed fields and the impact path), and timestamp (event generation timestamp).

[0037] The trigger condition for change detection is: when the value of any field of data object x changes, and the forward index of x is not null (i.e., a downstream object references x), the event generation and broadcast process is triggered. If the changed object has no downstream references, no event needs to be generated, and the process ends directly.

[0038] For example, if a user changes the ending episode number of a beat item from episode 5 to episode 6 in the beat table module: the beat table module detects that the field value has changed from 5 to 6; it searches the positive index, calculates the impact closure, and identifies all outline items that reference this beat and the script paragraphs that further reference these outlines; the system generates an event object, where changedFields contains the field name, old value, and new value, and impactedItems is a list of all object identifiers in the impact closure; the event object is asynchronously pushed to the outline module and script module via the event bus.

[0039] S4, maintain a consistency status flag for each data object in the list of affected objects, the status flag including CLEAN, SOURCE_CHANGED, UPDATING, and CONFLICT.

[0040] In this embodiment, the system maintains a consistency state marker for each data object that can be referenced downstream. The state space contains four states: CLEAN indicates that the data object is consistent with all upstream constraints; SOURCE_CHANGED indicates that the upstream data it depends on has changed and the object needs to be updated; UPDATING indicates that a partial regeneration is being performed based on the new constraints; and CONFLICT indicates that the verification failed after regeneration and manual intervention is required.

[0041] State transitions follow the rules of a finite state machine. The initial state is CLEAN. When the event bus pushes a change event affecting this object, the state transitions from CLEAN to SOURCE_CHANGED, and the system simultaneously records transition metadata: the source object identifier, the change timestamp, and the impact chain path. After the user clicks the synchronize update button, the state transitions from SOURCE_CHANGED to UPDATING, and a partial regeneration process is initiated. If the user chooses not to update, the state transitions back from SOURCE_CHANGED to CLEAN. After the partial regeneration is completed and passes the consistency check, the state transitions back from UPDATING to CLEAN. If the consistency check fails after the partial regeneration, the state transitions from UPDATING to CONFLICT, and conflict details are output to the user interface. The user can manually revise the state to restore it from CONFLICT to CLEAN.

[0042] S5, in response to user confirmation of update, performs partial regeneration of data objects with state SOURCE_CHANGED based on context locking strategy, and performs consistency verification on the result of partial regeneration.

[0043] In this embodiment, when a user confirms a synchronous update of a data object with a state of SOURCE_CHANGED, the system does not perform a full regeneration, but instead regenerates only the affected local data based on a context locking strategy. The core idea is to model the regeneration problem as a constraint satisfaction problem: the regenerated content must simultaneously satisfy both positive and negative constraints.

[0044] Positive constraints are derived from the updated upstream data object. For example, if the beat entry changes the climax ending episode number from 5 to 6, then the positive constraint is that this episode must be a climax episode, end in episode 6, and must include the final showdown between character X and character Y.

[0045] Negative constraints are derived from content adjacent to the current object that is in a CLEAN state. Specifically, if regenerating an outline entry, it searches for its immediate and next adjacent outline entries that are in a CLEAN state; if regenerating a script segment, it searches for its immediate and next adjacent script segments that are in a CLEAN state, as well as outline entries belonging to the same episode that are in a CLEAN state. For example, if the previous episode ends with the protagonist arriving at the port and the next episode begins with the protagonist infiltrating the enemy camp, the negative constraint is that the regenerated content must not contain plot points that contradict these two anchor points.

[0046] Formatting constraints are defined by the formatting specifications of the module to which the current object belongs. For example, the script module requires the output of standard fields such as scene titles, action descriptions, and dialogue.

[0047] The positive constraints, negative constraints, formatting specifications, and existing text are assembled into a complete AI prompt word according to a preset template. A large language model is then invoked to perform regeneration, with parameters configured to use a GPT-4o or equivalent large language model, and temperature parameters. Maximum number of output tokens .

[0048] The regenerated result is temporarily stored in the draft field, awaiting consistency verification.

[0049] When the impact of an upstream change spans multiple downstream levels, the system executes updates sequentially according to the topological order of the dependency graph: first, the updates and verifications of the direct dependency layers are completed, and after the state of the direct dependency layers is restored to CLEAN, the updates of the indirect dependency layers are then executed.

[0050] After partial regeneration is complete, the system automatically performs consistency checks. The checks include reference validity checks, role state consistency checks, temporal consistency checks, and adjacent content coherence assessments. The reference validity check verifies whether the entity identifiers referenced in the regenerated content are still valid. The role state consistency check verifies whether the role behaviors and states in the newly generated content contradict the latest attributes of that role in the set. The temporal consistency check verifies whether the temporal logic of the newly generated content is consistent with the set number constraints of the upstream beat table. The adjacent content coherence assessment sends the regenerated content and adjacent unchanged content to the large language model to obtain a coherence score from 0 to 100. A score below a preset threshold (default 70) is marked as a verification failure.

[0051] When all rules pass, the regenerated content is written to the official data store, overwriting the original content. The reference record of the data object to the upstream data in the inverted index is updated, and the status changes from UPDATING to CLEAN. When any rule fails, the status changes from UPDATING to CONFLICT, and a conflict details panel is displayed in the user interface. The panel includes the conflict type, a detailed description, and suggested manual handling directions. The status is restored to CLEAN after the user manually modifies the rules.

[0052] The system provides a unified creation interface with a three-column layout. The left column is the settings and beat table management area, displaying all settings and beat entries in a tree-like list. It supports expanding, collapsing, and editing, with different colored status icons next to each entry indicating its consistency status. The middle column is the main creation and preview area, displaying the content of the currently selected module. Affected entries are highlighted in yellow with the SOURCE_CHANGED status. The editor supports direct editing, and the editing function is automatically disabled when the module is in UPDATING state. The right column is the dependency and impact analysis panel. When a data object is selected, it dynamically displays the object's forward dependency tree and backward reference chain, with different colors distinguishing the consistency status of each object.

[0053] The system supports two modes: item-by-item review and batch update. In item-by-item review mode, users view the affected items in the impact analysis panel one by one, and click the "Synchronize Update" button for each item individually. The system then performs a local regeneration and verification process for that item. In batch update mode, users click the "Synchronize Update All" button, and the system performs regeneration and verification on all objects marked with "SOURCE_CHANGED" in the dependency graph topology order. If any data object fails verification and enters the CONFLICT state, the updates of downstream data objects will be executed only after the data object's state returns to CLEAN. After processing, a summary report is generated, listing the success or conflict results of each update.

[0054] Combination Figure 3 This application also provides a multi-stage AI-generated content consistency maintenance system based on an event-driven architecture, applicable to the aforementioned electronic devices. The device may include a dependency graph management module, an event listening and change capture module, an event processing and consistency state management module, a local regeneration engine module, and a consistency verification module.

[0055] A dependency graph management module is used to construct a dependency graph between cross-module data objects, wherein the dependency graph includes forward and reverse indexes. In this embodiment, the dependency graph management module can be used to execute... Figure 2 For details regarding the dependency graph management module shown in step S1, please refer to the previous description of step S1.

[0056] An event listening and change capture module is used to respond to the detection of a change in an upstream data object, recursively calculate the impact closure of the affected downstream data objects based on the forward index, and generate a semantic impact analysis event, wherein the event includes a list of affected objects in the impact closure. In this embodiment, the event listening and change capture module can be used to execute... Figure 2 For details regarding steps S2 and S3 shown, please refer to the previous description of steps S2 and S3 for information about the event listening and change capture module.

[0057] An event handling and consistency state management module is used to maintain a consistency state flag for each data object in the affected object list. The state flags include CLEAN, SOURCE_CHANGED, UPDATING, and CONFLICT. In this embodiment, the event handling and consistency state management module can be used to execute... Figure 2 For details regarding step S4, the relevant content of the event processing and consistency state management module can be found in the previous description of step S4.

[0058] A partial regeneration engine module is used to partially regenerate data objects with a state of SOURCE_CHANGED based on a context locking strategy in response to user confirmation of an update. In this embodiment, the partial regeneration engine module can be used to execute... Figure 2 The part about local regeneration in step S5 shown above, and the relevant content about the local regeneration engine module, can be found in the previous description of the local regeneration part in step S5.

[0059] A consistency verification module is used to perform consistency verification on the results of local regeneration. In this embodiment, the consistency verification module can be used to perform... Figure 2 The consistency verification part in step S5 shown above, and the relevant content about the consistency verification module can be found in the previous description of the consistency verification part in step S5.

[0060] In this embodiment of the application, corresponding to the method applied to the electronic device described above, a computer-readable storage medium is also provided. The computer-readable storage medium stores a computer program, which, when executed, performs the various steps of the above-described method. The specific steps performed by the computer program during execution are not repeated here, but can be found in the preceding explanation of the method.

[0061] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus and method embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0062] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0063] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks. It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0064] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for maintaining consistency of multi-stage AI-generated content based on an event-driven architecture, characterized in that, include: Construct a dependency graph between cross-module data objects, the dependency graph including forward indexes and reverse indexes; In response to the detection of a change in an upstream data object, the impact closure of the affected downstream data object is recursively calculated based on the forward index; Generate a semantic impact analysis event, the event including a list of affected objects in the impact closure; Maintain a consistency status flag for each data object in the list of affected objects, the status flag including CLEAN, SOURCE_CHANGED, UPDATING, and CONFLICT; In response to user confirmation of the update, the data object with the state SOURCE_CHANGED is partially regenerated based on the context locking strategy, and a consistency check is performed on the result of the partial regeneration.

2. The method according to claim 1, characterized in that, The steps for constructing a dependency graph between cross-module data objects include: The forward and reverse indexes are maintained in the form of an adjacency list. The forward index uses any data object identifier as the key and stores a list of all downstream data object identifiers that reference the data object. The reverse index uses any data object identifier as the key and stores a list of all upstream data object identifiers that reference the data object.

3. The method according to claim 1, characterized in that, The calculation method for the impact closure is as follows: starting from the upstream data object that has changed, recursively traverse all reachable downstream nodes along the forward index. During the traversal, nodes that have been added to the impact closure are not traversed again until no new nodes are added.

4. The method according to claim 1, characterized in that, The semantic impact analysis event also includes the change source object identifier, change field details, and description of the impact reason; the event is asynchronously broadcast to downstream modules through the event bus in a publish-subscribe mode.

5. The method according to claim 1, characterized in that, The transition rules for the consistency state markers include: When an upstream change event is received, the status changes from CLEAN to SOURCE_CHANGED; When the user confirms the update, the status changes from SOURCE_CHANGED to UPDATING; When the user keeps the original content, the status switches from SOURCE_CHANGED back to CLEAN; When the local regeneration is complete and the verification passes, the status changes from UPDATING to CLEAN; When the verification fails, the status changes from UPDATING to CONFLICT; When the user manually resolves the conflict, the state changes from CONFLICT to CLEAN.

6. The method according to claim 1, characterized in that, The context locking strategy includes: Construct positive constraints, which are derived from the updated upstream data object; Construct negative constraints, which are derived from the content adjacent to the current data object and in a CLEAN state; The positive constraints, negative constraints, and format constraints are assembled into prompt words, and the large language model is invoked to perform local regeneration.

7. The method according to claim 1, characterized in that, The consistency check includes at least one of the following rules: Reference validity check: Checks whether the set entity identifier referenced in the regenerated content is valid; Character state consistency check: Check whether the character behavior in the regenerated content is inconsistent with the character attributes in the setting set; Timing consistency check: Check whether the timing logic of the regenerated content is consistent with the set constraints of the upstream beat table; The coherence assessment of adjacent content involves sending the regenerated content and adjacent unchanged content to the language model to obtain a coherence score, and marking it as a verification failure when the score is lower than a preset threshold.

8. A multi-stage AI-generated content consistency maintenance system based on an event-driven architecture, characterized in that, include: The dependency graph management module is used to construct a dependency graph between data objects across modules. The dependency graph includes forward indexes and reverse indexes. The event listening and change capture module is used to respond to the detection of changes in upstream data objects, recursively calculate the impact closure of the affected downstream data objects based on the forward index, and generate a semantic impact analysis event, wherein the event includes a list of affected objects in the impact closure; The event handling and consistency state management module is used to maintain a consistency state flag for each data object in the list of affected objects. The status flags include CLEAN, SOURCE_CHANGED, UPDATING, and CONFLICT. The partial regeneration engine module is used to partially regenerate data objects with a state of SOURCE_CHANGED based on a context locking strategy in response to user confirmation of updates. The consistency verification module is used to perform consistency verification on the results of partial regeneration.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor connected to the memory is configured to execute a computer program stored in the memory to implement the method of any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, performs the method according to any one of claims 1 to 7.