Simulation data exchange method and system based on dynamic reflection mechanism

By adopting the simulation data exchange method of the dynamic reflection mechanism in the parallel simulation system to process a variety of data objects, including container data types, the problem of low data exchange efficiency and scalability in the traditional method is solved, and efficient data exchange and communication.

CN118426990BActive Publication Date: 2024-09-17NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410900874.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2024-09-17
Estimated Expiration
2044-07-05

AI Technical Summary

Technical Problem

Existing parallel simulation systems have low efficiency and scalability in data exchange, especially when dealing with container data types. There is a problem of high serialization and deserialization overhead.

Method used

Adopt a simulation data exchange method based on the dynamic reflection mechanism, process multiple data objects, including container data types, through dynamic serialization and deserialization, use a digital dictionary to identify the data type, and operate in strict accordance with the simulation data exchange protocol of the dynamic reflection mechanism.

Benefits of technology

It improves the flexibility and accuracy of data exchange, reduces data access and copy overhead, improves communication efficiency and reliability, and ensures the consistency and standardization of data exchange.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118426990B
    Figure CN118426990B
Patent Text Reader

Abstract

The present application relates to a simulation data exchange method and system based on a dynamic reflection mechanism. The method includes realizing flexible processing of various data objects including container data types through dynamic serialization and deserialization, and using a digital dictionary to identify data types. During the data exchange process, the message content generated by dynamic serialization is delivered to the target system according to the rules specified by the simulation data exchange protocol based on the dynamic reflection mechanism, and then restored to the original data object through dynamic deserialization. The present invention can process various data objects, including container data types, and has stronger scalability. It realizes dynamic serialization and deserialization through a dynamic reflection mechanism, which improves the flexibility of data exchange; the process of dynamic serialization and deserialization is more efficient than traditional methods, reduces the overhead of data access and copying, and improves communication efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical fields of simulation data exchange, distributed parallel simulation system and discrete event parallel simulation system, and in particular to a simulation data exchange method and system based on a dynamic reflection mechanism. Background Art

[0002] Discrete event system simulation drives the simulation model to run based on time or event-driven mode. Each simulation model continuously updates its own state during the simulation process. At the same time, it also needs to read the attribute state data of other simulation models and interact with other models during the simulation process, thus generating a large amount of data interaction behavior. HLA (High Level Architecture) defines the entire distributed simulation as a federation, and the subsystems under the federation are federation members. HLA stipulates OMT (Object Model Template) to describe the common standard format of the information of interest to simulation members in the federation, and all federation members must have a SOM (Simulation Object Model) that complies with the OMT rules to describe the object attributes and interactions that they can update or receive. Next, the SOM collection of all federation members constitutes the FOM (Federation Object Model) of the entire federation, which is used to describe all shared attributes and interaction information of the federation. Therefore, the FOM table contains all data types in the entire federation simulation process. In a distributed environment, the distribution and parsing of this data type are handed over to RTI (Run-Time Infrastructure) for completion.

[0003] At present, the data types that can be used by various mature parallel simulation systems usually include basic data types, enumeration types, arrays, strings, and structures formed by the above. Traditional simulation data exchange usually adopts basic data type exchange, enumeration type exchange, array type exchange and string type exchange.

[0004] However, the above-mentioned traditional simulation data exchange method has technical problems of low efficiency and scalability. Summary of the invention

[0005] Based on this, it is necessary to provide a simulation data exchange method based on a dynamic reflection mechanism and a simulation data exchange system based on a dynamic reflection mechanism to address the above technical problems.

[0006] In order to achieve the above objectives, the embodiments of the present invention adopt the following technical solutions:

[0007] On the one hand, a simulation data exchange method based on a dynamic reflection mechanism is provided, comprising:

[0008] Dynamically serialize the data object to be sent according to the selected serialization format to generate message content; the data type of the data object includes the container data type, and in the dynamic serialization process, a digital dictionary is used to identify the data type of the data object;

[0009] Deliver message content to the target system;

[0010] The message content is dynamically deserialized and restored to a data object; the process of dynamic serialization, the process of transmitting the message content and the process of dynamic deserialization are carried out in accordance with the rules specified by the simulation data exchange protocol based on the dynamic reflection mechanism.

[0011] On the other hand, a simulation data exchange system based on a dynamic reflection mechanism is also provided, comprising:

[0012] The sending system is used to dynamically serialize the data object to be sent according to the selected serialization format to generate the message content; the data type of the data object includes the container data type, and in the dynamic serialization process, a digital dictionary is used to identify the data type of the data object;

[0013] A delivery module, used to deliver the message content to the target system;

[0014] The target system is used to dynamically deserialize the message content and restore it into a data object; the dynamic serialization process, the process of transmitting the message content and the dynamic deserialization process are carried out in accordance with the rules specified by the simulation data exchange protocol based on the dynamic reflection mechanism.

[0015] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0016] The above-mentioned simulation data exchange method and system based on dynamic reflection mechanism can handle a variety of data objects, including container data types, and has stronger scalability. Dynamic serialization and deserialization are realized through dynamic reflection mechanism, which improves the flexibility of data exchange; the use of digital dictionary to identify data types helps to ensure accurate identification and restoration of various data types in data exchange, and improves the accuracy, reliability and transmission efficiency of communication. Strictly follow the rules specified by the simulation data exchange protocol based on dynamic reflection mechanism to ensure the consistency and standardization of data exchange. The process of dynamic serialization and deserialization is more efficient than traditional methods, reduces the overhead of data access and copying, and improves communication efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 A schematic diagram of a flow chart of a simulation data exchange method based on a dynamic reflection mechanism in one embodiment;

[0019] Figure 2 A schematic diagram of the logical structure of a simulation data exchange protocol module based on a dynamic reflection mechanism in one embodiment;

[0020] Figure 3 A schematic diagram of the workflow of a basic type parsing module of an object description file in one embodiment;

[0021] Figure 4 A schematic diagram of the workflow of an object description file container type parsing module in one embodiment;

[0022] Figure 5 The following is a schematic diagram of the workflow of a basic data type information parsing module in one embodiment;

[0023] Figure 6 The following is a schematic diagram of the workflow of a container data type information parsing module in one embodiment;

[0024] Figure 7 A schematic diagram of a workflow of a data structure construction management module in one embodiment;

[0025] Figure 8 A schematic diagram of the workflow of a data structure access management module in one embodiment;

[0026] Fig. 9 The following is a schematic diagram of the workflow of a data dynamic serialization module in one embodiment;

[0027] Fig.10 The figure is a schematic diagram of the module structure of a simulation data exchange system based on a dynamic reflection mechanism in one embodiment. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0030] It should be noted that the reference to "embodiment" in this document means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The presentation of the phrase at various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments.

