A bus signal conversion method

By setting high-priority receiving tasks and low-priority scheduling tasks in the processor operating system, and using message queues to implement 1553B bus signal conversion, the problems of resource waste and cumbersome conversion in the prior art are solved, and efficient signal conversion and transmission are achieved.

CN117093344BActive Publication Date: 2026-06-12TIANJIN JINHANG COMP TECH RES INST

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TIANJIN JINHANG COMP TECH RES INST
Filing Date
2023-08-23
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

In existing technologies, the 1553B bus signal conversion in the aerospace field requires two separate processors or board-level operations, resulting in resource waste and increased complexity of the conversion process.

Method used

In the processor's operating system, a receiving task and a scheduling task are set, with the receiving task having a higher priority than the scheduling task. Data exchange is achieved using two message queues, and signal conversion between the upper-level and lower-level devices is completed through a single processor.

🎯Benefits of technology

It saves hardware and software resources, simplifies signal conversion steps, improves conversion efficiency, and achieves real-time conversion and transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117093344B_ABST
    Figure CN117093344B_ABST
Patent Text Reader

Abstract

The application provides a bus signal conversion method, comprising the following steps: opening a receiving task and a scheduling task in an operating system of a processor. The receiving task is triggered periodically, a first message queue is acquired and sent, the first message queue is used for storing data issued by a superior device and needing to be transmitted to an inferior device; the data in the first message queue is converted into a two-level bus signal and transmitted to the inferior device by the two-level bus without waiting for querying a second message queue; the second message queue is used for storing data scheduled from the inferior device and needing to be transmitted to the superior device; when it is found that the first message queue contains data, the scheduling task is triggered; the second message queue is sent, the data in the second message queue is converted into a one-level bus signal and transmitted to the superior device by the one-level bus, the scheme saves software and hardware resources, improves efficiency, and can achieve the effect of real-time conversion and transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of embedded software technology, such as aerospace, and specifically to a bus signal conversion method. Background Technology

[0002] The 1553B bus boasts high reliability and is widely used in the aerospace industry. In the 1553B bus, the bus controller (BC) manages bus scheduling, while remote terminals (RTs) passively perform functions such as sending and receiving data. In the aerospace field, because higher-level devices need to send data to lower-level devices, and lower-level devices also need to send data to higher-level devices, devices are required to perform bus signal conversion between the two.

[0003] In existing technologies, two processors or two boards are typically used to output signals from the upper-level device to the lower-level device and transmit signals from the lower-level device to the upper-level device. This requires writing two different control software programs for two processors or two boards, which not only wastes hardware and software resources but also increases the complexity of bus signal conversion. Summary of the Invention

[0004] In view of the above-mentioned defects or deficiencies in the prior art, this application aims to provide a bus signal conversion method, including the following steps:

[0005] In the processor's operating system, a receiving task and a scheduling task are created, and the receiving task is given a higher priority than the scheduling task.

[0006] The receiving task is periodically triggered to acquire and send a first message queue. The first message queue is used to store data sent by the upper-level device that needs to be transmitted to the lower-level device. The data in the first message queue has at least a message type. The message type includes at least the type that needs to be directly transmitted and the type that needs to be scheduled to the lower-level device.

[0007] The data in the first message queue is converted into a secondary bus signal and transmitted to the lower-level device via the secondary bus, without waiting to query the second message queue; the second message queue is used to store data scheduled from the lower-level device that needs to be transmitted to the upper-level device;

[0008] When data is found in the first message queue, the scheduling task is triggered;

[0009] Send the second message queue, convert the data in the second message queue into a first-level bus signal, and transmit it to the upper-level device via the first-level bus.

[0010] According to the technical solution provided in the embodiments of this application, the method further includes the following steps:

[0011] The system receives all data sent by the superior device and filters it according to message type to obtain several first data to be forwarded that need to be directly transmitted to the subordinate device. Each first data to be forwarded is stored in the first message queue.

[0012] According to the technical solution provided in the embodiments of this application, the method further includes the following steps:

[0013] All data from the lower-level device is scheduled, and several second data items to be forwarded to the upper-level device are selected. Each second data item to be forwarded is stored in the second message queue.

