Flight simulator soft and hard panel data source dynamic switching method and system based on shared memory

The shared memory-based dynamic data source switching method in flight simulators addresses unsynchronized data changes and high delays by enabling precise variable-level control and optimizing thread resources, improving efficiency and reducing maintenance costs.

CN120316170AActive Publication Date: 2025-07-15CHINA SOUTHERN TECHNOLOGY (GUANGDONG HENGQIN) CO LTD

Patent Information

Application Number
CN202510771488.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-07-15
Estimated Expiration
2045-06-11

AI Technical Summary

Technical Problem

The existing flight simulator data source switching technology has problems such as inability to realize independent control of a single signal variable, high response time delay, serious resource waste and long hardware adaptation cycle, resulting in risk of misoperation, high system delay and maintenance costs.

Method used

Using a shared memory-based method, by building database relationship binding tables and dynamic thread pools, precise data source switching at variable level is achieved, shared memory is used for data synchronization, and resource usage is optimized through dynamic thread pool scheduling.

Benefits of technology

It realizes accurate switching at variable level, reduces data switching delay, improves system response speed and maintenance efficiency, and reduces resource waste and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120316170A_ABST
    Figure CN120316170A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of data processing, and particularly relates to a flight simulator soft and hard panel data source dynamic switching method and system based on a shared memory. The invention aims to solve the problems of high delay, resource waste, data loss risk and high maintenance cost in the prior art. The method comprises the following steps: constructing a database relationship binding table; establishing a corresponding data structure; initializing a shared memory and updating a variable address; associating the data structure and defining a data source switch parameter; activating a source switching judgment thread and a working thread; the operation module enables the soft and hard panels to write data according to the on-off state; the resources are released during quit. According to the method, variable-level accurate switching is realized, and redundant switching is avoided through a database binding table and a state variable; the shared memory technology is adopted to improve data synchronization efficiency and system stability; dynamic thread management reduces switching delay and improves response performance; meanwhile, the fault diagnosis and maintenance efficiency of the simulator is improved, and the debugging time and cost are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] The existing flight simulator data source switching technology generally adopts the following solutions: Integrated switching architecture: realizing the switching of the entire panel data source through hardware jumpers or configuration files Polling detection mechanism: periodically traversing all variable states, with the response time usually in the millisecond level. Static thread allocation: a fixed number of worker threads handle the data source switching requests (1) Coarse-grained operation limitations It is impossible to achieve independent control of a single signal variable. When switching, it is necessary to synchronously modify the data sources of the entire panel, resulting in the risk of misoperation. For example, when only the sensor data of a certain instrument needs to be replaced, the existing system still needs to switch the input source of the entire joystick.

[0003] (2) Synchronization delay problem The polling method is used to detect state changes. When the number of variables exceeds 100,000, the system response time increases linearly. The measured data shows that the state update delay can reach more than 200 ms in the scenario of 500,000 variables.

[0004] (3) Resource waste phenomenon The fixed-thread architecture has a CPU idle rate of 30%-50% under light load, and thread blocking may occur during sudden switching requests, resulting in data loss.

[0005] (4) High maintenance cost Each time a new device is added, it is necessary to recompile the underlying driver. The hardware adaptation cycle is as long as 2-3 weeks, which cannot meet the requirements of rapid iteration.

[0006] Based on this, the present invention proposes a method and system for dynamically switching the data sources of the software and hardware panels of a flight simulator based on shared memory. Summary of the Invention

[0007] To solve the above problems in the prior art, that is, the coarse-grained overall switching architecture leads to the inability to achieve independent control of single variables, the polling detection mechanism causes high latency (up to 200 ms in the scenario of 500,000 variables), the fixed-thread architecture results in resource waste (CPU idle rate of 30%-50% under light load) and the risk of data loss during sudden requests, and the long hardware adaptation cycle (2-3 weeks) and high maintenance cost caused by the need to recompile the driver when adding new devices, the present invention provides a method and system for dynamically switching the data sources of the software and hardware panels of a flight simulator based on shared memory.

