System and method for automatic generation of interactive scripts and multimedia materials

By using a large language model-driven multi-stage asynchronous task scheduling and graph theory constraints, combined with incremental script expansion and semantic-level multimedia material generation, the defects in plot structure and the adaptability of multimedia materials in interactive script generation are solved, realizing the automated generation from idea to complete work, and improving generation efficiency and consistency.

CN122334278APending Publication Date: 2026-07-03SHANGHAI MENGYAN QINGYU INTELLIGENT TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI MENGYAN QINGYU INTELLIGENT TECHNOLOGY CO LTD
Filing Date
2026-04-28
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing technologies for interactive script generation suffer from several problems, including insufficient end-to-end generation capabilities, lack of strict constraints on plot structure, poor compatibility between multimedia materials and plot, inability to achieve end-to-end delivery from idea to complete work, and low availability of long-term task systems.

Method used

It adopts a multi-stage asynchronous task scheduling architecture driven by a large language model, combined with a directed acyclic graph structure post-processing method and incremental script expansion generation. It ensures the legality of the plot structure through graph theory constraints, and uses semantic-level prompt word optimization conversion technology and a dual-channel reference mechanism for actor and character images to achieve a high degree of matching between multimedia materials and plot.

Benefits of technology

It achieves end-to-end automated generation from creative description to complete interactive drama, solving problems such as lengthy creation process, high cost, flawed plot structure and inconsistent multimedia materials, and improving generation efficiency and content consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122334278A_ABST
    Figure CN122334278A_ABST
Patent Text Reader

Abstract

The application provides a one-key creation interactive script and multimedia material automatic generation system and method. The application starts a multi-stage asynchronous task scheduling method, sequentially executes a script generation and role modeling stage, a media generation stage, a meta information generation stage and a result assembly stage; in the script generation and role modeling stage, a structured branch script meeting graph theory constraints is generated by reading a creative description text, script roles are analyzed, and a cast data is established; in the media generation stage, the structured branch script and the cast data are read, and multimedia materials matching the plot semantics are generated by traversing each scene node; in the meta information generation stage, a work introduction and a cover picture are generated; in the result assembly stage, all generated contents are integrated, and a complete work is returned. The application realizes one-key automatic generation from creativity to complete work, and solves the technical problems of insufficient plot structure constraints and lack of visual coherence of multimedia materials.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent creation and automated content generation technology, specifically, it relates to an automated generation system and method for one-click creation of interactive scripts and multimedia materials. Background Technology

[0002] Currently, in the field of interactive script automatic generation, structured plot generation based on large language models is the core technology direction. However, most existing solutions are still in the "pure text script generation" stage, and generally suffer from problems such as insufficient end-to-end generation capabilities, lack of strict constraints on plot structure, lack of multimedia materials or poor compatibility between multimedia materials and plot.

[0003] Patent document CN121303094A discloses a "Method and System for Automatic Generation of 3D Scene Interactive Scripts Based on a Large Language Model." This method generates 3D scene interactive scripts through steps such as semantic parsing to extract character and event information, constructing a multi-character interaction graph, and verifying plot coherence, thus solving the problem of insufficient adaptability of traditional template-matching generation logic. However, this technology still has the following significant drawbacks: Firstly, it only generates script text and does not cover the automatic generation of multimedia materials, such as images or videos, or meta-information of the work, such as synopsis or cover. It requires additional manual collaboration to complete the production and integration of materials, and cannot achieve end-to-end delivery from idea to complete work, resulting in a fragmented creative process. Secondly, the optimization of the plot structure relies on the adjustment of node weights and the verification of continuity. Without the introduction of graph theory constraint mechanisms, it is difficult to avoid structural defects such as suspended nodes, unreachable scenes, and multiple starting points, which may lead to abnormal playback of interactive dramas. Third, there is a lack of incremental expansion solutions for long scripts. Due to the limitations of the large language model Token, it cannot meet the generation needs of large-scale scene nodes. Fourth, the linear process architecture is adopted, and no asynchronous task scheduling and failure isolation mechanism is set up. When facing long-running tasks such as multi-scenario generation, the system availability and execution efficiency are low.

[0004] Patent document CN118394926A discloses a method for automatically generating long scripts based on language model role-playing, including: assigning language models to different roles in the human creative process. Besides being considered as "authors," the language models also act as "editors," responsible for providing feedback and revision suggestions to the "authors." Furthermore, to enrich character portrayals and deepen the plot, the language models also act as "actors," allowing them to interact and communicate with each other within the story.