[0031] In the process of studying and implementing this application, the data types that can be used by various mature parallel simulation systems usually include basic data types, enumeration types, arrays, strings, and the structures formed by the above, but it is difficult to implement certain container data types such as vectors, maps, and lists in high-level languages ​​such as C++ and Java. On the one hand, because these container data types can dynamically add or delete elements, the number of bytes of memory occupied will change. On the other hand, the memory space of some container data types is not continuous, and contains pointers inside, and pointer types cannot be serialized. A common solution is to use an indefinite-length array to equivalently express the content information of the container, but this also results in having to traverse the entire container during serialization and deserialization, resulting in huge data access and copying overhead. On the other hand, in order to avoid using the reflection mechanism to access data completely during operation, which will cause additional serialization and deserialization overhead for RTI (after generating the header file in advance, the sub-members of the data can be accessed through the declaration of the header file), many simulation systems adopt the development method of first generating the header file based on the FOM table and then developing the federated members. However, this development method does not take advantage of the reusability of the federated members, because the already developed federated members must also include the FOM table header file of the new federated RTI again and then be recompiled to adapt their RTI.

[0032] In this regard, the present invention provides a simulation data exchange method based on a dynamic reflection mechanism, which realizes flexible processing of multiple data objects including container data types through dynamic serialization and deserialization, and uses a digital dictionary to identify data types. In the data exchange process, according to the rules specified by the simulation data exchange protocol based on the dynamic reflection mechanism, the message content generated by dynamic serialization is transmitted to the target system, and then restored to the original data object through dynamic deserialization.

[0033] The simulation data exchange method based on the dynamic reflection mechanism of the present invention can process a variety of data objects, including container data types, and has stronger scalability. Dynamic serialization and deserialization are realized through the dynamic reflection mechanism, which improves the flexibility of data exchange; the use of digital dictionaries to identify data types helps to ensure accurate identification and restoration of various data types in data exchange, and improves the accuracy, reliability and transmission efficiency of communication. Operations are strictly carried out in accordance with the rules specified in the simulation data exchange protocol based on the dynamic reflection mechanism to ensure the consistency and standardization of data exchange. The process of dynamic serialization and deserialization is more efficient than traditional methods, reduces the overhead of data access and copying, and improves communication efficiency.

[0034] The following will describe the implementation of the present invention in detail with reference to the accompanying drawings in the embodiment diagram of the present invention.

[0035] In one embodiment, Figure 1 As shown, the embodiment of the present application provides a simulation data exchange method based on a dynamic reflection mechanism, including the following processing steps S12-S16:

[0036] S12, dynamically serialize the data object to be sent according to the selected serialization format to generate message content; the data type of the data object includes a container data type, and in the dynamic serialization process, a digital dictionary is used to identify the data type of the data object.

[0037] It can be understood that in the simulation data exchange, the data object to be sent is dynamically serialized according to the selected serialization format. Dynamic serialization refers to converting the data object into a transmittable format according to its actual structure at runtime. The data object may contain various data types, such as basic data types, enumeration types, arrays, strings, and structures formed by the above. In particular, the data types also include container data types, such as vector, map, list, etc. These container data types have dynamic size and structure, so they need special processing during the serialization process.

[0038] In the dynamic serialization process, a digital dictionary is used to identify the data type of a data object. The digital dictionary is a mapping relationship that maps the data type to a unique digital identifier so that the type of the data object can be accurately identified and restored during data transmission.

[0039] Specifically, in actual implementation, the following steps can be used to complete dynamic serialization: Traverse the members of the data object, including members of the container data type. Perform serialization operations on each member according to its data type. For container types, recursive serialization is required to ensure that the elements inside the container can also be serialized correctly. Use a digital dictionary to map the data type of each member to a unique identifier, and add the identifier information to the serialized message content. Organize the serialized data into message content according to the selected serialization format.

[0040] Through the above steps, the dynamic serialization process converts the data object into a transmittable message content, and uses a digital dictionary to identify the data type of each data member so that it can be accurately deserialized at the receiving end. This design ensures the effective processing of complex data objects containing container data types.

[0041] S14, delivering the message content to the target system.

[0042] It can be understood that delivering the message content to the target system means sending the dynamically serialized message to the target system for subsequent processing and parsing in the target system. This is a key step in data transmission between different systems. The target system can be other simulation nodes, remote computers, or any entity that needs to receive and process messages.

[0043] The message content is transmitted according to the simulation data exchange protocol based on the dynamic reflection mechanism, and the serialized message content is transmitted to the target system through the network, message queue or other communication mechanism. It is ensured that the transmitted message content includes the serialization information of the data object and the identification of the digital dictionary. Specifically, the serialized message content is transmitted to the target system using the communication library or protocol, and the digital dictionary information used to identify the data type is included in the transmission.

[0044] S16, dynamically deserialize the message content and restore it into a data object; the dynamic serialization process, the process of transmitting the message content and the dynamic deserialization process are performed in accordance with the rules specified by the simulation data exchange protocol based on the dynamic reflection mechanism.

[0045] It can be understood that dynamic deserialization refers to the process of restoring the serialized message content into a data object. This process requires the correct restoration of the data object according to the rules and digital dictionary information during serialization. Extract the serialized data and digital dictionary identifier from the received message. Use the identifier information in the digital dictionary to determine the data type of the data object contained in the message. For the selected serialization format, restore the serialized byte stream to a data object according to the specified rules. Generate the corresponding data object according to the rules for the restored data.

[0046] Specifically, regarding message content extraction: the communication library or protocol can be used to extract the received message content. Digital dictionary restoration: Use the identifier information in the digital dictionary to determine the data type of the data object. Deserialization process: According to the format used during serialization, such as binary or JSON, restore the byte stream according to the specified parsing rules. Data object generation: Use the deserialized data to generate the corresponding data object according to the specified data object type. Follow the rules specified in the protocol: Ensure that the entire dynamic deserialization process complies with the provisions of the simulation data exchange protocol based on the dynamic reflection mechanism. This includes the correct use of the digital dictionary, consistency of the serialization format, etc. Overall, the goal of dynamic deserialization is to restore the correct data object from the serialized message so that the subsequent simulation process can correctly process and use this data.

[0047] In the above-mentioned simulation data exchange method based on dynamic reflection mechanism, the simulation data exchange method based on dynamic reflection mechanism of the present invention can process multiple data objects, including container data types, and has stronger scalability. Dynamic serialization and deserialization are realized through dynamic reflection mechanism, which improves the flexibility of data exchange; the use of digital dictionary to identify data types helps to ensure accurate identification and restoration of various data types in data exchange, and improves the accuracy, reliability and transmission efficiency of communication. Operations are strictly carried out in accordance with the rules specified in the simulation data exchange protocol based on dynamic reflection mechanism to ensure the consistency and standardization of data exchange. The process of dynamic serialization and deserialization is more efficient than traditional methods, reduces the overhead of data access and copying, and improves communication efficiency.

[0048] In one embodiment, the above-mentioned simulation data exchange method based on dynamic reflection mechanism, wherein the implementation steps of the simulation data exchange protocol based on dynamic reflection mechanism include:

[0049] According to the object description file path in the assumption file, the object description file is parsed to obtain the data type definition declaration.

[0050] It can be understood that the object description file basic type parsing module of the simulation data exchange system can be used to parse the basic data types in the object description file. According to the object description file path in the assumption file, the object description file is read, the data type definition node, object definition node, interaction definition node and service definition node are parsed, and all data type declarations defined in the object description file are obtained, including basic types, enumeration types, structure types, object attribute data types and interaction attribute data types.

[0051] Specifically, the detailed steps can be:

[0052] ① Read and parse the object description file content according to the object description file path in the assumption file;

[0053] ② Parse the data type definition node to obtain the basic data type, enumeration data type, and structure data type declaration string set;

[0054] ③ Parse the object definition node and obtain the data type declaration string set defined by the object attributes;

[0055] ④ Parse the interaction definition node and obtain the data type declaration string set defined by the interaction attribute;

[0056] ⑤ Parse the service definition node and obtain the data type declaration string set of the service input and output data definition.

[0057] Traverse the data type definition declaration, obtain the container type declaration, split the container type declaration into basic data types, and obtain the container type component stack.

[0058] It can be understood that the container type parsing module of the object description file of the simulation data exchange system can be used to parse the container data type in the object description file. Get all container type declaration strings, remove all spaces in the declaration string, and determine whether the declaration is a container array. If it is a container array, split the declaration string, perform container type parsing on the left half, and array type parsing on the right half. Container type parsing first determines whether the declaration string is a map type. If it is a map type, parse it separately by value and keyword. For other types, only parse the data type in the container declaration string. Recursively traverse the data type string in the container until the subtype is the basic data type. Put the subtype declaration string into the container type string stack in turn, and put the container data type string on the top of the stack. All container type string stacks are summarized to obtain the container type string stack information map.

[0059] Specifically, the detailed steps can be:

[0060] ① Traverse the data type declaration string set obtained from the object, interaction, structure, and service parts, extract the container type declaration string and summarize it into a container declaration string set;

[0061] ② Traverse the container declaration string set and remove all spaces in the declaration string;

[0062] ③ Determine whether the container declaration string is a container array. If it is not a container array type, perform container type parsing on the entire container declaration string. If it is a container array type, split the container declaration string by the '[' character, perform container type parsing on the left half of the container declaration string, and perform array type parsing on the right half of the array definition string.

[0063] ④ Container type parsing determines whether the container declaration string is of map type. If it is of map type, it is parsed by value and keyword respectively. If it is not of map type, it only parses the data type in the container declaration string.

[0064] ⑤ Recursively traverse the data type string in the parsed container until the final subtype string is any one of the basic type, enumeration type, structure type, string type, and Binary type declaration string, and put the subtype declaration string into the container type string stack in turn, and put the container's own data type string on the top of the stack;

[0065] ⑥ Summarize the parsed container type string stack to obtain the container type string stack information map.

[0066] The information of the split basic data type is recorded and initialized to obtain the basic data type information.

[0067] It can be understood that the basic data type information parsing module of the simulation data exchange system can be used to parse the basic data types, record the basic data type information, and maintain the basic information and associations of the data types. Initialize the data type set in the type parser, record the string type and Binary type data type information to the data type map, traverse the basic type data set and the enumeration type data set, record each data type information to the data type map, traverse the structure type set, object attribute data set and interactive attribute data set, and calculate the byte size occupied by the structure and the byte size occupied when aligned to one byte, record the corresponding data type information to the data type map, and put the corresponding information in the data type map into the all type information map.

[0068] Specifically, the detailed steps can be:

[0069] ① Use the data types obtained from the parsed object description file to initialize the data type set in the type parser;

[0070] ② Record the string type and Binary type data type information in the data type map, including type name, byte size, data type, alignment, whether it is a variable size type and subtype, and put all type information maps into the string type and Binary type information in the data type map;

[0071] ③ Traverse the basic type data set and enumeration type data set, record each data type information to the data type map, and put the corresponding information in the data type map into all type information maps;

[0072] ④ Traverse the structure type set, object attribute data set, and interaction attribute data set, and additionally calculate the byte size occupied by the structure and the byte size occupied when aligned to one byte, record the corresponding data type information to the data type map, and put the corresponding information in the data type map into all type information maps.

[0073] Parse the container type composition stack, obtain the container type name, judge the container type name according to the basic data type information, obtain the judgment result, enter the corresponding container type information recording process according to the judgment result, and obtain the corresponding container type information.

[0074] It can be understood that the container data type information parsing module of the simulation data exchange system can be used to parse the container string stack information map to record the container data type information and maintain the basic information and association relationship of the container data type. Traverse the container string stack information map, take out the container type string declaration and the container type string stack in turn, pop the top element of the stack to get the container type name, determine the container type name to enter the corresponding container type data parsing process, and record the corresponding container data type information.

[0075] Specifically, the detailed steps can be:

[0076] ① Traverse the container string stack information map, and take out the container type string declaration and container type string stack in turn;

[0077] ② Pop the top element of the stack to get the container type name, judge the container type name, if it is "map", enter the map type data parsing, if it is "vector", enter the vector type data parsing, if it is "list", enter the linked list type data parsing, if it is a number, enter the array type data parsing, after the parsing is completed, put the corresponding information into all type information maps;

[0078] ③Map data type information record, pop two elements in the container type string stack to get the keyword string and value string, where the data type name of the data type in the data type map consists of "map", keyword string and value string, and the subtype is a structure composed of the corresponding addresses of the keyword string and value type string in the data type map.

[0079] ④Vector data type information record, pop the top element of the container type string stack to get the element type string, where the data type name of this data type in the data type map consists of "vector" and the element type string, and the subtype is a structure composed of the corresponding address of the element type string in the data type map.

[0080] ⑤list data type information record, pop the top element of the container type string stack to get the element type string, where the data type name of this data type in the data type map consists of "list" and the element type string, and the subtype is a structure composed of the corresponding address of the element type string in the data type map.

[0081] ⑥Array type information record, pop the top element of the container type string stack to get the array type string, where the data type name of the data type in the data type map consists of the array type string and the array size, and the subtype is a structure composed of the corresponding address of the array type string in the data type map.

[0082] The data type information table is initialized according to the basic data type information and the container type information, and the digital dictionary table is constructed according to the data type information table.

[0083] It can be understood that the data structure construction management module of the simulation data exchange system can be used to perform digital dictionary conversion on all type information maps, which is more efficient overall. Initialize the data type information table in the reflection class, initialize the digital dictionary table by traversing the data type information table, the keyword in the digital dictionary table is the data type name, and the dictionary value increases in sequence according to the number of data types. At the same time, the corresponding data type dictionary value and data type information in the data dictionary table are inserted into the data information table in sequence. After the digital dictionary conversion is completed, the global data information table pointer in the reflection class points to the data information table address, and the global data dictionary table pointer points to the digital dictionary table address.

[0084] Specifically, the detailed steps can be:

[0085] ① Get the data type map in the type parser to initialize the data type information table in the reflection class;

[0086] ② Traverse the data type information table and initialize the digital dictionary table. The digital dictionary keyword is the data type name, and the digital dictionary value increases in sequence according to the number of data types;

[0087] ③The data information table is inserted into the corresponding data type dictionary value in the data dictionary table and the corresponding data type information in the data type information table in sequence;

[0088] ④The global data information table pointer in the reflection class points to the data information table address, and the global digital dictionary table pointer points to the digital dictionary table address.

[0089] In addition to the above method steps, regarding the initialization of the data type information table: some programming languages ​​provide an automated reflection mechanism that can obtain type information at runtime. These mechanisms can be used to dynamically build the data type information table. If the code is generated during compilation, you can consider using a code generation tool to generate the corresponding initialization code based on the information in the object description file. Regarding the construction of the digital dictionary table: you can also use a hash algorithm to generate digital dictionary keywords for the data type name instead of directly increasing them in sequence. If the naming rules of the data type name are not convenient as keywords for the digital dictionary, you can also consider using other unique identifiers. Regarding the insertion of the data information table: the method of inserting the data information table can be selected according to the characteristics of the specific implementation language. For example, data structures such as dynamic arrays or linked lists can be used to store data type information. If the code is generated at compile time, the operation of inserting the data information table can be directly embedded in the generated code.

[0090] According to the data type information table and the digital dictionary table, the reflection attribute class is constructed during the simulation process.

[0091] It can be understood that the data structure access management module of the simulation data exchange system can be used to encapsulate the dynamic construction, dynamic storage and dynamic access interface of the specified data type, so that users can dynamically build a reflection attribute class to transfer attribute data during the simulation process. The data type information corresponding to the data type is obtained from the data type information table, and a continuous interval equal to the size of the data type is divided from the memory pool as the storage area of ​​the data. According to the data type, the corresponding data type creation function is entered to record the first address of the storage area and the data type information; the data with subtypes recursively enters the subtype data creation function until the subtype is the base type; if the data type string for building the reflection attribute class does not exist in the data type information table, an exception is thrown.

[0092] Specifically, the detailed steps can be:

[0093] ① Determine whether the data type string for constructing the reflection attribute class exists in the data type information table. If not, throw an exception to indicate that the constructed type is undefined;

[0094] ② Obtain the data type information corresponding to the data type from the data type information table, and divide a continuous interval equal to the size of the data type from the memory pool as the storage area for the data;

[0095] ③ Enter the corresponding data type creation function according to the data type, record the first address of the storage area and the data type information, and recursively enter the subtype data creation function for the data with subtypes until the subtype becomes the basic type;

[0096] ④ The reflection attribute class provides STL-like read and write operations, which can be used for assignment, search, and copy operations during the simulation process to facilitate attribute data transfer.

[0097] In addition to the above method steps, regarding memory allocation methods: other memory allocation methods can be selected according to specific system requirements, such as dynamic allocation on the heap, allocation on the stack, etc. Regarding exception handling: the exception handling method can select appropriate strategies according to the system design, such as logging, reporting errors to users, etc. Regarding STL read and write operations: the specific operation interface can be expanded or modified according to the needs of system design.

[0098] Provides dynamic serialization and deserialization capabilities for reflection attribute classes.

[0099] It can be understood that the data dynamic serialization function module of the simulation data exchange system can be used to assist in supporting the binary serialization and deserialization of reflective attribute class data and the serialization and deserialization of Json format strings. Provide a packaging interface. If the serialization is a Binary binary type, a Binary type data space is created according to the size of the reflective attribute class data, and the data content is packaged into the data space in sequence starting from the first address pointer according to the data type information; if the serialization is a string type, a string stream is created, and the data content is input into the string stream in Json format starting from the first address pointer according to the data type information, and finally the string content in the string stream is output. Provide an unpacking interface. If the source data is a Binary binary type, the data content is restored in sequence from the first address pointer according to the data type information; if the source data is a string type, the string content is parsed in Json format according to the data type information, and restored in sequence starting from the first address pointer.

[0100] Specifically, the detailed steps can be:

[0101] ①Serialize into Binary binary type, create Binary type data space according to the size of the reflection attribute class, and pack the data content into the data space in sequence starting from the first address pointer according to its own data type information;

[0102] ②Binary type deserialization, according to the data type information of the reflection attribute class itself, restore it from the first address pointer in sequence according to the byte size and subtype;

[0103] ③Serialize to a string, create a string stream, input the data content into the string stream in Json format starting from the first address pointer according to its own data type information, and output the string content in the string stream;

[0104] ④ Deserialize the string type, parse the string in Json format according to the data type information of the reflection attribute class itself, and restore it in sequence starting from the first address pointer.

[0105] In addition to the above method steps, it can also be serialized into MessagePack or Avro. MessagePack is a binary serialization format with a small data volume. It supports multiple programming languages ​​and can easily exchange data between different systems. Apache Avro is a binary serialization framework with a dynamic architecture and compact data format. It supports cross-language and cross-platform data exchange.

[0106] In the above-mentioned simulation data exchange method based on dynamic reflection mechanism, the simulation data exchange protocol based on dynamic reflection mechanism obtains data type information by parsing the data type declaration defined in the object description file, thereby constructing a reflection attribute class to more efficiently read, write and transfer data, thereby accelerating simulation calculation. The simulation data exchange protocol has the following advantages: in view of the aforementioned problems in the existing traditional data format and data management of parallel simulation systems, the present invention obtains data type information by parsing the data type declaration defined in the object description file, and supports container data types, which is more scalable; by constructing a reflection attribute class to read, write and transfer data, the interface is more universal and convenient, and at the same time, the data type set is converted into a digital dictionary at the bottom layer, and the overall efficiency is higher. Compared with the existing technology, the present invention has the following benefits: it supports container type data transfer, avoids the use complexity caused by using indefinite length arrays to equivalently express the content information of the container, and avoids the huge data access and copy overhead caused by traversing the entire container during serialization and deserialization; dynamically parses and generates data type information by parsing the object description file, and reads, writes and transfers data by building a reflection attribute class, providing STL-like read and write operations, which is simpler and more convenient to use. At the same time, dynamic construction makes the federation members more reusable and avoids the problem of secondary compilation.

[0107] In one embodiment, the simulation data exchange method based on the dynamic reflection mechanism, the process of initializing the data type information table and constructing the digital dictionary table includes:

[0108] Get the data type map in the type parser to initialize the data type information table;

[0109] Traverse the data type information table and initialize the digital dictionary table; the keyword of the digital dictionary table is the data type name, and the dictionary value of the digital dictionary table increases in sequence according to the number of data types;

[0110] Insert the data type information table into the corresponding dictionary value in the data dictionary table and the corresponding data type information in the data type information table in sequence;

[0111] The global data information table pointer in the reflection class points to the address of the data type information table, and the global digital dictionary table pointer points to the address of the digital dictionary table.