[0008] In the first aspect of the present invention, a method for dynamically switching the data sources of the software and hardware panels of a flight simulator based on shared memory is proposed. The method includes the following steps: A method for dynamically switching the data sources of the software and hardware panels of a flight simulator based on shared memory, the method comprising the following steps: Step S1, construct a database relationship binding table, including a simulator variable information table, a variable status parameter and simulation variable binding table, a software panel variable and simulation variable binding table, and a hardware device and simulation variable binding table; Step S2, establish corresponding data structures based on the database relationship binding table; Step S3, initialize the shared memory, create a shared memory area according to the information of each variable in the simulator, and update the address information of all variables in the memory; Step S4, associate the data structures in Step S2 through the simulation variable ID and variable name to generate an internal data structure; define a data source type switch parameter in the internal data structure, and set pointers in the software panel variable binding structure and the hardware device variable binding structure to point to the memory address of the data source type switch parameter; Step S5, create and activate a source switching judgment thread and a data source switching working thread; Step S6, run the data source switching module, so that the software panel processing module and the hardware signal processing module determine whether to write data into the shared memory according to the source switch state; Step S7, when exiting the data source switching module, stop all threads and release the memory resources.

[0009] Further, the simulator variable information table includes a variable ID, a variable name, a data type, a shared memory name to which it belongs, a memory address, and the system to which it belongs; The variable status parameter and simulation variable binding table associates the status variable ID with the simulation variable ID; The software panel variable and simulation variable binding table associates the software panel variable ID with the simulation variable ID; The hardware device and simulation variable binding table contains a device ID, a channel ID, and a simulation variable ID.

[0010] Further, the data structures in Step S2 include a variable information structure, a software panel variable binding structure, a hardware device variable binding structure, and a variable status parameter and simulation variable binding structure.

[0011] Further, the variable information structure stores the fields of the simulator variable information table; The software panel variable binding structure stores the binding relationship between the software panel variable ID and the simulation variable ID; The hardware device variable binding structure stores the binding relationship between the device ID, the channel ID, and the simulation variable ID; The variable status parameter is bound to the simulation variable structure to store the association relationship between the status variable ID and the simulation variable ID.

[0012] Furthermore, a shared memory area is created according to the information of each variable in the simulator, and the address information of all variables in the memory is updated. Specifically: The shared memory area is created according to the shared memory name in the simulator variable information table; The update of the shared memory address is based on the physically created shared memory address.

[0013] Furthermore, the data source type switch parameter is a Boolean flag bit used to identify the current signal source type.

[0014] Furthermore, the source switching judgment thread is used to monitor the change of the status variable of the data source type in the shared memory in real time and trigger a data source switching request; The source switching judgment thread monitors the status variable of the data source type in the shared memory at a fixed frequency and activates the working thread through an event when the status changes; The data source switching working thread processes the update of the source switch status of the specified simulation variable according to the dynamically calculated number of threads; The number of data source switching working threads is dynamically calculated according to the total number of variables and the number of variables processed by a single thread, and is used to update the source switch status of the simulation variable in parallel.

[0015] Furthermore, when the soft panel processing module or the hardware signal processing module writes data into the shared memory, if the current source switch type matches its own module, the data is updated to the simulation variable address in the shared memory; if the current source switch type does not match its own module, the update is skipped and the next cycle is entered.

[0016] Furthermore, after step S7, the method further includes at least one of the following: Mapping the soft panel address and the hardware device address to the same memory space through double-bound address mapping; and / or Adopting a dynamic thread pool scheduling algorithm to adjust the number of working threads according to the system load; and / or Implementing zero-copy data transmission through memory barrier synchronization technology.

[0017] On the other hand, the present invention proposes a dynamic switching system for the software and hardware panel data sources of a flight simulator based on shared memory, based on a dynamic switching method for the software and hardware panel data sources of a flight simulator based on shared memory. The system includes: A binding table construction module configured to construct a database relationship binding table, including a simulator variable information table, a variable status parameter and simulation variable binding table, a soft panel variable and simulation variable binding table, and a hardware device and simulation variable binding table; A data structure establishment module, configured to establish a corresponding data structure based on the database relationship binding table; An initialization module, configured to initialize the shared memory, create a shared memory area according to the information of each variable in the simulator, and update the address information of all variables in the memory; A data association and integration module, configured to associate the data structure in the data structure establishment module through the simulation variable ID and variable name to generate an internal data structure; define a data source type switch parameter in the internal data structure, and set pointers in the soft panel variable binding structure and the hardware device variable binding structure to point to the memory address of the data source type switch parameter; A thread initialization module, configured to create and activate a source switching judgment thread and a data source switching working thread; A shared memory data writing module, configured to run the data source switching module, so that the soft panel processing module and the hardware signal processing module determine whether to write data into the shared memory according to the source switch state; A resource release module, configured to stop all threads and release memory resources when exiting the data source switching module.

