Flight simulator dynamic encoding and decoding system and method based on rule decoupling
Through the decoupling of the rules based flight simulation machine dynamic codec system, decoupling codec logic and simulation logic, and dynamic adaptation is achieved using configuration files, the problems of inefficient maintenance and long configuration switching cycles in the existing technology are solved, and the flexibility and compatibility of the system are improved.
Patent Information
- Application Number
- CN202510918529.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-07-04
AI Technical Summary
The codec technology of existing flight simulator systems is inefficient in maintenance, has a long configuration switching cycle and insufficient compatibility, making it difficult to cope with frequent demand changes and rapid switching of multiple scenarios.
A flight simulation machine dynamic codec system based on rule decoupling is adopted to decouple the codec logic from the simulation logic, and dynamic adaptation is achieved through configuration files, including the network connection layer, the variable codec layer and the message analysis layer, and data interaction is used using codec rules.
It realizes the zero-code switching configuration, quickly adapts to protocol changes and device switching, improves the flexibility and maintainability of the system, and reduces maintenance difficulty and risks.
Smart Images

Figure CN120416299B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of aircraft control simulation, and in particular relates to a flight simulator dynamic encoding and decoding system and method based on rule decoupling. Background Art
[0002] In flight simulator systems, the encoding and decoding process is the core link in enabling data interaction between hardware devices and simulation logic. Its performance directly impacts the realism of simulation training and system maintenance efficiency. Traditional flight simulator systems utilize customized code development to adapt to the device encoding and decoding requirements of different flight simulator configurations (e.g., different aircraft models and configurations). When adding or removing devices or changing configurations, manual coding is required to integrate the encoding and decoding functions of the new devices. This encoding and decoding approach, which relies on fixed-format parsing modules, solidifies the parsing logic for different communication protocols in the form of preset rules, limiting the system's flexibility and maintainability.
[0003] This tightly coupled architecture significantly increases system maintenance costs: when the communication protocol changes (such as adjusting the data frame format or upgrading the verification algorithm) 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 dependencies to avoid chain errors; when adjusting the data frame start character of a certain protocol, the encoding and decoding function and the flight attitude solution module that relies on this data must be modified at the same time, which extends the maintenance cycle and makes it difficult for the system to cope with frequent changes in requirements.
[0004] At the same time, in the multi-configuration adaptation scenario of flight simulators, existing technologies lack a universal codec adaptation framework. Simulators of different configurations may be equipped with different sensors, display devices, or input and output devices (such as the difference in joystick communication protocols between A320 and B737 models), and existing solutions require customized code development for the communication protocol of each device. When switching configurations or adding or removing devices, developers need to rewrite the parsing logic to adapt to the codec requirements of the new devices. This adaptation method that relies on code rewriting has a long reconstruction cycle and low development efficiency, which seriously restricts the rapid reconstruction capability of the simulator system and makes it difficult to meet the actual needs of rapid switching between multiple scenarios in aviation training.
[0005] Regarding protocol expansion, existing codec methods utilize fixed parsing logic, lacking support for new communication protocols or adjustments to existing ones. For emerging IoT protocols (such as MQTT and CoAP) or proprietary protocols for avionics, the system requires structural modifications to the codec module. Furthermore, when existing protocols add new data fields or change message formats, adaptation requires code modifications and recompilation. This inadequate system responsiveness to protocol changes severely limits the compatibility of flight simulator systems.
[0006] Therefore, how to achieve modular decoupling of encoding and decoding logic, configurable management of configuration adaptation, and dynamic support for protocol extension has become a technical challenge that needs to be urgently solved in the current flight simulation field. Summary of the Invention
[0007] In order to solve the above-mentioned problems in the prior art, namely, the problems of inefficient maintenance, long configuration switching cycle and insufficient compatibility of the existing flight simulator encoding and decoding technology, the first aspect of the present invention proposes a flight simulator dynamic encoding and decoding system based on rule decoupling, which is used for information exchange between various simulation devices and simulation systems in flight simulators of different configurations. The system includes:
[0008] The network connection layer is configured to receive or send messages; and is also configured to obtain connection information of the simulated device and save it to the configuration file module;
[0009] The variable codec layer is configured to store multiple codec rules and modify the corresponding codec rules according to the change status of the communication protocol in the connection information; the codec rules include device codec rules, channel codec rules ChCodeRule and variable codec rules VarCodeRule;
[0010] The message parsing layer includes a receiving channel and a sending channel. The receiving channel decodes the received message into a logical variable, and the sending channel encodes the logical variable to be sent into a target protocol message and sends it. The message parsing layer is configured to encode and decode the message based on predefined encoding and decoding rules, and map and interact with the logical variable:
[0011] 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;
[0012] The configuration file module is used to configure parameters of the network connection layer, message parsing layer and variable encoding and decoding layer respectively, and to configure global parameters.
[0013] In some preferred implementations, the connection information includes device information and corresponding configuration parameters; the device information includes communication protocol and channel information.
[0014] In some preferred implementations, the encoding and decoding rules are defined as follows:
[0015] Defining a device codec rule, wherein the device codec rule stores device communication information, wherein the device communication information includes a communication protocol and a communication port;
[0016] Defining channel encoding and decoding rules, wherein different bytes of the channel encoding and decoding rules correspond to storing the packet header, packet tail, and instruction word in the message information, and the receiving channel and the sending channel have different channel encoding and decoding rules;
[0017] Define variable encoding and decoding rules. 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 include the byte index, bit index, bit length and big-endian and small-endian mode conversion flag of the logical variables in the protocol frame, as well as the correspondence between the logical variables and the protocol messages.
[0018] In some preferred embodiments, the message is encoded and decoded based on predefined encoding and decoding rules, and interacts with logical variables, and the method is as follows:
[0019] 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 state, and then obtains the device state;
[0020] When a logical variable needs to be sent 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 the target protocol message to the simulation device via the network connection layer to complete the device state control.
[0021] In some preferred implementations, the message is decoded into a logical variable according to the encoding and decoding rules, and the method is as follows:
[0022] After receiving the message, traverse the logical variables contained 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;
[0023] The position size information includes byte position, bit index and number of occupied bits.
[0024] In some preferred implementations, the logical variables are encoded into protocol messages according to encoding and decoding rules, and the method is as follows:
[0025] Traversing the logical variables to be sent; analyzing based on the encoding and decoding rules to obtain the position and size information of each logical variable in the target protocol message; assigning a value in the target protocol message based on the position and size information;
[0026] The position size information includes byte position, bit index and number of occupied bits.
[0027] In some preferred embodiments, the analysis is performed based on the encoding and decoding rules, and the method is as follows:
[0028] Integrate device communication information according to device codec rules and configure the communication of the simulated device; the device communication information includes communication protocol details and communication ports;
[0029] According to the channel encoding and decoding rules, the packet header, packet tail and instruction word in the message information are extracted and separated to obtain the message data of the current channel;
[0030] The logical variable is located according to the variable encoding and decoding rules. Based on the position and encoding information of the logical variable in the message data in the variable encoding and decoding rules, the position and size information of the message data or logical variable of the current channel is obtained.
[0031] In some preferred implementations, the codec rule is modified according to the connection information by:
[0032] If the communication protocol of the simulated device changes, modify the corresponding device encoding and decoding rules and channel encoding and decoding rules, load the modified encoding and decoding rules and save them to the configuration file;
[0033] If the communication protocol of the simulation device is upgraded and the position and length of the device status are changed, modify the variable encoding and decoding rules corresponding to the device status, load the modified encoding and decoding rules and store them in the configuration file;
[0034] If the communication protocol of the simulated device is increased, codec rules are created according to the rules of the new protocol, and the newly added codec rules are loaded and stored in the configuration file.
[0035] In some preferred implementations, the corresponding configuration rules are switched based on the link information of the simulation device and the logic variable information obtained after the interaction to adapt to different simulator models.
[0036] A second aspect of the present invention provides a flight simulator dynamic encoding and decoding method based on rule decoupling, the method comprising the following steps:
[0037] S1. Obtain connection information of each simulated device, modify 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;
[0038] The coding and decoding rules include device coding and decoding, channel coding and decoding, and variable coding and decoding rules contained in the channel;
[0039] S2. Based on the modified encoding and decoding rules, encode and decode the received and sent data, and interact with the logical variables:
[0040] 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;
[0041] S3. Determine whether the configuration needs to be switched based on the interaction information. If so, unload the current configuration rules and load the target configuration configuration file; otherwise, keep the configuration rules unchanged and proceed to the next interaction.
[0042] Beneficial effects of the present invention:
[0043] This invention systematically solves the problems of inefficient maintenance, long configuration switching cycles, and insufficient compatibility of existing flight simulator encoding and decoding technologies through the decoupling design of encoding and decoding rules and simulation logic and the dynamic encoding and decoding mechanism. The specific beneficial effects are as follows:
[0044] 1. By decoupling code from configuration, the interaction between the simulation program and the device is divided into three layers. The layers are associated with configuration files, and the encoding and decoding rules are separated from the simulation logic. When the protocol or logic changes, the encoding and decoding rules can be modified without changing the code, reducing maintenance difficulty and risk.
[0045] 2. The encoding and decoding rules are stored in the configuration file. When the protocol is changed, adjusted or added, the device, channel and variable encoding and decoding rules can be modified to quickly adapt to the dynamic adaptation of encoding and decoding without stopping the compilation, realizing "configuration is development", meeting the diverse data processing needs, and quickly adapting to new devices or configuration switching.
[0046] 3. By decoupling code from configuration, a zero-code switching configuration for device access and switching is achieved: when switching configurations, the old rules are uninstalled, the new configuration file is loaded, and the new device is activated after verification, with zero code in the entire process, improving system flexibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Other features, objects and advantages of the present application will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0048] Figure 1 1 is an architectural diagram of a flight simulator dynamic encoding and decoding system based on rule decoupling according to an embodiment of the present invention;
[0049] Figure 2 is a flow chart of a dynamic encoding and decoding method for a flight simulator based on rule decoupling in an embodiment of the present invention;
[0050] Figure 3 This is a flowchart of reconfiguring the codec to adapt to protocol changes in an embodiment of the present invention;
[0051] Figure 4 This is a flowchart of receiving and decoding a message in an embodiment of the present invention;
[0052] Figure 5 This is a flowchart of encoding a logical variable to be sent and sending a message in an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are intended only to illustrate the relevant invention and are not intended to limit the invention. It should also be noted that, for ease of description, only portions relevant to the relevant invention are shown in the accompanying drawings.
[0054] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0055] Aiming at the technical problems of inefficient system maintenance, long configuration switching cycle and insufficient technological evolution capability caused by the strong coupling of encoding and decoding rules and simulation logic, code dependency of configuration adaptation and static design of protocol extension in existing flight simulator encoding and decoding technology, the first embodiment of the present invention proposes a flight simulator dynamic encoding and decoding system based on rule decoupling, which is used for information interaction between various simulation devices and simulation systems in flight simulators of different configurations. The interaction between simulation programs and devices is abstracted into a specific three-layer architecture, and data is encoded and decoded based on encoding and decoding rules. Associations and mappings are established between layers through configuration files, so as to achieve zero-code operation when adapting to different protocols and switching configurations. Figure 1 As shown, the details are as follows:
[0056] The flight simulator dynamic encoding and decoding system based on rule decoupling includes:
[0057] The network connection layer is configured to receive or send messages; it is also configured to obtain the connection information of the simulated device and save it to the configuration file module, including the device's IP, port, sending / receiving frequency, etc. The corresponding content is saved to the device encoding and decoding rules;
[0058] The variable encoding and decoding layer is 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 to map and interact with the message content and the logical variables, mainly including the offset, byte size, big and small endian information of the logical variables in the message content;
[0059] 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 the target protocol message and sends it. The message parsing layer is configured as a channel encoding and decoding rule to obtain the logical variables contained in the sent and received messages and the message header, packet trailer, packet length and other frame formats:
[0060] 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;
[0061] The configuration file module is used to configure parameters of the network connection layer, message parsing layer and variable encoding and decoding layer respectively, and to configure global parameters.
[0062] This application divides the interaction between simulation and device into three layers: network connection, message parsing, and variable encoding and decoding, and associates each layer with configuration files to reduce coupling and improve maintainability and scalability.
[0063] In this embodiment, the system is used for information exchange between various simulation devices and the simulation system in flight simulators of different configurations, and can be connected to multiple flight simulators at the same time, wherein:
[0064] a simulation system for simulating the six-degree-of-freedom motion characteristics of the target configuration to generate motion and state parameters of the flight simulator, and for simulating the functions of the onboard systems of the target configuration and outputting corresponding data of the simulated onboard systems;
[0065] Simulation equipment is equipment used to simulate a flight simulator of the target configuration.
[0066] Preferably, in other embodiments, a standardized interface is provided on the device on which the method of the present invention is carried, for providing a communication interface with the simulation system for the simulation device to be tested, obtaining information and exchanging data through the standardized interface, realizing zero-code operation during configuration switching, and improving system flexibility and configuration efficiency. Specifically, the specific process of variable encoding and decoding and message parsing and the specific process of network packet transmission and reception can be abstracted into a standardized interface, such as encoding and decoding rules are different digital variables, but the functions called by the parsing process are all the same. The process is encapsulated as a repeatedly callable function and abstracted into an interface to adapt to different encoding and decoding rules.
[0067] Preferably, the connection information includes device information and corresponding configuration parameters; the device information includes communication protocol and channel information.
[0068] In this embodiment, the network connection layer supports multiple network protocols, such as UDP and TCP. Furthermore, this layer can distinguish between different devices and save device connection information (including IP addresses, port numbers, protocol types, etc.) in a configuration file. During system initialization, the program reads the configuration file, loads the information from it, and establishes a connection with the device based on this information.
[0069] Further preferably, the encoding and decoding rules are defined as follows:
[0070] Defining a device codec rule, wherein the device codec rule stores device communication information, wherein the device communication information includes a communication protocol and a communication port;
[0071] Defining channel encoding and decoding rules, wherein different bytes of the channel encoding and decoding rules correspond to storing the packet header, packet tail, and instruction word in the message information, and the receiving channel and the sending channel have different channel encoding and decoding rules;
[0072] Define variable encoding and decoding rules. 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 include the byte index, bit index, bit length and big-endian and small-endian mode conversion flag of the logical variables in the protocol frame, as well as the correspondence between the logical variables and the protocol messages.
[0073] The encoding and decoding process is abstracted into codec rules (CodeRule), including variable codec rules (VarCodeRule), channel codec rules (ChCodeRule), and device codec rules. These define the data encoding and decoding methods, including the correspondence between variables and protocol messages, and the specific encoding and decoding algorithms. This abstraction separates the encoding and decoding process from the specific code implementation, providing a foundation for zero-code adaptation.
[0074] In this embodiment, the variable encoding and decoding rule is a large number of type long long, which can store 8 bytes of information. Using these 8 bytes of information, the position and encoding information of the logical variable in the message data can be stored respectively. Preferably, in this embodiment, some bytes of the 8 bytes are used to store encoding information such as the byte index, bit index, bit length, and big-endian and small-endian mode conversion flag of the logical variable in the protocol frame.
[0075] In this embodiment, the channel codec is a long long number, with different bytes corresponding to key information such as the packet header, packet trailer, and instruction word. The device codec integrates device communication information into a string, including key configuration information such as the device's communication protocol details and communication port.
[0076] In this embodiment, as a feasible solution, the encoding and decoding rules under a certain protocol are defined as follows:
[0077] The device codec integrates the device's communication protocol details (such as a custom protocol) and communication port information to accurately configure communication with the sensor. For the channel codec of the receiving channel, some bytes correspond to the device's packet header (0xAB), packet trailer (0xCD), and instruction word (0x01 represents a device status data instruction). Assuming the variable in the protocol frame has a byte index of 8, a bit index of 4, a bit length of 16, and little-endian mode, this key information is stored in the corresponding byte positions.
[0078] Preferably, the message is encoded and decoded based on predefined encoding and decoding rules, and interacts with logical variables, and the method is:
[0079] 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 state, and then obtains the device state;
[0080] When a logical variable needs to be sent 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 the target protocol message to the simulation device via the network connection layer to complete the device state control.
[0081] In the message parsing layer, the message data in the channel (receiving channel or sending channel) is separated into the packet header and data, and the corresponding program logic variables in the message data of the channel are obtained; for a specific message, according to the configured encoding and decoding rules, the logical variables can be accurately extracted, providing a basis for subsequent processing. An example is as follows:
[0082] Set the message received from the device to channel 1, configure the encoding and decoding rules, determine its message header characteristics (such as the specific hexadecimal 0xAB) and length information (fixed 40 bytes), so as to accurately separate the header and data and obtain the logical variable values related to the device.
[0083] More preferably, Figure 4 As shown, according to the encoding and decoding rules, the message is decoded into a logical variable, and the method is as follows:
[0084] After receiving the message, traverse the logical variables contained 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;
[0085] The position size information includes byte position, bit index and number of occupied bits.
[0086] More preferably, Figure 5As shown, the logical variables are encoded into protocol messages according to the encoding and decoding rules. The method is:
[0087] Traversing the logical variables to be sent; analyzing based on the encoding and decoding rules to obtain the position and size information of each logical variable in the target protocol message; assigning a value in the target protocol message based on the position and size information;
[0088] The position size information includes byte position, bit index and number of occupied bits.
[0089] In this embodiment, as an option, analysis is performed based on the encoding and decoding rules, and the method is as follows:
[0090] Integrate device communication information according to device codec rules and configure the communication of the simulated device; the device communication information includes communication protocol details and communication ports;
[0091] According to the channel encoding and decoding rules, the packet header, packet tail and instruction word in the message information are extracted and separated to obtain the message data of the current channel;
[0092] The logical variable is located according to the variable encoding and decoding rules. Based on the position and encoding information of the logical variable in the message data in the variable encoding and decoding rules, the position and size information of the message data or logical variable of the current channel is obtained.
[0093] Through the configuration file, the corresponding relationship 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 the protocol or simulation logic needs to be modified, there is no need to change the code, only the rule base and configuration file need to be modified. This decoupled design greatly improves the maintainability and flexibility of the system. The relationship between each layer is as follows Figure 1 shown.
[0094] Specifically, the encoding and decoding rules are modified according to the connection information, and the method is as follows:
[0095] If the communication protocol of the simulated device changes, modify the corresponding device encoding and decoding rules and channel encoding and decoding rules, load the modified encoding and decoding rules and save them to the configuration file;
[0096] If the communication protocol of the simulation device is upgraded and the position and length of the device status are changed, modify the variable encoding and decoding rules corresponding to the device status, load the modified encoding and decoding rules and store them in the configuration file;
[0097] If the communication protocol of the simulated device is increased, codec rules are created according to the rules of the new protocol, and the newly added codec rules are loaded and stored in the configuration file.
[0098] The three-tier architecture of this application allows network connection configuration to be flexibly modified through configuration files without modifying the code. For example, when you need to replace a device or modify the device's connection information, you only need to modify the configuration file.
[0099] In this embodiment, if Figure 3 As shown, when the system is initialized or the device communication configuration is changed, the device communication can be accurately configured based on this to ensure 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 message corresponding to the channel can be accurately extracted based on the channel encoding and decoding, thereby realizing the preprocessing and parsing of the channel data. For a protocol message containing multiple variables, the system can accurately encode the logical variables into protocol messages, or decode the protocol messages into logical variables through the information stored in the variable encoding and decoding rules. 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 accurate processing of data from different channels.
[0100] Further preferably, a distributed server can be selectively used to synchronize configuration files of multiple connected flight simulators, unify their configurations, realize shared servers, and synchronously realize configuration changes of multiple simulators without the need for manual configuration one by one, thus reducing time consumption.
[0101] Further preferably, simulation devices using different protocols can be selectively connected to a simulator of one configuration, and the encoding and decoding rules of each device can be defined separately through configuration files to achieve synchronous simulation of heterogeneous devices. Synchronous simulation of devices under different protocols can be achieved, which is suitable for mixed configurations of multiple devices.
[0102] Optimally, based on the simulated device's link information and the logical variable information obtained after interaction, when a configuration switch is needed, the system uninstalls the current configuration rules, loads the target configuration file, and switches to the corresponding configuration rules. Finally, the new device is activated, achieving seamless configuration switching. For example, when switching from one device configuration to another, the system automatically updates the rules and activates the device, eliminating the need to write new code to accommodate different simulator models, enabling rapid system adaptation and enhancing versatility.
[0103] It should be noted that the above embodiment provides a rule-decoupled flight simulator dynamic encoding and decoding system, which is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, 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 divided 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 the modules or steps and are not considered to be improper limitations of the present invention.
[0104] The second embodiment of the present invention is a flight simulator dynamic encoding and decoding method based on rule decoupling, based on the above-mentioned flight simulator dynamic encoding and decoding system based on rule decoupling, such as Figure 2 As shown, the method includes the following steps:
[0105] S1. Obtain connection information of each simulation device through a standardized interface, modify predefined codec rules according to the connection information, and save the connection information and the modified codec rules to a configuration file; the codec rules include device codec, channel codec, and variable codec rules contained in the channel;
[0106] S2. Based on the modified encoding and decoding rules, encode and decode the received and sent data, and interact with the logical variables:
[0107] 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;
[0108] S3. Determine whether the configuration needs to be switched based on the interaction information. If so, unload the current configuration rules and load the target configuration configuration file; otherwise, keep the configuration rules unchanged and proceed to the next interaction.
[0109] Although the various steps in the above embodiment are described in the above-mentioned order, those skilled in the art will understand that in order to achieve the effect 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 reverse order. These simple changes are within the scope of protection of the present invention.
[0110] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working process and related instructions of the above-described method can refer to the corresponding process in the aforementioned system embodiment and will not be repeated here.
[0111] An electronic device according to a third embodiment of the present invention includes:
[0112] at least one processor; and
[0113] a memory communicatively connected to at least one of the processors; wherein,
[0114] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the above-mentioned rule-decoupling-based flight simulator dynamic encoding and decoding method.
[0115] A fourth embodiment of the present invention provides a computer-readable storage medium, wherein 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 rule-decoupling-based dynamic encoding and decoding method for a flight simulator.
[0116] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes and related instructions of the electronic device and computer-readable storage medium described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0117] Those skilled in the art should be able to appreciate that the modules and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two, and the programs corresponding to the software modules and method steps can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art. In order to clearly illustrate the interchangeability of electronic hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in electronic hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0118] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, 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 cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0119] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0120] The terms "first", "second", etc. are used to distinguish similar objects, rather than to describe or indicate a particular order or sequence.
[0121] The term "comprise" or any other similar term is intended to cover non-exclusive inclusion such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed or inherent to such process, method, article, or apparatus.
[0122] Thus far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will fall within the scope of protection of the present invention.
Claims
1. A flight simulator dynamic encoding and decoding system based on rule decoupling, used for information exchange between simulation devices and simulation systems of different configurations and different protocols in the same configuration of flight simulators, characterized by: The system comprises: The network connection layer is configured to receive or send messages; and is also configured to obtain connection information of the simulated device and save it to the configuration file module; A variable codec layer is configured to store multiple codec rules and modify corresponding codec rules according to the change status of the communication protocol in the connection information; the codec rules include device codec rules, channel codec rules and variable codec rules; The message parsing layer includes a receiving channel and a sending channel. The receiving channel decodes the received message into a logical variable, and the sending channel encodes the logical variable to be sent into a target protocol message and sends it. The message parsing layer is configured to encode and decode the message based on predefined encoding and decoding rules, and map and interact with the logical variable: 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 is used to configure parameters of the network connection layer, message parsing layer and variable encoding and decoding layer respectively, and to configure global parameters; Define encoding and decoding rules as follows: Defining a device codec rule, wherein the device codec rule stores device communication information, wherein the device communication information includes a communication protocol and a communication port; Defining channel encoding and decoding rules, wherein different bytes of the channel encoding and decoding rules correspond to storing the packet header, packet tail, and instruction word in the message information, and 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 the logical variable in the message data under the current communication protocol. The position and encoding information include the byte index, bit index, bit length and big-endian mode conversion flag of the logical variable in the protocol frame, as well as the correspondence between the logical variable and the protocol message; Encode and decode the message based on predefined encoding and decoding rules, and interact with logical variables. 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 state, and then obtains the device state; When a logical variable needs to be sent 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 the target protocol message to the simulation device via the network connection layer to complete the device state control; The message is decoded into a logical variable according to the encoding and decoding rules, and the method is as follows: After receiving the message, traverse the logical variables contained 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 size information includes byte position, bit index and number of occupied bits.
2. The flight simulator dynamic encoding and decoding system 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 communication protocol and channel information.
3. The flight simulator dynamic encoding and decoding system based on rule decoupling according to claim 2, characterized in that: The logical variables are encoded into protocol messages according to the encoding and decoding rules. The method is as follows: Traversing the logical variables to be sent; analyzing based on the encoding and decoding rules to obtain the position and size information of each logical variable in the target protocol message; assigning a value in the target protocol message based on the position and size information; The position size information includes byte position, bit index and number of occupied bits.
4. The rule-decoupling-based flight simulator dynamic encoding and decoding system according to claim 3, characterized in that: The analysis is performed based on the encoding and decoding rules as follows: Integrate device communication information according to device codec rules and configure the communication of the simulated device; the device communication information includes communication protocol details and communication ports; According to the channel encoding and decoding rules, the packet header, packet tail and instruction word in the message information are extracted and separated to obtain the message data of the current channel; The logical variable is located according to the variable encoding and decoding rules. Based on the position and encoding information of the logical variable in the message data in the variable encoding and decoding rules, the position and size information of the message data or logical variable of the current channel is obtained.
5. The flight simulator dynamic encoding and decoding system based on rule decoupling according to claim 4, characterized in that: Modify the encoding and decoding rules according to the connection information, and the method is as follows: If the communication protocol of the simulated device changes, modify the corresponding device encoding and decoding rules and channel encoding and decoding rules, load the modified encoding and decoding rules and save them to the configuration file; If the communication protocol of the simulation device is upgraded and the position and length of the device status are changed, modify the variable encoding and decoding rules corresponding to the device status, load the modified encoding and decoding rules and store them in the configuration file; If the communication protocol of the simulated device is increased, codec rules are created according to the rules of the new protocol, and the newly added codec rules are loaded and stored in the configuration file.
6. The flight simulator dynamic encoding and decoding system 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, the corresponding configuration rules are switched to adapt to different simulator models.
7. A flight simulator dynamic encoding and decoding method based on rule decoupling, applied to the flight simulator dynamic encoding and decoding system based on rule decoupling according to any one of claims 1 to 6, characterized in that: The method comprises the following steps: S1. Obtain connection information of each simulated device, modify 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 coding and decoding rules include device coding and decoding, channel coding and decoding, and variable coding and decoding rules contained in the channel; S2. Based on the modified encoding and decoding rules, encode and decode the received and sent data, and interact with the 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. Determine whether the configuration needs to be switched based on the interactive information. If so, unload the current configuration rules and load the target configuration configuration file; if not, maintain the current configuration.
Citation Information
Patent Citations
GOOSE message optimization method based on IEC61850 protocol
CN106375293A
Declarative message decoding method for binary message
CN115834736A