A model building method for digital twins

By detecting the associated characteristic parameters of the file to be parsed and the historical parsed file, combining the parsed file status of the file to be parsed, the parsing process is optimized by incremental parsing or chunk parsing, the problem of inefficient parsing in the complex situation of the files to be parsed in the existing technology is solved, and the efficiency of building a digital twin model is improved.

CN119150842BActive Publication Date: 2025-02-25JINGHANG WEITAI AUTOMATIC TEST EQUIP BEIJING

Patent Information

Application Number
CN202411224492.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2025-02-25
Estimated Expiration
2044-09-03

AI Technical Summary

Technical Problem

The existing digital twin model construction method has failed to optimize targetedly based on the complexity of the files to be parsed during the construction process, resulting in inefficient file parsing process, which in turn reduces the efficiency of digital twin model construction.

Method used

By detecting the associated characteristic parameters of the file to be parsed and the historical parsed file, determining the file processing method, and optimizing the parsing process using incremental parsing or chunked parsing methods based on the parsing optimization strategy of the associated historical parsing file or the parsing file status of the file to be parsed.

Benefits of technology

It improves the parsing efficiency of the files to be parsed, and thus improves the efficiency of digital twin model construction, ensuring the accuracy and speed of the analysis optimization strategy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150842B_ABST
    Figure CN119150842B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of digital twin technology, and in particular to a model building method for digital twins, comprising: storing information of each model file in a file to be parsed; determining a file processing method according to whether there is an associated historical parsing file; determining a parsing optimization strategy according to the parsing file status of the file to be parsed; under the condition that the parsing is completed, generating a data interaction relationship between models, extracting key information in a target element and storing it in a preset data structure; analyzing a target file that has been merged and packaged by a compiler to build a syntax tree of the target file; obtaining a target code file of each level model by converting the syntax tree of the target file, and merging each target code file into an executable file by a linker, wherein data exchange is performed between models in the executable file based on the data interaction relationship between models obtained after parsing. The present invention improves the model building efficiency of the digital twin.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of digital twin technology, and in particular to a model building method for digital twins. Background Art

[0002] A digital twin refers to an accurate model of an entity or system created in a virtual environment through digital technology to simulate and analyze its operating status and behavior in the real world. The model not only contains the geometric structure of the physical entity, but also contains information such as its operating logic and performance parameters. The model construction process involves not only models of different disciplines such as physics, performance, and function, but also models of different life cycles such as requirement models, architecture models, and test models. However, the existing digital twin model construction methods have failed to make targeted adjustments to the parsing process based on the complexity of the files to be parsed during the construction process, making the digital twin model construction inefficient.

[0003] Chinese patent publication number CN114626228A discloses a method for constructing a digital twin model, including a receiving module for receiving physical entity data from a target business, a determination module for entity determination of the received physical entity data, and determination of attribute data included in the entity, a processing module for processing the attribute data, and an abstract module for communication connection with the processing module. The invention reduces the complexity of the model construction process, shortens the development cycle, realizes the rapid construction of the digital twin model, and optimizes the constructed digital twin model through the digital twin model optimization module to obtain the optimal digital twin model, thereby ensuring the accuracy of the constructed digital twin model. However, the above technical solution fails to make targeted optimization for the parsing process according to the complexity of the files to be parsed during the construction process, resulting in poor efficiency of the file parsing process, and thus low efficiency in the model construction of the digital twin. Summary of the invention

[0004] To this end, the present invention provides a model building method for digital twins, which is used to overcome the problem that the prior art fails to make targeted adjustments to the parsing process according to the complexity of the files to be parsed in the construction process, resulting in poor efficiency of the file parsing process and thus low efficiency in model building of the digital twins.

[0005] To achieve the above object, the present invention provides a model construction method for digital twins, comprising:

[0006] Obtaining each model file constituting the target modeling body, performing unified analysis on each model file, and storing the information of each model file of the target modeling body in a file to be analyzed using a system modeling language;