[0018] Advantages of the present invention: Variable-level precise switching: Through the database relationship binding table and the corresponding boolean type status variable, the data source switching accurate to the variable level is realized, avoiding unnecessary data source switching, and improving the accuracy and efficiency of data processing.

[0019] Efficient data synchronization: The shared memory method is adopted for data synchronization, reducing the overhead of data transmission, improving the speed and stability of data synchronization, and ensuring the real-time performance and reliability of the system.

[0020] Reducing switching delay: By dynamically creating a data source switching working thread, parallel processing is realized, effectively reducing the delay of data switching, and improving the response speed and performance of the system.

[0021] Improving maintenance efficiency: This method has important application value in the fault diagnosis, maintenance and equipment debugging of the real components / simulation components in the cockpit of the simulator, can improve the fault diagnosis and maintenance efficiency, and save debugging time and cost. Description of the drawings

[0022] By reading the detailed description of the non-restrictive embodiments with reference to the following drawings, other features, objects and advantages of the present application will become more obvious: Figure 1 is the overall flowchart of a method for dynamically switching the data sources of the software and hardware panels of a flight simulator based on shared memory according to the present invention; Figure 2It is a schematic diagram of whether data is written into the shared memory in a method for dynamically switching the data sources of the software and hardware panels of a flight simulator based on shared memory according to the present invention; Figure 3 It is a schematic diagram of the data switching process of a system for dynamically switching the data sources of the software and hardware panels of a flight simulator based on shared memory according to the present invention. Specific embodiments

[0023] The following further elaborates on the present application in conjunction with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention, rather than limiting the invention. Additionally, it should be noted that for ease of description, only parts related to the invention are shown in the drawings.

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

[0025] In the first embodiment of the present invention, a method for dynamically switching the data sources of the software and hardware panels of a flight simulator based on shared memory is provided. The method includes the following steps: Step S1, construct a database relationship binding table, including a simulator variable information table, a variable status parameter and simulation variable binding table, a soft panel variable and simulation variable binding table, and a hardware device and simulation variable binding table; Step S2, establish corresponding data structures based on the database relationship binding table; Step S3, initialize the shared memory, create a shared memory area according to the information of each variable in the simulator, and update the address information of all variables in the memory; Step S4, associate the data structures in Step S2 through the simulation variable ID and variable name to generate an internal data structure; define a data source type switch parameter in the internal data structure, and set pointers in the soft panel variable binding structure and the hardware device variable binding structure to point to the memory address of the data source type switch parameter; Step S5, create and activate a source switching judgment thread and a data source switching working thread; Step S6, run the data source switching module, so that the soft panel processing module and the hardware signal processing module judge whether to write data into the shared memory according to the source switch state; Step S7, when exiting the data source switching module, stop all threads and release the memory resources.

[0026] To more clearly illustrate a method for dynamically switching the data sources of the software and hardware panels of a flight simulator based on shared memory according to the present invention, the following combines Figure 1 Elaborate on each step in the embodiment of the present invention in detail. The detailed description of each step is as follows: Step S1, construct a database relationship binding table, including a simulator variable information table, a variable status parameter and simulation variable binding table, a soft panel variable and simulation variable binding table, and a hardware device and simulation variable binding table; In this embodiment, to achieve the precise binding of the virtual cockpit soft panel and the airborne hardware device signal variables to support the data source switching at the variable level, the following database relationship binding tables are constructed: Simulator variable information table: This table records the detailed information of various variables in the simulator system, including variable ID, variable name, variable data type, variable - affiliated shared memory name, the address of the variable in the shared memory, and the system to which the variable belongs. A set of global variables is set in the table to store all the parameter variables required for simulator simulation; at the same time, for the hardware signal quantities or virtual soft panel variables collected through the interface system, a set of Boolean - type status variables is set. The signals of the virtual soft panel are stored in a specific shared memory area, and the signal acquisition adopts the memory copy method.