[0112] In the above-mentioned simulation data exchange method based on dynamic reflection mechanism, this embodiment adopts a relatively concise way, by obtaining the data type map in the type parser to initialize the data type information table, and then traverses and initializes the digital dictionary table. Such an implementation method can make the code relatively concise and easy to understand. The keywords of the digital dictionary table directly use the data type name, and the dictionary value increases according to the number of data types. Such a design makes the digital dictionary table more intuitive, easy to understand and maintain. By pointing the global data information table pointer and the global digital dictionary table pointer in the reflection class to the corresponding data structure respectively, it is helpful to more conveniently access and manage this information in the entire reflection class. The method of inserting the data information table adopts sequential insertion, directly associating the information in the data type information table with the corresponding dictionary value in the digital dictionary table. Such an implementation is relatively direct and suitable for simple data structures.

[0113] In one embodiment, the above simulation data exchange method based on dynamic reflection mechanism, the process of constructing the reflection attribute class includes:

[0114] Determine whether the data type string used to construct the reflection attribute class exists in the data type information table. If not, throw an exception prompt.

[0115] Obtain data type information corresponding to the data type from the data type information table, and divide a continuous interval equal to the size of the data type from the memory pool as a storage area for the data;

[0116] Enter the corresponding data type creation function according to the data type, record the first address of the storage area and the data type information; recursively enter the subtype data creation function for data with subtypes until the subtype becomes the base type;

[0117] The reflection attribute class provides STL read and write operations.

[0118] In the above-mentioned simulation data exchange method based on dynamic reflection mechanism, this embodiment describes the process of building reflection attribute class through clear steps, including key steps such as judging whether data type string exists, memory allocation, data type creation, etc., so that the whole construction process appears clear and compact. By throwing an exception prompt when the data type string does not exist, this embodiment directly interrupts and prompts when a problem occurs, which helps to quickly find problems in the development and debugging stages. This embodiment specifies that a continuous interval equal to the size of the data type is divided from the memory pool as the storage area of ​​the data. This clear memory allocation method helps to manage data more effectively in a limited memory environment. This embodiment clearly points out that the reflection attribute class provides STL read and write operations, making it more convenient to perform operations such as assignment, search, and copy during the simulation operation process. By clarifying the steps of recursively entering the subtype data creation function of the subtype, this embodiment clearly shows the method for processing nested types.

[0119] In one embodiment, the above-mentioned simulation data exchange method based on the dynamic reflection mechanism provides dynamic serialization and deserialization functions of the reflection attribute class, and serializes the data object into a Binary binary type or a string type.

[0120] In the above-mentioned simulation data exchange method based on dynamic reflection mechanism, by specifying that the data object is serialized into Binary binary type or string type, this embodiment provides a concise choice. In some scenarios, Binary type may be more suitable for saving bandwidth and storage space, while string may be easier for humans to read. Compared with other more complex formats (such as MessagePack or Avro), choosing Binary binary type or string type as the serialization format can reduce the complexity of implementation and is more suitable for some simple application scenarios. This embodiment directly specifies the use of Binary or string format, making the entire serialization and deserialization process more direct and transparent. Other complex serialization frameworks may require more configuration and processing. This embodiment does not need to introduce additional dependent libraries or frameworks, reduces the system's dependence on third-party libraries, and makes the system more lightweight.

[0121] In some implementations, in order to more intuitively and comprehensively illustrate the above-mentioned simulation data exchange method based on the dynamic reflection mechanism, the following is an application example of the simulation data exchange method based on the dynamic reflection mechanism. It should be noted that the implementation cases given in this specification are only illustrative and are not the only limitation of the specific implementation cases of the present invention. Those skilled in the art can adopt the above-mentioned simulation data exchange method based on the dynamic reflection mechanism under the illustration of the implementation cases provided by the present invention to improve efficiency and scalability.

[0122] like Figure 2: As shown in the logical structure diagram of the simulation data exchange protocol module based on the dynamic reflection mechanism, it shows the object description file basic type parsing module 1, the object description file container type parsing module 2, the basic data type information parsing module 3, the container data type information parsing module 4, the data structure construction management module 5, the data structure access management module 6, and the data dynamic serialization function module 7, and the data flow and logical relationship between these seven. The core function of the efficient and scalable simulation data exchange protocol is the dynamic reflection mechanism. The data structure construction management module 5 and the data structure access management module 6 are the cornerstones to ensure the dynamic reflection mechanism, record the data type information, encapsulate the dynamic construction, dynamic storage and dynamic access interface of the specified data type, and perform digital dictionary conversion at the bottom layer to ensure the overall efficient operation; the object description file basic type parsing module 1 and the basic data type information parsing module 3 parse and record the basic data type information, and provide support for the container data type parsing; the object description file container type parsing module 2 and the container data type information parsing module 4 ensure the container data type data transmission function, avoiding the use complexity caused by using indefinite length arrays to equivalently express the content information of the container and the huge data access and copying overhead caused by serialization and deserialization; the data dynamic serialization function module 7 supports the data serialization and deserialization functions, supports the serialization and deserialization of binary and Json format strings, and has a unified interface and convenient calling.

[0123] like Figure 3 As shown, the workflow of the object description file basic type parsing module is as follows:

[0124] 301. The proceedings begin;

[0125] 302. Check whether the assumed file exists. If the test result is yes, go to step 304. If the test result is no, go to step 303.

[0126] 303. Since the scenario file is not detected in step 302 or the object description file is not detected in step 305, reading the scenario file fails or reading the object description file fails, the program exits;

[0127] 304. Since the assumption file is detected in step 302, the assumption file content is opened and read to obtain the object description file path;

[0128] 305. Check whether the object description file exists. If the detection result is yes, go to step 306. If the detection result is no, go to step 303.

[0129] 306. Since the object description file is detected in step 305, the object description file is opened and the content is read;

[0130] 307. Parse the data type definition node to obtain the basic data type, enumeration data type, and structure data type declaration string set;

[0131] 308. Parse the object definition node to obtain the data type declaration string set defined by the object attribute;

[0132] 309. Parse the interaction definition node and obtain the data type declaration string set of the interaction attribute definition;

[0133] 310. Parse the service definition node and obtain the data type declaration string set of the service input and output data definition.

[0134] like Figure 4 As shown, the workflow of the object description file container type parsing module is as follows:

[0135] 401. Traverse the object attribute definition data type declaration string set, the interaction attribute definition data type declaration string set, the service input and output definition data type declaration string set and the structure data type declaration string set;

[0136] 402. Get the container declaration string set <string>containerTypeStrSet;

[0137] 403. Remove all spaces in the container declaration string;

[0138] 404. Check whether the container declaration string is a container array. If the test result is yes, go to step 405. If the test result is no, go to step 408.

[0139] 405. Since the detection result of step 404 is yes, the container declaration string is split by the '[' character to obtain the left half and the right half substrings;

[0140] 406. The left half of the substring is parsed as a container type, and the process goes to step 408;

