Flight simulator dynamic coding and decoding system and method based on rule decoupling

By introducing a three-layer architecture decoding rule decoding design in the flight simulator system, the problem of inefficient maintenance of the codec technology and long configuration switching cycle is solved, zero-code configuration switching and fast adaptation are achieved, and the system flexibility and compatibility are improved.

CN120416299AActive Publication Date: 2025-08-01CHINA SOUTHERN TECHNOLOGY (GUANGDONG HENGQIN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510918529.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-04
Publication Date
2025-08-01
Estimated Expiration
2045-07-04

AI Technical Summary

Technical Problem

In existing flight simulator systems, the codec technology has inefficient maintenance, long configuration switching cycles and insufficient compatibility, making it difficult to cope with the needs of rapid switching of multiple scenarios and protocol expansion.

Method used

The dynamic codec system of the flight simulation machine based on rules is adopted. Through the three-layer architecture of the network connection layer, the variable codec layer and the message analysis layer, the configuration files are used to realize the modular management of codec rules, decouple the simulation logic and the device interaction, and support dynamic protocol adaptation and configuration switching.

Benefits of technology

The zero-code switching configuration is realized, reducing maintenance difficulty and risk, improving system flexibility and compatibility, meeting diverse data processing needs, and quickly adapting to equipment and configuration changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120416299A_ABST
    Figure CN120416299A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of aircraft control simulation, relates to a flight simulator dynamic encoding and decoding system and method based on rule decoupling, and aims to solve the problems that an existing flight simulator encoding and decoding method is low in maintenance efficiency, long in switching period and insufficient in compatibility. The method comprises the following steps: configuring a file module and a three-layer architecture, wherein a network connection layer obtains connection information of simulation equipment; the variable coding and decoding layer stores predefined coding and decoding rules and modifies the corresponding coding and decoding rules according to the connection information; the message analysis layer encodes and decodes the message according to the encoding and decoding rule, and maps and interacts with the logic variable; the coding and decoding rule comprises a device coding and decoding rule for integrating communication information of each device, a channel coding and decoding rule for extracting message information of each channel and a variable coding and decoding rule for positioning a logic variable. According to the invention, codes and configuration are decoupled, dynamic coding and decoding are carried out, flexible switching of a code-modification-free adaptive protocol and configuration is realized, and the compatibility is better.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In a flight simulator system, the encoding and decoding process is the core link for realizing the interaction between hardware devices and simulation logic data, and its performance directly affects the authenticity of simulation training and the system maintenance efficiency. For the encoding and decoding requirements of devices in traditional flight simulator systems for different flight simulator configurations (such as different aircraft models, different configuration schemes), a customized code development method is adopted for adaptation. When it comes to adding or removing devices or changing configurations, it is necessary to manually write specific codes to implement the access of the encoding and decoding functions of new devices. This encoding and decoding method that relies on a fixed format parsing module has the parsing logic for different communication protocols solidified in the system in the form of preset rules, restricting the flexibility and maintainability of the system.

[0003] This strongly coupled architecture leads to a significant increase in system maintenance costs: when the communication protocol changes (such as data frame format adjustment, checksum algorithm upgrade) or the simulation logic needs to be optimized, developers must synchronously modify the encoding and decoding module and the simulation code, and comprehensively check the code relevance to avoid chain errors; when adjusting the start symbol of the data frame of a certain protocol, it is necessary to modify both the encoding and decoding function and the flight attitude calculation module that depends on this data, extending the maintenance cycle and making it difficult for the system to cope with frequent requirement changes.

[0004] At the same time, in the multi-configuration adaptation scenario of flight simulators, the existing technology lacks a general-purpose encoding and decoding adaptation framework. Different configurations of simulators may be equipped with different sensors, display devices or input / output devices (such as the difference in the communication protocols of the joysticks of the A320 and B737 models), and the existing solutions need to develop customized codes for the communication protocols of each device. When switching configurations or adding / removing devices, developers need to rewrite the parsing logic to adapt to the encoding and decoding requirements of new devices. This adaptation method that relies on code rewriting has a long reconstruction cycle and low development efficiency, seriously restricting the rapid reconstruction ability of the simulator system and making it difficult to meet the actual needs of rapid switching in multiple scenarios in aviation training.

[0005] In terms of protocol extension, the existing encoding and decoding methods adopt fixed parsing logic and have insufficient support for new communication protocols or adjustments to existing protocols. For emerging Internet of Things protocols (such as MQTT, CoAP) or private protocols of avionics devices, the system needs to carry out structural transformation of the encoding and decoding module; and when new data fields are added or the message format is changed in the existing protocol, it is necessary to modify the code and recompile to achieve adaptation, and the system's response ability to protocol changes is insufficient, seriously restricting the compatibility of the flight simulator system.

[0006] Therefore, how to achieve modular decoupling of encoding and decoding logic, configuration management of configuration adaptation, and dynamic support for protocol extension has become an urgent technical problem in the current flight simulation field. Summary of the Invention

[0007] To solve the above problems in the prior art, namely the problems of low maintenance efficiency, long configuration switching cycle and insufficient compatibility in the existing flight simulator encoding and decoding technology, the first aspect of the present invention proposes a dynamic encoding and decoding system for flight simulators based on rule decoupling, which is used for information interaction between simulation devices and simulation systems in flight simulators of different configurations. The system includes: A network connection layer, configured to receive or send messages; and also configured to obtain connection information of simulation devices and save it to a configuration file module; A variable encoding and decoding layer, configured to store multiple encoding and decoding rules, and modify corresponding encoding and decoding rules according to the change status of the communication protocol in the connection information; the encoding and decoding rules include device encoding and decoding rules, channel encoding and decoding rules ChCodeRule, and variable encoding and decoding rules VarCodeRule; The message parsing layer includes a receiving channel and a sending channel. The receiving channel decodes the received message into logical variables, and the sending channel encodes the logical variables to be sent into target protocol messages and sends them; the message parsing layer is configured to encode and decode messages based on predefined encoding and decoding rules, and map and interact with logical variables: Integrate device communication information corresponding to each channel based on device encoding and decoding rules; extract message information corresponding to each channel based on channel encoding and decoding rules; locate logical variables corresponding to each channel based on variable encoding and decoding rules; A configuration file module, used to configure parameters for the network connection layer, message parsing layer and variable encoding and decoding layer respectively, and perform global parameter configuration.

[0008] In some preferred embodiments, the connection information includes device information and corresponding configuration parameters; the device information includes communication protocol and channel information.

[0009] In some preferred embodiments, the method of defining encoding and decoding rules is as follows: Define device encoding and decoding rules, which store device communication information, and the device communication information includes communication protocol and communication port; Define channel encoding and decoding rules. Different bytes of the channel encoding and decoding rules respectively store the packet header, packet tail and instruction word in the message information. The receiving channel and the sending channel have different channel encoding and decoding rules; Define variable encoding and decoding rules, which store the position and encoding information of logical variables in message data under the current communication protocol. The position and encoding information include byte index, bit index, bit length and endian mode conversion flag of logical variables in the protocol frame, and the corresponding relationship between logical variables and protocol messages.

[0010] In some preferred embodiments, the method of encoding and decoding a message based on predefined encoding and decoding rules and interacting with logical variables is as follows: When receiving a message sent by a simulation device, the receiving channel decodes the received message into logical variables according to the encoding and decoding rules, extracts the logical variable values of the device status, and then obtains the device status; When it is necessary to send logical variables to the simulation device, the sending channel encodes the logical variables into a target protocol message according to the encoding and decoding rules and sends it, and sends the target protocol message to the simulation device through the network connection layer to complete the device status control.

[0011] In some preferred embodiments, the method of decoding a message into logical variables according to the encoding and decoding rules is as follows: After receiving a message, traverse the logical variables included in the message; analyze based on the encoding and decoding rules to obtain the position and size information of each logical variable in the original message; obtain the value in the original message based on the position and size information and assign it to the logical variable; The position and size information includes the byte position, bit index, and the number of bits occupied.

[0012] In some preferred embodiments, the method of encoding logical variables into a protocol message according to the encoding and decoding rules is as follows: Traverse the logical variables to be sent; analyze based on the encoding and decoding rules to obtain the position and size information of each logical variable in the target protocol message; assign the value based on the position and size information to the value in the target protocol message; The position and size information includes the byte position, bit index, and the number of bits occupied.

[0013] In some preferred embodiments, the method of analyzing based on the encoding and decoding rules is as follows: Integrate the device communication information according to the device encoding and decoding rules to configure the communication of the simulation device; the device communication information includes communication protocol details and communication ports; According to the channel encoding and decoding rules, respectively extract the packet header, packet tail, and instruction word in the message information and separate them to obtain the message data of the current channel; Locate the logical variables according to the variable encoding and decoding rules, and based on the position and encoding information of the logical variables in the message data in the variable encoding and decoding rules, obtain the position and size information of the message data or logical variables of the current channel.

[0014] In some preferred embodiments, the method of modifying the encoding and decoding rules according to the connection information is as follows: If the communication protocol of the simulation device changes, modify the corresponding device encoding and decoding rules and channel encoding and decoding rules, load the modified encoding and decoding rules and store them in the configuration file; If the communication protocol of the simulation device is upgraded and the position and length of the device status change, modify the variable encoding and decoding rules of the corresponding device status, load the modified encoding and decoding rules and store them in the configuration file; If a new communication protocol is added to the simulation device, create encoding and decoding rules according to the rules of the new protocol, load the newly added encoding and decoding rules and store them in the configuration file.

[0015] In some preferred embodiments, based on the link information of the simulation device and the logical variable information obtained after interaction, switch the corresponding configuration rules to adapt to different simulator models.

[0016] The second aspect of the present invention proposes a dynamic encoding and decoding method for a flight simulator based on rule decoupling, and the method includes the following steps: S1. Obtain the connection information of each simulation device, modify the predefined encoding and decoding rules according to the connection information, and save the connection information and the modified encoding and decoding rules to the configuration file; The encoding and decoding rules include device encoding and decoding, channel encoding and decoding, and variable encoding and decoding rules included in the channel; S2. Based on the modified encoding and decoding rules, encode and decode the transmitted and received data, and interact with the logical variables: Decode the received message into logical variables, or encode the logical variables to be sent to generate a target protocol message and send it to the simulation device; S3. Based on the interaction information, determine whether the configuration needs to be switched. If so, unload the current configuration rules and load the target configuration file; otherwise, the configuration rules remain unchanged and the next interaction is performed.

[0017] Advantages of the present invention: Through the decoupling design of the encoding and decoding rules and the simulation logic, and the dynamic encoding and decoding mechanism, the present invention systematically solves the problems of low maintenance efficiency, long configuration switching cycle and insufficient compatibility of the existing flight simulator encoding and decoding technology. The specific advantages are as follows: 1. By decoupling the code and the configuration, the interaction between the simulation program and the device is divided into three layers, and each layer is associated through the configuration file, and the encoding and decoding rules are separated from the simulation logic; when the protocol or logic changes, only the encoding and decoding rules need to be modified, without changing the code, reducing the maintenance difficulty and risk.

[0018] 2. The encoding and decoding rules are stored in the configuration file. When the protocol changes, is adjusted, or new rules are added, modifying the encoding and decoding rules for devices, channels, and variables can quickly adapt to achieve dynamic adaptation of encoding and decoding. There is no need for downtime compilation, realizing "configuration is development", meeting diverse data processing requirements, and quickly adapting to new devices or configuration switches. 3. By decoupling the code from the configuration, zero-code switching of configurations for device access / switching is achieved: when switching configurations, the old rules are unloaded, the new configuration file is loaded, and the new device is activated after verification, all without code, enhancing the flexibility of the system. Description of the Drawings

[0019] Other features, objectives, and advantages of this application will become more apparent by reading the detailed description of the non-limiting embodiments with reference to the following drawings: Figure 1 is the architecture diagram of the flight simulator dynamic encoding and decoding system based on rule decoupling in the embodiment of the present invention; Figure 2 is the flowchart of the flight simulator dynamic encoding and decoding method based on rule decoupling in the embodiment of the present invention; Figure 3 is the flowchart of reconfiguring the encoding and decoding to adapt to protocol changes in the embodiment of the present invention; Figure 4 is the flowchart of receiving a message and performing decoding in the embodiment of the present invention; Figure 5 is the flowchart of encoding the logical variables to be sent and sending the message in the embodiment of the present invention. Detailed Embodiments

[0020] The following further elaborates on this application in conjunction with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention and are not intended to limit the invention. Additionally, it should be noted that for ease of description, only parts related to the relevant invention are shown in the drawings.

[0021] It should be noted that, without conflict, the embodiments in this application and the features in the embodiments can be combined with each other. The following will detail this application with reference to the drawings and embodiments.

[0022] In view of the technical problems existing in the existing flight simulator encoding and decoding technology, such as the strong coupling between the encoding and decoding rules and the simulation logic, the code dependence of configuration adaptation, and the static design of protocol extension, which lead to low system maintenance efficiency, long configuration switching cycle, and insufficient technology evolution ability, the first embodiment of the present invention proposes a dynamic encoding and decoding system for flight simulators based on rule decoupling, which is used for information interaction between each simulation device and the simulation system in flight simulators of different configurations. The interaction between the simulation program and the device is abstracted into a specific three-layer architecture, and data is encoded and decoded based on the encoding and decoding rules. Associations are established and mappings are realized between layers through configuration files, achieving zero-code operation when adapting to different protocols and during configuration switching. As Figure 1 shown, specifically as follows: The dynamic encoding and decoding system for flight simulators based on rule decoupling includes: A network connection layer, configured to receive or send messages; it is also configured to obtain the connection information of the simulation device and save it to the configuration file module, including the device's IP, port, send / receive frequency, etc., and the corresponding content is saved to the device encoding and decoding rules; A variable encoding and decoding layer, configured to store multiple encoding and decoding rules, and modify the corresponding encoding and decoding rules according to the change status of the communication protocol in the connection information; the variable encoding and decoding rules are used for mapping and interaction between the message content and logical variables, mainly including information such as the offset, byte size, and endianness of the logical variables in the message content; The message parsing layer includes a receiving channel and a sending channel. The receiving channel decodes the received message into logical variables, and the sending channel encodes the logical variables to be sent into a target protocol message and sends it; the message parsing layer is configured with channel encoding and decoding rules for obtaining the logical variables included in the received and sent messages, as well as the frame formats such as the message header, message tail, and message length: Integrate the device communication information corresponding to each channel based on the device encoding and decoding rules; extract the message information corresponding to each channel based on the channel encoding and decoding rules; locate the logical variables corresponding to each channel based on the variable encoding and decoding rules; A configuration file module, used to configure parameters for the network connection layer, message parsing layer, and variable encoding and decoding layer respectively, and perform global parameter configuration.

[0023] This application divides the interaction between the simulation and the device into three layers: network connection, message parsing, and variable encoding and decoding, and associates each layer with a configuration file to reduce coupling and improve maintainability and scalability.

[0024] In this embodiment, the system is used for information interaction between each simulation device and the simulation system in flight simulators of different configurations, and can connect multiple flight simulators simultaneously, where: A simulation system, which is used to simulate the six-degree-of-freedom motion characteristics of a target configuration to generate the motion and state parameters of the flight simulator, and is used to simulate the functions of the airborne system of the target configuration and output the corresponding data of the simulated airborne system; A simulation device, which is used to simulate the devices of a flight simulator with a target configuration.

[0025] Preferably, in other embodiments, a standardized interface is provided on the device carried by the method of the present invention, which is used to provide a communication interface between the device under test and the simulation system, obtain information and interact data through the standardized interface, realize zero-code operation during configuration switching, and improve the flexibility and configuration efficiency of the system. Specifically, the specific processes of variable encoding and decoding and message parsing, as well as the specific processes of network packet receiving and sending, can be abstracted as a standardized interface. For example, the encoding and decoding rules are different digital variables, but the functions called during the parsing process are the same. Package the above processes into reusable functions and abstract them as interfaces to adapt to different encoding and decoding rules.

[0026] Preferably, the connection information includes device information and corresponding configuration parameters; the device information includes communication protocol and channel information.

[0027] In this embodiment, the network connection layer supports multiple network protocols, such as UDP, TCP, etc. At the same time, this layer can distinguish different devices and save the device connection information (including IP address, port number, protocol type, etc.) to a configuration file. When the simulator system is initialized, the program reads the configuration file, loads the information in the configuration file, and creates a connection with the device based on this information.

[0028] Further preferably, define the encoding and decoding rules, and the method is as follows: Define the device encoding and decoding rules, and the device encoding and decoding rules store the device communication information, and the device communication information includes communication protocol and communication port; Define the channel encoding and decoding rules. In different bytes of the channel encoding and decoding rules, the packet header, packet tail, and instruction word in the message information are respectively stored, and the receiving channel and the sending channel have different channel encoding and decoding rules; Define the variable encoding and decoding rules, and the variable encoding and decoding rules store the position and encoding information of the logical variables in the message data under the current communication protocol. The position and encoding information includes the byte index, bit index, bit length, and endian mode conversion flag of the logical variable in the protocol frame, as well as the corresponding relationship between the logical variable and the protocol message.

[0029] The encoding and decoding process is abstracted into encoding and decoding rules (CodeRule), including variable encoding and decoding rules (VarCodeRule), channel encoding and decoding (ChCodeRule), and device encoding and decoding, which define the encoding and decoding methods of data, including the correspondence between variables and protocol messages, and the specific algorithms for encoding and decoding. Through this abstraction, the encoding and decoding process is separated from the specific code implementation, providing a basis for zero-code adaptation.

[0030] In this embodiment, the variable encoding and decoding rule is a large number of type long long, which can store 8-byte information. Using this 8-byte information, the positions and encoding information of logical variables in the message data can be stored respectively. Preferably, in this embodiment, some of the 8 bytes are used to store encoding information such as the byte index, bit index, bit length, and endian mode conversion flag of the logical variable in the protocol frame.

[0031] In this embodiment, the channel encoding and decoding is a large number of type long long, and its different bytes correspond to key information such as the message header, packet tail, and instruction word respectively. The device encoding and decoding integrates the device communication information into a string, which covers key configuration information such as the communication protocol details and communication ports of the device.

[0032] In this embodiment, as a feasible solution, for the encoding and decoding rules under a certain protocol, the following are defined: The device encoding and decoding integrates the communication protocol details of the device (such as a custom communication protocol) and information such as the communication port, etc., for accurately configuring the communication with the sensor. For the channel encoding and decoding of the receiving channel, some bytes correspond to the header (OxAB), packet tail (OxCD), and instruction word (0x01 represents the device status data instruction) of the device. Assume that the byte index of the variable in the protocol frame is 8, the bit index is 4, the bit length is 16, and the endian mode is the little endian mode, and store these key information in the corresponding byte positions.

[0033] Preferably, the message is encoded and decoded based on the predefined encoding and decoding rules and interacts with the logical variable. The method is as follows: When receiving a message sent by the simulation device, the receiving channel decodes the received message into a logical variable according to the encoding and decoding rules, extracts the logical variable value of the device status, and further obtains the device status; When it is necessary to send a logical variable to the simulation device, the sending channel encodes the logical variable into a target protocol message according to the encoding and decoding rules and sends it, and sends the target protocol message to the simulation device through the network connection layer to complete the device status control.

[0034] In the message parsing layer, the message data in the channel (receive channel or send channel) is split into a packet header and data, and the corresponding program logic variables in the channel message data are obtained; for a specific message, according to the configured encoding and decoding rules, the logical variables therein can be accurately extracted, providing a basis for subsequent processing. The following is an example: Set the message received from the device to channel 1, configure the encoding and decoding rules, determine its message packet header characteristics (such as specific hexadecimal 0xAB) and length information (fixed 40 bytes), so as to accurately split the packet header and data, and obtain the logical variable values related to the device.

[0035] Further preferably, as Figure 4 shown, decoding the message into logical variables according to the encoding and decoding rules, the method is: After receiving the message, traverse the logical variables included in the message; analyze based on the encoding and decoding rules to obtain the position and size information of each logical variable in the original message; obtain the value in the original message based on the position and size information and assign it to the logical variable; The position and size information includes byte position, bit index, and the number of bits occupied.

[0036] Further preferably, as Figure 5 shown, encoding the logical variables into protocol messages according to the encoding and decoding rules, the method is: Traverse the logical variables to be sent; analyze based on the encoding and decoding rules to obtain the position and size information of each logical variable in the target protocol message; assign values to the values in the target protocol message based on the position and size information; The position and size information includes byte position, bit index, and the number of bits occupied.

[0037] In this embodiment, as an option, analyzing based on the encoding and decoding rules, the method is: Integrate the device communication information according to the device encoding and decoding rules, and configure the communication of the simulation device; the device communication information includes communication protocol details and communication ports; According to the channel encoding and decoding rules, respectively extract the packet header, packet tail, and instruction word in the message information and separate them to obtain the message data of the current channel; Locate the logical variables according to the variable encoding and decoding rules, and based on the position and encoding information of the logical variables in the message data in the variable encoding and decoding rules, obtain the position and size information of the message data or logical variables of the current channel.

[0038] Through the configuration file, the corresponding relationships between the network connection layer, the message parsing layer, and the variable encoding and decoding layer can be obtained, thereby realizing the mapping between the simulation logic and the device. When it is necessary to modify the protocol or the simulation logic, there is no need to change the code. Only the rule library and the configuration file need to be modified to complete. This decoupled design greatly improves the maintainability and flexibility of the system. The relationships between the layers are as Figure 1 shown.

[0039] Specifically, the encoding and decoding rules are modified according to the connection information, and the method is as follows: If the communication protocol of the simulation device changes, modify the corresponding device encoding and decoding rules and the channel encoding and decoding rules, load the modified encoding and decoding rules and store them in the configuration file; If the communication protocol of the simulation device is upgraded and the position and length of the device state change, modify the variable encoding and decoding rules of the corresponding device state, load the modified encoding and decoding rules and store them in the configuration file; If the communication protocol of the simulation device is added, create encoding and decoding rules according to the rules of the new protocol, load the newly added encoding and decoding rules and store them in the configuration file.

[0040] Through the three-layer architecture of this application, the configuration of the network connection can be flexibly modified through the configuration file without modifying the code. For example, when it is necessary to replace the device or modify the connection information of the device, only the configuration file needs to be modified.

[0041] In this embodiment, as Figure 3 shown, when the system is initialized or the device communication configuration changes, the device communication can be accurately configured based on this, ensuring the smooth establishment and normal operation of the communication link between the device and the simulation program. When the system needs to process the message data of a certain channel, the data of the corresponding message of the channel can be accurately extracted according to the channel encoding and decoding, realizing the preprocessing and parsing of the channel data. For a protocol message containing multiple variables, through the information stored in the variable encoding and decoding rules, the system can accurately encode the logical variables into protocol messages or decode the protocol messages into logical variables. Different channels will have their own corresponding variable encoding and decoding rules and channel encoding and decoding. The system encodes and decodes the messages based on these rules, thereby realizing the accurate processing of the data of different channels.

[0042] Further preferably, a distributed server can be selectively adopted to synchronize the configuration files of multiple connected flight simulators, unify their configurations, realize a shared server, and synchronously change the configurations of multiple simulators, without manual configuration one by one, reducing the time consumption.

[0043] Further preferably, simulation devices using different protocols can be selectively connected to a simulator of one configuration. By defining the encoding and decoding rules of each device separately in a configuration file, synchronous simulation of heterogeneous devices can be achieved, enabling synchronous simulation of devices under different protocols and adapting to multi-device hybrid configurations.

[0044] Preferably, based on the link information of the simulation devices and the logical variable information obtained after interaction, when a configuration needs to be switched, the system will unload the current configuration rules and load the target configuration file, switching the corresponding configuration rules. Finally, new devices are activated to achieve seamless configuration switching. For example, when switching from one device configuration to another, the system will automatically complete the rule update and device activation without writing new code, so as to adapt to different simulator models, achieve rapid system adaptation, and enhance generality.

[0045] It should be noted that the dynamic encoding and decoding system of a flight simulator based on rule decoupling provided in the above embodiments is only illustrated by dividing the above functional modules. In actual applications, the above functions can be assigned to different functional modules according to needs, that is, the modules or steps in the embodiments of the present invention can be further decomposed or combined. For example, the modules in the above embodiments can be combined into one module, or further split into multiple sub-modules to complete all or part of the functions described above. The names of the modules and steps involved in the embodiments of the present invention are only for distinguishing each module or step, and are not regarded as an improper limitation of the present invention.

[0046] The dynamic encoding and decoding method of a flight simulator based on rule decoupling in the second embodiment of the present invention is based on the above dynamic encoding and decoding system of a flight simulator based on rule decoupling, as Figure 2 shown. The method includes the following steps: S1. Obtain the connection information of each simulation device through a standardized interface, modify the predefined encoding and decoding rules according to the connection information, and save the connection information and the modified encoding and decoding rules to a configuration file; the encoding and decoding rules include device encoding and decoding, channel encoding and decoding, and variable encoding and decoding rules included in the channel; S2. Based on the modified encoding and decoding rules, encode and decode the transceiver data and interact with logical variables: Decode the received message into a logical variable, or encode the logical variable to be sent to generate a target protocol message and send it to the simulation device; S3. Judge whether the configuration needs to be switched based on the interaction information. If so, unload the current configuration rules and load the target configuration file; otherwise, the configuration rules remain unchanged and the next interaction is performed.

[0047] In the above embodiments, although the various steps are described in the above sequential order, those skilled in the art can understand that, in order to achieve the effects of this embodiment, different steps do not have to be executed in such an order. They can be executed simultaneously (in parallel) or in a reversed order, and these simple changes are all within the protection scope of the present invention.

[0048] Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working processes and related descriptions of the methods described above can refer to the corresponding processes in the foregoing system embodiments, and will not be repeated here.

[0049] An electronic device according to a third embodiment of the present invention includes: At least one processor; and A memory communicatively connected to at least one of the processors; wherein, The memory stores instructions executable by the processor, and the instructions are used to be executed by the processor to implement the above-mentioned dynamic encoding and decoding method of a flight simulator based on rule decoupling.

[0050] A computer-readable storage medium according to a fourth embodiment of the present invention, the computer-readable storage medium stores computer instructions, and the computer instructions are used to be executed by a computer to implement the above-mentioned dynamic encoding and decoding method of a flight simulator based on rule decoupling.

[0051] Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working processes and related descriptions of the above-mentioned electronic device and computer-readable storage medium can refer to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0052] Those skilled in the art should be able to realize that the modules and method steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. The programs corresponding to the software modules and method steps can be placed in a random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the art. To clearly illustrate the interchangeability of electronic hardware and software, the components and steps of each example have been generally described according to their functions in the above description. Whether these functions are executed in the form of electronic hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0053] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The above-mentioned programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).

