Data interaction method for aviation emergency simulation rescue training and storage medium

By creating system model files and realizing data interaction between devices in aviation emergency simulation and rescue training, the problems of low data interaction reliability and efficiency in the prior art are solved, and efficient data interaction and system performance improvement are achieved.

CN119441240AInactive Publication Date: 2025-02-14CHINA STATE SHIPBUILDING CORP LTD RESEARCH INSTITUTE 719
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411526739.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, the reliability and efficiency of data interaction in aviation emergency simulation rescue training is low, making it difficult to meet the requirements of distributed simulation network, timing and connection design.

Method used

By creating system model files, the equipment used in aviation emergency simulation rescue training is abstracted into a model to realize data interaction between devices. The specific steps include creating a system model file, requesting local model files, updating the local model data structure, initiating data updates, refreshing the update queue, receiving data updates, forwarding data updates, and receiving data.

Benefits of technology

The information interaction mechanism based on "content" is realized, which simplifies the distributed simulation network, timing and connection design, improves the real-time performance of the simulation model, and improves the reliability, maintainability and testability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441240A_ABST
    Figure CN119441240A_ABST
Patent Text Reader

Abstract

A data interaction method for aviation emergency simulation rescue training comprises the following steps: creating a system model file: abstracting each device into a model, and forming a data interaction system by a plurality of models: requesting a local model file: before an initiator initiates a data exchange request, obtaining the model file belonging to the initiator; a local model data structure is updated; an initiator analyzes a corresponding model file and initializes a local model management structure; the initiator obtains model parameters of corresponding equipment, puts the model parameters into a parameter cache, adds parameter indexes and then puts the model parameters into an update queue; refreshing the update queue: the data exchange initiator re-encodes the data in the update queue and sends the data; the processing party receives the data, decodes the data, generates parameter data and puts the parameter data into a cache; forwarding data updating: the processing party codes and sends the data again according to the parameters declared by each model; and receiving the data: receiving the data by the receiver, updating the local cache, and completing the data exchange process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of aviation emergency simulation rescue training, and in particular to a data interaction method and a storage medium for aviation emergency simulation rescue training. Background Art

[0002] With the continuous development of my country's economy, general aviation aircraft have made great progress in both quantity and quality in recent years. At present, my country is a country with relatively serious natural disasters in the world. There are many types of disasters, which are distributed over a wide area, occur frequently, and cause heavy losses. Aviation emergency rescue is one of the most timely and effective ways to organize rescue and save lives. It has become an important part of the emergency rescue system in developed countries and some developing countries. Therefore, conducting aviation emergency simulation rescue training has very important social significance. Aviation emergency simulation rescue training involves many equipment or systems, which will generate a large amount of data interaction. Therefore, it is urgent to design a data interaction method for aviation emergency simulation rescue training to improve the reliability and efficiency of data interaction. Summary of the invention

[0003] In view of the technical defects and technical drawbacks in the prior art, the embodiments of the present invention provide a data interaction method and storage medium for aviation emergency simulation rescue training that overcome the above problems or at least partially solve the above problems. The specific scheme is as follows:

[0004] As a first aspect of the present invention, a data interaction method for aviation emergency simulation rescue training is provided, the method comprising:

[0005] Step 1, create a system model file: abstract all the equipment used in aviation emergency simulation rescue training into models. Several models constitute the entire data interaction system. The system model file is the basis for data interaction. The model file defines the identification, version, description and parameters of each model:

[0006] Step 2, requesting a local model file: Before initiating a data exchange request, the data exchange initiator first obtains its own model file, thereby learning its own configuration constraints, the range of access parameters, and the characteristics of access parameters;

[0007] Step 3, update the local model data structure: after obtaining its own model file, the initiator parses the corresponding model file and initializes the local model management structure, including parameter cache, update queue, event trigger and bridge;

[0008] Step 4, initiating data update: the data exchange initiator obtains the model parameters of the corresponding device based on the index of the pre-updated model parameters, puts them into the parameter cache, and adds the corresponding parameter index and puts them into the update queue;

[0009] Step 5, refresh update queue: the data exchange initiator reorganizes and encodes the data in the update queue, and sends it out through the network after encoding;

[0010] Step 6, receiving data update: the data exchange processor receives the data from the data exchange initiator, decodes it, generates parameter data, and puts the corresponding parameter data into the system global parameter cache;

[0011] Step 7, forwarding data update: the data exchange processor repackages and encodes the updated data according to the parameters declared by each model in the system model file, and finally sends it to the receiver;

[0012] Step 8, receiving data: the receiver receives the data forwarded by the processor, updates the local cache, and completes the data exchange process;

[0013] Among them, data interaction is realized between various devices in aviation emergency simulation rescue training based on data bus;

[0014] Among them, since the devices are distributed in different geographical locations, in order to facilitate unified configuration and management of the devices, the model configuration information corresponding to all devices is concentrated on the Server side, and each device is distributed on different Client sides as a data exchange initiator or receiver.

[0015] Furthermore, in step 1, the system model file defines three aspects of information: model composition, model attributes, and model parameters within the system;

[0016] Among them, model parameters are the core of the model, and model parameters are divided into two categories: input parameters and output parameters. If the model contains input parameters, the corresponding model has the function of being a receiver and receiving data updates from other models. If the model contains output parameters, the corresponding model has the function of being an initiator and sending updated data to other models.