[0141] 407. Perform array type analysis on the right half of the substring, obtain the array size string, and go to step 412;

[0142] 408. Since the detection result of step 404 is no, check whether it is a map type according to the container declaration string. If the detection result is yes, go to step 409; if the detection result is no, go to step 410;

[0143] 409. Since the detection result of step 408 is yes, the data type string in the container is split by the ',' character to obtain the value and keyword substrings, and the process goes to step 411 to parse the value and keyword substrings respectively;

[0144] 410. Since the result of step 408 is negative, the string is parsed according to the data type declaration in the container;

[0145] 411. Recursively traverse and parse the data type declaration string;

[0146] 412. Put the subtype declaration strings into the container type string stack in sequence;

[0147] 413. Put the data type declaration string of the container itself on the top of the stack;

[0148] 414. Summarize the container type string stack to obtain the container type string stack information map.

[0149] like Figure 5 As shown, the workflow of the basic data type information parsing module is as follows:

[0150] 501. Use the data types obtained from the parsed object description file to initialize the data type set in the type parser TypeParser, including the basic type set BasicTypeSet, the enumeration type set EnumTypeSet, the structure type set StructTypeSet, the model attribute type set ModelClassTypeSet, the interaction attribute type set InterTypeSet and the container string stack information map ContainerTypeMap;

[0151] 502. Data type map unordered_map<string, DataTypeInfo> TypeMap records string type and Binary type data information, including type name, size in bytes, data type, alignment, whether it is a variable-size type and its subtype;

[0152] 503. Traverse the basic type set BasicTypeSet and the enumeration type set EnumTypeSet, and record the corresponding data type information to the data type map;

[0153] 504. Traverse the structure type set StructTypeSet, the model attribute type set ModelClassTypeSet, and the interaction attribute type set InterTypeSet, and record data information according to the structure type;

[0154] 505. Calculate the byte size of the structure according to the default byte alignment;

[0155] 506. Calculate the byte size of the structure according to the one-byte alignment method;

[0156] 507. Record the structure data type information to the data type map;

[0157] 508. Data type information is placed in all type information maps unordered_map <DataTypeInfo::DataTypeEnum,vector <datatypeinfo>>AllTypeInfo.

[0158] like Figure 6 As shown, the workflow of the container data type information parsing module is as follows:

[0159] 601. Traversing container string stack information map unordered_map <string, stack <string>>ContainerTypeMap;

[0160] 602. Take out the container type string declaration typeName and the container type string stack typeStack in turn;

[0161] 603. Pop the top element of the stack to get the container type name string;

[0162] 604. Determine the container type according to the container type name string. If it is a "map" string, enter the map type data parsing and go to step 605. If it is a "vector" string, enter the vector type data parsing and go to step 606. If it is a "list" string, enter the list type data parsing and go to step 607. If it is a number, enter the array type data parsing and go to step 608.

[0163] 605. Enter map type data parsing and go to step 609;

[0164] 606. Enter vector type data parsing and go to step 610;

[0165] 607. Enter list type data parsing and go to step 610;

[0166] 608. Enter array type data parsing and go to step 610;

[0167] 609. Pop the top two elements of the stack to get the keyword string and the value string. The data type name consists of "map", the keyword string and the value string. The subtype is a structure consisting of the corresponding addresses of the keyword string and the value type string in the data type map.

[0168] 610. Pop the top element of the stack to get the element type string. The vector data type name consists of "vector" and the element type string. The list data type consists of "list" and the element type string. The subtype is a structure consisting of the element type string and the corresponding address in the data type map. The array type name consists of the array type string and the array size. The subtype is a structure consisting of the element type string and the corresponding address in the data type map.

[0169] 611. Record the corresponding data type information;

[0170] 612. Record subtype information;

[0171] 613.Container data type information corresponds to all type information map unordered_map <DataTypeInfo::DataTypeEnum,vector <datatypeinfo>>AllTypeInfo.

[0172] like Figure 7 As shown, the workflow of the data structure construction management module is as follows:

[0173] 701. Get the data type map in the type parser TypeParser to initialize the data type information table unordered_map in the reflection class FOMReflection<string, DataTypeInfo> dataTypeInfoMap;

[0174] 702. Call the clear() function to clear the digital dictionary table DataNameNumberMap;

[0175] 703. traverse the data type information table dataTypeInfoMap, and take out the data type name string typeName and the type information typeInfo in turn;

[0176] 704. The digital dictionary table DataNameNumberMap inserts the data type name string typeName in sequence, and the dictionary value increases in sequence starting from 0;

[0177] 705.Data Information Table InfoTable<DataName, DataTypeInfo> dataInfoTable inserts the corresponding data type dictionary value in the digital dictionary table DataNameNumberMap and the corresponding data type in the data type information table dataTypeInfoMap in sequence;

[0178] 706. InfoTable pointer to global data information table in reflection class<DataName, DataTypeInfo> *globalInfoTable points to the address of data information table dataInfoTable;

[0179] 707. The global digital dictionary table pointer StringNumberBimap* globalDataNameMap in the reflection class points to the address of the digital dictionary table DataNameNumberMap;

[0180] like Figure 8 As shown, the workflow of the data structure access management module is as follows:

[0181] 801. Enter the data type string to start building the reflection attribute class RefAttribute;

[0182] 802. Obtain the data type string dictionary value through the global digital dictionary table globalDataNameMap, and check whether the dictionary value exists through the global data information table globalInfoTable. If the test result is no, go to step 803; if the test result is yes, go to step 804;

[0183] 803. Since the detection result of step 802 is no, the construction of the reflection attribute class fails and an exception is thrown;

[0184] 804. Since the detection result of step 802 is yes, the data type information is obtained in the global data information table globalInfoTable through the dictionary value;

[0185] 805. Allocate a continuous interval equal to the size of the data type from the memory pool as a storage area for the data;

[0186] 806. Enter the corresponding data type creation function according to the data type;

[0187] 807. Record the storage area first address and data type information;

[0188] 808. Check whether there is a subtype through the subtype information in the data type information. If the test result is yes, go to step 809; if the test result is no, go to step 810;

[0189] 809. Recursively enter the subtype data creation function until the subtype is the base type;

[0190] 810. The reflective attribute class RefAttribute is constructed and can be used for assignment, copying, searching and other operations to transfer attribute data.

[0191] like Fig. 9 As shown, the workflow of the data dynamic serialization module is as follows:

[0192] 901. After the reflection attribute class RefAttribute is constructed, the packaging interface is called to go to step 902, and the unpacking interface is called to go to step 903;

[0193] 902. Call the packaging interface, serialize to Binary type and go to step 904, serialize to string type and go to step 907;

[0194] 903. Call the unpacking interface, deserialize into the reflection attribute class RefAttribute, and go to step 911;

[0195] 904. The reflection attribute class RefAttribute data is serialized into Binary binary type;

[0196] 905. Create Binary type data space according to the byte size of the reflection attribute class RefAttribute itself;