[0007] Determine whether there is an associated historical parsing file by detecting the associated characteristic parameters of the file to be parsed and the historical parsing file;

[0008] Determine the file processing method based on whether there is an associated historical parsing file;

[0009] The file processing method includes optimizing the parsing process for the file to be parsed according to the parsing optimization strategy of the associated historical parsing file, or determining the parsing optimization strategy according to the parsing file status of the file to be parsed;

[0010] Parsing optimization strategies include optimizing the parsing process by using incremental parsing or block parsing;

[0011] When the parsing is completed, the data interaction relationship between the models is generated, the document object model is traversed to determine the target element, the key information in the target element is extracted and stored in the preset data structure;

[0012] According to different categories of key information, the key information is copied to the directory of the corresponding category of the target file;

[0013] Merge and package the model files at each level in the target file, and use the compiler to analyze the target file after merging and packaging to build a syntax tree of the target file;

[0014] The object code files of each level model are obtained by converting the syntax tree of the target file into an intermediate representation in the form of three-address code, and the compiled object code files of each level model are merged into one executable file through a linker.

[0015] Further, the file to be parsed is obtained, and the associated characteristic parameters of the file to be parsed and the historical parsed file are detected, and the file processing method is determined according to whether there is an associated historical parsed file in the historical parsed file;

[0016] The associated characteristic parameters are determined according to the associated characteristic values ​​corresponding to the file to be parsed and each historical parsed file;

[0017] The historical analysis file is a analysis file that has been received and analyzed, the associated historical analysis file is a historical analysis file whose associated characteristic parameter is greater than the preset associated characteristic parameter, and the non-associated historical analysis file is a historical analysis file whose associated characteristic parameter is less than or equal to the preset associated characteristic parameter.

[0018] Further, it is detected whether there is an associated historical parsing file in the historical parsing file, and when there is an associated historical parsing file, the parsing process of the file to be parsed is optimized according to the parsing optimization strategy of the associated historical parsing file.

[0019] Furthermore, if there is no associated historical parsing file, a processing amount reference value and a complex coefficient reference value of the file to be parsed are obtained, and a parsing file status is determined according to the processing amount reference value and the complex coefficient reference value of the file to be parsed, and the parsing file status includes:

[0020] A first preset file state in which the processing volume reference value is greater than a preset processing volume reference value and the complexity coefficient reference value is less than a preset complexity coefficient reference value;

[0021] A second preset file state in which the processing volume reference value is greater than a preset processing volume reference value and the complexity coefficient reference value is greater than or equal to the preset complexity coefficient reference value.

[0022] Furthermore, a parsing optimization strategy is determined according to the parsed file status of the file to be parsed. The parsing optimization strategy includes optimizing the parsing process by adopting an incremental parsing method or a block parsing method.

[0023] Furthermore, when the file to be parsed is in the first preset file state, an incremental parsing method is used to optimize the parsing process. The incremental parsing is to compare the file to be parsed with the historical parsing library and parse some data in the file to be parsed that is not included in the historical parsing library.

[0024] Furthermore, when the file to be parsed is in the second preset file state, a block parsing method is adopted to optimize the parsing process, the file to be parsed is divided into a plurality of modules to be processed, and each module to be processed is processed in parallel;

[0025] There is a positive correlation between the number of modules to be processed distinguished by the file to be parsed and the reference value of the complexity coefficient of the file to be parsed.

[0026] Further, under the condition that the parsing is completed, the data interaction relationship between the models is generated, the document object model is traversed to determine the target element, the key information in the target element is extracted and stored in a preset data structure;

[0027] The parsing completion condition is that the parsing work has been completed for the file to be parsed and a complete document object model has been generated according to the preset rules;

[0028] The document object model is a model representing the structure and content of the document to be parsed, which is obtained after the parsing of the file to be parsed is completed.