[0017] The model file is described in the extensible description language XML. The data interaction system contains multiple models, each model contains one or more parameters (i.e., model parameters). The parameters are managed in a flat manner with index (similar to array subscript) as the core. Each parameter appears in the corresponding one or more models and can have different parameter names, IO types, classifications, and description information. The index and data type of the parameter are globally unified. The corresponding parameter values ​​are the same when the same parameter is running. The system model file is created on the server side, and each model file is pre-defined with a model identifier that matches the corresponding device attributes.

[0018] Furthermore, step 2 includes:

[0019] When the client corresponding to the initiator starts, it pulls the corresponding local model file from the server to obtain its own model file. The specific implementation process includes:

[0020] Step 2.1, the client reads the corresponding device attributes, generates a model identifier according to the attributes, and generates a model request data packet containing the model identifier, wherein the model request data packet includes a header and a data area, the header includes a domain identifier, a packet length, a sender identifier, a packet type, a timestamp, and a reserved word, and for the model request data packet, the sender identifier is the generated model identifier;

[0021] Step 2.2, after receiving the model request data packet from the client, the server checks the correctness and integrity of the data, reads the system model file loaded into the memory, selects a model file with the same model identifier as the model request data packet from the model file, and puts the model file including an XML paragraph into the data area of ​​the model request data packet. After modifying the relevant identification information, the server's timestamp is loaded into the model request data packet, and the corresponding data packet is returned to the corresponding client;

[0022] Step 2.3, after receiving the data packet returned by the Server, the Client checks whether the model identifier in the data packet matches the local model identifier. If they match, execute step 2.4; otherwise, return to step 2.1;

[0023] Step 2.4: The client calculates the time drift between the client and the server based on the timestamp data of the server. If the drift exceeds the time accuracy requirement of the test, the client's system clock is adjusted.

[0024] The model file includes XML segments, and the XML segments include an XML segment recording model attribute information and an XML segment recording model parameter information.

[0025] Further, step 3 includes:

[0026] Data exchange initiator:

[0027] Step 3.1, after obtaining the model file belonging to itself, parse the model attribute information XML fragment, generate model data, and bind the model identifier and the network connection handle to facilitate subsequent update operations, and the model data includes model corresponding information;

[0028] Step 3.2, parse the model parameter information XML fragment and generate a model parameter array;

[0029] Step 3.3, generating a mapping table according to the position of the model parameter array and the index of the model parameter, so as to associate the corresponding model parameter through the parameter index, so as to facilitate the subsequent rapid search for the model parameter in the model parameter array according to the model parameter index;

[0030] Step 3.4, create an update queue. According to the data type of the model parameter, create an update queue of the corresponding type to record data updates. The data type of the model parameter includes Bool type, Int type, Real type and Buf type. The update queue includes Bool type, Int type, Real type and Buf type data update queues.

[0031] Step 3.5, register events, bind predefined events and model parameter indexes. Each model parameter supports one binding event. When data is updated, the corresponding event function is triggered.

[0032] To solve the data synchronization waiting caused by network transmission, the system uses a pre-allocated data structure to save updated data. The external interface only needs to read or write data from the system memory, and the system automatically updates and maintains the data in the memory.

[0033] Further, step 4 includes:

[0034] Data exchange initiator:

[0035] Step 4.1, check the status of the client as the initiator to determine whether step 3 is completed correctly; if step 3 is completed correctly, execute step 4.2; if step 3 is not completed correctly, return update failure;

[0036] Step 4.2, according to the index of the pre-updated model parameter, search the model parameter in the local model parameter array, if the corresponding model parameter is found, execute step 4.3, otherwise return update failure.

[0037] Step 4.3, check whether the parameter type is Output. If so, execute 4.4. Otherwise, return update failure.

[0038] Step 4.4, update the value of the corresponding model parameter based on the updated value, and add the local index of the parameter (the subscript of the parameter in the local model parameter array) to the update queue;

[0039] Among them, the Client can only update the model parameters with IO type Output. When updating, the index of the model parameter to be updated and the update value are provided. The index of the model parameter to be updated and the update value can be provided by the controller or any other module that can issue instructions through control instructions.

[0040] Further, step 5 includes:

[0041] Data exchange initiator:

[0042] Step 5.1, check the Bool type, Int type, Real type, Buf type data update queues in turn. If there is a parameter index in a certain type of queue, obtain the model parameter and model parameter value based on the parameter index, and fill the data area of ​​the data packet used for data exchange in the queue according to the protocol format corresponding to the queue type; (the data area contains the parameter index, the model to which the parameter belongs, the model parameter and the model parameter value) Step 5.2, update the header description of the corresponding data packet to form a complete network data packet;

[0043] Step 5.3, call the network connection handle bound to the model and send the corresponding data packet. If the data packet is sent successfully, clear the update queues. If the data sending fails, return an error.

[0044] Further, step 6 comprises:

[0045] Data exchange processor:

[0046] Step 6.1, the data exchange processor reads the data sent in step 5 from the network cache. If the amount of data read is less than or equal to 0, the receiving process is exited, otherwise, step 6.2 is executed;

[0047] Step 6.2, copy the data to the system data buffer;

[0048] Step 6.3, search the domain identifier of the data packet corresponding to the data from the system data buffer. If the corresponding domain identifier is not found, the corresponding data packet is judged to be illegal, the buffer is reset, and the receiving process is exited, otherwise, step 6.4 is executed;