[0197] 906. Pack the data content into the data space in sequence starting from the first address pointer according to its own attribute type information;

[0198] 907. The reflection attribute class RefAttribute data is serialized into a string type;

[0199] 908. Create stringstream* jsonStream;

[0200] 909. Input the data content into the string stream jsonStream in Json format starting from the first address pointer according to its own attribute type information;

[0201] 910. Output the string content in the string stream jsonStream;

[0202] 911. Determine the source data type to be unpacked. If it is a binary type, go to step 912; if it is a string type, go to step 914;

[0203] 912.Binary type is deserialized into the reflection attribute class RefAttribute;

[0204] 913. Read the source data content, and restore it in sequence from the first address pointer according to the byte size and subtype according to the data type information of the reflection attribute class itself;

[0205] 914. The string type is deserialized into the reflection attribute class RefAttribute;

[0206] 915. Parse the source string content according to Json format;

[0207] 916. According to the data type information of the reflection attribute class itself, the parsed data content is restored in sequence from the first address pointer according to the byte size and subtype.

[0208] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0209] In one embodiment, Fig.10 As shown, a simulation data exchange system based on a dynamic reflection mechanism is provided, comprising:

[0210] The sending system 22 is used to dynamically serialize the data object to be sent according to the selected serialization format to generate the message content; the data type of the data object includes the container data type, and in the dynamic serialization process, a digital dictionary is used to identify the data type of the data object;

[0211] A delivery module 24, used to deliver the message content to the target system;

[0212] The target system 26 is used to dynamically deserialize the message content and restore it into a data object; the dynamic serialization process, the process of transmitting the message content and the dynamic deserialization process are carried out in accordance with the rules specified by the simulation data exchange protocol based on the dynamic reflection mechanism.

[0213] The above-mentioned simulation data exchange system based on dynamic reflection mechanism can handle a variety of data objects, including container data types, and has stronger scalability. It realizes dynamic serialization and deserialization through dynamic reflection mechanism, which improves the flexibility of data exchange; using digital dictionary to identify data types helps to ensure accurate identification and restoration of various data types in data exchange, and improves the accuracy, reliability and transmission efficiency of communication. Strictly follow the rules specified by the simulation data exchange protocol based on dynamic reflection mechanism to ensure the consistency and standardization of data exchange. The process of dynamic serialization and deserialization is more efficient than traditional methods, reduces the overhead of data access and copying, and improves communication efficiency.

[0214] In one embodiment, the above-mentioned simulation data exchange system based on the dynamic reflection mechanism also includes: an object description file basic type parsing module, which is used to parse the object description file according to the object description file path in the assumption file to obtain the data type definition declaration; an object description file container type parsing module, which is used to traverse the data type definition declaration, obtain the container type declaration, split the container type declaration into basic data types, and obtain the container type composition stack; a basic data type information parsing module, which is used to record and initialize the basic data type after the split, and obtain the basic data type information; a container data type information parsing module, which is used to parse the container type composition stack, obtain the container type name, judge the container type name according to the basic data type information, obtain the judgment result, enter the corresponding container type information recording process according to the judgment result, and obtain the corresponding container type information; a data structure construction management module, which is used to initialize the data type information table according to the basic data type information and the container type information, and construct a digital dictionary table according to the data type information table; a data structure access management module, which is used to construct a reflection attribute class in the simulation process according to the data type information table and the digital dictionary table; a data dynamic serialization function module, which is used to provide dynamic serialization and deserialization functions of the reflection attribute class.

[0215] In one embodiment, in the above-mentioned simulation data exchange system based on the dynamic reflection mechanism, the data structure construction management module includes: a first initialization unit, used to obtain the data type map in the type parser to initialize the data type information table; a second initialization unit, used to traverse the data type information table and initialize the digital dictionary table; the keyword of the digital dictionary table is the data type name, and the dictionary value of the digital dictionary table increases in sequence according to the number of data types; an insertion unit, used to insert the data type information table into the corresponding dictionary value in the data dictionary table and the corresponding data type information in the data type information table in sequence; a setting unit, used to point the global data information table pointer in the reflection class to the address of the data type information table, and point the global digital dictionary table pointer to the address of the digital dictionary table.

[0216] In one embodiment, in the above-mentioned simulation data exchange system based on the dynamic reflection mechanism, the data structure access management module includes: a judgment unit, used to judge whether the data type string for constructing the reflection attribute class exists in the data type information table, and if not, throw an exception prompt; a division unit, used to obtain the data type information corresponding to the data type from the data type information table, and divide a continuous interval equal to the size of the data type from the memory pool as a storage area for data; a creation function unit, used to enter the corresponding data type creation function according to the data type, and record the first address of the storage area and the data type information; data with subtypes recursively enters the subtype data creation function until the subtype is the base type; a read and write operation unit, used to provide STL read and write operations.

[0217] In one embodiment, in the above-mentioned simulation data exchange system based on dynamic reflection mechanism, the data dynamic serialization function module serializes the data object into a Binary binary type or a string type.

[0218] The specific definition of the simulation data exchange system based on the dynamic reflection mechanism can be found in the above definition of the simulation data exchange method based on the dynamic reflection mechanism, which will not be repeated here. Each module in the above-mentioned simulation data exchange system based on the dynamic reflection mechanism can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0219] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0220] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements may be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.< / datatypeinfo> < / string> < / datatypeinfo> < / string>

Claims

1. A simulation data exchange method based on dynamic reflection mechanism, It is characterized in that Includes steps: Dynamically serializing the data object to be sent according to the selected serialization format to generate message content; the data type of the data object includes a container data type, and in the dynamic serialization process, a digital dictionary is used to identify the data type of the data object; delivering the message content to a target system; Dynamically deserialize the message content to restore it to the data object; the dynamic serialization process, the process of transmitting the message content and the dynamic deserialization process are performed in accordance with the rules specified by the simulation data exchange protocol based on the dynamic reflection mechanism; The implementation steps of the simulation data exchange protocol based on the dynamic reflection mechanism include: According to the object description file path in the assumption file, parse the object description file to obtain the data type definition statement; Traversing the data type definition declaration, obtaining a container type declaration, splitting the container type declaration into basic data types, and obtaining a container type component stack; Recording and initializing the split basic data type information to obtain basic data type information; Parse the container type composition stack, obtain the container type name, judge the container type name according to the basic data type information, obtain the judgment result, enter the corresponding container type information recording process according to the judgment result, and obtain the corresponding container type information; wherein, traverse the container string stack information, take out the container type string declaration and the container type string stack in turn; pop the top element of the stack to obtain the container type name, judge the container type name to enter the corresponding type data parsing and record the corresponding container type information; map data type information record, pop two elements in the container type string stack to obtain the keyword string and the value string, the data type name in the data type map is composed of "map", keyword string and value string, and the subtype is a structure composed of the corresponding addresses of the keyword string and the value type string in the data type map; vector data Type information record, pop the top element of the container type string stack to get the element type string, the data type name in the data type map consists of "vector" and the element type string, and the subtype is a structure consisting of the element type string at the corresponding address in the data type map; list data type information record, pop the top element of the container type string stack to get the element type string, the data type name in the data type map consists of "list" and the element type string, and the subtype is a structure consisting of the element type string at the corresponding address in the data type map; array type information record, pop the top element of the container type string stack to get the array type string, the data type name in the data type map consists of the array type string and the array size, and the subtype is a structure consisting of the array type string at the corresponding address in the data type map; Initialize a data type information table according to the basic data type information and the container type information, and construct a digital dictionary table according to the data type information table; According to the data type information table and the digital dictionary table, a reflection attribute class is constructed in the simulation process; wherein, data type information corresponding to the data type is obtained from the data type information table, and a continuous interval equal to the size of the data type is divided from the memory pool as a storage area for the data; according to the data type, the corresponding data type creation function is entered to record the first address of the storage area and the data type information; data with subtypes recursively enters the subtype data creation function until the subtype is the base type; Provides dynamic serialization and deserialization capabilities for the reflective attribute class.