[0005] This solution is only designed for traditional linear script creation and lacks the branching plot generation capabilities required for interactive drama creation. It also does not use graph theory constraints to ensure the legality of the plot structure. Furthermore, it only supports plain text script output and does not involve the automated generation of any multimedia materials or meta-information of the work, making it impossible to achieve end-to-end delivery of the interactive drama work from concept to completion. In addition, it adopts a serial text generation process and does not set up asynchronous task scheduling and long-term task guarantee mechanisms, making it difficult to support the content generation needs of interactive dramas with multiple scenes and high time consumption.

[0006] This technical problem urgently needs to be solved. Summary of the Invention

[0007] In view of the shortcomings of the existing technology, the purpose of this invention is to provide an automated generation system and method for creating interactive scripts and multimedia materials with one click.

[0008] The present invention provides an automated method for one-click creation of interactive scripts and multimedia materials, comprising: Receive a creation request sent by the user, initialize the task state according to the creation request, start a multi-stage asynchronous task scheduling method, and execute the script generation and character modeling stage, media generation stage, meta-information generation stage and result assembly stage. In the script generation and character modeling stage, a structured branch script that satisfies graph theory constraints is generated based on the creative description text in the creation request, and the script characters are analyzed to establish cast list data; During the media generation stage, the structured branch script and cast list data are read, and multimedia materials that match the plot semantics are generated by traversing each scene node of the structured branch script. Furthermore, the character image information in the cast list data is used to ensure the visual consistency of the same character across scenes. In the meta-information generation stage, the structured branch script and cast list data are read to generate a work synopsis and cover image; In the result assembly stage, all generated content is integrated, and the complete work is returned.

[0009] Specifically, the media generation stage generates multimedia materials for each plot point in the script; the meta-information generation stage generates a synopsis and cover of the entire script, which are the basic information of the work. Therefore, there is no visual inconsistency between the two stages.

[0010] Preferably, in the script generation and character modeling stage, prompts containing creative descriptions and script structure constraints are input into a large language model to generate a structured branch script, and a directed acyclic graph post-processing is performed on the structured branch script; based on the processed script, a character list is extracted, and the model is called to generate standard image images of the characters to establish an actor list; The graph theory constraints include: the root node has an in-degree of zero, the out-degree of non-ending nodes is equal to a preset value, the out-degree of ending nodes is zero, all nodes are reachable from the root node, the total number of endings in long script mode is less than or equal to a preset upper limit, and the chapter entry nodes have a parallel topology.

[0011] Preferably, in the script generation and character modeling stage, when the script mode in the creation request is long script mode and the total number of scene nodes is less than a preset threshold, an incremental script expansion generation method is executed, including: Step A1: Calculate the maximum scene identifier number, the number of existing chapters, the number of endings, and the set of dangling references in the current script; the set of dangling references consists of scene node identifiers that are referenced by branch options but do not exist in the current script. Step A2: Based on the information obtained in Step A1, construct continuation prompt words, write the set of dangling references as the priority completion task into the prompt words to eliminate dangling references, and call the large language model to generate a new set of scene nodes with the generated content summary and initial creation request. Step A3: Merge the newly added scene node set with the current script and remove duplicate identifiers to obtain newly added isolated nodes that are not referenced by any branch options after merging; Step A4: Perform a grafting operation on the isolated node, connecting it as a new selection branch to an existing leaf node whose out-degree has not reached the upper limit; if there is no available leaf node, mark it as an independent ending node and clear all its branch options to prevent it from generating new dangling references and invalid continuation in subsequent rounds; repeat steps A1 to A4 until the total number of scenes reaches the corresponding preset threshold or the preset maximum number of expansion rounds is reached.

[0012] Preferably, the post-processing of the directed acyclic graph structure includes, in sequence: Remove completely isolated nodes with no incoming edges and no outgoing edges, and force truncate the number of branches that exceed the limit in each scene. Detect and remove consecutive connections between entry nodes in the same chapter to ensure that each entry node is independent and runs in parallel, rather than being chained together. Ensure the root node is the entry point for Chapter 1, and remove duplicate Chapter 1 tags; Determine if the number of endings exceeds a preset limit. If yes, perform a breadth-first search (BFS) in ascending depth order to remove the shallowest redundant endings and redirect the branch options of their parent nodes. If no, do not process them. Identify unreachable nodes and perform a grafting operation to connect them to reachable leaf nodes; if no leaf nodes are available, mark it as an independent outcome. Perform final graph structure verification, delete dangling references, ensure that the root node has an in-degree of zero, perform a second reachability check and mark nodes with no branch options as ending nodes, and finally forcibly truncate the number of branch options that exceed the limit for each scene.