[0049] Step 6.4, read the packet length field of the data packet to obtain the length of the data packet. If the packet length is greater than the amount of data currently received, return to step 6.1 and continue receiving data, otherwise execute step 6.5.

[0050] Step 6.5, parse the message type field of the data packet, call the corresponding data parsing function to parse the data according to different message types, obtain the parameter data of the data area, that is, the model parameter, the model to which the parameter belongs, the parameter index and the model parameter value, and put the parameter data into the system global parameter cache;

[0051] Step 6.6, remove the parsed data packet from the system data buffer and return to step 6.3

[0052] The message types include Bool, Int, Real and Buf types, and the server side, which is the data exchange processor, continuously listens to data on a fixed network port.

[0053] Further, step 7 includes:

[0054] Data exchange processor:

[0055] Step 7.1, according to the message type and the encoding rules of the data area in step 5.1, parse the parameters from the system global parameter buffer in sequence to obtain the parameter index, the model to which the parameter belongs, and the updated value, where the updated value is the model parameter value.

[0056] Step 7.2, according to the parameter index, check whether the parameter exists in the two-dimensional linked list on the server side. If not, return to step 7.1 to parse the next data area; otherwise, execute step 7.3;

[0057] Step 7.3, according to the parameter index, traverse the multiple models linked to the corresponding parameter index, and update the parameter value of each model;

[0058] In step 7.4, during the model traversal process, if the parameter type of the corresponding index in the model is INPUT, it means that the corresponding model requires the parameter of the corresponding index as input, then create or update the update queue with the model identifier and parameter index as the content;

[0059] Step 7.5 traverses the update queue. Each node in the queue is the model identifier and all its parameters to be updated. The traversal process is as follows:

[0060] Step 7.5.1, according to the model identifier, search for the network connection handle corresponding to the model identifier from the Client queue on the Server side. If the network connection handle is found, execute step 7.5.2, otherwise return to step 7.5 to traverse the next node.

[0061] Step 7.5.2, traverse the parameter list to be updated, and divide the parameter list into four lists of different message types according to the parameter type, where the parameter type includes BOOL, INT, REAL and BUF types;

[0062] If the BOOL type list is not empty, generate the data area according to the protocol rules of the BOOL type parameter in step 5.1, then use the network connection handle to send the data to the network cache, and finally clear the BOOL type update list;

[0063] If the INT type list is not empty, generate the data area according to the protocol rules of the INT type parameter in step 5.1, then use the network connection handle to send the data to the network cache, and finally clear the INT type update list;

[0064] If the REAL type list is not empty, generate the data area according to the protocol rules of the REAL type parameter in step 5.1, then use the network connection handle to send the data to the network cache, and finally clear the Real type update list;

[0065] If the BUF type list is not empty, generate the data area according to the protocol rules of the BUF type parameter in step 5.1, then use the network connection handle to send the data to the network cache, and finally clear the BUF type update list;

[0066] The server manages all parameters in the system in the form of a two-dimensional linked list. Data management is centered on parameters, and the global index of the parameters is organized into a first-dimensional linked list. The unique parameter can be accessed through the index. At the same time, the index is hashed to increase the speed of index access. The global index of each parameter links the same parameter of multiple models, so that the same parameter of different models has an independent data cache space, thereby reducing the waiting overhead of data synchronization and improving data forwarding efficiency. Due to the difference in the number of parameters used by the model, the number of models linked to different parameters is different.

[0067] Further, step 8 comprises:

[0068] Data exchange recipient:

[0069] Step 8.1, read data from the network cache. If the amount of data read is less than or equal to 0, it means that the server is abnormal. Exit the receiving process and restart the network connection process. Otherwise, execute step 8.2;

[0070] Step 8.2, copy the data to the global data buffer of the Client. If the copy fails, discard the data packet and return to step 8.1 to the next receiving process. Otherwise, execute step 8.3.

[0071] Step 8.3, search the domain identifier of the data packet from the buffer. If the domain identifier is not found, it means that the data packet is illegal, reset the buffer, and exit the receiving process. Otherwise, execute step 8.4.

[0072] Step 8.4, read the packet length field to obtain the length of the data packet. If the packet length is greater than the current amount of data received and less than the maximum length of the global data buffer, return to step 8.1 to continue receiving data. If the packet length is greater than the maximum length of the global data buffer, reset the buffer and exit the receiving process.

[0073] Step 8.5, parse the message type field and call different data parsing functions according to different message types (Bool, Int, Real, Buf);

[0074] Step 8.6, parse the data area of ​​the data packet to obtain the parameter index and model parameter value.

[0075] Step 8.7, search the local model data structure on the client side for the parameter corresponding to the parameter index. If it exists, update the parameter value of the corresponding parameter based on the model parameter value, set the parameter update status to TRUE, and reset the timestamp of the parameter update to the timestamp of the data packet.

[0076] Step 8.8, if the parameter is bound to an event trigger, the data value before and after the update is used as parameters to call the corresponding event trigger function.

[0077] As a second aspect of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a computer, the computer executes any of the above-described data interaction methods for aviation emergency simulation rescue training.

[0078] The present invention has the following beneficial effects:

[0079] The present invention transforms the traditional point-to-point information interaction mechanism based on "connection" into an information interaction mechanism based on "content", which greatly simplifies the network, timing, and connection design of distributed simulation, improves the real-time performance of the simulation model, and enhances the reliability, maintainability, and testability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0081] Figure 1 A flow chart of a data interaction method for aviation emergency simulation rescue training provided by an embodiment of the present invention;

