A multi-format script output and metadata hierarchical integration method and system
By constructing a unified script object tree and generating stable identifiers, a two-way binding relationship is established between the main script file and the external metadata file. This solves the problem of insufficient stability in the association between the script text and metadata, and enables accurate positioning and write-back merging during the output of multi-format scripts, thereby improving the synchronization consistency between files.
Patent Information
- Application Number
- CN202611198367.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-07
- Publication Date
- 2026-11-06
AI Technical Summary
In the process of outputting scripts in multiple formats, the existing technology has insufficient stability in the association between the script text and the external metadata, and the accuracy of writing back and merging the modified target files is insufficient, making it difficult to keep the script structure and metadata relationship consistent.
By constructing a unified script object tree, generating stable identifiers and positioning information, establishing a two-way binding relationship between the main script file and the external metadata file, and performing metadata layering and field mapping according to the target format's carrying capacity, the script object can be accurately located and written back and merged in the target file.
It improves the stability of the association between the script text and metadata, ensures accurate write-back and synchronous update of the modified target file, and realizes linkage maintenance and synchronous consistency among multiple files.
Smart Images

Figure CN123048539A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital content processing technology, and in particular to a method and system for multi-format script output and metadata hierarchical integration. Background Technology
[0002] The digital production of scripts typically involves the flow of files between stages such as creation, proofreading, production breakdown, translation and localization, and archiving and release. Conventional processing methods often rely on a single script document or a fixed-format file, expressing the script structure through layout features such as text paragraphs, scene titles, character names, dialogue content, and cues. During output, the script is converted into plain text, tabular files, formatted display files, or production data files. Related metadata is usually saved with the main text, annotations, hidden fields, or separate explanatory files to support the management of information such as characters, scenes, props, versions, and production constraints.
[0003] Conventional methods, when outputting in multiple formats, are first susceptible to the impact of differences in the carrying capacity of target formats. Different formats do not support hierarchical structures, extended fields, hidden identifiers, and annotation information to varying degrees, which may weaken the correspondence between the script text and metadata. Secondly, after the target file has been manually edited or processed by tools, without stable object identifiers and rewritable positioning criteria, it is difficult to accurately merge modified content, object movements, and metadata changes into the original structure. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides a method for multi-format script output and hierarchical integration of metadata to solve the problems of insufficient stability in the association between script text and external metadata and insufficient accuracy in writing back and merging modified target files in the prior art.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] In a first aspect, the present invention provides a method for multi-format script output and hierarchical integration of metadata, comprising: acquiring an input script; performing structured parsing on the input script; constructing a unified script object tree according to script-level, scene-level, character-level, dialogue-level, and prompt-level objects; and generating stable identifiers and positioning information for each script object; separating and generating a main script file and an external metadata file based on the unified script object tree; and establishing a two-way binding relationship between the main script file and the external metadata file; receiving a target format output instruction; performing layered trimming and field mapping of metadata in the external metadata file according to the carrying capacity of the target format; generating a main script file, an external metadata file, and a two-way index record in the target format; identifying differences in the modified target format file; performing write-back merging based on the stable identifier and positioning information; and synchronously updating the unified script object tree, the main script file, the external metadata file, and the two-way index record.
[0008] As a preferred embodiment of the multi-format script output and metadata hierarchical integration method of the present invention, the input script is subjected to text normalization processing to unify the form of line breaks, spaces, punctuation, and paragraph boundaries to obtain a standard paragraph sequence; according to the order in which the paragraphs appear in the input script, a paragraph sequence number is assigned to each paragraph in the standard paragraph sequence; according to fixed semantic rules, the matching score between each paragraph and scene-level, character-level, dialogue-level, and prompt-level objects is calculated respectively, and the object category with the highest matching score is determined as the initial object type of the corresponding paragraph; according to the object type relationship between adjacent paragraphs, the initial object type is corrected for consistency to obtain the corrected object type.
[0009] As a preferred embodiment of the multi-format script output and metadata hierarchical integration method described in this invention, paragraphs of the same and consecutive type after correction are merged to form script objects; using script-level objects as root nodes, scene-level objects are attached to script-level objects, and character-level objects, dialogue-level objects, and prompt-level objects are attached to scene-level objects to construct a unified script object tree; a stable identifier is generated based on the object category, hierarchical path, same-level sequential position, and object content verification information of each script object; positioning information is generated based on the starting paragraph number, ending paragraph number, parent object identifier, preceding object identifier, and succeeding object identifier of each script object; the stable identifier and positioning information are written into the object index table, and the object index table is associated with and saved in relation to the unified script object tree.
[0010] As a preferred embodiment of the multi-format script output and metadata hierarchical integration method of the present invention, the text content of scene-level objects, character-level objects, dialogue-level objects, and prompt-level objects is extracted according to the hierarchical traversal order of the unified script object tree; a main script content sequence is generated based on the parent-child relationship and hierarchical order of each script object in the unified script object tree; the main script content sequence is written into the main script file, and the stable identifier of each script object is retained in the main script file; an external metadata file is generated based on the stable identifier, object category, hierarchical path, positioning information, and extended attributes of each script object; an object mapping table is established in the external metadata file, and the object mapping table records the stable identifier, hierarchical path, positioning information, and position of each script object in the main script file.
[0011] As a preferred embodiment of the multi-format script output and metadata hierarchical integration method of the present invention, the method includes: generating a main script file identifier for the main script file and generating an external metadata file identifier for the external metadata file; writing the external metadata file identifier into the main script file and the main script file identifier into the external metadata file to form a file-level bidirectional reference relationship; writing the stable identifiers of each script object into the main script file and the external metadata file respectively to form an object-level binding relationship; calculating the summary value of the main script file and the summary value of the external metadata file respectively; generating a joint verification value based on the summary value of the main script file and the summary value of the external metadata file, and writing the joint verification value into the main script file and the external metadata file respectively.
[0012] As a preferred embodiment of the multi-format script output and metadata hierarchical integration method of the present invention, the method includes: receiving a target format output instruction containing a target format identifier; calling a format capability description table according to the target format identifier to determine the target format's capacity to carry hierarchical structure, custom fields, hidden identifiers, and annotation information; determining the capacity to carry each metadata field in the external metadata file according to the capacity to carry; and dividing the metadata fields into a basic output layer, an enhanced output layer, and an external retention layer according to the capacity to carry result.
[0013] As a preferred embodiment of the multi-format script output and metadata hierarchical integration method of the present invention, the basic output layer is mapped and written into the main manuscript file of the target format; the enhanced output layer fields that the target format can carry are written into the main manuscript file; the enhanced output layer fields and the external retention layer fields that are not carried by the target format are written into the external metadata file of the target format; and a bidirectional index record is generated based on the stability identifier of the script object, the position index in the main manuscript file, and the record index in the external metadata file.
[0014] As a preferred embodiment of the multi-format script output and metadata hierarchical integration method of the present invention, the modified target format file is obtained, and the script text, additional fields, annotation information, and stability identifiers are extracted; a modified object candidate sequence is generated according to structured parsing rules; the modified object candidate sequence is compared with the bidirectional index records, and the corresponding script object is first determined based on the stability identifier; when the stability identifier is missing or cannot be matched, the script object is determined based on the hierarchical path, adjacent objects, text anchors, and relative positions in the positioning information; the difference type is identified according to the specific changes, including text modification, object movement, object addition, object deletion, and metadata modification.
[0015] As a preferred embodiment of the multi-format script output and metadata hierarchical integration method of the present invention, deterministic write-back merging is performed according to the difference type and write-back rules; the master script file is regenerated and the bidirectional index records are updated based on the updated unified script object tree and external metadata files.
[0016] Secondly, this invention provides a multi-format script output and metadata hierarchical integration system, comprising: a structured parsing module, responsible for acquiring the input script, performing structured parsing on the input script, constructing a unified script object tree according to script-level, scene-level, character-level, dialogue-level, and prompt-level objects, and generating stable identifiers and positioning information for each script object; a two-way binding establishment module, responsible for separating and generating the main script file and external metadata file based on the unified script object tree, and establishing a two-way binding relationship between the main script file and the external metadata file; an adaptation output module, responsible for receiving the target format output instruction, performing layered trimming and field mapping of the metadata in the external metadata file according to the carrying capacity of the target format, and generating the target format main script file, external metadata file, and two-way index record; and a difference write-back and merging module, responsible for identifying differences in the modified target format file, performing write-back and merging according to the stable identifier and positioning information, and synchronously updating the unified script object tree, main script file, external metadata file, and two-way index record.
[0017] The beneficial effects of this invention are as follows: by generating a target format main manuscript file, external metadata file, and bidirectional index record, bidirectional positioning of the script object between the target main manuscript position and the external metadata record is achieved, improving the accuracy of subsequent retrieval, verification, and write-back processing; by synchronously updating the unified script object tree, main manuscript file, external metadata file, and bidirectional index record after write-back merging, linkage maintenance between multiple files is achieved, ensuring the synchronous consistency of the script text, metadata, and index relationship after editing iteration. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Fig. 1 A flowchart for a method of integrating multi-format script output with metadata hierarchy.
[0020] Fig. 2 This is a schematic diagram of a multi-format script output and metadata hierarchical integration system.
[0021] Fig. 3 This is a flowchart of structured parsing and two-way binding relationships.
[0022] Fig. 4 This is a flowchart for difference identification and synchronous update of write-back merging. Detailed Implementation
[0023] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0024] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0025] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0026] Reference Figs. 1-4 As an embodiment of the present invention, this embodiment provides a method for multi-format script output and metadata hierarchical integration, including the following steps:
[0027] S1. Obtain the input script, perform structured parsing on the input script, construct a unified script object tree according to script-level, scene-level, character-level, dialogue-level, and prompt-level objects, and generate stable identifiers and positioning information for each script object.
[0028] Furthermore, the input script is normalized.
[0029] Specifically, duplicate spaces are removed, line breaks are standardized, full-width and half-width characters are standardized, colons and parentheses are standardized, original paragraph boundaries are preserved, and consecutive blank lines are compressed into single paragraph breaks.
[0030] After normalization, a standard paragraph sequence is obtained.
[0031] Furthermore, based on the fixed semantic rules of script writing, the standard paragraphs obtained are classified into categories using an identification process that prioritizes rule matching and follows adjacency correction.
[0032] Specifically, the object categories are divided into scene-level objects, character-level objects, dialogue-level objects, prompt-level objects, and ordinary narrative paragraph objects. Among them, ordinary narrative paragraph objects participate in the paragraph recognition process as auxiliary text categories, but do not participate in the hierarchical construction of the unified script object tree as independent nodes.
[0033] Record No. The paragraph is about the first The matching score of the class object is ,in, Represents a scene-level object. Represents a role-level object. Represents a dialogue-level object. Represents a prompt-level object. Indicates a normal narrative paragraph object,
[0034] Create a keyword thesaurus.
[0035] Specifically, the keyword list is obtained offline. First, common expressions are extracted from several standard script texts, then combined with scriptwriting habits to form a fixed rule list, which is then incorporated into this method. The fixed keyword list used in this embodiment is as follows:
[0036] For scene-level objects, the preferred keywords in the keyword list include: "interior", "exterior", "day", "night", "morning", "dusk", "INT", "EXT", "DAY", and "NIGHT".
[0037] For role-level objects, role name candidate rules are used for identification.
[0038] It should be noted that the rules are determined by statistically organizing the writing format of character names in the standard script text and combining it with the semantic scope of the script; when a paragraph is an independent line of text, and the length of the entire line does not exceed 12 Chinese characters or 24 English letters, does not end with a period, does not contain obvious narrative verbs, and does not contain scene marker words, the paragraph is considered as a candidate paragraph for character-level objects.
[0039] When a candidate paragraph of a role-level object meets the role name candidate rule, the corresponding rule hit flag value is 1; otherwise, it is 0.
[0040] For dialogue-level objects, the keyword list preferably includes dialogue-leading phrases and continuous speech features, such as “I”, “you”, “he”, “she”, “ma”, “ba”, “ah”, “ne”, “?”, “!”, as well as continuous sentence text following the role-level object.
[0041] For prompt-level objects, the keyword list should preferably include: "narration", "OS", "VO", "cut to", "fade in", "fade out", "transition", "music start", "voice-over", "note", "prompt", as well as supplementary explanations introduced by parentheses, square brackets, and dashes.
[0042] For ordinary narrative objects, the keyword list should preferably include: action verbs, environmental descriptive words, and state descriptive words, such as "walk", "look", "turn around", "stop", "enter", "stand up", "lights", "room", "street", "sky", "silence", and "quiet".
[0043] Based on the keyword thesaurus, calculate the keyword rule matching values for the five categories of objects.
[0044] It should be noted that the keyword rule matching value is calculated as follows: after segmenting the paragraph into words and matching character fragments, the keyword hit value of the object category in the keyword thesaurus is calculated, and it is expressed as:
[0045] ;
[0046] in, For the first Does the paragraph hit the first...? The first class object The tag value for each keyword is 1 when it is matched and 0 when it is not matched. This refers to the term weight of the keyword.
[0047] It should be noted that the term weights were obtained through offline statistical analysis of labeled, standardized script text samples. Take 2; the remaining keywords are treated as ordinary keywords, and their term weights are determined accordingly. Take 1.
[0048] Among them, "INT", "EXT", "Interior", and "Exterior" in scene-level objects are strong indicative keywords, while "OS", "VO", "Cut to", "Fade in", and "Fade out" in prompt-level objects are strong indicative keywords.
[0049] Subsequently, the keyword hit value was analyzed. Perform normalization to obtain keyword rule matching values:
[0050] ;
[0051] in, For the first Keyword normalization threshold for class objects.
[0052] It should be noted that the keyword normalization threshold was obtained using an offline calibration method, and the keyword normalization threshold was set to [value missing]. , , , , .
[0053] Specifically, the keyword rule matching value is 1 when the scene-level object scores 3 points or more; the keyword rule matching value is 1 as long as the character name candidate rule is met; the keyword rule matching value is 1 when the dialogue-level object scores 2 points or more; the keyword rule matching value is 1 when the prompt-level object scores 2 points or more; and the keyword rule matching value is 1 when the ordinary narrative paragraph object scores 3 points or more.
[0054] Extract the layout features of each paragraph.
[0055] Specifically, six fixed format features are extracted for each paragraph:
[0056] Independent line feature. If the paragraph is preceded and followed by line breaks and exists independently, then the value is 1; otherwise, the value is 0.
[0057] Short text feature. If the number of characters in a paragraph is no more than 12 Chinese characters or 24 English letters, then take 1; otherwise, take 0.
[0058] : All uppercase or near-heading characteristics. If most English characters are uppercase, or the Chinese paragraph consists of a short heading-style phrase, then take 1; otherwise, take 0.
[0059] : Bracketing characteristics. If the paragraph is enclosed in parentheses, square brackets, or full-width brackets, the value is 1; otherwise, the value is 0.
[0060] Ending punctuation characteristics. If the paragraph ends with a period, question mark, or exclamation mark, take 1; otherwise, take 0.
[0061] Paragraph length characteristics. Let the number of characters in a paragraph be denoted as... Define the standard length value, expressed as:
[0062] ;
[0063] in, This indicates the definition of the specification length value. Indicates the first Typical length center value of class objects, This indicates the allowable deviation range. It should be noted that the typical length center value and allowable deviation range were obtained through statistical analysis of the paragraph length distribution of various object types in the standard script sample. The typical length center value is the average of the number of characters in paragraphs for each object type, and the allowable deviation range is the standard deviation range. The corresponding values for the typical length center value and allowable deviation range for each object type are as follows: ; ; ; ; .
[0064] Calculate the paragraph layout feature matching values for five types of objects.
[0065] Specifically, the paragraph layout feature matching values for various objects are obtained by a fixed weighted sum followed by normalization, and are represented as follows:
[0066] ;
[0067] in, This indicates the paragraph layout feature matching value. Indicates the first Class object to the first The weight of each layout feature.
[0068] It should be noted that the weights of layout features are derived from offline calibration results, and the preferred fixed values for the layout feature weights of various objects are as follows:
[0069] For scene-level objects 1: 0.25, 0.10, 0.30, 0.00, 0.05, 0.30.
[0070] For role-level objects 2: 0.30, 0.25, 0.25, 0.00, 0.00, 0.20.
[0071] For dialogue-level objects 3: 0.05, 0.00, 0.00, 0.00, 0.45, 0.50.
[0072] For prompt level objects 4: 0.20, 0.20, 0.00, 0.40, 0.00, 0.20.
[0073] For ordinary narrative paragraphs : 0.00, 0.00, 0.00, 0.00, 0.35, 0.65.
[0074] Construct an adjacency matrix.
[0075] First, construct a fixed adjacency matrix. , where matrix elements Indicates that the current object type is The current object type is The forward adjacency support value at that time.
[0076] In this embodiment, the forward adjacency matrix is set as follows:
[0077] ;
[0078] Among them, the Line number Column values This indicates that "the previous paragraph is the first" Class object, the current paragraph is the The reasonableness value of "class object".
[0079] It should be noted that the reasonableness value is obtained through sample statistical calibration and frequency normalization modeling. Specifically, in the labeled standard script sample, after conditional probability normalization, the reasonableness value is obtained and expressed as:
[0080] ;
[0081] in, This indicates that "the previous paragraph is the first" Class object, current paragraph is the The number of times "class objects" co-occur. This indicates that in all paragraphs preceding the first paragraph... In the case of "class object", the total number of occurrences of all successor types.
[0082] Simultaneously, construct the backward adjacency matrix. Matrix elements This indicates that the current paragraph is the first one. Class object, the next paragraph is the first Backward adjacency support values for class objects. Backward adjacency matrix. This was obtained through statistical analysis of the co-occurrence relationships of successor types in adjacent paragraphs of annotated standard script samples, and is represented as follows:
[0083] ;
[0084] in, This indicates that "the current paragraph is the first one". Class object, the next paragraph is the first The number of times "class objects" co-occur. This indicates that in all paragraphs where "the current paragraph is the first" In the case of "class object", the total number of occurrences of all subsequent paragraph types.
[0085] Based on the adjacency matrix, calculate the adjacency matching values of the preceding and following paragraphs for the five types of objects.
[0086] Specifically, the adjacency matching values for various object types are represented as follows:
[0087] ;
[0088] in, Indicates the first When dealing with class objects, the adjacency matching value is... This represents the forward adjacency influence coefficient. Indicates the initial object type of the previous paragraph. Indicates the initial object type of the next paragraph.
[0089] It should be noted that the forward adjacency influence coefficient was obtained by comparing the classification accuracy of "using only forward adjacency information" and "combining forward and backward adjacency information" on labeled script samples, and the forward adjacency influence coefficient was set to 0.6.
[0090] For the first and last paragraphs, if there is no preceding or following paragraph, the missing item will be replaced with the default boundary support value of 0.5.
[0091] It should be noted that when calculating adjacency matching values, adjacency relationships are not based on the final determined object type, but rather on the initial classification result set. The initial classification result set is obtained by independently classifying the input script paragraphs.
[0092] Specifically, for each paragraph, the matching score for each object category is calculated based solely on the keyword rule matching value and the paragraph structure feature matching value. The object category with the highest score is selected as the initial classification result for the paragraph, thus forming an initial classification result set.
[0093] Finally, the total matching score is calculated based on the keyword rule matching value, paragraph layout feature matching value, adjacent relationship matching value of preceding and following paragraphs, and rule weight coefficient.
[0094] Specifically, the total matching score is expressed as:
[0095] ;
[0096] in, This represents the total matching score. Paragraph For the Keyword rule matching value of class object, This indicates the paragraph layout feature matching value. This indicates the adjacency match value with the preceding and following paragraphs. , and They represent the first The rule weight coefficient of the class object.
[0097] It should be noted that the rule weight coefficients were obtained using an offline calibration method, and all weight coefficients take values in the interval [0, 1], and satisfy the following conditions: The normalization constraints; where, Typically, the value is taken as 0.3~0.5. The value is usually taken as 0.3~0.5. The value is usually taken as 0.4 to 0.6.
[0098] After calculating the matching score, the paragraph is assigned to the object category with the highest score, which is then determined as the paragraph's initial object type.
[0099] In the initial object type After generation, an order correction is performed based on the context adjacency relationship.
[0100] Specifically, taking the current paragraph as the center, the initial object types of the previous and next paragraphs are read, and the adjacency consistency judgment value is constructed as the average of the type adjacency consistency value between the previous and current paragraphs and the type adjacency consistency value between the current and next paragraphs.
[0101] When the adjacency consistency score is lower than the adjacency consistency threshold, it indicates that the initial object type of the paragraph is inconsistent with the usual arrangement pattern of the script. In this case, the one with the higher score among the two adjacent candidate objects is selected as the corrected object type.
[0102] It should be noted that the adjacency consistency determination threshold is obtained by comparing and calibrating the object type correction accuracy under different thresholds on the labeled script samples, and the preferred value range is 0.5~0.7.
[0103] After correction, consecutive and similar paragraphs are merged to form basic script objects.
[0104] Specifically, the merged script objects are divided into script-level objects, scene-level objects, character-level objects, dialogue-level objects, and cue-level objects according to their hierarchy.
[0105] There is only one script-level object as the root object. Scene-level objects are attached to script-level objects. Character-level objects, dialogue-level objects, and prompt-level objects are attached to their respective scene-level objects. When a prompt-level object directly belongs to a certain dialogue, it is attached to the corresponding dialogue-level object.
[0106] After completing object identification and merging, a unified script object tree is established.
[0107] Specifically, taking the script-level object as the root node, denoted as... ; will the first Each scene-level object is denoted as ; Hooked at The first scene-level object Each role-level object is denoted as ; The first one attached to the corresponding role-level object Each dialogue-level object is denoted as The prompt-level objects associated with the scene and dialogue are respectively connected to the object tree as child nodes of the corresponding parent objects.
[0108] For each object, the parent object number, the same-level sequence number, and the scene sequence number are recorded, forming a unique hierarchical path in the object tree.
[0109] After the unified script object tree is established, a stable identifier is generated for each script object.
[0110] Specifically, the stability identifier is generated by the object category code, the object hierarchy path code, and the object's same-level sequence code; the object content verification code is stored independently in the object index table or external metadata file, and is used to determine whether the object text has changed.
[0111] Among them, object-level path encoding and same-level sequence encoding are used to characterize the structural position of an object in the unified script object tree, and are used as positioning information.
[0112] The object category codes are assigned values in the following fixed manner: scene-level objects are assigned a value of 1, character-level objects are assigned a value of 2, dialogue-level objects are assigned a value of 3, prompt-level objects are assigned a value of 4, and script-level objects are assigned a value of 5.
[0113] The object hierarchy path encoding records the parent-child path of an object from the root object to the current object; the object intra-level order encoding records the arrangement order of objects under the same parent object; the object content verification encoding is calculated based on the object's normalized text and is generated using a weighted character position verification method, represented as:
[0114] ;
[0115] in, This represents the object content verification code. This represents the total number of characters in the normalized text of an object. Indicates the character position number. Indicates the first The character encoding value corresponding to each character.
[0116] Based on object category encoding, object hierarchy path encoding, and object intra-level sequence encoding, a stable identifier for the script object is generated after processing by the encoding concatenation function, represented as:
[0117] ;
[0118] in, Indicates stability. Indicates the object category code, Indicates the object hierarchy path encoding. This indicates the sequential encoding of objects within the same level. This indicates a function for encoding concatenation. Object content validation encoding. It is stored independently in the object index table or external metadata file, and is used to determine whether the object's text content has changed. It is not part of the stable identifier.
[0119] For each script object, location information is generated. Specifically, the location information includes the parent object identifier, the starting paragraph number, the ending paragraph number, the preceding object identifier, the following object identifier, and a summary of the object's text anchor point.
[0120] The object text anchor summary is generated by concatenating a fixed-length character segment representing the beginning of the object's normalized text and a fixed-length character segment representing the end of the object's normalized text.
[0121] It should be noted that the fixed length is obtained by statistically calibrating the distribution of text lengths of various objects in the standard script sample, and is selected as a fixed number of characters under the premise of ensuring distinguishability and stability. The lengths of the first and second segments of the object text are preferably 8 to 16 characters respectively.
[0122] Furthermore, the object position value is calculated as the ratio of the object's starting paragraph number plus the object's ending paragraph number to twice the total number of paragraphs in the input script, quantifying the object's relative central position in the entire script.
[0123] After all script objects have been classified, merged, identified, and located, a unified script object tree and object index table are output.
[0124] The object index table records: object stability identifier, object category code, object hierarchical path code, object start paragraph number, object end paragraph number, preceding object identifier, following object identifier, and object text anchor summary.
[0125] S2. Based on the unified script object tree, separate and generate the main script file and the external metadata file, and establish a two-way binding relationship between the main script file and the external metadata file.
[0126] Furthermore, a set of text objects for constructing the main script file is extracted from the unified script object tree in hierarchical order. The main script content includes the script's main semantic objects, namely scene-level objects, character-level objects, dialogue-level objects, prompt-level objects, and ordinary narrative segment objects that are classified into the corresponding scene-level objects or dialogue-level objects.
[0127] Specifically, for any script object, its category code determines whether it belongs to the main script content. If the object's category belongs to the main script category set, the object is added to the main script content sequence. For example, when the script object category codes are 1, 2, 3, and 4, they correspond to scene-level objects, character-level objects, dialogue-level objects, and prompt-level objects, respectively. Ordinary narrative paragraph objects are not written into the main script content sequence as independent nodes; their text content is written into the main script file along with the scene-level or dialogue-level object to which they belong.
[0128] Generate a sequence of main script objects according to the traversal order of the objects in the unified script object tree.
[0129] After obtaining the sequence of main manuscript objects, the text content of each object is written into the main manuscript file in sequence, while embedding the minimum necessary identification information.
[0130] Specifically, the content written to the main text for objects in the sequence is represented as follows:
[0131]
[0132] in, This represents the content written to the main text for objects in the sequence. Represents the original text content of the object. Indicates the object's stability identifier. This indicates that the main manuscript is written to the function.
[0133] It should be noted that the main manuscript writing function processes the following rules: first, it reads the object's text content; then, based on the object's category, it writes corresponding stable identifiers before, after, and in the hidden marker area of the text content; finally, it generates the main manuscript writing content, represented as follows:
[0134] ;
[0135] in, This represents the string concatenation operation. Indicates stability identifier The generated identifier reference fragment.
[0136] Secondly, the main document does not directly display complete and stable identifiers, but only embeds simplified identifier fragments, such as embedding scene identifiers in scene titles, implicitly appending object numbers before dialogue paragraphs, and recording identifier references in invisible marker areas.
[0137] Further, calculate the abstract value of the main manuscript file. , is represented as:
[0138] ;
[0139] in, This indicates the calculation of the abstract value of the main manuscript file. This represents the text encoding function.
[0140] It should be noted that the text encoding function processes text as follows: each character in the main text is read sequentially, the character encoding value of each character is obtained, and the values are summed according to the character positions, as shown below:
[0141] ;
[0142] in, This indicates the content written in the main manuscript. The total number of characters, Indicates the character position number. Indicates the first The character encoding value corresponding to each character.
[0143] While generating the main script file, an add-on metadata file is constructed based on the unified script object tree.
[0144] First, for script objects, generate metadata record items in the external metadata file.
[0145] Specifically, through metadata encapsulation functions, object stability identifiers, object category codes, object hierarchical path codes, object location information, and object extended attribute sets (including character attributes, item hints, crafting constraints, version tags, etc.) are encapsulated into metadata record items.
[0146] Subsequently, the metadata records of all objects are aggregated into a plugin metadata set.
[0147] At the same time, an object mapping table is created in the external metadata file.
[0148] Specifically, the mapping table records the object's stability identifier, the corresponding position index in the main manuscript, the starting paragraph number and the ending paragraph number, as well as the identifiers of the preceding and following adjacent objects.
[0149] Calculate the add-on metadata file digest value based on the metadata records of all objects, and represent it as follows:
[0150] ;
[0151] in: This represents the digest value of the add-on's metadata file. Indicates the first Metadata record item for an object, This represents the metadata encoding function.
[0152] It should be noted that the metadata encoding function processes the following rules: first, the metadata record item is expanded into a field string according to a fixed field order; then, the positional sum of the character encoding values in the field string is calculated, as follows:
[0153] ;
[0154] in, Represents metadata record items Total number of characters after expansion Indicates the character position number. Indicates the first The character encoding value corresponding to each character.
[0155] The joint verification value is calculated based on the main manuscript abstract value and the external metadata abstract value, and is expressed as follows:
[0156] ;
[0157] Where Z represents the joint check value, This represents a consistency combination function used to generate a joint verification value between the main manuscript and the add-on.
[0158] It should be noted that the consistency combination function processing rule is as follows: the main manuscript abstract value and the external metadata abstract value are combined according to the defined parameters, and a cross term is introduced so that the joint verification value changes synchronously when any abstract changes, expressed as:
[0159] ;
[0160] in, , , , To limit the parameters, This represents the value of the main manuscript abstract. This represents the summary value of the add-on's metadata.
[0161] It should be noted that during the system initialization phase, a set of sample script data was collected to obtain the numerical range of the main script summary value and the external metadata summary value:
[0162] ;
[0163] Then, the parameters are determined according to the normalization constraints:
[0164] ; ;
[0165] The constraints that must be met for the parameter values are: , , Not equal to zero and Not less than zero
[0166] And preferably satisfying: .
[0167] Based on the joint verification value, a two-way binding relationship is established between the main manuscript file and the external metadata file.
[0168] Specifically, the two-way binding relationship is established through three types of information:
[0169] Write the identifier of the external metadata file in the header of the main file, and write the identifier of the main file in the header of the external metadata file to form a file-level mutual reference relationship.
[0170] The simplified identifier embedded in the main file is consistent with the complete and stable identifier in the external metadata file, achieving object-level mapping.
[0171] The joint checksum is written to both the main manuscript file and the external metadata file to verify their consistency. When the checksum in the main manuscript file equals the checksum in the external metadata file, the main manuscript file and the external metadata file are considered to be matched.
[0172] S3. Receive the target format output instruction, perform layered trimming and field mapping of the metadata in the external metadata file according to the carrying capacity of the target format, and generate the main manuscript file, external metadata file and bidirectional index record in the target format.
[0173] Furthermore, obtain the target format output instruction.
[0174] Specifically, the output instructions include a target format identifier, an output precision level parameter, and a set of optional field constraints. The target format identifier indicates the type of script format to be output, such as plain text script format, structured script format, and layout display format.
[0175] After parsing the target format identifier, the format capability description function is called to obtain the target format's carrying capacity vector, which is represented as:
[0176] ;
[0177] in, Represents a multidimensional capability vector. Functions that describe formatting capabilities Indicates the target format identifier.
[0178] It should be noted that the mapping rule for the format capability description function is as follows:
[0179] When the target format is identified as a plain text script format, the target format capability vector is determined as follows: ;
[0180] When the target format is identified as a structured script format, the target format capability vector is determined as follows: ;
[0181] When the target format is identified as a layout display format, the target format capability vector is determined as follows: ;
[0182] When the target format is identified as a film breakdown data format, the target format capability vector is determined as follows: ;
[0183] When the target format is identified as a localized exchange format, the target format capability vector is determined as follows: ;
[0184] in, , Indicates the load-bearing capacity of the hierarchical structure. Indicates the field's expandability. Indicates the ability to embed identifiers. Indicates the annotation's carrying capacity. This represents the implicit metadata expression capability, and the value range of each capability item is 0. 1.
[0185] Based on the target format capability vector, the external metadata set Each metadata field in the dataset undergoes a capacity assessment.
[0186] Specifically, define the field to carry the decision function. , is represented as:
[0187] ;
[0188] in: Indicates the first One field, This indicates the matching value for the complexity of the field structure. This indicates the degree to which a field is supported in the target format. This indicates the weight of the field's influence on script reading. These are the weighting coefficients.
[0189] It should be noted that the three weighting coefficients in the field carrying determination function were obtained through statistical analysis of the field mapping success rate and the impact on the readability of the main manuscript in historical multi-format output samples, and were fixedly configured during system initialization. The values of the three weighting coefficients satisfy the normalization constraint. The value is the structural complexity weight. 0.30~0.40, Format Support Weight 0.40~0.50, reading influence weight 0.20~0.30.
[0190] Based on the value of the field carrying determination function, the fields are divided into three levels: basic output field layer, enhanced output field layer, and external reserved field layer.
[0191] Specifically,
[0192] After the field hierarchy is defined, the external metadata collection is... Perform layered trimming to generate a subset of metadata in the target format, including a base output layer metadata set, an enhanced output layer metadata set, and an external retained layer metadata set.
[0193] Specifically, layered clipping is achieved through the following selection function:
[0194] ; ; ;
[0195] in, and The threshold for layered cropping, and , Represents the basic output layer metadata collection. This represents an enhanced output layer metadata collection. This represents the set of metadata for the external plugin retention layer.
[0196] It should be noted that the tiered pruning threshold was obtained by evaluating the mapping effect of metadata fields under different target formats through offline experiments and by tuning it in combination with the importance weight of the fields. It was then fixed as a configuration parameter during system initialization and set as the basic output threshold. 0.70~0.85, Enhanced Output Threshold 0.40~0.60
[0197] After completing the layered cropping, field mapping is performed on the fields in the basic output layer and the enhanced output layer, and the target format master file is generated.
[0198] Specifically, mapping is performed based on the original text content of the script object output in the target format, the target format mapping function, and the metadata of the base layer and enhancement layer.
[0199] It should be noted that the mapping rules include embedding basic fields directly into the main manuscript structure; mapping enhanced fields as additional attributes when the target format allows; and retaining stability identifiers implicitly.
[0200] The target master file is generated through object mapping.
[0201] Based on the metadata not written to the main file, the target plugin metadata file is compiled into a set of target plugin metadata files.
[0202] At the same time, the external metadata is reorganized to maintain stable identifiers, hierarchical paths, and location information.
[0203] Based on the mapping relationship between the target master file and the target add-on metadata file, a two-way index record is generated.
[0204] Define an indexed record item as follows:
[0205] ;
[0206] in: This indicates the definition of an indexed record item. For object stability identification, This is the index of the object's position in the target master file. This refers to the index location of the object in the target add-on metadata file. This is a function for generating indexes.
[0207] It should be noted that the index generation function is used to establish a positional association between the unified script object and the target master script file and the target external metadata file. Specifically, the index generation function combines the parameters according to the field concatenation rules to form a unique index structure, and ensures that bidirectional positioning can be achieved in both the master script file and the external metadata file through stable identifiers and position indexes.
[0208] The field concatenation rule involves selecting the stability identifier, main script location index, external metadata location index, and hierarchical path encoding sequentially for any script object. Each field is then standardized to meet a unified character set and length constraint. Subsequently, the fields are concatenated in a fixed order: "stability identifier—main script location—external location—hierarchical path," with separators inserted between adjacent fields to form a combined string, expressed as:
[0209] ;
[0210] in This indicates a field concatenation operation. Indicates a separator. This indicates the hierarchical path encoding.
[0211] Furthermore, for combined strings Perform consistent encoding processing to obtain the final index record items.
[0212] All index items are aggregated into an index set, which is then written to both the main file and the external metadata file.
[0213] S4. Perform difference identification on the modified target format file, and perform write-back and merging based on the stability identifier and positioning information, and synchronously update the unified script object tree, main manuscript file, external metadata file and bidirectional index record.
[0214] Furthermore, when the target format file is modified, such as through manual editing, automatic modification by tools, or changes in the production process.
[0215] Retrieve the modified target format file package, which includes the target format master file, the target format external metadata file, and bidirectional index records. If only the target format master file is received, retrieve the target format external metadata file and bidirectional index records based on the file identifier carried in the target format master file.
[0216] It should be noted that the target format file is the actual output file of the target main file after format adaptation, layer trimming, and field mapping.
[0217] Then, following the structured parsing rules, the modified target format file is re-parsed to obtain the modified object candidate sequence.
[0218] Among them, the candidate objects include candidate text, candidate category, candidate paragraph position, candidate preceding object, and candidate following object.
[0219] First, perform a first-level match based on stable identifiers.
[0220] Specifically, extract the stability identifier carried by the candidate object. If the stability identifier exists, search for the same stability identifier in the original bidirectional index record.
[0221] Among them, the candidate object refers to the script object to be matched obtained from the parsed target format file, which includes text content, category candidate, stability identifier, hierarchical path and additional metadata; the candidate original object refers to the original object that already exists in the unified script object tree and is used as a matching reference.
[0222] When the stability identifier of the candidate object is the same as the stability identifier in the original bidirectional index record, it is determined that the candidate object and the original script object are the same object, and the difference identification is initiated.
[0223] When the target format does not support hidden identifiers or annotation information, stable identifiers are preserved as visible but unaffected inline markers, short prefix codes, side note numbers, or independent index files; if the user deletes the identifier, a secondary matching is performed by combining bidirectional index records, text anchors, and relative positions in the external metadata file.
[0224] Secondary matching is performed based on location information.
[0225] Specifically, the location similarity is calculated between each candidate object and the original candidate object, and is expressed as follows:
[0226] ;
[0227] in: Indicates the hierarchical path matching value. This indicates the matching value of the preceding and following adjacent objects. This represents the text anchor matching value. Indicates the relative position matching value. These are the weighting coefficients.
[0228] It should be noted that the four weighting coefficients were obtained by statistically analyzing the contribution of each matching feature in the historical script rewrite samples to the final matching result, while satisfying the normalization constraint. Under the premise that the value range is: hierarchical path matching weight 0.35~0.45, adjacency matching weight 0.20~0.30, text anchor matching weight 0.20~0.30, relative position matching weight The values range from 0.10 to 0.20, where each weight satisfies 0. 1.
[0229] When the location similarity is greater than the similarity threshold, the candidate object is determined to be the same object as the original script object; if multiple original script objects meet the similarity threshold, the one with the highest location similarity is selected as the same object; if no object meets the threshold, the candidate object is determined to be a new object.
[0230] It should be noted that the similarity threshold is obtained by statistical analysis of the location similarity distribution in the historical script rewriting samples, and the value is usually between 0.65 and 0.80.
[0231] After completing object matching, perform difference identification on the matched objects.
[0232] Specifically, for the candidate object and the original script object, the text difference value is calculated and expressed as:
[0233] ;
[0234] in, This represents the normalized text of the original script object. Represents the normalized text of the object candidates. This represents the character edit distance between the two. This indicates the larger of the two lengths.
[0235] At the same time, determine the type of change in the external metadata fields; if the text difference value is greater than the text change threshold, it is determined to be text modification; if the object hierarchy path changes, it is determined to be object movement; if the candidate has no corresponding original object, it is determined to be object addition; if the original script object does not appear in the modified object candidate sequence, it is determined to be object deletion; if only the attached fields or annotation information changes, it is determined to be metadata modification.
[0236] It should be noted that the text change threshold is obtained by statistical analysis of the edit distance normalization results in the historical script revision sample and offline tuning in combination with the false positive rate and false negative rate. It is configured as a fixed parameter during system initialization and is usually set to 0.15~0.30.
[0237] It should be noted that when the same object candidate simultaneously meets the judgment conditions of multiple difference types, the primary difference type is determined according to the priority order of object deletion, object addition, object movement, text modification, and metadata modification. Among them, when object movement and text modification occur simultaneously, the hierarchical path and order of the object in the unified script object tree are updated first, and then the candidate text of the object candidate is written back to the corresponding original script object. When text modification and metadata modification occur simultaneously, the object content verification code and the corresponding metadata record items in the external metadata file are updated respectively.
[0238] Perform deterministic write-back merging based on the difference type. The specific write-back rules are as follows: A1-A5
[0239] A1. When the difference type is text modification, write the candidate text of the object candidate back to the corresponding original script object in the unified script object tree, and retain the original stable identifier.
[0240] A2. When the difference type is object movement, update the parent object identifier, preceding object identifier, succeeding object identifier, start paragraph number, and end paragraph number of the object in the unified script object tree, and synchronously update the positioning information in the object index table; the object stability identifier remains unchanged.
[0241] A3. When the difference type is "object addition", generate a new stable identifier and positioning information for the new object, and insert the new object into the unified script object tree.
[0242] A4. When the difference type is object deletion, mark the corresponding object as deleted in the unified script object tree and write it into the version relationship data.
[0243] A5. When the difference type is metadata modification, the modified additional fields and tag information will be written to the metadata record item under the stable identifier in the external metadata file.
[0244] It should be noted that the stability identifier is used to uniquely identify script objects. The stability identifier is generated by the object category code and the object's initial generation sequence number. The object hierarchy path code, object sibling sequence code, parent object identifier, preceding object identifier, succeeding object identifier, start paragraph number, and end paragraph number are stored separately as positioning information in the object index table. The object content verification code is stored separately in the external metadata file and is used to determine whether the object's text content has changed. When text modification is detected, only the object content verification code is updated, and the stability identifier remains unchanged; when object movement is detected, only the positioning information is updated, and the stability identifier remains unchanged.
[0245] After the write-back and merging are completed, the text representations of the affected objects in the main script file are regenerated based on the updated unified script object tree, and the corresponding metadata record items in the external metadata file are updated synchronously.
[0246] Specifically, for objects that have changed, the main manuscript summary value, the external metadata summary, and the joint verification are recalculated.
[0247] Subsequently, update the target location index, external metadata index location, version number, and checksum of the object in the bidirectional index record.
[0248] After the update, the main manuscript file, external metadata file, and bidirectional index records are now consistent again.
[0249] Each write-back and merge generates a version change record.
[0250] Specifically, the version change log includes the source file identifier, the stability identifier of the modified object, the difference type, the digest value before modification, the digest value after modification, the modification time, and the write-back result status.
[0251] All version change records are written to the version relationship data area in the add-on metadata file in the order they occur.
[0252] This embodiment also provides a multi-format script output and metadata hierarchical integration system, including:
[0253] The structured parsing module is responsible for acquiring the input script, performing structured parsing on the input script, constructing a unified script object tree according to script-level, scene-level, character-level, dialogue-level, and prompt-level objects, and generating stable identifiers and positioning information for each script object.
[0254] The two-way binding module is responsible for generating the main script file and the external metadata file based on the unified script object tree, and establishing a two-way binding relationship between the main script file and the external metadata file.
[0255] The output adaptation module is responsible for receiving output instructions in the target format, performing layered trimming and field mapping of metadata in the external metadata file according to the carrying capacity of the target format, and generating the main manuscript file, external metadata file, and bidirectional index records in the target format.
[0256] The difference write-back and merge module is responsible for identifying differences in the modified target format file, performing write-back and merge based on the stability identifier and positioning information, and synchronously updating the unified script object tree, the main manuscript file, the external metadata file, and the bidirectional index record.
[0257] In summary, this invention achieves bidirectional positioning of the script object between the target main manuscript location and the external metadata record by generating a main manuscript file in the target format, an external metadata file, and a bidirectional index record, thereby improving the accuracy of subsequent retrieval, verification, and write-back processing. By synchronously updating the unified script object tree, main manuscript file, external metadata file, and bidirectional index record after write-back merging, it achieves linkage maintenance between multiple files, ensuring the synchronous consistency of the script text, metadata, and index relationship after editing iterations.
[0258] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for multi-format script output and hierarchical metadata integration, characterized in that, include: The input script is obtained, and the input script is parsed in a structured manner. A unified script object tree is constructed according to script-level, scene-level, character-level, dialogue-level, and prompt-level objects, and stable identifiers and positioning information are generated for each script object. Based on a unified script object tree, the main script file and the external metadata file are generated separately, and a two-way binding relationship is established between the main script file and the external metadata file; Receive the target format output instruction, perform layered trimming and field mapping of the metadata in the external metadata file according to the carrying capacity of the target format, and generate the main manuscript file, external metadata file and bidirectional index record in the target format; The modified target format file is subjected to difference identification, and a write-back and merging is performed based on the stability identifier and positioning information, synchronously updating the unified script object tree, the main script file, the external metadata file, and the bidirectional index record.
2. The method for multi-format script output and hierarchical metadata integration as described in claim 1, characterized in that, The process of obtaining the input script and performing structured parsing on the input script includes: Perform text normalization on the input script to unify line breaks, spaces, punctuation, and paragraph boundaries, and obtain a standard paragraph sequence. Assign paragraph sequence numbers to each paragraph in the standard paragraph sequence according to the order in which the paragraphs appear in the input script; Based on fixed semantic rules, the matching scores between each paragraph and scene-level, character-level, dialogue-level, and prompt-level objects are calculated respectively, and the object category with the highest matching score is determined as the initial object type of the corresponding paragraph. Based on the object type relationship between adjacent paragraphs, the initial object type is corrected for consistency, and the corrected object type is obtained.
3. The method for multi-format script output and metadata hierarchical integration as described in claim 1, characterized in that, The process of constructing a unified script object tree based on script-level, scene-level, character-level, dialogue-level, and cue-level objects, and generating stable identifiers and positioning information for each script object, includes: Merge consecutive paragraphs of the same type after correction to form a script object; Using the script-level object as the root node, attach scene-level objects under the script-level object, and attach character-level objects, dialogue-level objects, and prompt-level objects under the scene-level object to build a unified script object tree; A stable identifier is generated based on the object category, hierarchical path, same-level sequential position, and object content verification information of each script object; Location information is generated based on the start paragraph number, end paragraph number, parent object identifier, preceding object identifier, and following object identifier of each script object; Write the stability identifier and positioning information into the object index table, and save the object index table in association with the unified script object tree.
4. The method for multi-format script output and metadata hierarchical integration as described in claim 2, characterized in that, The process of separating and generating the main script file and the add-on metadata file based on the unified script object tree includes: Extract the text content of scene-level objects, character-level objects, dialogue-level objects, and prompt-level objects according to the hierarchical traversal order of the unified script object tree; Generate the main script content sequence based on the parent-child relationship and hierarchical order of each script object in the unified script object tree; Write the sequence of main script content into the main script file, and retain stable identifiers for each script object in the main script file; Generate plugin metadata files based on the stable identifier, object category, hierarchical path, location information, and extended attributes of each script object; An object mapping table is created in the external metadata file. The object mapping table records the stable identifier, hierarchical path, location information, and position of each script object in the main script file.
5. The method for multi-format script output and metadata hierarchical integration as described in claim 1, characterized in that, The establishment of a two-way binding relationship between the main file and the external metadata file includes: Generate a main manuscript file identifier for the main manuscript file, and generate a plugin metadata file identifier for the plugin metadata file; Write the external metadata file identifier into the main file, and write the main file identifier into the external metadata file to form a two-way file-level reference relationship; Write the stable identifiers of each script object into the main script file and the external metadata file respectively to form an object-level binding relationship; Calculate the summary value of the main file and the summary value of the external metadata file respectively; A joint verification value is generated based on the summary value of the main manuscript file and the summary value of the external metadata file, and the joint verification value is written to the main manuscript file and the external metadata file respectively.
6. The method for multi-format script output and metadata hierarchical integration as described in claim 5, characterized in that, The layered trimming of metadata in external metadata files based on the target format carrying capacity includes: Receive a target format output command that includes a target format identifier; Based on the target format identifier, call the format capability description table to determine the target format's ability to support hierarchical structure, custom fields, hidden identifiers, and annotation information; Based on the carrying capacity, the carrying capacity of each metadata field in the external metadata file is determined; Based on the capacity assessment results, the metadata fields are divided into the basic output layer, the enhanced output layer, and the external retention layer.
7. The method for multi-format script output and metadata hierarchical integration as described in claim 1, characterized in that, The generated target format master file, external metadata file, and bidirectional index record include: Write the base output layer mapping into the target format master file; Write the enhanced output layer fields that the target format can support into the main manuscript file; Write the enhanced output layer fields and external reserved layer fields that are not carried by the target format into the external metadata file of the target format; A bidirectional index record is generated based on the stable identifier of the script object, the position index in the main script file, and the record index in the external metadata file.
8. The method for multi-format script output and metadata hierarchical integration as described in claim 7, characterized in that, The difference identification of the modified target format file includes: Obtain the modified target format file and extract the script text, additional fields, annotation information, and stability identifiers. Generate a modified candidate sequence of objects according to the structured parsing rules; The modified candidate sequence of objects is compared with the bidirectional index records, and the corresponding script object is first determined based on the stability identifier; When a stable identifier is missing or cannot be matched, the script object is determined based on the hierarchical path, adjacent objects, text anchors, and relative position in the location information. Based on the specific changes, the types of differences can be identified, including text modification, object movement, object addition, object deletion, and metadata modification.
9. The method for multi-format script output and metadata hierarchical integration as described in claim 7 or 8, characterized in that, The process of performing write-back merging based on stability identifiers and positioning information, and synchronously updating the unified script object tree, main script file, external metadata file, and bidirectional index records, includes: Perform deterministic write-back merging based on the difference type and write-back rules; Based on the updated unified script object tree and add-on metadata file, regenerate the master script file and update the bidirectional index records.
10. A multi-format script output and metadata hierarchical integration system, based on the multi-format script output and metadata hierarchical integration method according to any one of claims 1 to 9, characterized in that, include: The structured parsing module is responsible for acquiring the input script, performing structured parsing on the input script, constructing a unified script object tree according to script-level, scene-level, character-level, dialogue-level, and prompt-level objects, and generating stable identifiers and positioning information for each script object; The two-way binding module is responsible for generating the main script file and the external metadata file based on the unified script object tree, and establishing a two-way binding relationship between the main script file and the external metadata file. The output module is responsible for receiving output instructions in the target format, performing layered cropping and field mapping of metadata in the external metadata file according to the carrying capacity of the target format, and generating the main manuscript file, external metadata file, and bidirectional index records in the target format. The difference write-back and merge module is responsible for identifying differences in the modified target format file, performing write-back and merge based on the stability identifier and positioning information, and synchronously updating the unified script object tree, the main manuscript file, the external metadata file, and the bidirectional index record.