[0014] According to the technical solution provided in the embodiments of this application, storing each of the first data to be forwarded in the first message queue includes at least the following steps:

[0015] All the first data to be forwarded is divided into several key data and several ordinary data; the key data is the data that needs to be transmitted to the secondary bus within a specified time, and the ordinary data is the other first data to be forwarded besides the first key data.

[0016] The key data is stored in the head of the first message queue, and the ordinary data is stored according to the first-in-first-out principle.

[0017] According to the technical solution provided in the embodiments of this application, the first data to be forwarded in the first message queue is stored using a structure type, and the structure type includes at least a time identifier, a message type, a command word, and data content.

[0018] According to the technical solution provided in the embodiments of this application, all the first data to be forwarded is divided into several key data and several ordinary data, including at least the following steps:

[0019] The key data is determined based on the command words of each of the first data to be forwarded.

[0020] According to the technical solution provided in the embodiments of this application, periodically triggering the receiving task includes at least the following steps:

[0021] The receiving task is triggered at each first preset time interval.

[0022] According to the technical solution provided in the embodiments of this application, after querying that data is stored in the first message queue, the process includes at least the following steps:

[0023] Determine the current state of the receiving task. If the current state of the receiving task is suspended, trigger the scheduling task.

[0024] According to the technical solution provided in the embodiments of this application, the time identifier includes time data; converting messages in the first message queue into secondary bus signals and transmitting them to lower-level devices via the secondary bus includes at least the following steps:

[0025] Parse the message type of the data in the first message queue. If it is determined to be broadcast time data, obtain the time loss recorded in the time stamp register and compensate the time loss into the time data to obtain the corrected time data.

[0026] The corrected time data is broadcast to the lower-level device.

[0027] According to the technical solution provided in the embodiments of this application, obtaining the time loss recorded in the time stamp register and compensating the time loss into the broadcast time data to obtain corrected time data includes at least the following steps:

[0028] Adjust the priority of the receiving task to be lower than that of the scheduling task, and obtain the time loss recorded in the time stamp register;

[0029] The time loss is then compensated into the broadcast time data to obtain corrected time data. The priority is then adjusted back to the original state, where the receiving task has a higher priority than the scheduling task.

[0030] In summary, this application proposes a bus signal conversion method, comprising the following steps: establishing a receiving task and a scheduling task in the processor's operating system, and setting the receiving task to have a higher priority than the scheduling task; periodically triggering the receiving task to acquire and send a first message queue, the first message queue being used to store data sent from an upper-level device that needs to be transmitted to a lower-level device; converting the data in the first message queue into a secondary bus signal, which is then transmitted to the lower-level device via the secondary bus, without waiting to query the second message queue; the second message queue being used to store data scheduled from the lower-level device that needs to be transmitted to the upper-level device; when data is found in the first message queue, triggering the scheduling task; sending the second message queue, converting the data in the second message queue into a primary bus signal, which is then transmitted to the upper-level device via the primary bus.

[0031] Compared with the prior art, the advantages of this application are as follows: by opening two tasks in a single processor operating system, and these two tasks exchange data based on two message queues, it is not necessary to use two processors or two boards to separately output signals from the upper-level device to the lower-level device, and transmit signals from the lower-level device to the upper-level device. This saves hardware and software resources, simplifies the bus signal conversion steps, improves efficiency, and achieves real-time conversion and transmission. Attached Figure Description

[0032] Figure 1This is a flowchart illustrating the steps of a bus signal conversion method provided in an embodiment of this application. Detailed Implementation

[0033] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0034] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0035] As mentioned in the background section, this application proposes a bus signal conversion method to address the problems in the prior art. Please refer to [link / reference]. Figure 1 As shown, it includes the following steps:

[0036] S101. In the processor's operating system, a receiving task and a scheduling task are created, and the receiving task is set to have a higher priority than the scheduling task.

[0037] S102. Periodically trigger the receiving task to acquire and send a first message queue. The first message queue is used to store data sent by the upper-level device and that needs to be transmitted to the lower-level device. The data in the first message queue has at least a message type. The message type includes at least the type that needs to be directly transmitted and the type that needs to be scheduled to the lower-level device.