[0029] Furthermore, if the target elements in the document object model have completed the extraction and storage of key information, the key information will be copied to the corresponding category directory of the target file according to the different categories of the key information, and the model files at each level in the target file will be merged and packaged. The compiler will perform lexical analysis and syntax analysis on the target files after the merger and packaging to construct a syntax tree for the target file.

[0030] Further, the syntax tree of the target file is converted into an intermediate representation in the form of three-address code to obtain the target code files of each level model, and the target code files of each level model obtained by compilation are merged into one executable file through a linker;

[0031] The data exchange between the models of the executable file is based on the data interaction relationship between the models obtained after parsing.

[0032] Compared with the prior art, the beneficial effect of the present invention lies in that the present invention detects the existence of associated historical parsing files of the file to be parsed and combines the parsing file status of the file to be parsed to ensure the accuracy and speed of selecting the parsing optimization strategy. The present invention improves the parsing efficiency of the file to be parsed, thereby improving the model building efficiency.

[0033] Furthermore, the present invention determines the associated historical analysis file based on the associated characteristic parameters of the file to be analyzed and each historical analysis file, and determines the file processing method based on whether there is an associated historical analysis file in the historical analysis file. If there is an associated historical analysis file, the file to be analyzed is analyzed using the analysis method of the associated historical analysis file, so that the analysis optimization strategy that meets the actual situation of the file to be analyzed can be determined more quickly. The present invention improves the model construction efficiency of the digital twin.

[0034] Furthermore, when there is no associated historical parsing file in the historical parsing file, the present invention determines the parsing file status according to the processing volume reference value and the complexity coefficient reference value of the file to be parsed in the actual construction process, and determines the parsing optimization strategy according to the parsing file status, so that the optimized parsing strategy is more in line with the data processing volume and complexity of the file to be parsed in the actual construction process, so as to improve the file parsing efficiency in the construction process, thereby improving the model construction efficiency of the digital twin.

[0035] Furthermore, the present invention adopts an incremental parsing method to optimize the parsing process of the file to be parsed in the first preset file state, thereby avoiding the low file parsing efficiency caused by the large size of the file to be parsed but limited system resources. The block parsing method is used to optimize the parsing process of the file to be parsed in the second preset file state, reducing the difficulty of parsing while using parallel processing to improve the parsing efficiency, thereby improving the model building efficiency of the digital twin. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A schematic diagram of a model building method for digital twins according to the present invention;

[0037] Figure 2 A flow chart of the present invention for determining an associated historical parsing file according to associated characteristic parameters of the historical parsing file;

[0038] Figure 3 This is a flow chart of the present invention for determining a file processing method according to whether there is an associated historical parsing file in the historical parsing file;

[0039] Figure 4 This is a flow chart of the present invention for determining a parsing optimization strategy according to the parsing file status of a file to be parsed. DETAILED DESCRIPTION

[0040] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0041] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.

[0042] It should be noted that, in the description of the present invention, terms such as "up", "down", "left", "right", "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings. This is merely for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.

[0043] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0044] See also Figures 1 to 4 As shown, the present invention provides a model building method for digital twins, comprising:

[0045] Obtaining each model file constituting the target modeling body, performing unified analysis on each model file, and storing the information of each model file of the target modeling body in a file to be analyzed using a system modeling language;

[0046] Determine whether there is an associated historical parsing file by detecting the associated characteristic parameters of the file to be parsed and the historical parsing file;

[0047] Determine the file processing method based on whether there is an associated historical parsing file;

[0048] The file processing method includes optimizing the parsing process for the file to be parsed according to the parsing optimization strategy of the associated historical parsing file, or determining the parsing optimization strategy according to the parsing file status of the file to be parsed;

[0049] Parsing optimization strategies include optimizing the parsing process by using incremental parsing or block parsing;

[0050] When the parsing is completed, the data interaction relationship between the models is generated, the document object model is traversed to determine the target element, the key information in the target element is extracted and stored in the preset data structure;

[0051] According to different categories of key information, the key information is copied to the directory of the corresponding category of the target file;