[0013] Preferably, in the media generation stage, multimedia materials are generated for scene nodes, including: The large language model is invoked to convert the text information of the scene nodes into generation-specific prompt words containing visual elements, i.e., video generation-specific prompt words; Specifically, the physical characteristics descriptions and image prompts of the corresponding characters are retrieved from the actor list and incorporated into the generated special prompts. The standard image of the character is used as a reference image and input into the image generation model.

[0014] Preferably, in the media generation stage, during the generation of multimedia materials, it is determined whether the generation of materials for scene nodes has timed out or failed. If the result is yes, the abnormal information is recorded and the corresponding scene node is skipped without interrupting the overall process. If the result is no, no processing is performed.

[0015] Preferably, in the media generation stage, when the user requests a video as the media type, the multimedia material generation step for the scene node includes: Step B1: Based on the specific prompt words, call the image generation model to generate the first frame static image of the scene; Step B2: Call the large language model to semantically integrate the image prompts with the scene and plot descriptions, supplement the descriptions of dynamic effects and camera movements, and generate video-specific prompts; Step B3: Using the first static image as a reference frame, generate new dedicated prompts based on the video, and then call the video generation model to generate a dynamic video of a preset duration.

[0016] An automated generation system for one-click creation of interactive scripts and multimedia materials, provided by the present invention, includes: Request receiving and initialization module: Receives creation requests sent by the user and initializes the task status according to the creation requests; Multi-stage asynchronous task scheduling module: sequentially triggers the script generation and character modeling module, media generation module, meta-information generation module, and result assembly module; Script generation and character modeling module: Generates structured branched scripts that satisfy graph theory constraints based on creative description text, and analyzes script characters to build cast data; Media generation module: Based on the structured branch script and the cast list, it traverses each scene node to generate multimedia materials that match the plot semantics, and ensures the visual consistency of the same character across scenes through the character image information in the cast list; Meta-information generation module: Generates a synopsis and cover image based on the script content; Result Assembly Module: Integrates all generated content and returns the complete work.

[0017] According to the present invention, a computer-readable storage medium storing a computer program is provided, wherein when the computer program is executed by a processor, the steps of an automated method for one-click creation of interactive scripts and multimedia materials are implemented. An electronic device according to the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of an automated method for one-click creation of interactive scripts and multimedia materials.

[0018] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention adopts an end-to-end multi-stage asynchronous task scheduling architecture driven by a large language model, which completes the process from script generation, media generation, meta-information generation to result assembly. It solves the problems in the prior art where interactive script creation requires multiple roles such as screenwriters, designers, and video producers to collaborate separately, resulting in a lengthy and costly creation process, and the inability to directly generate playable interactive dramas from creative descriptions.

[0019] 2. This invention employs a post-processing method based on a directed acyclic graph (DAG) structure, including steps such as isolated node cleanup, option quantity constraints, unreachable node grafting, and starting point in-degree verification. This addresses graph theory defects in the branching plot structure generated by large language models, such as dangling nodes, circular references, unreachable scenes, and multiple starting points, which prevent interactive dramas from playing properly. Furthermore, by adopting an incremental script expansion generation method based on already generated content summaries, which includes carrying progress statistics of existing scenes and a list of dangling references as context in each round, incrementally generating and merging new scenes, this invention solves the problem that large language models are limited by token budgets in a single output and cannot generate a complete long branching script at once.

[0020] 3. This invention employs a large language model semantic-level prompt word optimization and conversion technology, which automatically converts plot scene descriptions into AIGC-generated prompt words containing visual elements such as characters, environment, lighting, and composition. This solves the problem of a lack of semantic connection between multimedia material generation and script content, leading to a mismatch between generated content and plot. Furthermore, this invention adopts a dual-channel reference mechanism based on the cast's character images. This automatically generates standard image images for each character, incorporates character appearance descriptions into prompt words during scene material generation, and uses the standard image images as reference images input into the image generation model. This solves the problem of inconsistent appearances of the same character in multiple AI-generated scene materials, resulting in a fragmented interactive drama viewing experience.

[0021] 4. This invention solves the problem of inconsistency between text-driven AI video generation and scene visuals and lack of visual coherence by adopting a two-step video generation method based on the first frame reference. That is, first, a static first frame image is generated, and then the scene video is generated by combining the image as a visual anchor point with dynamic effect prompts. Attached Figure Description

[0022] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a flowchart provided for the present invention; Figure 2 This is a schematic diagram of the incremental script expansion algorithm provided by the present invention; Figure 3 This is a schematic diagram of the post-processing method for directed acyclic graph structures provided by the present invention. Detailed Implementation