[0082] Figure 2 A schematic diagram of the basic format of a data exchange data packet provided by an embodiment of the present invention;

[0083] Figure 3 A table of update queues of various types of data provided in an embodiment of the present invention;

[0084] Figure 4 A data structure diagram based on a data bus provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0085] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0086] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.

[0087] See also Figure 1 As shown, a data interaction method for aviation emergency simulation rescue training provided by an embodiment of the present invention includes:

[0088] Step 1, create a system model file: abstract all the equipment used in aviation emergency simulation rescue training into models. Several models constitute the entire data interaction system. The system model file is the basis for data interaction. The model file defines the identification, version, description and parameters of each model:

[0089] Step 2, requesting a local model file: Before initiating a data exchange request, the data exchange initiator first obtains its own model file, thereby learning its own configuration constraints, the range of access parameters, and the characteristics of access parameters;

[0090] Step 3, update the local model data structure: after obtaining its own model file, the initiator parses the corresponding model file and initializes the local model management structure, including parameter cache, update queue, event trigger and bridge;

[0091] Step 4, initiating data update: the data exchange initiator obtains the model parameters of the corresponding device based on the index of the pre-updated model parameters, puts them into the parameter cache, and adds the corresponding parameter index and puts them into the update queue;

[0092] Step 5, refresh update queue: the data exchange initiator reorganizes and encodes the data in the update queue, and sends it out through the network after encoding;

[0093] Step 6, receiving data update: the data exchange processor receives the data from the data exchange initiator, decodes it, generates parameter data, and puts the corresponding parameter data into the system global parameter cache;

[0094] Step 7, forwarding data update: the data exchange processor repackages and encodes the updated data according to the parameters declared by each model in the system model file, and finally sends it to the receiver;

[0095] Step 8, receiving data: the receiver receives the data forwarded by the processor, updates the local cache, and completes the data exchange process;

[0096] Among them, data interaction is realized between various devices in aviation emergency simulation rescue training based on data bus. The device can be a system in aviation emergency simulation rescue training or a subsystem, device, software or hardware in the system. The data bus is responsible for data interaction between all relevant data of the whole system and other software, hardware or systems;

[0097] Among them, since the devices are distributed in different geographical locations, in order to facilitate unified configuration and management of the devices, the model configuration information corresponding to all devices is concentrated on the Server side, and each device is distributed on different Client sides as a data exchange initiator or receiver.

[0098] Among them, the initiator (Client side): initiates a data exchange request and sends the latest data; the receiver (Client side): receives the data exchange request, updates the local data with the received data, and triggers local events; the processor (Server side): the intermediate role real-time data exchange system, receives the initiator's request, decodes the data, and sends the re-encoded data to the receiver according to the rules.

[0099] The present invention transforms the traditional point-to-point information interaction mechanism based on "connection" into an information interaction mechanism based on "content", which greatly simplifies the network, timing, and connection design of distributed simulation, improves the real-time performance of the simulation model, and enhances the reliability, maintainability, and testability of the system.

[0100] The data exchange granularity of the present invention can reach the variable level, using a globally unified virtual address access, which is independent of the actual location of the device, the communication protocol, and the interface form, reducing the encoding and decoding operations of the data on the application side; the real-time communication delay is below 50ms, and a maximum distributed simulation of 200Hz is supported. It supports the connection and distributed communication of no less than 10 communication terminals, and supports basic data types (Boolean, integer, floating point, string) and complex data types (XML, JSON).

[0101] The software of the present invention is based on real-time protocol design and adapter design mode to build a distributed content distribution service. The system consists of central service software (Server side) and client API (Client side). The central service software is responsible for subscribing to data content and distributing specified data content to the demander. The client API is responsible for publishing and obtaining the data content required by the client.

[0102] In some optional embodiments, the system model file defines information on model composition, model attributes, and model parameters within the system;

[0103] Among them, model parameters are the core of the model, and model parameters are divided into two categories: input parameters and output parameters. If the model contains input parameters, it means that the model can act as a receiver and receive data updates from other models; if the model contains output parameters, it means that the model can act as an initiator and send updated data to other models.

[0104] Among them, the model file is described in the extensible description language XML. The data interaction system contains multiple models, each model contains one or more parameters (i.e., model parameters). The parameters are managed in a flat manner with index (similar to array subscript) as the core. Each parameter appears in the corresponding one or more models and can have different parameter names, IO types, classifications and description information. The index and data type of the parameter are globally unified. The corresponding parameter values ​​are the same when the same parameter is running. The system model file is created on the server side. Each model file is pre-defined with a model identifier that matches the corresponding device attributes. The model identifier is equivalent to the model ID.

[0105] In some optional embodiments, when the client corresponding to the initiator is started, it pulls the corresponding local model file from the server to obtain its own model file. The specific implementation process includes:

[0106] Step 2.1, the client reads the corresponding device attributes, generates a model identifier based on the attributes, and generates a model request data packet containing the model identifier, wherein the model request data packet includes a header and a data area, wherein the header includes fields such as a domain identifier, a packet length, a sender identifier, a packet type, a timestamp, and a reserved word, wherein the packet type is also called a message type, and for the model request data packet, the sender identifier is the generated model identifier, and the basic format of the data packet is as follows: Figure 2 As shown;