[0054] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0055] The terms "first", "second", etc. are used to distinguish similar objects and are not used to describe or represent a specific order or sequence.

[0056] The term "comprising" or any other similar term is intended to cover non-exclusive inclusion, such that a process, method, article, or device / equipment that comprises a series of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent in these processes, methods, articles, or devices / equipment.

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

Claims

1. A dynamic encoding and decoding system for flight simulators based on rule decoupling, which is used for information interaction between simulation devices and simulation systems with different configurations of flight simulators and different protocols under the same configuration. It is characterized in that The system includes: A network connection layer, configured to receive or send packets; also configured to obtain connection information of a simulation device and save it to a configuration file module; A variable encoding and decoding layer, configured to store multiple encoding and decoding rules, and modify corresponding encoding and decoding rules according to the change status of the communication protocol in the connection information; the encoding and decoding rules include device encoding and decoding rules, channel encoding and decoding rules, and variable encoding and decoding rules; The packet parsing layer includes a receiving channel and a sending channel. The receiving channel decodes the received packet into logical variables, and the sending channel encodes the logical variables to be sent into a target protocol packet and sends it; the packet parsing layer is configured to encode and decode packets based on predefined encoding and decoding rules, and map and interact with logical variables: Integrate the device communication information corresponding to each channel based on the device encoding and decoding rules; extract the packet information corresponding to each channel based on the channel encoding and decoding rules; locate the logical variables corresponding to each channel based on the variable encoding and decoding rules; A configuration file module, used to configure parameters for the network connection layer, packet parsing layer, and variable encoding and decoding layer respectively, and perform global parameter configuration.