[0023] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.

[0024] To address the shortcomings of existing technologies, such as insufficient end-to-end generation capabilities, lack of strict constraints on plot structure, and poor adaptability of multimedia materials to the plot, this invention discloses an automated generation system and method for creating interactive scripts and multimedia materials with a single click. This solves problems such as reliance on manual labor in interactive drama creation, fragmented AIGC applications, and the lack of graph theory constraints to ensure plot structure. The system employs a multi-stage asynchronous task scheduling method to sequentially generate the script. This includes an incremental script expansion generation method, a directed acyclic graph (DAG) structure post-processing method, character modeling, media generation, metadata generation, and result assembly. It achieves the transformation from creative ideas to structured scripts through a large language model (LLM), ensures the DAG constraints of plot branches through graph theory algorithms, achieves a high degree of matching between media materials and plot through semantic-level prompt word optimization, ensures visual consistency of characters in different scenes through a dual-channel reference mechanism for actor character images (integration of prompt words and input of standard image reference graphs), and ensures high availability of long-running tasks through asynchronous work pool scheduling.

[0025] This invention enables end-to-end automated generation of interactive dramas, from creative description to complete work, significantly reducing creation costs and improving content consistency and generation efficiency.

[0026] Step 1: Receive the interactive script creation request sent by the user terminal. The request includes creative description text, art style identifier, screen ratio parameters, script mode parameters, and media type parameters. Generate a globally unique task identifier based on the request, initialize the task state, and start a multi-stage asynchronous task scheduling method.

[0027] The task identifier is used to globally and uniquely identify user interactive script creation requests. As the core index for multi-stage asynchronous task scheduling, it enables subtask distribution, resource allocation, execution order control, and status callback. At the same time, it serves as a unique key for database storage and data association, running through the entire process of script generation, character modeling, media generation, meta-information generation, and result assembly, ensuring unified data ownership, traceable tasks, and high availability of scheduling at each stage.

[0028] Step 2: Enter the first stage of the multi-stage asynchronous task scheduling method—script generation and character modeling stage. Based on the creative description text, generate a structured branch script that satisfies graph theory constraints, and analyze the script characters to establish an actor list.

[0029] This stage includes the following sub-steps: Step 2.1: Select the corresponding prompt word template according to the script mode parameters, and integrate the creative description text, art style identifier and preset script structure constraints to construct the system prompt words of the large language model; the structure constraints include: the range of the number of scene nodes, the range of the number of chapters, the upper limit of the number of endings, the topological constraints of the directed acyclic graph, the maximum out-degree constraint of each node, and the scene text length constraint.

[0030] Step 2.2: Input the system prompt words constructed in Step 2.1 into the large language model, and obtain the structured script data output by the model through the streaming interface. The script data is structured data containing a set of scene nodes. Each scene node contains a unique identifier, scene name, plot description, ending marker, chapter marker and branch option list.

[0031] Step 2.3: Determine whether the script mode parameter is a long script mode, and whether the total number of scene nodes obtained in Step 2.2 is lower than a preset threshold; if the conditions are met, execute the incremental script expansion generation method, the specific algorithm of which is described in the core algorithm one of this invention; each round of expansion includes: counting the maximum scene identifier number, number of chapters, number of endings, and dangling references of the current script; constructing continuation prompt words based on the statistical information, carrying the generated content summary and initial creation request as context to call the large language model to generate subsequent scene nodes; merging the newly generated scene nodes with the original nodes, and performing identifier deduplication verification; performing a grafting operation on the newly added isolated nodes without incoming edges after merging, connecting them to existing leaf nodes whose out-degree has not reached the upper limit; repeating the above operations until the total number of scenes reaches the preset threshold or the maximum number of expansion rounds is reached.

[0032] Step 2.4: Perform directed acyclic graph post-processing on the script scene set output in Step 2.2 or Step 2.3. The post-processing includes eight sub-steps executed sequentially. For the specific algorithm, see the core algorithm two of this invention. The post-processed script satisfies the following graph theory constraints: the in-degree of the root node is zero, the out-degree of non-ending nodes is equal to a preset value, the out-degree of the ending node is zero, all nodes are reachable from the root node, the total number of endings in long script mode does not exceed a preset upper limit, and the chapter entry nodes are in a parallel topology structure.

[0033] Specifically, the script mode includes short script and long script modes. The long script mode is used to generate longer interactive scripts with more scene nodes and more complex plot structures. That is, interactive scripts whose number of scene nodes and plot structure meet the preset threshold and length conditions need to be incrementally expanded and have a maximum limit on the total number of endings. The short script mode is a lightweight short script generation mode that does not require incremental expansion, and the endings are constrained in the conventional way. The limit control on the number of endings mentioned in step 2.4 is only executed in the long script mode. The standard script mode is processed according to the default rules without additional pruning.