[0038] S103. Convert the data in the first message queue into a secondary bus signal and transmit it to the lower-level device via the secondary bus, without waiting to query the second message queue; the second message queue is used to store data scheduled from the lower-level device that needs to be transmitted to the upper-level device.

[0039] S104. When data is found in the first message queue, the scheduling task is triggered;

[0040] S105. Send the second message queue, convert the data in the second message queue into a first-level bus signal, and transmit it to the upper-level device via the first-level bus;

[0041] Specifically, the processor is a BM3610 with a maximum clock speed of 144MHz. This processor is a programmable system-on-a-chip (SOPC) that integrates two 1553B bus controllers. The processor is mounted on an intermediate device, which is located between the upper-level and lower-level devices. There is a first-level 1553B bus between the intermediate device and the upper-level device, and a second-level 1553B bus between the intermediate device and the lower-level device. Each of the two channels can be configured as a BC (Bus Controller), RT (Remote Terminal), or MT (Bus Monitor). One channel is configured as an RT to act as the RT in the first-level 1553B bus, and the other is configured as a BC to manage the lower-level device in the second-level bus. The intermediate device is at the core of the two-level bus conversion, acting as an RT in the first-level bus and as a BC in the second-level bus. The processor runs an entire operating system. Optionally, the lower-level device may include one or more.

[0042] The operating system is an embedded real-time operating system (FreeRTOS), which has two tasks: a receiving task (TaskRT) and a scheduling task (TaskBC). TaskBC has a lower priority and TaskRT has a higher priority. The two tasks exchange data through two message queues, namely the first message queue (MsgQ1) and the second message queue (MsgQ2).

[0043] Specifically, FreeRTOS is a tiny real-time operating system. As a lightweight operating system, its functions include task management, time management, semaphores, message queues, memory management, etc. It is a preemptive operating system with task preemption capabilities.

[0044] TaskRT is a high-priority task, and its tasks include at least: scheduling RT, querying data received by RT from upper-layer devices, sending MsgQ1, clearing vector words, querying TaskBC to send MsgQ2 without waiting, and converting messages into first-level bus signals.

[0045] TaskBC is a low-priority task, and its content includes at least: scheduling the RT vector word in the secondary bus, sending data from BC to RT, receiving data from RT to BC, and sending MsgQ2.

[0046] This method involves creating two tasks within a single processor operating system. These two tasks exchange data using two message queues, eliminating the need for two separate processors or boards for signal output from the upper-level device to the lower-level device and signal transmission from the lower-level device to the upper-level device. This saves hardware and software resources, simplifies the bus signal conversion process, improves efficiency, and achieves real-time conversion and transmission.

[0047] In a preferred embodiment, the method further includes the following steps:

[0048] The system receives all data sent by the upper-level device and filters it according to the message type to obtain several first data to be forwarded directly to the lower-level device. Each first data to be forwarded is stored in the first message queue.

[0049] Specifically, of all the data transmitted downwards by the upper-level device, a portion is used by the device itself, and a portion needs to be transmitted downwards to the lower-level device for its use. Therefore, it is necessary to filter the data to be forwarded and store it in the first message queue.

[0050] In a preferred embodiment, the method further includes the following steps:

[0051] All data from the lower-level device is scheduled, and several second data items to be forwarded to the upper-level device are selected. Each second data item to be forwarded is stored in the second message queue.

[0052] Specifically, by parsing to determine what information the upper-level device needs to obtain from the lower-level device, the secondary bus scheduler (BC) schedules the data from the lower-level device to query the required information from the upper-level device and stores it in the second message queue.

[0053] In a preferred embodiment, storing each of the first data to be forwarded in the first message queue includes at least the following steps:

[0054] All the first data to be forwarded is divided into several key data and several ordinary data; the key data is the data that needs to be transmitted to the secondary bus within a specified time, and the ordinary data is the other first data to be forwarded besides the first key data.

[0055] The key data is stored in the head of the first message queue, and the ordinary data is stored according to the first-in-first-out principle.

[0056] Specifically, some of the data sent from the first-level bus needs to meet real-time requirements, that is, data that needs to be forwarded to the second-level bus within a specified time. This data is the first key data.