2. The dynamic encoding and decoding system of a flight simulator based on rule decoupling according to claim 1, characterized in that, The connection information includes device information and corresponding configuration parameters; the device information includes a communication protocol and channel information.

3. The dynamic encoding and decoding system of a flight simulator based on rule decoupling according to claim 2, characterized in that, Define encoding and decoding rules, and the method is: Define device encoding and decoding rules, and the device encoding and decoding rules store device communication information, and the device communication information includes a communication protocol and a communication port; Define channel encoding and decoding rules. Different bytes of the channel encoding and decoding rules respectively store the packet header, packet tail, and instruction word in the packet information. The receiving channel and the sending channel have different channel encoding and decoding rules; Define variable encoding and decoding rules. The variable encoding and decoding rules store the position and encoding information of logical variables in packet data under the current communication protocol. The position and encoding information includes the byte index, bit index, bit length, and endian mode conversion flag of the logical variable in the protocol frame, as well as the correspondence between the logical variable and the protocol packet.

4. The dynamic encoding and decoding system for a flight simulator based on rule decoupling according to claim 3, characterized in that, Encode and decode packets based on predefined encoding and decoding rules, and interact with logical variables, and the method is: When receiving a packet sent by a simulation device, the receiving channel decodes the received packet into logical variables according to the encoding and decoding rules, extracts the logical variable value of the device state, and further obtains the device state; When it is necessary to send logical variables to a simulation device, the sending channel encodes the logical variables into a target protocol packet according to the encoding and decoding rules and sends it, and sends the target protocol packet to the simulation device through the network connection layer to complete device state control.