2. The simulation data exchange method based on dynamic reflection mechanism according to claim 1, It is characterized in that The process of initializing the data type information table and constructing the digital dictionary table includes: Obtain the data type map in the type parser to initialize the data type information table; Traversing the data type information table, initializing the digital dictionary table; the keyword of the digital dictionary table is the data type name, and the dictionary value of the digital dictionary table increases in sequence according to the number of data types; Inserting the data type information table into the corresponding dictionary values ​​in the digital dictionary table and the corresponding data type information in the data type information table in sequence; The global data information table pointer in the reflection class is pointed to the address of the data type information table, and the global digital dictionary table pointer is pointed to the address of the digital dictionary table.

3. The simulation data exchange method based on dynamic reflection mechanism according to claim 1, It is characterized in that The process of constructing the reflection attribute class includes: Determine whether the data type string for constructing the reflection attribute class exists in the data type information table, and if not, throw an exception prompt; Acquire data type information corresponding to the data type from the data type information table, and divide a continuous interval equal to the size of the data type from the memory pool as a data storage area; Enter the corresponding data type creation function according to the data type, record the first address of the storage area and the data type information; recursively enter the subtype data creation function for the data with subtypes until the subtype is the basic type; The reflection attribute class provides STL read and write operations.

4. The simulation data exchange method based on dynamic reflection mechanism according to claim 1, It is characterized in that In the process of providing the dynamic serialization and deserialization functions of the reflection attribute class, the data object is serialized into a Binary binary type or a string type.

5. A simulation data exchange system based on dynamic reflection mechanism, It is characterized in that include: The sending system is used to dynamically serialize the data object to be sent according to the selected serialization format to generate the message content; The data type of the data object includes a container data type, and in the dynamic serialization process, a digital dictionary is used to identify the data type of the data object; A delivery module, used for delivering the message content to a target system; The target system is used to dynamically deserialize the message content and restore it to the data object; the dynamic serialization process, the process of transferring the message content and the dynamic deserialization process are performed according to the rules specified in the simulation data exchange protocol based on the dynamic reflection mechanism; The simulation data exchange system based on the dynamic reflection mechanism also includes: The object description file basic type parsing module is used to parse the object description file according to the object description file path in the assumption file to obtain the data type definition statement; An object description file container type parsing module is used to traverse the data type definition declaration, obtain the container type declaration, split the container type declaration into basic data types, and obtain a container type composition stack; A basic data type information parsing module is used to record and initialize the information of the split basic data type to obtain basic data type information; A container data type information parsing module is used to parse the container type composition stack, obtain the container type name, judge the container type name according to the basic data type information, obtain the judgment result, enter the corresponding container type information recording process according to the judgment result, and obtain the corresponding container type information; wherein, the container string stack information map is traversed, and the container type string declaration and the container type string stack are taken out in turn; the top element of the stack is popped to obtain the container type name, the container type name is judged to enter the corresponding type data parsing and record the corresponding container type information; the map data type information is recorded, and two elements in the container type string stack are popped to obtain the keyword string and the value string. The data type name in the data type map is composed of "map", the keyword string and the value string, and the subtype is a structure composed of the corresponding addresses of the keyword string and the value type string in the data type map. ; Vector data type information record, pop the top element of the container type string stack to get the element type string, the data type name in the data type map consists of "vector" and the element type string, and the subtype is a structure consisting of the element type string at the corresponding address in the data type map; List data type information record, pop the top element of the container type string stack to get the element type string, the data type name in the data type map consists of "list" and the element type string, and the subtype is a structure consisting of the element type string at the corresponding address in the data type map; Array type information record, pop the top element of the container type string stack to get the array type string, the data type name in the data type map consists of the array type string and the array size, and the subtype is a structure consisting of the array type string at the corresponding address in the data type map; A data structure construction management module, used for initializing a data type information table according to the basic data type information and the container type information, and constructing a digital dictionary table according to the data type information table; A data structure access management module is used to construct a reflection attribute class in the simulation process according to the data type information table and the digital dictionary table; wherein, the data type information corresponding to the data type is obtained from the data type information table, and a continuous interval equal to the size of the data type is divided from the memory pool as a storage area for the data; according to the data type, the corresponding data type creation function is entered to record the first address of the storage area and the data type information; the data with subtypes recursively enters the subtype data creation function until the subtype is the base type; The data dynamic serialization function module is used to provide dynamic serialization and deserialization functions of the reflection attribute class.

6. The simulation data exchange system based on dynamic reflection mechanism according to claim 5, It is characterized in that The data structure construction management module includes: A first initialization unit, used to obtain a data type map in a type parser to initialize the data type information table; A second initialization unit is used to traverse the data type information table and initialize the digital dictionary table; the keyword of the digital dictionary table is the data type name, and the dictionary value of the digital dictionary table increases in sequence according to the number of data types; An inserting unit, used for inserting the data type information table into the corresponding dictionary values ​​in the digital dictionary table and the corresponding data type information in the data type information table in sequence; The setting unit is used to point the global data information table pointer in the reflection class to the address of the data type information table, and to point the global digital dictionary table pointer to the address of the digital dictionary table.

7. The simulation data exchange system based on dynamic reflection mechanism according to claim 5, It is characterized in that The data structure access management module includes: A judging unit, used for judging whether the data type string for constructing the reflection attribute class exists in the data type information table, and if not, throwing an exception prompt; a partitioning unit, configured to obtain data type information corresponding to the data type from the data type information table, and partition a continuous interval equal to the size of the data type from the memory pool as a data storage area; A creation function unit is used to enter a corresponding data type creation function according to the data type, record the first address of the storage area and the data type information; data with subtypes recursively enters the subtype data creation function until the subtype is the base type; The read and write operation unit is used to provide STL read and write operations.

8. The simulation data exchange system based on dynamic reflection mechanism according to claim 5, It is characterized in that The data dynamic serialization function module serializes the data object into a Binary binary type or a string type.