[0057] In the TaskRT task, query RT and divide the received data sent from the first-level bus into two categories: critical data and ordinary data. The critical data needs to be processed first.

[0058] In a preferred embodiment, the first data to be forwarded in the first message queue is stored using a structure type, which includes at least a timestamp, message type, command word, and data content.

[0059] In a preferred embodiment, all the first data to be forwarded is divided into several key data items and several ordinary data items, including at least the following steps:

[0060] The key data is determined based on the command words of each of the first data to be forwarded.

[0061] Specifically, MsgQ1 stores data that needs to be forwarded from the first-level 1553B bus to the second-level 1553B bus. The message content includes a timestamp, message type, command word, and data content. The first message queue size is 512, meaning it can store a maximum of 512 messages. The command word can be used to determine whether it is critical data. If it is critical data, it is placed at the head of the first message queue, thus completing data insertion. If it is critical data, it is processed first. If it is ordinary data, it follows the first-in-first-out principle in the first message queue.

[0062] In a preferred embodiment, periodically triggering the receiving task includes at least the following steps:

[0063] The receiving task is triggered at each first preset time interval.

[0064] In a preferred embodiment, after data is found to be stored in the first message queue, the process includes at least the following steps:

[0065] Determine the current state of the receiving task. If the current state of the receiving task is suspended, trigger the scheduling task.

[0066] Specifically, TaskRT is triggered by a semaphore, with a first preset duration of 2.5 milliseconds. When the semaphore arrives, TaskRT is triggered to execute. Specifically, it performs a query on the first-level 1553B bus RT, retrieves the data content, command word, message type, and timestamp after the query, and sends it to MsgQ1. If the data requires special priority processing and is determined to be critical data, it is inserted into the header of MsgQ1.

[0067] In order to trigger the second-level 1553B bus BC scheduling of the vector word of the lower-level device, a message type of periodic scheduling vector word needs to be sent.

[0068] Query the message queue MsgQ2 of the secondary 1553B bus. If there is data stored in the current queue, upload the data in MsgQ2 to the BC of the primary bus to complete the signal conversion from the secondary bus to the primary bus.

[0069] TaskBC is triggered by MsgQ1 sent by TaskRT. When there is no data in MsgQ1, it is in a suspended state. At the same time, because TaskBC has a low priority, it can be preempted by TaskRT.

[0070] Once TaskBC obtains CPU access, it first parses the message type. If the message is to retrieve the vector word of the lower-level device, it schedules BC to retrieve the vector word of the lower-level device RT. Based on the vector word, it then schedules data from RT to BC and sends MsgQ2 for TaskRT to query.

[0071] The message type is parsed as transparent data, and then the data is converted into the corresponding sub-address of the lower-level device RT according to the communication protocol before being sent.

[0072] In a preferred embodiment, converting messages in the first message queue into secondary bus signals and transmitting them to lower-level devices via the secondary bus includes at least the following steps:

[0073] Parse the message type of the data in the first message queue. If it is determined to be broadcast time data, obtain the time loss recorded in the time stamp register and compensate the time loss into the time data to obtain the corrected time data.

[0074] The corrected time data is broadcast to the lower-level device.

[0075] In a preferred embodiment, obtaining the time loss recorded in the time stamp register and compensating the time loss into the broadcast time data to obtain corrected time data includes at least the following steps:

[0076] Adjust the priority of the receiving task to be lower than that of the scheduling task, and obtain the time loss recorded in the time stamp register;

[0077] The time loss is then compensated into the broadcast time data to obtain corrected time data. The priority is then adjusted back to the original state, where the receiving task has a higher priority than the scheduling task.

[0078] Specifically, when parsing a message type of broadcast time data, the task priority of TaskBC is first changed to be higher than that of TaskRT. Then, the time stamp register of the BM3610 controller, which acts as the RT, is read again. The time stamp register is configured with LSB=64us during initialization and is a 16-bit register. When the RT receives the broadcast time data, it automatically adds a time stamp, i.e., the time stamp in MsgQ1. The difference between the read value and the value in MsgQ1 is calculated to obtain the time loss of this device. The time loss is then compensated into the broadcast time data to obtain new time data, which is then broadcast to the lower-level device of the secondary bus. After completion, the priority of TaskBC is changed back to the original priority. This is to prevent TaskBC from being preempted by TaskRT during the time data correction process, which would cause the correction value to be inaccurate. The change in priority ensures the accuracy of the time data.