[0034] Step 2.5: Based on the structured script data processed in Step 2.4, the large language model is used to perform character analysis on the plot descriptions of all scene nodes, generating a list of characters appearing in the work; a character profile is generated for each character, including character name, gender, age range, physical characteristics description, and personality tags; for each character, based on its physical characteristics description and the art style identifier, the large language model is used to generate image generation prompts for the character's image, and then the image generation model is used to generate a standard image image of the character; the character image material identifier is bound to the corresponding actor list entry.

[0035] Step 2.6: Persistently store the structured branch script data processed in Step 2.4 and the actor list data generated in Step 2.5 in the database, update the task status and stage progress information, and the first stage is completed.

[0036] Step 3: Proceed to the second stage of the multi-stage asynchronous task scheduling method—the media generation stage. Based on the structured branch script and cast list data, traverse each scene node of the structured branch script to generate multimedia materials that match the plot semantics, and utilize the character image information in the cast list to ensure visual consistency of the same character across scenes. This stage includes the following sub-steps: Step 3.1: Read the structured branch script and cast list data stored in Step 2.6 from the database, extract the scene node set and sort it by identifier to determine the total number of scenes to be processed; initialize a task pool with preset concurrency and queue capacity to schedule subsequent media material generation tasks.

[0037] Step 3.2: Traverse each scene node extracted in Step 3.1, and call the large language model to perform semantic optimization of prompt words for each scene node. Convert the name, plot description, and art style identifier of the scene node into image generation-specific prompt words containing visual elements such as character features, environmental atmosphere, lighting effects, and picture composition. During the prompt word optimization process, according to the characters appearing in the scene plot description, retrieve the standard image image, appearance feature description, and image prompt words of the corresponding characters from the actor list generated in Step 2.5. And input the standard image image of the character generated in Step 2.5 as a reference image into the image generation model to ensure that the facial features, physical features, and clothing style of the character in the generated scene image are consistent with the standard image, thereby achieving visual consistency of the same character in different scene materials. If the large language model call is abnormal, the system uses a preset template to directly splice the scene, style, and character information to generate the simplest image prompt words as a fallback solution to ensure that the process is not interrupted.

[0038] Step 3.3: Based on the prompt words generated in Step 3.2, execute the corresponding material generation process according to the media type parameter: If the media type is an image, submit the image generation task to the task pool initialized in Step 3.1, call the image generation model to generate scene images, poll and wait for the task to complete, and bind the material identifier to the corresponding scene node after completion; if the media type is a video, adopt the video generation method based on the first frame reference, specifically: First, based on the prompt words, the image generation model is invoked to generate the first frame static image of the scene; Secondly, the large language model is invoked to semantically integrate the image prompts with the scene and plot descriptions, supplementing dynamic effects and camera movement descriptions to generate video-specific prompts. Among them, video-specific prompts refer to structured prompts that are specially adapted to the video generation model and can directly drive video generation. The large language model semantically integrates the prompts with the scene and plot descriptions, supplementing the static image prompts with video-specific information such as actions, dynamic effects, camera movement, and camera language.

[0039] Finally, using the first frame as a reference frame, the video generation model is invoked to generate a dynamic video of a preset duration; upon completion, the video material identifier is bound to the corresponding scene node. If the material generation for a single scene node times out or fails, the exception information is recorded and the node is skipped without interrupting the overall generation process.

[0040] Step 3.4: After each scene node's material generation is completed in Step 3.3, update the task progress count using atomic operations; once all scene nodes have been processed, update the complete script data bound to the material identifier to the database, update the task status and stage progress information, and the second stage is completed.

[0041] Step 4: Enter the third stage of the multi-stage asynchronous task scheduling method—the meta-information generation stage—to generate a work synopsis and cover image based on the script content generated in the first stage. This stage is independent of and runs in parallel with the second stage, the media generation stage, without waiting for the scene media materials to be generated.

[0042] This stage includes the following sub-steps: Step 4.1: Read the structured branch script and cast data stored in Step 2.6 from the database and construct the work context summary information; The summary information includes: the title of the work, the total number of scene nodes, the names and plot descriptions of a preset number of scene nodes, and the marking information of the ending nodes.

[0043] Step 4.2: Input the context summary information constructed in Step 4.1 into the large language model to generate a brief introduction text of the work; the large language model is configured as a copywriting expert role, and the generated introduction text must meet the preset word count range constraint, have a sense of suspense and attraction, and not reveal the key plot direction.