[0052] Merge and package the model files at each level in the target file, and use the compiler to analyze the target file after merging and packaging to build a syntax tree of the target file;

[0053] The object code files of each level model are obtained by converting the syntax tree of the target file into an intermediate representation in the form of three-address code, and the compiled object code files of each level model are merged into one executable file through a linker.

[0054] Among them, the target modeling body is a digital twin model composed of the model files currently being processed. The model files contained in the target modeling body are files that describe models of different dimensions, scales and life cycles corresponding to the entities constituting the digital twin model, that is, model files at each level. The models at each level are interrelated but functionally independent. Different types of model files use a unified parser to interpret the structure and content of each model file and use the system modeling language to store the model file information of the target modeling body in the SysML model file, which is the file to be parsed. The parsing method for parsing the file to be parsed in the present invention is DOM parsing. After the parsing is completed, a document object model is obtained, and the executable file is an executable digital twin DTX file.

[0055] Specifically, the file to be parsed is obtained, and the associated characteristic parameters of the file to be parsed and the historical parsed file are detected, and the file processing method is determined according to whether there is an associated historical parsed file in the historical parsed file;

[0056] The associated characteristic parameters are determined according to the associated characteristic values ​​corresponding to the file to be parsed and each historical parsed file;

[0057] The historical parsing file is a parsing file that has been parsed before the current file to be parsed is received, the associated historical parsing file is a historical parsing file whose associated characteristic parameter is greater than the preset associated characteristic parameter, and the non-associated historical parsing file is a historical parsing file whose associated characteristic parameter is less than or equal to the preset associated characteristic parameter.

[0058] Among them, the associated characteristic parameters n is the number of types of associated feature values ​​of the evaluation associated feature parameter, gi is the i-th associated feature value, δi is the weight coefficient corresponding to the i-th associated feature value, the associated feature value of the evaluation associated feature parameter and the corresponding weight coefficient can be set by the user according to the actual situation, and a composition of associated feature values ​​of the evaluation associated feature parameter and the weight coefficient corresponding to each associated feature value are provided, the associated feature value of the evaluation associated feature parameter includes a reference value of the number of models of the same category and a reference value of the similarity of models of the same category, the weight coefficient corresponding to the reference value of the number of models of the same category is 45%, the weight coefficient corresponding to the reference value of the similarity of models of the same category is 55%, the reference value of the number of models of the same category is the number of model files of the same category in each historical parsing file and the file to be parsed, model similarity = the number of the same component modules of the same model file of the file to be parsed and the historical parsing file / the total number of component modules of the model file of the corresponding category in the file to be parsed, and the reference value of the similarity of models of the same category is the average value of the model similarities of each model of the same category in each historical parsing file;

[0059] The value of the preset associated feature parameter can be set by the user according to actual needs and historical records. The stricter the user's judgment requirements for the associated historical analysis file, the smaller the value of the preset associated feature parameter. A method for setting the value of the preset associated feature parameter is provided, and the average value of each associated feature parameter in the historical record is set as the preset associated feature parameter.

[0060] Specifically, it is detected whether there is an associated historical parsing file in the historical parsing file, and when there is an associated historical parsing file, the parsing process of the file to be parsed is optimized according to the parsing optimization strategy of the associated historical parsing file.

[0061] Specifically, if there is no associated historical parsing file, obtain the processing amount reference value and the complexity coefficient reference value of the file to be parsed, and determine the parsing file status according to the processing amount reference value and the complexity coefficient reference value of the file to be parsed. The parsing file status includes:

[0062] A first preset file state in which the processing volume reference value is greater than a preset processing volume reference value and the complexity coefficient reference value is less than a preset complexity coefficient reference value;

[0063] A second preset file state in which the processing volume reference value is greater than a preset processing volume reference value and the complexity coefficient reference value is greater than or equal to the preset complexity coefficient reference value.