[0107] Step 2.2, after receiving the model request data packet from the client, the server checks the correctness and integrity of the data, reads the system model file loaded into the memory, selects a model file with the same model identifier as the model request data packet from the model file, and puts the model file including an XML paragraph into the data area of ​​the model request data packet. After modifying the relevant identification information, the server's timestamp is loaded into the model request data packet, and the corresponding data packet is returned to the corresponding client;

[0108] Step 2.3, after receiving the data packet returned by the Server, the Client checks whether the model identifier in the data packet matches the local model identifier. If they match, execute step 2.4; otherwise, return to step 2.1;

[0109] Step 2.4: The client calculates the time drift between the client and the server based on the timestamp data of the server. If the drift exceeds the time accuracy requirement of the test, the client's system clock is adjusted.

[0110] The model file includes XML segments, and the XML segments include an XML segment recording model attribute information and an XML segment recording model parameter information.

[0111] In some optional embodiments, step 3 is implemented by the data exchange initiator, and the specific process includes:

[0112] Step 3.1, after obtaining the model file belonging to itself, parse the model attribute information XML fragment, generate model data, and bind the model identifier and the network connection handle to facilitate subsequent update operations, wherein the model data includes the model identifier;

[0113] Step 3.2, parse the model parameter information XML fragment and generate a model parameter array;

[0114] Step 3.3, generating a mapping table according to the position of the model parameter array and the index of the model parameter, so as to associate the corresponding model parameter through the parameter index, so as to facilitate the subsequent rapid search for the model parameter in the model parameter array according to the model parameter index;

[0115] Step 3.4, create an update queue. According to the data type of the model parameter, create an update queue of the corresponding type to record data updates. The data type of the model parameter includes Bool type, Int type, Real type and Buf type. The update queue includes Bool type, Int type, Real type and Buf type data update queues.

[0116] Step 3.5, register events, bind predefined events and model parameter indexes. Each model parameter supports one binding event. When data is updated, the corresponding event function is triggered.

[0117] To solve the data synchronization waiting caused by network transmission, the system uses a pre-allocated data structure to save updated data. The external interface only needs to read or write data from the system memory, and the system automatically updates and maintains the data in the memory.

[0118] In some embodiments, step 4 is implemented by the data exchange initiator, and the specific process includes:

[0119] Step 4.1, check the status of the client as the initiator to determine whether step 3 is completed correctly; if step 3 is completed correctly, execute step 4.2; if step 3 is not completed correctly, return update failure;

[0120] Step 4.2, according to the index of the pre-updated model parameter, search the model parameter in the local model parameter array, if the corresponding model parameter is found, execute step 4.3, otherwise return update failure.

[0121] Step 4.3, check whether the parameter type is Output. If so, execute 4.4. Otherwise, return update failure.

[0122] Step 4.4, update the value of the corresponding model parameter based on the updated value, and add the local index of the parameter (the subscript of the parameter in the local model parameter array) to the update queue;

[0123] Among them, the Client can only update the model parameters with IO type Output. When updating, the index of the model parameter to be updated and the update value are provided. The index of the model parameter to be updated and the update value can be provided by the controller or any other module that can issue instructions through control instructions.

[0124] In some embodiments, step 5 is implemented by the data exchange initiator, and the specific process includes

[0125] Step 5.1, check the Bool type, Int type, Real type, Buf type data update queue in turn. If there is a parameter index in a certain type of queue, obtain the model parameter and model parameter value based on the parameter index, and fill the data area of ​​the data packet used for data exchange in the queue according to the protocol format corresponding to the queue type. The data area contains the parameter index, the model to which the parameter belongs, the model parameter and the model parameter value. The data of each type is as follows Figure 3 As shown, the numbers in brackets represent the byte length;

[0126] Step 5.2, update the packet header description of the corresponding data packet to form a complete network data packet;

[0127] Step 5.3, call the network connection handle bound to the model and send the corresponding data packet. If the data packet is sent successfully, clear the update queues. If the data sending fails, return an error.

[0128] Furthermore, step 6 takes the data exchange processing party as the embodiment subject, and the specific process includes:

[0129] Step 6.1, the data exchange processor reads the data sent in step 5 from the network cache. If the amount of data read is less than or equal to 0, the receiving process is exited, otherwise, step 6.2 is executed;

[0130] Step 6.2, copy the data to the system data buffer;

[0131] Step 6.3, search the domain identifier of the data packet corresponding to the data from the system data buffer. If the corresponding domain identifier is not found, the corresponding data packet is judged to be illegal, the buffer is reset, and the receiving process is exited, otherwise, step 6.4 is executed;

[0132] Step 6.4, read the packet length field of the data packet to obtain the length of the data packet. If the packet length is greater than the amount of data currently received, return to step 6.1 and continue receiving data, otherwise execute step 6.5.

[0133] Step 6.5, parse the message type field of the data packet, call the corresponding data parsing function to parse the data according to different message types, obtain the parameter data of the data area, that is, the model parameter, the model to which the parameter belongs, the parameter index and the model parameter value, and put the parameter data into the system global parameter cache;

[0134] Step 6.6, remove the parsed data packet from the system data buffer and return to step 6.3

[0135] The message types include Bool, Int, Real and Buf types, and the server side, which is the data exchange processor, continuously listens to data on a fixed network port.

[0136] In some embodiments, step 7 is implemented by data exchange processing, and the specific process includes:

[0137] Step 7.1, according to the message type and the encoding rules of the data area in step 5.1, parse the parameters from the system global parameter buffer in sequence to obtain the parameter index, the model to which the parameter belongs, and the updated value, where the updated value is the model parameter value.