[0044] Step 4.3: Based on the context summary information obtained in Step 4.1 and the art style identifier, call the large language model to generate prompt words for the cover image. The prompt words integrate the theme of the work, core scene elements and art style; input the prompt words into the image generation model to generate a cover image of the work with a preset ratio, poll and wait for the generation to complete, and obtain the cover material identifier.

[0045] Step 4.4: Write the work synopsis text generated in Step 4.2 and the cover material identifier generated in Step 4.3 into the metadata field of the script data, update the database, update the task status and stage progress information, and the third stage is completed.

[0046] Step 5: Proceed to the fourth stage of the multi-stage asynchronous task scheduling method—the result assembly stage—integrating all generated content and returning the complete work. This stage includes the following sub-steps: Step 5.1: Read the complete work data updated in Step 4.4 from the database, traverse all scene nodes to count the number of ending nodes, and extract the material access address bound to each scene node and the material access address of the cover image.

[0047] Step 5.2: Assemble the script structure data, access addresses of each scene's materials, cast list data, work metadata, and statistical information extracted in Step 5.1 into a complete interactive drama work result object; update the task status to "completed", persist the final result to the database, and return the complete interactive drama work result to the user after all four asynchronous tasks have been executed.

[0048] The core algorithm of this invention is the incremental script expansion generation method. This algorithm addresses the technical problem that large language models are limited by the token budget in a single generation, making it impossible to output a complete long branching script at once. Through multiple rounds of incremental generation and merging, the number of scene nodes is gradually expanded from the initial generation amount to a preset threshold.

[0049] Input: Initial structured script S0, generated in step 2.2 in this example; preset scene number threshold T, with a default value of 80; maximum number of extended rounds N, with a default value of 3.

[0050] Output: A complete structured script with a total number of scenes ≥ T, i.e., S.

[0051] The algorithm flow includes: E1 Initialization: Let the current scenario S ← S0, and let the round count r ← 0. ← indicates assignment, | represents the cardinality or number of elements in the set; |S.scenes| represents the total number of scene nodes in scenario S; E2 Termination Decision: If |S.scenes| ≥ T or r ≥ N, proceed to step E8.

[0052] E3 Script Status Statistics: Traverse all scene nodes in S and collect the following information: The maximum scene identifier sequence number maxID is used to determine the starting number of newly added nodes; The number of chapters (chapterCount) and the number of endings (endingCount) are currently in use. The dangling reference set U = {nextSceneId | nextSceneId is referenced by a branch option but does not have a corresponding scene node in S}, that is, all branch option references in the current script that point to scenes that have not yet been defined. nextSceneId represents a unique identifier for the target scene node pointed to by the branch option; E4 Continuation Prompt Word Construction: Based on the statistical information from step E3, a continuation request for the large language model is constructed, the request including: Current generation progress, i.e., the number of existing scenes and the remaining number of scenes to be generated, T - |S.scenes|; The list of scenario identifiers for the dangling reference set U requires prioritizing the definition of these referenced but unimplemented scenarios; The starting sequence number of the identifier for the new scene is maxID + 1; Structural constraints reiterated: Maintain continuity with previous storylines; new branches must ultimately lead to the ending node; existing scenes will not be generated repeatedly.

[0053] E5 Incremental Generation: Input the continuation prompts from step E4, along with the generated content summary and initial creation request, into the large language model. Obtain the set of newly added scene nodes S_new output by the model through the streaming interface. If the large language model call fails or returns an empty set, record the exception information and proceed to step E8.

[0054] E6 Merging and Deduplication: Perform a merging operation on the newly added scene node set S_new and the complete structured script S: Create an existing scene index using the scene identifier as the key; Iterate through each scene node in the newly added scene node set S_new. If its identifier is not in the existing index, append it to S; if the identifier already exists, skip the node, i.e., remove duplicates. Update the existing scene index to include the new node.

[0055] E7 Orphaned Node Grafting: Perform no-entry-edge node detection on the merged S—find new scene nodes that are not referenced by any branch options and are not root nodes in the branch option reference relationships of all scenes, i.e., isolated nodes; for each isolated node, find existing leaf nodes in S whose degree has not reached the preset upper limit, and connect the isolated node as a new selection branch to the leaf node; if there are no available leaf nodes, mark the isolated node as an independent ending node and clear all its branch options. Let r ← r + 1, go to step E2.

[0056] E8 Output: Returns the expanded, complete structured script S, whose total number of scenes satisfies |S.scenes|≥ T or has reached the maximum number of expansion rounds.