[0027] Variable status parameter and simulation variable binding table: This table establishes the association relationship between the status variable ID and the simulation variable ID, providing a basis for determining the data source of the simulation variable according to the change of the status variable during data source switching.

[0028] Soft panel variable and simulation variable binding table: This table associates the soft panel variable ID with the simulation variable ID, clarifying the corresponding relationship between the soft panel signal and the simulation variable.

[0029] Hardware device and simulation variable binding table: It contains device ID, channel ID, and simulation variable ID, and is used to establish the binding relationship between the hardware device signal and the simulation variable. The binding of the hardware device and the simulation variable may involve multi - table association, and only the key attributes are listed here.

[0030] According to the configuration and requirements of the actual simulator device, complete the data binding work of the above - mentioned tables to ensure the accurate association between signal variables.

[0031] In practical applications, first, according to the functional requirements and hardware configuration of the simulator system, design and create a simulator variable information table, a variable status parameter and simulation variable binding table, a soft panel variable and simulation variable binding table, and a hardware device and simulation variable binding table. Then, according to the specific situation of the actual simulator device, accurately input the relevant information of each signal variable into the corresponding table to complete the data binding work. For example, bind the signal variables of the virtual cockpit soft panel with the corresponding simulation variables, bind the signal variables of the airborne hardware device with the corresponding simulation variables, and define the corresponding Boolean - type status variables for each signal variable.

[0032] Step S2: Establish corresponding data structures based on the database relationship binding table; The data structures in this embodiment include a variable information structure, a soft panel variable binding structure, a hardware device variable binding structure, and a variable status parameter and simulation variable binding structure.

[0033] The variable information structure stores the fields of the simulator variable information table; specifically, it is used to store various information in the simulator variable information table, such as variable ID, variable name, data type, etc., providing a basis for subsequent data processing and operations.

[0034] The soft panel variable binding structure stores the binding relationship between the soft panel variable ID and the simulation variable ID, facilitating quick positioning and access to relevant data.

[0035] The hardware device variable binding structure stores the binding relationship between the device ID, channel ID, and simulation variable ID, supporting the association operation between the hardware device signal and the simulation variable.

[0036] The variable status parameter and simulation variable binding structure stores the association relationship between the status variable ID and the simulation variable ID, providing data support for the logical judgment of data source switching.

[0037] When the system starts, these data structures are initialized, the data in the database is read into the corresponding data structures, and a shared memory is created according to the information of each variable in the simulator, initializing the address information of all variables in the memory.

[0038] Step S3: Initialize the shared memory, create a shared memory area according to the information of each variable in the simulator, and update the address information of all variables in the memory; Specifically: The shared memory area is created according to the shared memory name in the simulator variable information table; The update of the shared memory address is based on the actual physical address of the created shared memory.

[0039] In this embodiment, since the data source switching function module is a part of the interface system software and all functions are implemented based on the shared memory, during the system startup phase, it is necessary to initialize the shared memory of all variables. The specific operations are as follows: Create corresponding shared memory areas according to the information of each variable in the simulator.

[0040] Update the address information of all variables in the memory according to the actual created shared memory address to ensure accurate storage and access of data.

[0041] Step S4: Associate the data structure in Step S2 with simulation variables ID and variable names to generate an internal data structure; define a data source type switch parameter in the internal data structure, and set pointers in the soft panel variable binding structure and the hardware device variable binding structure to point to the memory address of the data source type switch parameter; Among them, the data source type switch parameter is a Boolean flag bit used to identify the current signal source type.

[0042] In this embodiment, the interface system calls the initialization function of the data source switching module, and passes in the variable information structure, the soft panel variable binding structure, the hardware device variable binding structure, and the simulation mechanism configuration information. The following operations are performed inside the function: According to the simulation mechanism configuration information, read the relationship information between the variable status parameters and the simulation variables, and initialize the variable status parameter and simulation variable binding structure.