[0138] Step 7.2, according to the parameter index, check whether the parameter exists in the two-dimensional linked list on the server side. If not, return to step 7.1 to parse the next data area; otherwise, execute step 7.3;

[0139] Step 7.3, according to the parameter index, traverse the multiple models linked to the corresponding parameter index, and update the parameter value of each model;

[0140] In step 7.4, during the model traversal process, if the parameter type of the corresponding index in the model is INPUT, it means that the corresponding model requires the parameter of the corresponding index as input, then create or update the update queue with the model identifier and parameter index as the content;

[0141] Step 7.5 traverses the update queue. Each node in the queue is the model identifier and all its parameters to be updated. The traversal process is as follows:

[0142] Step 7.5.1, according to the model identifier, search for the network connection handle corresponding to the model identifier from the Client queue on the Server side. If the network connection handle is found, execute step 7.5.2, otherwise return to step 7.5 to traverse the next node.

[0143] Step 7.5.2, traverse the parameter list to be updated, and divide the parameter list into four lists of different message types according to the parameter type, where the parameter type includes BOOL, INT, REAL and BUF types;

[0144] If the BOOL type list is not empty, generate the data area according to the protocol rules of the BOOL type parameter in step 5.1, then use the network connection handle to send the data to the network cache, and finally clear the BOOL type update list;

[0145] If the INT type list is not empty, generate the data area according to the protocol rules of the INT type parameter in step 5.1, then use the network connection handle to send the data to the network cache, and finally clear the INT type update list;

[0146] If the REAL type list is not empty, generate the data area according to the protocol rules of the REAL type parameter in step 5.1, then use the network connection handle to send the data to the network cache, and finally clear the Real type update list;

[0147] If the BUF type list is not empty, generate the data area according to the protocol rules of the BUF type parameter in step 5.1, then use the network connection handle to send the data to the network cache, and finally clear the BUF type update list;

[0148] refer to Figure 4As shown, the server side manages all parameters in the system in the form of a two-dimensional linked list. Data management is centered on parameters, and the global index of the parameter is organized into a first-dimensional linked list. The unique parameter can be accessed through the index. At the same time, the index is hashed to increase the speed of index access. The global index of each parameter links the same parameter of multiple models, so that the same parameter of different models has an independent data cache space, thereby reducing the waiting overhead of data synchronization and improving data forwarding efficiency. Due to the difference in the number of parameters used by the model, the number of models linked to different parameters is different.

[0149] In some embodiments, step 8 is implemented by the data exchange recipient, and the specific process includes:

[0150] Step 8.1, read data from the network cache. If the amount of data read is less than or equal to 0, it means that the server is abnormal. Exit the receiving process and restart the network connection process. Otherwise, execute step 8.2;

[0151] Step 8.2, copy the data to the global data buffer of the Client. If the copy fails, discard the data packet and return to step 8.1 to the next receiving process. Otherwise, execute step 8.3.

[0152] Step 8.3, search the domain identifier of the data packet from the buffer. If the domain identifier is not found, it means that the data packet is illegal, reset the buffer, and exit the receiving process. Otherwise, execute step 8.4.

[0153] Step 8.4, read the packet length field to obtain the length of the data packet. If the packet length is greater than the current amount of data received and less than the maximum length of the global data buffer, return to step 8.1 to continue receiving data. If the packet length is greater than the maximum length of the global data buffer, reset the buffer and exit the receiving process.

[0154] Step 8.5, parse the message type field, and call different data parsing functions for parsing according to different message types (Bool, Int, Real, Buf);

[0155] Step 8.6, parse the data area of ​​the data packet, obtain the parameter index and the model parameter value, remove the parsed data packet from the buffer after parsing, and continue to receive data packets;

[0156] Step 8.7, search the local model data structure on the client side for the parameter corresponding to the parameter index. If it exists, update the parameter value of the corresponding parameter based on the model parameter value, set the parameter update status to TRUE, and reset the timestamp of the parameter update to the timestamp of the data packet.

[0157] Step 8.8, if the parameter is bound to an event trigger, the data value before and after the update is used as parameters to call the corresponding event trigger function.

[0158] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a computer, the computer executes any of the above-described data interaction methods for aviation emergency simulation rescue training.

[0159] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A data interaction method for aviation emergency simulation rescue training, characterized in that: The method comprises: Step 1, create a system model file: abstract all the equipment used in aviation emergency simulation rescue training into models. Several models constitute the entire data interaction system. The system model file is the basis for data interaction. The model file defines the identification, version, description and parameters of each model: Step 2: Request local model file: Before initiating a data exchange request, the data exchange initiator first obtains its own model file; Step 3, update the local model data structure: after obtaining its own model file, the initiator parses the corresponding model file and initializes the local model management structure, including parameter cache, update queue, event trigger and bridge; Step 4, initiating data update: the data exchange initiator obtains the model parameters of the corresponding device based on the index of the pre-updated model parameters, puts them into the parameter cache, and adds the corresponding parameter index and puts them into the update queue; Step 5, refresh update queue: the data exchange initiator reorganizes and encodes the data in the update queue, and sends it out through the network after encoding; Step 6, receiving data update: the data exchange processor receives the data from the data exchange initiator, decodes it, generates parameter data, and puts the corresponding parameter data into the system global parameter cache; Step 7, forwarding data update: the data exchange processor repackages and encodes the updated data according to the parameters declared by each model in the system model file, and finally sends it to the receiver; Step 8, receiving data: the receiver receives the data forwarded by the processor, updates the local cache, and completes the data exchange process; Among them, data interaction is realized between various devices in aviation emergency simulation rescue training based on data bus; The model configuration information corresponding to all devices is concentrated on the Server side, and each device is distributed on different Client sides as the initiator or receiver of data exchange.