[0064] The reference value of the processing volume is the number of bytes in the file to be parsed, and the reference value of the complexity coefficient is F=V×ω V +E×ω E , V is the model reference value of the file to be parsed, the model reference value is the number of model files contained in the target modeling body corresponding to the file to be parsed, E is the model dependency coefficient of the file to be parsed, the model dependency coefficient is determined according to the number of models with dependency relationships in the model files contained in the target modeling body corresponding to the file to be parsed, the model dependency coefficient of the file to be parsed is positively correlated with the number of models with dependency relationships, and the existence of model dependency relationships means that the parsing order of the corresponding parts of the model in the file to be parsed during the parsing process will affect the parsing process, ω V is the weight coefficient corresponding to the model reference value of the file to be parsed, ω E The weight coefficient corresponding to the model dependency coefficient of the file to be parsed can be set by the user according to actual needs and historical records for the model reference value of the file to be parsed and the value of the weight coefficient corresponding to the model dependency coefficient, and a model reference value of the file to be parsed and the value of the weight coefficient corresponding to the model dependency coefficient are provided. The value of the weight coefficient corresponding to the model reference value of the file to be parsed is 40%, and the value of the weight coefficient corresponding to the model dependency coefficient of the file to be parsed is 60%;

[0065] The user can set the preset processing volume reference value and the preset complexity coefficient reference value according to actual conditions and historical records. The higher the user's requirements for the efficiency of parsing files, the smaller the value of the preset processing volume reference value and the smaller the value of the preset complexity coefficient reference value. A method for setting the preset processing volume reference value is provided, and the maximum value of the processing volume reference value in the historical records that have not been optimized for the parsing process and meet the user's requirements for the efficiency of parsing files is recorded as the preset processing volume reference value. A method for setting the preset complexity coefficient reference value is provided, and the average value of the complexity coefficient reference value in the historical records is set as the preset complexity coefficient reference value.

[0066] Specifically, a parsing optimization strategy is determined according to the parsing file status of the file to be parsed. The parsing optimization strategy includes optimizing the parsing process by adopting an incremental parsing method or a block parsing method.

[0067] Specifically, when the file to be parsed is in the first preset file state, an incremental parsing method is used to optimize the parsing process. The incremental parsing is to compare the file to be parsed with a historical parsing library and parse some data in the file to be parsed that is not included in the historical parsing library.

[0068] The historical parsing library is a database consisting of parsed files that have been parsed before receiving the current file to be parsed. The file parsing process is optimized through incremental parsing to avoid low file parsing efficiency caused by large files to be parsed but limited system resources.

[0069] Specifically, when the file to be parsed is in the second preset file state, a block parsing method is used to optimize the parsing process, the file to be parsed is divided into multiple modules to be processed, and each module to be processed is processed in parallel;

[0070] There is a positive correlation between the number of modules to be processed distinguished by the file to be parsed and the reference value of the complexity coefficient of the file to be parsed.

[0071] Among them, the larger the reference value of the complexity coefficient of the file to be parsed, the smaller the amount of data contained in a single module to be processed, and the more modules to be processed correspond to the file to be parsed. However, it is worth noting that models with mutual dependencies need to be divided into the same module to be processed, and the processing order is set according to their dependencies. By dividing the file to be parsed into multiple modules to be processed and parsing each module to be processed in parallel, the parsing difficulty is reduced and the file parsing efficiency is improved.

[0072] Specifically, under the condition that the parsing is completed, the data interaction relationship between the models is generated, the document object model is traversed to determine the target element, the key information in the target element is extracted and stored in the preset data structure;

[0073] The parsing completion condition is that the parsing work has been completed for the file to be parsed and a complete document object model has been generated according to the preset rules;

[0074] The document object model is a model representing the structure and content of the document to be parsed, which is obtained after the parsing of the file to be parsed is completed.

[0075] The target element is an element containing key information of the target modeling body. The element is a basic building block of the document to be parsed. The content of the element is the data between the start tag and the end tag. The key information is the system logical structure composition information of the target modeling body, including the name of the component, the type of connector, and the properties of the port. The preset data structure is a data structure designed and defined in advance by the user according to the specific needs of the model, that is, a custom class and object. Storing the key information in the custom class and object can better represent complex data relationships and behaviors. It is worth noting that this preset data structure makes the target element and key information easier to understand and maintain;