[0043] Create an internal data structure, and integrate and associate the variable information structure, the soft panel variable binding structure, the hardware device variable binding structure, and the variable status parameter and simulation variable binding structure through key information such as the simulation variable ID and variable name in each table.

[0044] Define a data source type switch parameter for a variable in the internal data structure. This parameter is used to store the input source type (soft panel or hardware device) of the current variable, and serves as the core control parameter for data source switching.

[0045] Set pointer type parameters in the soft panel variable binding structure and the hardware device variable binding structure to point to the memory address of the data source type switch, so that the software and hardware signal processing modules in the interface system can obtain the current data source type switch value in real time through this memory address, laying a foundation for subsequent data source switching operations.

[0046] The interface system calls the initialization function of the data source switching module, passes in relevant parameters, and performs data association integration and thread initialization. During the data association integration process, associate each data structure through the simulation variable ID, variable name, etc., create an internal data structure, define the data source type switch parameter for the variable, and at the same time set pointers in the soft panel variable binding structure and the hardware device variable binding structure to point to the memory address of this switch. During the thread initialization process, create a source switching judgment thread and a data source switching working thread, which are responsible for monitoring the data source switching status and updating the source switch status respectively.

[0047] When all the initialization work is completed, the interface system calls the running function of the source switching module to activate the suspended threads. When the soft panel processing module and the hardware signal processing module write data, they judge whether to update the data to the shared memory according to the value of the source switching switch.

[0048] Step S5, create and activate a source switching judgment thread and a data source switching working thread; The source switching judgment thread is used to monitor the change of the status variable of the data source type in the shared memory in real time and trigger a data source switching request; The source switching judgment thread monitors the status variable of the data source type in the shared memory at a fixed frequency, and activates the working thread through an event when the status changes; The data source switching working thread processes the update of the source switch status of the specified simulation variable according to the dynamically calculated number of threads; The number of the data source switching working threads is dynamically calculated according to the total number of variables and the number of variables processed by a single thread, and is used to update the source switch status of the simulation variables in parallel.

[0049] Among them, there is only one source switching judgment thread, which monitors the status variable of the data source type in the instructor console in the shared memory in real time at a fixed frequency. When the user sets the data signal to be switched by checking the entire panel or specific signal variables through the instructor console, the instructor console software will update the status variable value of the data source type (indicating that the data source type is soft panel input or hardware device input), and set the status parameter variable of the simulation variable to be switched in the shared memory to true (True). When the source switching judgment thread detects a change in the status variable value of the data source type, it will notify the instructor console that the request has been received through the corresponding parameters. After receiving it, the instructor console will reset the status variable value of this data source type, while the thread will compare the status variable value of the data source type with the previous data source switching status. If there is a difference, it will activate the data source switching request, save and update the current data source status, and activate the working thread through an event.

[0050] The number of data source switching working threads is dynamically calculated and created according to the number of variables processed by each thread and the total number of variables. The working thread waits for the judgment thread to wake up in the form of an event and is responsible for updating the data source type switch status of the specified simulation variable. Specifically, according to the status of the Boolean type status variable corresponding to each signal variable and the data source type to be switched, the source switch of each variable in the variable binding table of the soft and hard panels is assigned a value. Since the memory address of the data source type switch has been associated with the corresponding variable in the soft and hard panel variable binding table, the relevant module can directly obtain the status update, thereby reducing the data switching delay and realizing parallel processing.

[0051] Step S6, run the data source switching module, so that the soft panel processing module and the hardware signal processing module determine whether to write data into the shared memory according to the source switch status; See Figure 2, after all initialization work is completed, the interface system calls the running function of the source switching module, activates the suspended threads, and starts the workflow of the data source switching module. At this time, when the soft panel processing module or the hardware signal processing module writes data to the shared memory, if the current source switch type matches its own module, the data is updated to the simulation variable address in the shared memory; if the current source switch type does not match its own module, the update is skipped and the next cycle is entered.

[0052] Step S7, when exiting the data source switching module, stop all threads and release memory resources.

[0053] The method further includes at least one of the following after step S7: Map the soft panel address and the hardware device address to the same memory space through double-bound address mapping; and / or Adopt a dynamic thread pool scheduling algorithm to adjust the number of working threads according to the system load; and / or Implement zero-copy data transmission through memory barrier synchronization technology.