5. The dynamic encoding and decoding system of a flight simulator based on rule decoupling according to claim 4, characterized in that Decode a packet into logical variables according to the encoding and decoding rules, and the method is: After receiving a packet, traverse the logical variables included in the packet; analyze based on the encoding and decoding rules to obtain the position and size information of each logical variable in the original packet; obtain the value in the original packet based on the position and size information and assign it to the logical variable; The position and size information includes the byte position, bit index, and the number of occupied bits.

6. The dynamic encoding and decoding system of a flight simulator based on rule decoupling according to claim 4, characterized in that Encode logical variables into a protocol packet according to the encoding and decoding rules, and the method is: Traverse the logical variables to be sent; analyze based on the encoding and decoding rules to obtain the position and size information of each logical variable in the target protocol message; assign values to the values in the target protocol message based on the position and size information. The position and size information includes the byte position, bit index, and the number of bits occupied.

7. The rule-based decoupled flight simulator dynamic encoding and decoding system according to claim 5 or 6, characterized in that The method of analysis based on the encoding and decoding rules is as follows: Integrate the device communication information according to the device encoding and decoding rules, and configure the communication of the simulation device; the device communication information includes communication protocol details and communication ports. According to the channel encoding and decoding rules, extract the packet header, packet tail, and instruction word in the packet information and separate them to obtain the packet data of the current channel. Locate the logical variables according to the variable encoding and decoding rules, and based on the position and encoding information of the logical variables in the packet data in the variable encoding and decoding rules, obtain the position and size information of the packet data or logical variables of the current channel.