[0076] The preset rules for generating the document object model include: obtaining the root element of the document after parsing is completed and constructing the document object model by traversing the child elements of the root element. The construction process also requires the user to improve the node relationship to construct a complete document object model and verify its correctness. The data exchange relationship between models is the rule followed for data exchange between different models.

[0077] Specifically, if the target elements in the document object model have completed the extraction and storage of key information, the key information will be copied to the corresponding category directory of the target file according to the different categories of the key information, and the model files at each level in the target file will be merged and packaged. The compiler will perform lexical analysis and syntax analysis on the target files after the merger and packaging to construct a syntax tree for the target file.

[0078] Among them, the user can set the category of key information according to the actual modeling needs. After copying the key information category to the corresponding category directory of the corresponding hierarchical model file, the user uses the Python script to merge and package the model files of each level in the target file. The user sets the merging and packaging rules according to the actual modeling situation and writes the Python script based on it. The target file is a DTX file, which contains multiple hierarchical model files;

[0079] The lexical analysis is to decompose the character string in the target file into basic elements, such as keywords, identifiers, numbers and symbols. The grammatical analysis combines the tag sequence generated by the lexical analyzer into a tree structure, i.e., a grammar tree, according to the grammatical rules of the language. The present invention does not specifically limit the analyzer and parser used for lexical analysis and grammar analysis of the target file. The user makes a choice based on the actual modeling process. How to perform lexical analysis and grammar analysis on the target file and the grammar tree construction process is easy for technicians in this field to understand and will not be elaborated here.

[0080] Specifically, the syntax tree of the target file is converted into an intermediate representation in the form of three-address code to obtain the target code files of each level model, and the target code files of each level model obtained by compilation are merged into an executable file through a linker;

[0081] The data exchange between the models of the executable file is based on the data interaction relationship between the models obtained after parsing.

[0082] Among them, converting the syntax tree of the target file into an intermediate representation in the form of three-address code requires traversing the entire syntax tree, and generating corresponding three-address codes according to the type of each node and its child nodes. Since the three-address code contains at most three addresses, converting the syntax tree into an intermediate representation in the form of three-address code reduces the complexity of the compiler backend and improves the efficiency of code generation and compilation;

[0083] The linker merges the compiled object code files into an executable file, including resolving external symbol references, merging the object code into an executable file, and adjusting the code and data positions during the merging process to ensure correct references. In addition, the linker also needs to add the required libraries and runtime support to the executable file. This is easy for technicians in this field to understand and will not be elaborated here.

[0084] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

[0085] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A model building method for digital twins, characterized in that: include: Obtaining each model file constituting the target modeling body, performing unified analysis on each model file, and storing the information of each model file of the target modeling body in a file to be analyzed using a system modeling language; Determine whether there is an associated historical parsing file by detecting the associated characteristic parameters of the file to be parsed and the historical parsing file; Determine the file processing method based on whether there is an associated historical parsing file; The file processing method includes optimizing the parsing process for the file to be parsed according to the parsing optimization strategy of the associated historical parsing file, or determining the parsing optimization strategy according to the parsing file status of the file to be parsed; Parsing optimization strategies include optimizing the parsing process by using incremental parsing or block parsing; When the parsing is completed, the data interaction relationship between the models is generated, the document object model is traversed to determine the target element, the key information in the target element is extracted and stored in the preset data structure; According to different categories of key information, the key information is copied to the directory of the corresponding category of the target file; Merge and package the model files at each level in the target file, and use the compiler to analyze the target file after merging and packaging to build a syntax tree of the target file; The target code files of each level model are obtained by converting the syntax tree of the target file into an intermediate representation in the form of three-address code, and the target code files of each level model compiled are merged into an executable file through a linker. Data exchange between models in the executable file is based on the data interaction relationship between models obtained after parsing.