[0054] Although the various steps are described in the above order in the above embodiments, 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, and 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.

[0055] See Figure 3 , the second embodiment of the present invention proposes a dynamic switching system for the software and hardware panel data sources of a flight simulator based on shared memory, based on a method for dynamically switching the software and hardware panel data sources of a flight simulator based on shared memory in the first embodiment. The system includes: A binding table construction module configured to construct a database relationship binding table, including a simulator variable information table, a variable status parameter and simulation variable binding table, a soft panel variable and simulation variable binding table, and a hardware device and simulation variable binding table; A data structure establishment module configured to establish a corresponding data structure based on the database relationship binding table; An initialization module configured to initialize the shared memory, create a shared memory area according to the information of each variable in the simulator, and update the address information of all variables in the memory; A data association and integration module configured to associate the data structures in the data structure establishment module through the simulation variable ID and variable name to generate an internal data structure; define a data source type switch parameter in the internal data structure, and set pointers in the soft panel variable binding structure and the hardware device variable binding structure to point to the memory address of the data source type switch parameter; A thread initialization module, configured to create and activate a source switching judgment thread and a data source switching working thread; A shared memory data writing module, configured to run a data source switching module, so that a soft panel processing module and a hardware signal processing module determine whether to write data into the shared memory according to the source switch state; A resource release module, configured to stop all threads and release memory resources when exiting the data source switching module.

[0056] Wherein, in this embodiment, a data structure establishment module and an initialization module together constitute a core sub-module, and are connected to a thread pool controller, and are used to read and operate data structures and manage threads.

[0057] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working process and related descriptions of the above-described system can refer to the corresponding process in the foregoing method embodiment, and will not be repeated here.

[0058] It should be noted that the above-described dynamic switching system for the software and hardware panel data sources of a flight simulator based on shared memory only uses the above-mentioned division of each functional module as an example. In actual applications, the above functions can be allocated 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 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.

[0059] 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 method for dynamically switching the software and hardware panel data sources of a flight simulator based on shared memory.

[0060] A computer-readable storage medium according to a fourth embodiment of the present invention, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to be executed by the computer to implement the above-mentioned method for dynamically switching the software and hardware panel data sources of a flight simulator based on shared memory.

[0061] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes and related descriptions of the above-described storage device and processing device can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.

[0062] 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), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium 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 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.

[0063] The terms "first", "second", etc. are used to distinguish similar objects, rather than to describe or represent a specific order or sequence.

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

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

Claims

1. A method for dynamically switching the data sources of the software and hardware panels of a flight simulator based on shared memory, characterized in that, The method includes the following steps: Step S1, construct a database relationship binding table, including a simulator variable information table, a variable status parameter and simulation variable binding table, a soft panel variable and simulation variable binding table, and a hardware device and simulation variable binding table; Step S2, establish a corresponding data structure based on the database relationship binding table; Step S3, initialize the shared memory, create a shared memory area according to the information of each variable in the simulator, and update the address information of all variables in the memory; Step S4, associate the data structure in Step S2 through the simulation variable ID and variable name to generate an internal data structure; define a data source type switch parameter in the internal data structure, and set pointers in the soft panel variable binding structure and the hardware device variable binding structure to point to the memory address of the data source type switch parameter; Step S5, create and activate a source switching judgment thread and a data source switching working thread; Step S6, run the data source switching module, so that the soft panel processing module and the hardware signal processing module determine whether to write data into the shared memory according to the source switch state; Step S7, when exiting the data source switching module, stop all threads and release the memory resources.

2. The dynamic switching method of the software and hardware panel data source of a flight simulator based on shared memory according to claim 1, wherein The simulator variable information table includes variable ID, variable name, data type, shared memory name to which it belongs, memory address, and the system to which it belongs; The variable status parameter and simulation variable binding table associates the status variable ID with the simulation variable ID; The soft panel variable and simulation variable binding table associates the soft panel variable ID with the simulation variable ID; The hardware device and simulation variable binding table contains device ID, channel ID, and simulation variable ID.

3. A method for dynamically switching the data sources of the software and hardware panels of a flight simulator based on shared memory according to claim 1, characterized in that The data structure in Step S2 includes a variable information structure, a soft panel variable binding structure, a hardware device variable binding structure, and a variable status parameter and simulation variable binding structure.