[0057] Algorithm complexity: The time complexity of each round of expansion is O(|S.scenes|+ |S_new|), where |S.scenes| represents the total number of scene nodes in the current script S, and |S_new| is the number of new scenes added in this round.

[0058] The main overhead includes: scene traversal and statistics O(|S.scenes|), hash index construction and merging O(|S.scenes| + |S_new|), and isolated node detection and grafting O(|S.scenes| + |S_new|), i.e., linear complexity. It executes at most N rounds in total, with a default setting of 3 rounds. The upper bound for the number of calls to the large language model is N+1, including initial generation.

[0059] Here, O represents the "Big O notation" in algorithm complexity analysis, which is used to describe the asymptotic time complexity of an algorithm, indicating the trend of the algorithm's execution time as the total number of scene nodes increases.

[0060] Core Algorithm 2: Post-processing Methods for Directed Acyclic Graph Structures

[0061] The present invention also provides an automated generation system for one-click creation of interactive scripts and multimedia materials. The automated generation system for one-click creation of interactive scripts and multimedia materials can be implemented by executing the process steps of the automated generation method for one-click creation of interactive scripts and multimedia materials. That is, those skilled in the art can understand the automated generation method for one-click creation of interactive scripts and multimedia materials as a preferred embodiment of the automated generation system for one-click creation of interactive scripts and multimedia materials.

[0062] An automated generation system for one-click creation of interactive scripts and multimedia materials, provided by the present invention, includes: Request receiving and initialization module: Receives creation requests sent by the user and initializes the task status according to the creation requests; Multi-stage asynchronous task scheduling module: sequentially triggers the script generation and character modeling module, media generation module, meta-information generation module, and result assembly module; Script generation and character modeling module: Generates structured branched scripts that satisfy graph theory constraints based on creative description text, and analyzes script characters to build cast data; Media generation module: Based on the structured branch script and the cast list, it traverses each scene node to generate multimedia materials that match the plot semantics, and ensures the visual consistency of the same character across scenes through the character image information in the cast list; Meta-information generation module: Generates a synopsis and cover image based on the script content; Result Assembly Module: Integrates all generated content and returns the complete work.

[0063] According to the present invention, a computer-readable storage medium storing a computer program is provided, wherein when the computer program is executed by a processor, the steps of an automated method for one-click creation of interactive scripts and multimedia materials are implemented. An electronic device according to the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of an automated method for one-click creation of interactive scripts and multimedia materials.

[0064] Those skilled in the art will understand that, besides implementing the system and its various devices, modules, and units provided by this invention in the form of purely computer-readable program code, the same functions can be achieved entirely through logical programming of the method steps, making the system and its various devices, modules, and units of this invention function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, the system and its various devices, modules, and units provided by this invention can be considered as a hardware component, and the devices, modules, and units included therein for implementing various functions can also be considered as structures within the hardware component; alternatively, the devices, modules, and units for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0065] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.

Claims

1. A method for automatically generating interactive scripts and multimedia materials with one click, characterized in that, include: Receive a creation request sent by the user, initialize the task state according to the creation request, start a multi-stage asynchronous task scheduling method, and execute the script generation and character modeling stage, media generation stage, meta-information generation stage and result assembly stage. In the script generation and character modeling stage, a structured branch script that satisfies graph theory constraints is generated based on the creative description text in the creation request, and the script characters are analyzed to establish cast list data; During the media generation stage, the structured branch script and cast list data are read, and multimedia materials that match the plot semantics are generated by traversing each scene node of the structured branch script. Furthermore, the character image information in the cast list data is used to ensure the visual consistency of the same character across scenes. In the meta-information generation stage, the structured branch script and cast list data are read to generate a work synopsis and cover image; In the result assembly stage, all generated content is integrated, and the complete work is returned.

2. The automated generation method for one-click creation of interactive scripts and multimedia materials according to claim 1, characterized in that, In the script generation and character modeling stage, prompts containing creative descriptions and script structure constraints are input into a large language model to generate a structured branch script, and a directed acyclic graph post-processing is performed on the structured branch script. Based on the processed script, a list of characters is extracted, and the model is called to generate standard image images of the characters to build the cast list. The graph theory constraints include: the root node has an in-degree of zero, the out-degree of non-ending nodes is equal to a preset value, the out-degree of ending nodes is zero, all nodes are reachable from the root node, the total number of endings in long script mode is less than or equal to a preset upper limit, and the chapter entry nodes have a parallel topology.