2. The data interaction method for aviation emergency simulation rescue training according to claim 1, characterized in that: In step 1, the system model file defines the model composition, model attributes, and model parameters in the system; Among them, model parameters are the core of the model, and model parameters are divided into two categories: input parameters and output parameters. If the model contains input parameters, the corresponding model has the function of being a receiver and receiving data updates from other models. If the model contains output parameters, the corresponding model has the function of being an initiator and sending updated data to other models. Among them, the model file is described in the extensible description language XML. The data interaction system contains multiple models, each model contains one or more parameters, and the parameters are managed in a flat manner with index as the core. Each parameter appears in the corresponding one or more models. The index and data type of the parameter are globally unified. The corresponding parameter values ​​are the same when the same parameter is running. The system model file is created on the server side, and each model file is pre-defined with a model identifier that matches the corresponding device attributes.

3. The data interaction method for aviation emergency simulation rescue training according to claim 2, characterized in that: Step 2 includes: When the client corresponding to the initiator starts, it pulls the corresponding local model file from the server to obtain its own model file. The specific implementation process includes: Step 2.1, the client reads the corresponding device attributes, generates a model identifier according to the attributes, and generates a model request data packet containing the model identifier, wherein the model request data packet includes a header and a data area, the header includes a domain identifier, a packet length, a sender identifier, a packet type, a timestamp, and a reserved word, and for the model request data packet, the sender identifier is the generated model identifier; Step 2.2, after receiving the model request data packet from the client, the server checks the correctness and integrity of the data, reads the system model file loaded into the memory, selects a model file with the same model identifier as the model request data packet from the model file, and puts the model file including an XML paragraph into the data area of ​​the model request data packet. After modifying the relevant identification information, the server's timestamp is loaded into the model request data packet, and the corresponding data packet is returned to the corresponding client; Step 2.3, after receiving the data packet returned by the Server, the Client checks whether the model identifier in the data packet matches the local model identifier. If they match, execute step 2.4; otherwise, return to step 2.1; Step 2.4: The client calculates the time drift between the client and the server based on the timestamp data of the server. If the drift exceeds the time accuracy requirement of the test, the client's system clock is adjusted. The model file includes XML segments, and the XML segments include an XML segment recording model attribute information and an XML segment recording model parameter information.

4. The data interaction method for aviation emergency simulation rescue training according to claim 3 is characterized in that: Step 3 includes: Data exchange initiator: Step 3.1, after obtaining its own model file, parse the model attribute information XML fragment, generate model data, and bind the model identifier and network connection handle in the model data; Step 3.2, parse the model parameter information XML fragment and generate a model parameter array; Step 3.3, generating a mapping table according to the position of the model parameter array and the index of the model parameter, so as to associate the corresponding model parameters through the parameter index; Step 3.4, create an update queue. According to the data type of the model parameter, create an update queue of the corresponding type to record data updates. The data type of the model parameter includes Bool type, Int type, Real type and Buf type. The update queue includes Bool type, Int type, Real type and Buf type data update queues. Step 3.5, register events, bind predefined events and model parameter indexes. Each model parameter supports one binding event. When the data is updated, the corresponding event function is triggered. To solve the data synchronization waiting caused by network transmission, the system uses a pre-allocated data structure to save updated data. The external interface only needs to read or write data from the system memory, and the system automatically updates and maintains the data in the memory.

5. The data interaction method for aviation emergency simulation rescue training according to claim 4, characterized in that: Step 4 includes: Data exchange initiator: Step 4.1, check the status of the client as the initiator to determine whether step 3 is completed correctly; if step 3 is completed correctly, execute step 4.2; if step 3 is not completed correctly, return update failure; Step 4.2, according to the index of the pre-updated model parameter, search the model parameter in the local model parameter array, if the corresponding model parameter is found, execute step 4.3, otherwise return update failure; Step 4.3, check whether the parameter type is Output. If so, execute 4.

4. Otherwise, return update failure. Step 4.4, update the value of the corresponding model parameter based on the updated value, and add the local index of the parameter to the update queue; The Client can only update model parameters whose IO type is Output. When updating, it provides the index of the model parameter to be updated and the update value.

6. The data interaction method for aviation emergency simulation rescue training according to claim 5, characterized in that: Step 5 includes: Data exchange initiator: Step 5.1, check the Bool type, Int type, Real type, and Buf type data update queues in turn. If there is a parameter index in a certain type of queue, obtain the model parameter and model parameter value based on the parameter index, and fill the data area of ​​the data packet used for data exchange in the queue according to the protocol format corresponding to the queue type; Step 5.2, update the packet header description of the corresponding data packet to form a complete network data packet; Step 5.3, call the network connection handle bound to the model and send the corresponding data packet. If the data packet is sent successfully, clear the update queues. If the data sending fails, return an error.

