Airborne suspension object management control device and method based on multiple tasks
By designing an airborne suspended object management and control device based on multi-tasking, and utilizing multi-task scheduling and task management of a real-time operating system, the delay problem that the traditional single-task architecture cannot meet the needs of complex systems is solved, and low-latency, high-real-time is achieved. communication effect.
Patent Information
- Application Number
- CN202411534460.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-01-24
AI Technical Summary
Traditional suspension management and control equipment adopts a single task architecture, which cannot meet the problems of system functions and operating environment complexity and the poor real-time performance caused by the diversification of bus and control equipment.
Design a multi -task -based airborne suspension management control device, including timer, chief executive module, cyclical task module, and send task module. Through multi -tasking scheduling and real -time operating system task management, low delays, high and real -time time Communication.
Through multi-task scheduling and priority-based preemptive scheduling strategies, low-latency, high-real-time airborne suspended object control and management requirements are achieved, and the delay problem of traditional single-task architecture being unable to meet complex system requirements is solved.
Smart Images

Figure CN119356821A_ABST
Abstract
Description
Technical Field
[0001] The disclosed embodiments relate to the field of data processing technology, and more particularly to a multi-tasking-based airborne suspended object management and control device and method. Background Art
[0002] The suspension management and control equipment is mainly used to receive and complete aircraft control commands and data, control and manage various suspensions, and convert them into drive signals for various suspensions such as suspension point interfaces and weapon launchers.
[0003] In the traditional software design of hanging object management and control equipment, it is usually single-task, and its mechanism is simple, intuitive and easy to write. This program is controlled by a main loop, and each function is called through different flag polling, so that the modules that meet the conditions run in sequence. When the system needs to respond to the outside, it jumps out of the loop and handles specific tasks by setting watchdogs and using interrupts. For simple application requirements, this method can still meet them. With the complexity of system functions and operating environments, the diversification of buses and controlled devices, and the need to communicate in real time with other external devices working in parallel, there are a large number of task scenarios that need to be processed in a timely manner. If traditional design methods are still used, poor real-time performance may occur.
[0004] Therefore, it is necessary to improve one or more problems existing in the above-mentioned related technical solutions.
[0005] It should be noted that this section is intended to provide background or context for the technical solutions of the present disclosure stated in the claims. The description herein is not admitted to be prior art by virtue of being included in this section. Summary of the invention
[0006] In order to avoid the shortcomings of the prior art, the present invention provides an airborne suspended object management and control device and method based on multi-task, so as to solve the problem of poor real-time performance when a large number of task scenarios need to be processed in a timely manner in the prior art.
[0007] According to a first aspect of an embodiment of the present disclosure, there is provided an onboard suspended object management and control device based on multi-task, the device comprising: Timer, main task module, several periodic task modules and several sending task modules; The timer is used to release the semaphore according to a preset frequency to activate the periodic message; The periodic task module is used to respond to the periodic message, poll and receive data sent by various buses, and store the data into the corresponding receiving ring buffer according to the data type of the data; The main task module is used to package the data in the receiving ring buffer and store the packaged data into the corresponding sending ring buffer; The sending task module is used to receive the data after packaging processing in the corresponding sending ring buffer, and send the data after packaging processing.
[0008] Furthermore, the device also includes: Several receiving schedulers and several sending schedulers; The receiving scheduler is used to obtain the data in the receiving ring buffer and send the data to the main task module; The sending scheduler is used to obtain the data after packaging processing in the sending ring buffer, and send the data after packaging processing to the sending task module.
[0009] Furthermore, the priority of the main task module in receiving the data and sending the data after packaging is greater than the priority of packaging the data.
[0010] Furthermore, the frequency of the timer setting is 5ms~20ms.
[0011] Furthermore, the data type of the data includes at least FC / DDS, 1553 and Can.
[0012] According to a second aspect of an embodiment of the present disclosure, a multi-task-based airborne suspended object management and control method is provided, the method comprising: Release the semaphore according to the preset frequency to activate the periodic message; In response to the periodic message, poll and receive data sent by various buses, and store the data into a corresponding receiving ring buffer according to the data type of the data; Packaging the data in the receiving ring buffer and storing the packaged data in the corresponding sending ring buffer; Receive the data after packaging processing in the corresponding sending ring buffer, and send the data after packaging processing.
[0013] Furthermore, it also includes: The receiving scheduler obtains the data in the receiving ring buffer and sends the data to the main task module for packaging processing; The sending scheduler obtains the packaged data in the sending ring buffer, and sends the packaged data to the sending task module.
[0014] According to a third aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the multi-tasking-based airborne suspended object management and control device described in any one of the above embodiments is implemented.
[0015] According to a fourth aspect of an embodiment of the present disclosure, there is provided an electronic device, including: Processor; and A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the multi-tasking-based airborne suspended object management and control device described in any one of the above-mentioned embodiments by executing the executable instructions.
[0016] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects: In the embodiments of the present disclosure, through the above-mentioned multi-task-based airborne suspension management and control device and method, on the one hand, for buses with different working frequencies, through multi-task scheduling, message transmission of various buses is completed to achieve low-latency, high-real-time communication, and multi-task synchronization is used to ensure that task execution is controllable and system operation is reliable. On the other hand, it can solve the delay problem caused by the complexity of system functions and operating environment, and the diversification of buses and controlled devices that the traditional single-task architecture cannot meet. Using a real-time operating system (RTOS), with its own task management, through a priority-based preemptive scheduling strategy, different priorities are given to each task, and it is restricted to obtain CPU access rights within its own time slice, forming a micro-rotational effect and a macro-concurrent multi-task effect, so as to achieve low-latency, high-real-time airborne suspension control and management requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0018] Figure 1 A schematic diagram showing an onboard suspended object management control device based on multi-task in an exemplary embodiment of the present disclosure is shown; Figure 2 A step diagram showing a multi-task based airborne suspended object management control method in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0019] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0020] In addition, the accompanying drawings are only schematic illustrations of the embodiments of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated descriptions will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities.
[0021] In this exemplary embodiment, a multi-task based on-board suspended object management and control device is provided. Figure 1 As shown in , the multi-task-based airborne suspension management and control device may include: a timer, a main task module, a plurality of periodic task modules and a plurality of sending task modules; wherein, The timer is used to release the semaphore according to a preset frequency to activate the periodic message; The periodic task module is used to respond to the periodic message, poll and receive data sent by various buses, and store the data into the corresponding receiving ring buffer according to the data type of the data; The main task module is used to package the data in the receiving ring buffer and store the packaged data into the corresponding sending ring buffer; The sending task module is used to receive the data after packaging processing in the corresponding sending ring buffer, and send the data after packaging processing.
[0022] Through the above-mentioned multi-task-based airborne suspension management and control device, on the one hand, for buses with different working frequencies, through multi-task scheduling, the message transmission of various buses is completed to achieve low-latency, high-real-time communication, and through multi-task synchronization, the task execution is controlled and the system operation is reliable. On the other hand, it can solve the delay problem caused by the complexity of the system functions and operating environment, the diversification of buses and controlled devices that the traditional single-task architecture cannot meet. Using the real-time operating system (RTOS), with its own task management, through the priority-based preemptive scheduling strategy, different priorities are given to each task, and it is restricted to obtain CPU access rights within its own time slice, forming a micro-rotational effect and a macro-concurrent multi-task effect, so as to achieve low-latency, high-real-time airborne suspension control and management needs.
[0023] Next, we will refer to Figure 1 The various parts of the above-mentioned multi-task-based onboard suspended object management and control device in this example embodiment are described in more detail.
[0024] In one embodiment, the logical architecture of the present application is mainly composed of a main task (i.e., a main task module), multiple periodic tasks (i.e., periodic task modules) and multiple sending tasks (i.e., sending task modules). The main task does not set a period, completes the response and processing in real time, and completes the control of bus sending and receiving through the scheduler; the periodic task and the sending task have high priority and single responsibility; the periodic message is triggered by the release of the semaphore by the hardware timer ISR. After the periodic message is activated, the receiving driver of the bus is connected to different timer frequencies to poll and receive data. Various types of buses can adapt to different polling frequencies according to system requirements and interface control files; after receiving new data through the message queue (i.e., the sending ring buffer), the sending task switches itself from the blocked state to the ready state, seizes the CPU and completes the message sending, and then switches itself to the blocked state, waiting for the next new data to arrive in the message queue.
[0025] The overall architecture workflow is: periodic tasks poll and receive data, the main task organizes, and stores new data in a one-to-one corresponding ring buffer (i.e., receiving ring buffer) according to the port (the port can be configured according to the bus characteristics, such as the FC bus is distinguished by the message ID, and the 1553 bus is distinguished by the RT number and sub-address number), and the receiving scheduler distributes it to each processing module to complete the data processing, and the sending scheduler sends it to the message queue of each bus (i.e., sending ring buffer) at a fixed frequency of the message. When the message queue reaches new data, the sending task switches itself from the blocked state to the ready state, seizes the CPU and completes the message sending, and then switches itself to the blocked state, waiting for the next new data to arrive in the message queue.
[0026] In one embodiment, the task synchronization of the present application: Only by ensuring that the execution of tasks is controllable and predictable can the system be stable and reliable. In order to ensure synchronization between tasks, the software mainly consists of two groups of producer / consumer relationships to ensure the sequential and predictable software processing flow and avoid deadlock or priority inversion caused by out-of-order execution of multiple tasks. The two groups can be specifically divided into the receiving end and the sending end: Receiving end: The data producer is composed of timer interrupt and timer periodic tasks, and the main task is the data consumer; Sending end: The main task acts as the data producer, and various bus tasks constitute the data consumers.
[0027] Receiver: The periodic message is triggered by the hardware timer ISR releasing the semaphore. After the periodic message is activated, the bus receiving driver is hooked to different timer frequencies to poll and receive data. At this stage, various buses can adapt to different polling frequencies according to system requirements and interface control files. If the minimum refresh frequency of the 1553 bus is 20ms, the 1553 receiving interface is called in a 10ms periodic message to ensure the timeliness of message reception and avoid data loss caused by insufficient hardware FIFO space under high load. After the periodic task gets the new data, the main task organizes it and stores the new data in a one-to-one corresponding ring buffer according to the port (the port can be configured according to the bus characteristics, such as the FC bus is distinguished by the message ID, and the 1553 bus is distinguished by the RT number and sub-address number), and the receiving scheduler distributes it to each processing module to complete the data processing.
[0028] Sending side: The main task packages various data processing, and the sending scheduler sends it to the message queue of various buses at a fixed frequency. When the message queue receives new data, the sending task switches from the blocked state to the ready state, seizes the CPU and completes the message sending, and then switches itself to the blocked state, waiting for the next new data to arrive in the message queue.
[0029] In one embodiment, the task functions are divided into: High-priority tasks (including periodic tasks and sending tasks) need to be designed as short as possible to ensure that they can block themselves after completing the operation as soon as possible after preempting the main task, similar to interrupt operations. Low-priority tasks (main tasks) occupy the CPU for a long time to ensure timely response, and all data should be received and sent.
[0030] Therefore, high-priority tasks have a single responsibility and try to do only one thing. Especially when it comes to accessing driver devices, the access time varies due to the different performance of different peripheral devices. If high-priority tasks occupy the CPU for too long, the processing capacity of the main task will not be able to keep up, causing delays in the entire system.
[0031] Low-priority tasks (i.e., main tasks) do not set a cycle, complete response and processing in real time, and control the bus sending and receiving time intervals through the scheduler. It is meaningful for the main task without a cycle to set the sending and receiving time intervals. Unlimited message reception and message sending will cause a large load on the system and the external systems working in parallel with it, and have adverse effects. Therefore, it cannot be assumed that the processing capacity of the system itself and the external system itself is infinite.
[0032] In one embodiment, the communication architecture design of the present application is based on space-for-time, that is, trying to use more memory resources in exchange for CPU resources, and improving real-time performance by increasing the memory consumption of the software system. The specific design practice is to use a set of ring buffer groups to cache received external messages. The buffer has the following characteristics: 1) Each message port has a matching buffer. Messages are cached independently in different memory areas. The main task accesses the buffer through the unique identifier of the message to complete the processing of the message. 2) The buffer can be configured as queue mode or sampling mode. In queue mode, all kinds of messages are arranged in a first-in-first-out queue and are processed by the main task in turn. This is used for event messages to ensure that each frame of messages is processed. In sampling mode, all kinds of messages will be overwritten and refreshed by new messages, and the main task processes the latest message each time. This is used for processing periodic messages. The main task is scheduled by the receiving scheduler according to the mode type, and the software coupling is greatly reduced. 3) Due to hardware limitations, different buses often have smaller buffers inside their hardware. With this design, bus data can be taken out in time and transferred to the memory buffer, avoiding data loss due to untimely processing and full hardware buffer.
[0033] In a specific embodiment, the FC data processing flow of the software is described by taking the reception, data processing and transmission of FC bus data as an example: the reception, processing and transmission of FC bus data involve the bus reception task, FC bus data receiver, main task FC bus processing module, FC bus data transmitter and FC bus data transmission task; first, before the software starts working, the bus data reception task (the priority of this task is slightly higher than the main task) is set, the FC data processing module is initialized (including the creation and initialization of the FC data reception scheduler and the ring buffer), and the bus data transmission module is initialized (including the creation and initialization of the FC data transmission scheduler, the FC transmission ring buffer, and the FC data transmission task). The bus data reception task calls the FC bus reception function every 20ms by setting a hardware timer to query whether there is new data. After querying that there is new data, the FC bus data reception scheduler stores the data in the corresponding FC bus data ring buffer with the message ID as the index. The main task of the software retrieves the data in the FC ring buffer in the FC bus data processing module and completes the corresponding data processing to generate the FC bus data to be sent. The data to be sent is stored in the ring buffer of the FC transmission data with the message ID as the index through the FC data transmission scheduler. The FC data sending scheduler determines whether the data to be sent is a periodic message. If it is a periodic message, it reads the data in the buffer regularly and passes the data to be sent to the FC bus data sending task in the form of a message queue. If it is an event sending message, it directly sends the message queue to the FC bus data sending task. After receiving the new data from the message queue, the FC data sending task completes the state switch from the blocked state to the ready state; calls the FC bus sending function to complete the actual sending of the FC bus data, and switches back to the blocked state after the data sending is completed to wait for the next message queue stimulation.
[0034] In one embodiment, the present application can communicate with different external buses in real time. The operating frequencies of different buses are not consistent. Using multitasking can flexibly set the operating frequency of the bus receiving task, so as to independently configure it according to different requirements and improve the real-time response capability.
[0035] This application has high operating efficiency and reasonable use of CPU resources. By allocating the priority of bus receiving and sending tasks, CPU resources are reasonably seized to ensure that key communications such as bus commands and the output of key discrete quantities are more reliable and can be executed more efficiently, ensuring that the performance of suspension management and control equipment meets user needs.
[0036] This application has event-responsive capabilities. By using inter-process communication between tasks, external events can be easily simulated, so that different responses can be made to complete the processing. Using this method can eliminate the use of various flags in software coding. Instead of polling various functional modules through flags in the main loop body to see whether they should be called, the task that bears the event / message of the response directly seizes the CPU and completes the processing in a timely and fast manner.
[0037] This application uses the producer / consumer model to solve the synchronization problem between tasks and determine the scheduling order of multiple tasks in the software.
[0038] This application has high real-time performance. Space is traded for time, and more memory resources are used to exchange for CPU resources. By increasing the memory consumption of the software system, real-time performance is improved.
[0039] The software of this application has high versatility and reuse capability. The design method of the task architecture makes each bus function independent of each other, which is more convenient for function expansion, more universal and easy to transplant when expanding new communication buses or in new hardware environments.
[0040] Furthermore, in this exemplary embodiment, a multi-task-based onboard suspended object management and control method is also provided. Figure 2 As shown in , the method may include: Step S101: releasing a signal according to a preset frequency to activate a periodic message; Step S102: responding to the periodic message, polling and receiving data sent by various buses, and storing the data into a corresponding receiving ring buffer according to the data type of the data; Step S103: Packaging the data in the receiving ring buffer, and storing the packed data into the corresponding sending ring buffer; Step S104: receiving the data after packaging in the corresponding sending ring buffer, and sending the data after packaging.
[0041] In a specific embodiment, one type of data corresponds to a receiving ring buffer, a sending ring buffer, a receiving scheduler, and a sending ring buffer. Taking FC data as an example, before the software starts working, the bus data receiving task (the priority of this task is slightly higher than the main task) is set, the FC data processing module (i.e., the main task module) is initialized (including the creation and initialization of the FC data receiving scheduler and the ring buffer), and the bus data sending module (i.e., the sending task module) is initialized (including the creation and initialization of the FC data sending scheduler, the FC sending ring buffer, and the FC data sending task).
[0042] The bus data receiving task sets the hardware timer to call the FC bus receiving function every 20ms to query (i.e., periodic message) whether there is new data. After querying for new data, the FC bus data receiving scheduler stores the data into the corresponding FC bus data receiving ring buffer with the message ID as the index. The main software task retrieves the data in the FC bus data receiving ring buffer in the FC bus data processing module and completes the corresponding data processing to generate the FC bus data to be sent. The FC data sending scheduler stores the data to be sent into the FC sending data ring buffer (i.e., the FC bus data sending ring buffer) with the message ID as the index. The FC data sending scheduler determines whether the data to be sent is a periodic message. If it is a periodic message, it reads the data in the buffer regularly and passes the data to be sent to the FC bus data sending task in the form of a message queue. If it is an event sending message, it directly sends the message queue to the FC bus data sending task. After receiving the new data in the message queue, the FC data sending task completes the state switching from the blocked state to the ready state; calls the FC bus sending function to complete the actual sending of the FC bus data, and switches back to the blocked state after the data sending is completed to wait for the next message queue stimulation.
[0043] Through the above-mentioned multi-task-based airborne suspension management and control device and method, on the one hand, for buses with different working frequencies, through multi-task scheduling, the message transmission of various buses is completed to achieve low-latency, high-real-time communication, and through multi-task synchronization, the task execution is controlled and the system operation is reliable. On the other hand, it can solve the delay problem caused by the complexity of the system function and operating environment, the bus and the diversification of the controlled equipment that the traditional single-task architecture cannot meet. Using the real-time operating system (RTOS), with its own task management, through the priority-based preemptive scheduling strategy, different priorities are given to each task, and it is restricted to obtain CPU access rights within its own time slice, forming a micro-rotation and macro-concurrent multi-task effect, to achieve low-latency, high-real-time airborne suspension control and management needs.
[0044] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a computer program is stored, and when the program is included in a processor and executed, the steps of the multi-task-based on-board suspended object management and control method described in any of the above embodiments can be implemented. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary embodiments of the present invention described in the multi-task-based on-board suspended object management and control method section of this specification.
[0045] In an exemplary embodiment of the present disclosure, an electronic device is also provided, which may include a processor and a memory for storing executable instructions of the processor, wherein the processor is configured to execute the steps of the multi-task-based onboard suspended object management and control method described in any one of the above embodiments by executing the executable instructions.
[0046] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification.
[0047] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A multi-task based airborne suspended object management and control device, characterized in that: The device includes: Timer, main task module, several periodic task modules and several sending task modules; The timer is used to release the semaphore according to a preset frequency to activate the periodic message; The periodic task module is used to respond to the periodic message, poll and receive data sent by various buses, and store the data into the corresponding receiving ring buffer according to the data type of the data; The main task module is used to package the data in the receiving ring buffer and store the packaged data into the corresponding sending ring buffer; The sending task module is used to receive the data after packaging processing in the corresponding sending ring buffer, and send the data after packaging processing.
2. The multi-task based on-board suspended object management and control device according to claim 1 is characterized in that: The device also includes: Several receiving schedulers and several sending schedulers; The receiving scheduler is used to obtain the data in the receiving ring buffer and send the data to the main task module; The sending scheduler is used to obtain the data after packaging processing in the sending ring buffer, and send the data after packaging processing to the sending task module.
3. The multi-task based on-board suspended object management and control device according to claim 1 is characterized in that: The priority of the main task module in receiving the data and sending the data after packaging is greater than the priority of the data after packaging.
4. The multi-task based on-board suspended object management and control device according to claim 1, characterized in that: The frequency of the timer setting is 5ms~20ms.
5. The multi-task based on-board suspended object management and control device according to claim 1, characterized in that: The data types of the data include at least FC / DDS, 1553 and Can.
6. A multi-task based airborne suspended object management and control method, characterized in that: The method includes: Release the semaphore according to the preset frequency to activate the periodic message; In response to the periodic message, poll and receive data sent by various buses, and store the data into a corresponding receiving ring buffer according to the data type of the data; Packaging the data in the receiving ring buffer and storing the packaged data in the corresponding sending ring buffer; Receive the data after packaging processing in the corresponding sending ring buffer, and send the data after packaging processing.
7. The multi-task based on-board suspended object management and control method according to claim 6 is characterized in that: Also includes: The receiving scheduler obtains the data in the receiving ring buffer and sends the data to the main task module for packaging processing; The sending scheduler obtains the packaged data in the sending ring buffer, and sends the packaged data to the sending task module.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the multi-tasking-based airborne suspended object management and control device described in any one of claims 1 to 5 is implemented.
9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the multi-tasking-based airborne suspended object management and control device according to any one of claims 1 to 5 by executing the executable instructions.