[0079] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. The above descriptions are only preferred embodiments of this application. It should be noted that due to the limitations of written expression, while there are objectively infinite specific structures, those skilled in the art can make several improvements, modifications, or changes without departing from the principles of this invention, and can also combine the above technical features in an appropriate manner. These improvements, modifications, changes, or combinations, or the direct application of the inventive concept and technical solution to other situations without modification, should all be considered within the scope of protection of this application.

Claims

1. A bus signal conversion method, characterized in that, Includes the following steps: In the processor's operating system, a receiving task and a scheduling task are created, and the receiving task is given a higher priority than the scheduling task. The receiving task is periodically triggered to acquire and send a first message queue. The first message queue is used to store data sent by the upper-level device that needs to be transmitted to the lower-level device. The data in the first message queue has at least a message type. The message type includes at least the type that needs to be directly transmitted and the type that needs to be scheduled to the lower-level device. The data in the first message queue is converted into a secondary bus signal and transmitted to the lower-level device via the secondary bus, without waiting to query the second message queue; the second message queue is used to store data scheduled from the lower-level device that needs to be transmitted to the upper-level device; When data is found in the second message queue, the scheduling task is triggered; Send the second message queue, convert the data in the second message queue into a first-level bus signal, and transmit it to the upper-level device via the first-level bus.

2. The bus signal conversion method according to claim 1, characterized in that: The method also includes the following steps: The system receives all data sent by the superior device and filters it according to message type to obtain several first data to be forwarded that need to be directly transmitted to the subordinate device. Each first data to be forwarded is stored in the first message queue.

3. The bus signal conversion method according to claim 1, characterized in that: The method also includes the following steps: All data from the lower-level device is scheduled, and several second data items to be forwarded to the upper-level device are selected. Each second data item to be forwarded is stored in the second message queue.

4. The bus signal conversion method according to claim 2, characterized in that: The storage of each of the first data to be forwarded into the first message queue includes at least the following steps: All the first data to be forwarded is divided into several key data and several ordinary data; the key data is the data that needs to be transmitted to the secondary bus within a specified time, and the ordinary data is the other first data to be forwarded besides the key data; The key data is stored in the head of the first message queue, and the ordinary data is stored according to the first-in-first-out principle.

5. The bus signal conversion method according to claim 4, characterized in that: The first data to be forwarded in the first message queue is stored using a structure type, which includes at least a timestamp, message type, command word, and data content.

6. The bus signal conversion method according to claim 5, characterized in that: Divide all the first data to be forwarded into several key data items and several ordinary data items, including at least the following steps: The key data is determined based on the command words of each of the first data to be forwarded.

7. The bus signal conversion method according to claim 3, characterized in that: Periodically triggering the receiving task includes at least the following steps: The receiving task is triggered at each first preset time interval.

8. The bus signal conversion method according to claim 1, characterized in that: Once data is found in the second message queue, at least the following steps are included: Determine the current state of the receiving task. If the current state of the receiving task is suspended, trigger the scheduling task.

9. The bus signal conversion method according to claim 5, characterized in that: Converting the data in the first message queue into secondary bus signals and transmitting them to the next-level device via the secondary bus includes at least the following steps: Analyze the message type of the data in the first message queue. If it is determined to be broadcast time data, obtain the time loss recorded in the time stamp register and compensate the time loss into the broadcast time data to obtain the corrected time data. The corrected time data is broadcast to the lower-level device.

10. The bus signal conversion method according to claim 9, characterized in that: Obtaining the time loss recorded in the time stamp register and compensating the time loss into the broadcast time data to obtain corrected time data includes at least the following steps: Adjust the priority of the receiving task to be lower than that of the scheduling task, and obtain the time loss recorded in the time stamp register; The time loss is then compensated into the broadcast time data to obtain corrected time data. The priority is then adjusted back to the original state, where the receiving task has a higher priority than the scheduling task.