2. The model building method for digital twins according to claim 1, characterized in that: Obtain the file to be parsed, detect the associated characteristic parameters of the file to be parsed and the historical parsed file, and determine the file processing method according to whether there is an associated historical parsed file in the historical parsed file; The associated characteristic parameters are determined according to the associated characteristic values ​​corresponding to the file to be parsed and each historical parsed file; The historical analysis file is a analysis file that has been received and analyzed, the associated historical analysis file is a historical analysis file whose associated characteristic parameter is greater than the preset associated characteristic parameter, and the non-associated historical analysis file is a historical analysis file whose associated characteristic parameter is less than or equal to the preset associated characteristic parameter.

3. The model building method for digital twins according to claim 2, characterized in that: It is detected whether there is an associated historical parsing file in the historical parsing file, and when there is an associated historical parsing file, the parsing process of the file to be parsed is optimized according to the parsing optimization strategy of the associated historical parsing file.

4. The model building method for digital twins according to claim 3 is characterized in that: If there is no associated historical parsing file, obtain the processing volume reference value and the complexity coefficient reference value of the file to be parsed, and determine the parsing file status according to the processing volume reference value and the complexity coefficient reference value of the file to be parsed. The parsing file status includes: A first preset file state in which the processing volume reference value is greater than a preset processing volume reference value and the complexity coefficient reference value is less than a preset complexity coefficient reference value; A second preset file state in which the processing volume reference value is greater than a preset processing volume reference value and the complexity coefficient reference value is greater than or equal to the preset complexity coefficient reference value.

5. The model building method for digital twins according to claim 4, characterized in that: The parsing optimization strategy is determined according to the parsing file status of the file to be parsed. The parsing optimization strategy includes optimizing the parsing process by adopting an incremental parsing method or a block parsing method.

6. The model building method for digital twins according to claim 5, characterized in that: When the file to be parsed is in the first preset file state, an incremental parsing method is used to optimize the parsing process. The incremental parsing is to compare the file to be parsed with a historical parsing library and parse some data in the file to be parsed that is not included in the historical parsing library.

7. The model building method for digital twins according to claim 6, characterized in that: When the file to be parsed is in the second preset file state, a block parsing method is used to optimize the parsing process, the file to be parsed is divided into multiple modules to be processed, and each module to be processed is processed in parallel; There is a positive correlation between the number of modules to be processed distinguished by the file to be parsed and the reference value of the complexity coefficient of the file to be parsed.

8. The model building method for digital twins according to claim 7, characterized in that: When the parsing is completed, the data interaction relationship between the models is generated, the document object model is traversed to determine the target element, the key information in the target element is extracted and stored in the preset data structure; The parsing completion condition is that the parsing work has been completed for the file to be parsed and a complete document object model has been generated according to the preset rules; The document object model is a model representing the structure and content of the document to be parsed, which is obtained after the parsing of the file to be parsed is completed.

9. The model building method for digital twins according to claim 8, characterized in that: If the target elements in the document object model have completed the extraction and storage of key information, the key information will be copied to the corresponding category directory of the target file according to the different categories of the key information, and the model files at each level in the target file will be merged and packaged. The compiler will perform lexical analysis and syntax analysis on the target files after the merger and packaging to construct a syntax tree for the target file.

10. The model building method for digital twins according to claim 9, characterized in that: The object code files of each level model are obtained by converting the syntax tree of the target file into an intermediate representation in the form of three-address code, and the compiled object code files of each level model are merged into an executable file through a linker; The data exchange between the models of the executable file is based on the data interaction relationship between the models obtained after parsing.

Citation Information

Patent Citations

  • Digital twinborn model construction method

    CN114626228A

  • Event full life cycle digital twinning method, device and equipment

    CN115017141A

  • Digital twinning method, digital twinning device and digital twinning equipment for full life cycle of physical entity

    CN115098472A

Cited By

  • Real-time operation method based on digital twin model

    CN121637190A