8. The dynamic encoding and decoding system for flight simulators based on rule decoupling according to claim 7, wherein The method of modifying the encoding and decoding rules according to the connection information is as follows: If the communication protocol of the simulation device changes, modify the corresponding device encoding and decoding rules and channel encoding and decoding rules, load the modified encoding and decoding rules and store them in the configuration file. If the communication protocol of the simulation device is upgraded and the position and length of the device state change, modify the variable encoding and decoding rules of the corresponding device state, load the modified encoding and decoding rules and store them in the configuration file. If the communication protocol of the simulation device is added, create encoding and decoding rules according to the rules of the new protocol, load the newly added encoding and decoding rules and store them in the configuration file.

9. The dynamic encoding and decoding system of a flight simulator based on rule decoupling according to claim 1, characterized in that, Based on the link information of the simulation device and the logical variable information obtained after interaction, switch the corresponding configuration rules to adapt to different simulator models.

10. A dynamic encoding and decoding method for a flight simulator based on rule decoupling, according to the dynamic encoding and decoding system for a flight simulator based on rule decoupling described in any one of claims 1-9, characterized in that The method includes the following steps: S1. Obtain the connection information of each simulation device, modify the predefined encoding and decoding rules according to the connection information, and save the connection information and the modified encoding and decoding rules to the configuration file. The encoding and decoding rules include device encoding and decoding, channel encoding and decoding, and variable encoding and decoding rules included in the channel. S2. Based on the modified encoding and decoding rules, encode and decode the transmitted and received data, and interact with the logical variables: Decode the received packet into logical variables, or encode the logical variables to be sent to generate a target protocol packet and send it to the simulation device. S3. Judge whether the configuration needs to be switched based on the interaction information. If so, unload the current configuration rules and load the target configuration file; if not, keep the current configuration.

Citation Information

Patent Citations

  • GOOSE message optimization method based on IEC61850 protocol

    CN106375293A

  • Declarative message decoding method for binary message

    CN115834736A

  • Intelligent gateway communication protocol conversion implementation method and system

    CN119449909A