7. The data interaction method for aviation emergency simulation rescue training according to claim 6, characterized in that: Step 6 includes: Data exchange processor: Step 6.1, the data exchange processor reads the data sent in step 5 from the network cache; Step 6.2, copy the data to the system data buffer; Step 6.3, search the domain identifier of the data packet corresponding to the data from the system data buffer. If the corresponding domain identifier is not found, the corresponding data packet is judged to be illegal, the buffer is reset, and the receiving process is exited, otherwise, step 6.4 is executed; Step 6.4, read the packet length field of the data packet to obtain the length of the data packet. If the packet length is greater than the amount of data currently received, return to step 6.1 and continue receiving data, otherwise execute step 6.

5. Step 6.5, parse the message type field of the data packet, call the corresponding data parsing function to parse the data according to different message types, obtain the parameter data of the data area, namely the model parameters, the model to which the parameters belong, the parameter index and the model parameter value, and put the parameter data into the system global parameter cache. Step 6.6, remove the parsed data packet from the system data buffer, go to 6.3 The message types include Bool, Int, Real and Buf types, and the server side, which is the data exchange processor, continuously listens to data on a fixed network port.

8. The data interaction method for aviation emergency simulation rescue training according to claim 7, characterized in that: Step 7 includes: Data exchange processor: Step 7.1, according to the message type and the encoding rule of the data area in step 5.1, parse the parameters from the system global parameter buffer in sequence to obtain the parameter index, the model to which the parameter belongs, and the updated value, where the updated value is the model parameter value; Step 7.2, according to the parameter index, check whether the parameter exists in the two-dimensional linked list on the server side. If not, return to step 7.1 to parse the next data area; otherwise, execute step 7.3; Step 7.3, according to the parameter index, traverse the multiple models linked to the corresponding parameter index, and update the parameter value of each model; Step 7.4, during the traversal of the model, if the parameter type of the corresponding index in the model is INPUT, it means that the corresponding model requires the parameter of the corresponding index as input, then create or update the update queue with the model identifier and parameter index as the content; Step 7.5, traverse the update queue. Each node in the queue is the model identifier and all its parameters to be updated. The traversal process is as follows: Step 7.5.1, according to the model identifier, search for the network connection handle corresponding to the model identifier from the Client queue on the Server side. If the network connection handle is found, execute step 7.5.2, otherwise return to step 7.5 to traverse the next node; Step 7.5.2, traverse the parameter list to be updated, and divide the parameter list into four lists of different message types according to the parameter type, where the parameter type includes BOOL, INT, REAL and BUF types; If the BOOL type list is not empty, generate the data area according to the protocol rules of the BOOL type parameter in step 5.1, then use the network connection handle to send the data to the network cache, and finally clear the BOOL type update list; If the INT type list is not empty, generate the data area according to the protocol rules of the INT type parameter in step 5.1, then use the network connection handle to send the data to the network cache, and finally clear the INT type update list; If the REAL type list is not empty, generate the data area according to the protocol rules of the REAL type parameter in step 5.1, then use the network connection handle to send the data to the network cache, and finally clear the Real type update list; If the BUF type list is not empty, generate the data area according to the protocol rules of the BUF type parameter in step 5.1, then use the network connection handle to send the data to the network cache, and finally clear the BUF type update list; The server manages all parameters in the system in the form of a two-dimensional linked list. Data management is centered on parameters, and the global index of the parameters is organized into a first-dimensional linked list. The unique parameter can be accessed through the index. At the same time, the index is hashed to increase the speed of index access. The global index of each parameter links the same parameter of multiple models, so that the same parameter of different models has an independent data cache space, thereby reducing the waiting overhead of data synchronization and improving data forwarding efficiency. Due to the difference in the number of parameters used by the model, the number of models linked to different parameters is different.

9. The data interaction method for aviation emergency simulation rescue training according to claim 8, characterized in that: Step 8 includes: Data exchange recipient: Step 8.1, read data from the network cache. If the amount of data read is less than or equal to 0, it means that the server is abnormal. Exit the receiving process and restart the network connection process. Otherwise, execute step 8.2; Step 8.2, copy the data to the global data buffer of the Client. If the copy fails, discard the data packet and return to step 8.1 to the next receiving process. Otherwise, execute step 8.

3. Step 8.3, search the domain identifier of the data packet from the buffer. If the domain identifier is not found, it means that the data packet is illegal, reset the buffer, and exit the receiving process. Otherwise, execute step 8.

4. Step 8.4, read the packet length field to obtain the length of the data packet. If the packet length is greater than the current amount of data received and less than the maximum length of the global data buffer, return to step 8.1 to continue receiving data. If the packet length is greater than the maximum length of the global data buffer, reset the buffer and exit the receiving process. Step 8.5, parse the message type field, and call different data parsing functions according to different message types, where the message types include Bool, Int, Real, and Buf types; Step 8.6, parse the data area of ​​the data packet to obtain the parameter index and model parameter value. Step 8.7, search the local model data structure on the client side for the parameter corresponding to the parameter index. If it exists, update the parameter value of the corresponding parameter based on the model parameter value, set the parameter update status to TRUE, and reset the timestamp of the parameter update to the timestamp of the data packet. Step 8.8, if the parameter is bound to an event trigger, the data value before and after the update is used as parameters to call the corresponding event trigger function.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the computer executes the data interaction method for aviation emergency simulation rescue training as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Real-time exchange method of distributed experimental data

    CN108173948A

  • Training evaluation platform and evaluation method suitable for aviation emergency rescue

    CN114971431A

  • Queue depth management for communication between host and peripheral device

    US20050177657A1