4. A dynamic switching method for the software and hardware panel data sources of a flight simulator based on shared memory according to claim 3, characterized in that, The variable information structure stores the fields of the simulator variable information table; The soft panel variable binding structure stores the binding relationship between the soft panel variable ID and the simulation variable ID; The hardware device variable binding structure stores the binding relationship between the device ID, channel ID, and simulation variable ID; The variable status parameter and simulation variable binding structure stores the association relationship between the status variable ID and the simulation variable ID.

5. A method for dynamically switching the data source of the software and hardware panels of a flight simulator based on shared memory according to claim 3, characterized in that Create a shared memory area according to the information of each variable in the simulator, and update the address information of all variables in the memory. Specifically: The shared memory area is created according to the shared memory name in the simulator variable information table; The update of the shared memory address is based on the actual physical address of the created shared memory.

6. A dynamic switching method for the data sources of the software and hardware panels of a flight simulator based on shared memory according to claim 1, characterized in that The data source type switch parameter is a boolean flag bit used to identify the current signal source type.

7. A dynamic switching method for the software and hardware panel data source of a flight simulator based on shared memory according to claim 1, characterized in that The source switching judgment thread is used to monitor the change of the status variable of the data source type in the shared memory in real time and trigger a data source switching request; The source switching judgment thread monitors the status variable of the data source type in the shared memory at a fixed frequency, and activates the working thread through an event when the status changes; The data source switching working thread processes the update of the source switch state of the specified simulation variable according to the dynamically calculated number of threads; The number of the data source switching worker threads is dynamically calculated according to the total number of variables and the number of variables processed by a single thread, and is used to update the source switch states of the simulation variables in parallel.

8. A method for dynamically switching the data source of the software and hardware panels of a flight simulator based on shared memory according to claim 1, characterized in that When the soft panel processing module or the hardware signal processing module writes data into the shared memory, if the current source switch type matches its own module, the data is updated to the simulation variable address in the shared memory; if the current source switch type does not match its own module, the update is skipped and the next cycle is entered.

9. A method for dynamically switching the data sources of the software and hardware panels of a flight simulator based on shared memory according to claim 1, characterized in that, After step S7, the method further includes at least one of the following: Mapping the soft panel address and the hardware device address to the same memory space through dual-bound address mapping; and / or Adopting a dynamic thread pool scheduling algorithm to adjust the number of worker threads according to the system load; and / or Implementing zero-copy data transmission through a memory barrier synchronization technique.

10. A dynamic switching system for the data sources of the hardware and software panels of a flight simulator based on shared memory, based on the method for dynamically switching the data sources of the hardware and software panels of a flight simulator based on shared memory according to any one of claims 1-9, characterized in that, The system includes: A binding table construction module configured to construct a database relationship binding table, including a simulator variable information table, a variable status parameter and simulation variable binding table, a soft panel variable and simulation variable binding table, and a hardware device and simulation variable binding table; A data structure establishment module configured to establish a corresponding data structure based on the database relationship binding table; An initialization module configured to initialize the shared memory, create a shared memory area according to the information of each variable in the simulator, and update the address information of all variables in the memory; A data association and integration module configured to associate the data structures in the data structure establishment module through the simulation variable ID and variable name to generate an internal data structure; define a data source type switch parameter in the internal data structure, and set pointers in the soft panel variable binding structure and the hardware device variable binding structure to point to the memory address of the data source type switch parameter; A thread initialization module configured to create and activate a source switching judgment thread and a data source switching worker thread; A shared memory data writing module configured to run a data source switching module, so that the soft panel processing module and the hardware signal processing module determine whether to write data into the shared memory according to the source switch state; A resource release module configured to stop all threads and release memory resources when exiting the data source switching module.

Citation Information

Patent Citations

  • Flight maintenance simulator distributed communication resource integration method

    CN115509146A

  • Data source dynamic switching method, device and equipment

    CN116401300A

Cited By

  • Real-time data driving method, system and equipment of flight simulation equipment

    CN120596327A

  • Real-time data driving method, system and device of flight simulation device

    CN120596327B