3. The automated generation method for one-click creation of interactive scripts and multimedia materials according to claim 1, characterized in that, In the script generation and character modeling stage, when the script mode in the creation request is long script mode and the total number of scene nodes is less than a preset threshold, an incremental script expansion generation method is executed, including: Step A1: Calculate the maximum scene identifier number, the number of existing chapters, the number of endings, and the set of dangling references in the current script; the set of dangling references consists of scene node identifiers that are referenced by branch options but do not exist in the current script. Step A2: Based on the information obtained in Step A1, construct continuation prompt words, use the set of dangling references as priority completion task prompt words to eliminate dangling references, and call the large language model to generate a new set of scene nodes with the generated content summary and initial creation request. Step A3: Merge the newly added scene node set with the current script and remove duplicate identifiers to obtain newly added isolated nodes that are not referenced by any branch options after merging; Step A4: Perform a grafting operation on the isolated node, connecting it as a new selection branch to an existing leaf node whose out-degree has not reached the upper limit; if there are no available leaf nodes, mark it as an independent ending node and clear all its branch options; Among them, steps A1 to A4 are repeated until the total number of scenarios reaches the corresponding preset threshold or the preset maximum number of expansion rounds is reached.

4. The automated generation method for one-click creation of interactive scripts and multimedia materials according to claim 2, characterized in that, The post-processing of the directed acyclic graph structure includes, in sequence: Remove completely isolated nodes with no incoming edges and no outgoing edges, and force truncate the number of branches that exceed the limit in each scene. Detect and remove consecutive connections between entry nodes of the same chapter to ensure that each entry node is independent and runs in parallel; Ensure the root node is the entry point for Chapter 1, and remove duplicate Chapter 1 tags; Determine if the number of endings exceeds a preset limit. If yes, perform a breadth-first search in ascending depth order to remove the shallowest redundant endings and redirect the branch options of their parent nodes. If no, do nothing. Identify unreachable nodes and perform a grafting operation to connect them to reachable leaf nodes; if no leaf nodes are available, mark it as an independent outcome. Perform final graph structure verification, delete dangling references, ensure that the root node has an in-degree of zero, perform a second reachability check and mark nodes with no branch options as ending nodes, and finally forcibly truncate the number of branch options that exceed the limit for each scene.

5. The automated generation method for one-click creation of interactive scripts and multimedia materials according to claim 1, characterized in that, In the media generation stage, multimedia materials are generated for scene nodes, including: The large language model is invoked to convert the text information of the scene nodes into generation-specific prompt words containing visual elements; Specifically, the physical characteristics descriptions and image prompts of the corresponding characters are retrieved from the actor list and incorporated into the generated special prompts. The standard image of the character is used as a reference image and input into the image generation model.

6. The automated generation method for one-click creation of interactive scripts and multimedia materials according to claim 1, characterized in that, During the media generation stage, in the process of generating multimedia materials, it is determined whether the material generation of the scene node has timed out or failed. If the result is yes, the abnormal information is recorded and the corresponding scene node is skipped without interrupting the overall process. If the result is no, no action is taken.

7. The automated generation method for one-click creation of interactive scripts and multimedia materials according to claim 5, characterized in that, In the media generation stage, when the user requests video as the media type, the multimedia material generation steps for the scene node include: Step B1: Based on the specific prompt words, call the image generation model to generate the first frame static image of the scene; Step B2: Call the large language model to semantically integrate the image prompts with the scene and plot descriptions, supplement the descriptions of dynamic effects and camera movements, and generate video-specific prompts; Step B3: Using the first static image as a reference frame, generate new dedicated prompts based on the video, and then call the video generation model to generate a dynamic video of a preset duration.

8. An automated system for one-click creation of interactive scripts and multimedia materials, characterized in that, include: Request receiving and initialization module: Receives creation requests sent by the user and initializes the task status according to the creation requests; Multi-stage asynchronous task scheduling module: sequentially triggers the script generation and character modeling module, media generation module, meta-information generation module, and result assembly module; Script generation and character modeling module: Generates structured branched scripts that satisfy graph theory constraints based on creative description text, and analyzes script characters to build cast data; Media generation module: Based on the structured branch script and the cast list, it traverses each scene node to generate multimedia materials that match the plot semantics, and ensures the visual consistency of the same character across scenes through the character image information in the cast list; Meta-information generation module: Generates a synopsis and cover image based on the script content; Result Assembly Module: Integrates all generated content and returns the complete work.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the one-click interactive script and multimedia material automatic generation method as described in any one of claims 1 to 7.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed by the processor, it implements the steps of the one-click interactive script and multimedia material automatic generation method as described in any one of claims 1 to 7.