Method and system for realizing TSN network access flow control based on PCIE query mode

By adopting a timed query method with time jitter tolerance and periodic message filling method in the TSN network in the Host end, the problem that the existing TSN network card cannot meet the rich flow type requirements of avionics systems and the high-precision requirements of time synchronization is solved, and the TSN network access flow control and flow control are realized, reducing the working pressure of the Host.

CN119922133APending Publication Date: 2025-05-02JITAI AVIATION TECH (SUZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411943424.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

The existing TSN network card data planning supports too few data flow categories, which cannot meet the rich flow types of avionics systems, and cannot meet the requirements of high-precision time synchronization of avionics systems.

Method used

The Host end uses a timed query method with time jitter tolerance to query the buffer idle status of the terminal device and the yellow and green light status of the N queues, and realizes the flow control of the TSN network network by periodically filling different types of messages.

Benefits of technology

The determinism of the network access time of multiple types of messages is realized, and the traffic control of messages entering the TSN network is completed, which reduces the delay effect of congestion queues on loose queues caused by terminal equipment queue multiplexing buffers, and reduces the working pressure of Host.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922133A_ABST
    Figure CN119922133A_ABST
Patent Text Reader

Abstract

The invention discloses a method and system for realizing TSN network access flow control based on a PCIE query mode, and the method comprises the steps: collecting messages in the operation process of an airplane, processing the messages to generate to-be-sent messages, and then mapping and storing the to-be-sent messages into N queues of a memory; querying the idle state of the buffer area of the terminal equipment and the yellow and green light states of the N queues by adopting a timing query mode with time jitter tolerance; whether DMA carrying is started or not and which queue data are carried are decided according to a query result; dMA carrying is carried out according to the decision, so that the terminal equipment can take out queue messages from the buffer area according to the yellow and green light states of the N queues and input the queue messages into the TSN. According to the method, the Host end adopts a timed query mode with time jitter tolerance and a mode of periodically filling messages, so that the certainty of the network access time of multiple types of messages is ensured, and the flow control of the messages entering the TSN network is completed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of aviation technology, and in particular relates to a method and system for implementing TSN network access flow control based on a PCIE query method. Background Art

[0002] The aviation field often requires time synchronization to reach microsecond or even nanosecond accuracy. For example, in the flight control system of an aircraft, precise time synchronization is required between different components to ensure accurate coordination of functions such as autopilot, navigation and positioning. When an inertial navigation system cooperates with a satellite navigation system, excessive time error will lead to positioning deviation and affect flight safety. Therefore, high-precision time synchronization is the basis for ensuring accurate coordination of various aviation equipment.

[0003] With the development of science and technology, more and more messages need to be transmitted and processed. The current AFDX network, which uses 100M Ethernet as the basic technology and superimposes the aviation deterministic requirements, can no longer meet the increasingly high time synchronization and high precision requirements of avionics systems. Therefore, the TSN network with higher time synchronization accuracy has become a better choice for the development of aviation networks.

[0004] Some of the current mainstream TSN network cards support too few data stream categories during data planning, which is far from meeting the rich stream type requirements of avionics systems. Summary of the invention

[0005] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a method and system for realizing TSN network access flow control based on PCIE query mode. The host end uses a timing query mode with time jitter tolerance to query the buffer idle state of the terminal device and the yellow-green light state of N queues, as well as a mode of periodically filling different types of messages, which not only ensures the certainty of the network access time of multiple types of messages, but also completes the flow control of messages entering the TSN network.

[0006] The present invention provides the following technical solutions: In a first aspect, a method for implementing TSN network access flow control based on a PCIE query method is provided, wherein the method is applied to a Host end, wherein the Host end communicates with a terminal device through a PCIE interface, and the method comprises: Collect messages during the operation of the aircraft, process the collected messages to generate messages to be sent, and then map and store the messages to be sent into N queues in the memory; Use a timing query method with time jitter tolerance to query the buffer idle status of the terminal device and the yellow-green light status of N queues; According to the buffer idle state of the queried terminal device and the yellow-green light state of N queues, a decision is made on whether to enable DMA transfer and which queue data to transfer; According to the decision, the corresponding queue data is DMA-transferred to the buffer of the terminal device, so that the terminal device can take out the queue message from the buffer according to the yellow-green light status of the N queues and input it into the TSN network.

[0007] Further, the method of mapping and storing the messages to be sent into N queues in the memory includes: Allocate a 2KB memory block for each short message and multiple 2KB memory blocks for each long message; Design N queues and allocate appropriate memory space to each queue. The size of the memory space is an integer multiple of 2KB. Design the mapping relationship between the VC number or port number of the message and the queue, and put the messages belonging to a queue into the memory corresponding to the queue in order; Set up a circular descriptor linked list for each queue, and record the descriptor of each stored message in turn. The descriptor includes the VC number or port number of the message, the effective length of the message, and the first and last identifier information of the message; Count the number of message blocks currently stored in each queue in memory.

[0008] Furthermore, the method for querying a terminal device using a timing query mode with time jitter tolerance includes: Send out periodic signals through timers pre-configured according to scenario requirements; Through the pre-configured time jitter tolerance, the DMA transfer request is allowed to be executed within the preset time after the periodic signal arrives, instead of being executed immediately; When the periodic time point arrives, the DMA transfer execution strategy is dynamically adjusted according to the execution status of the current task.

[0009] Furthermore, the dynamically adjusting the DMA transfer execution strategy according to the execution state of the current task includes: If the critical task has not been completed when the periodic time point arrives, but is completed within the time jitter tolerance, the terminal device is queried when the critical task is completed. If the terminal device is ready, the DMA engine is initialized and the terminal device is notified to initiate a DMA transfer. The data in this DMA transfer contains the message of the critical task. If both critical tasks and common tasks are completed before the periodic time point, the terminal device is queried at the periodic time point. If the terminal device is ready, the DMA engine is initialized and the terminal device is notified to initiate a DMA transfer. The data in this DMA transfer includes messages of critical tasks and common tasks. If the common task has not been completed when the periodic time point arrives, the terminal device is queried at the periodic time point. If the terminal device is ready, the DMA engine is initialized and the terminal device is notified to initiate a DMA transfer. The data in this DMA transfer does not contain the message of the common task. If the critical task has not been completed when the periodic time point arrives, and has not been completed within the time jitter tolerance, the terminal device is queried at the time jitter tolerance boundary. If the terminal device is ready, the DMA engine is initialized and the terminal device is notified to initiate a DMA transfer. The data in this DMA transfer does not contain the message of the critical task.

[0010] Furthermore, the decision of whether to enable DMA transfer and which queue data to transfer is obtained based on the idle state of the buffer of the queried terminal device and the yellow-green light states of the N queues, including: If the query finds that the terminal device buffer is not idle, no DMA transfer action will be performed during this query cycle; If it is found that the buffer in the terminal device is free, the message in the yellow light queue is removed according to the yellow and green light status of the N queues, and the message block is taken from the memory of the green light queue according to the round-robin strategy; If there is no message in the memory of the green light queue, no DMA transfer action will be performed in this query cycle; If the number of message blocks in the green light queue does not exceed the number of free message blocks in the terminal device buffer, all messages are transferred to the terminal device via DMA. If the number of message blocks in the green light queue exceeds the number of free message blocks in the terminal device buffer, the number of message blocks that the buffer can receive is taken according to the round-robin strategy and transmitted to the terminal device through DMA.

[0011] Further, the DMA transfer includes: Initialize the DMA engine and put the queue information to be moved into the descriptor list. Each line of the descriptor list includes the VC number or port number of the message, the head and tail identifiers of the message, the effective length of the message, and the memory offset address of the message. Configure the descriptor list to the terminal device, and configure the length of the descriptor list for DMA transfer to the terminal device; After the terminal device receives the configuration information, it initiates a DMA transfer operation, and sequentially transfers a specified number of message blocks from the memory to the specified buffer of the terminal device according to the descriptor linked list; wherein, since the free area of ​​the buffer is discontinuous, the message blocks transferred by DMA are written into the free area pointed to by the read-write pointer, and the terminal device records the write address, and writes the write address and the message related information in the descriptor into the queue linked list corresponding to the terminal device according to the port number corresponding to the message block. Each time a write is completed, the write pointer moves to the next blank area until the data transfer is completed; The host responds to the DMA transfer interrupt signal sent by the terminal device, shuts down the DMA engine, and completes a DMA transfer.

[0012] Furthermore, the terminal device takes out queue messages from the buffer according to the yellow-green light status of the N queues and inputs them into the TSN network, including: The terminal device decides which messages to retrieve based on the yellow-green light status of the N queues and the empty or full status of each queue; Based on the decision result, the terminal device takes out one message from the buffer or does not take any message into the TSN network processing unit each time, and enters the TSN network after network access processing.

[0013] Furthermore, the buffer of the terminal device is provided with a buffer counter. When a message block is transferred to the buffer by DMA, the buffer counter is incremented by 1. When a message block is taken out of the buffer to the TSN network processing unit, the buffer counter is decremented by 1. When the number of the buffer counter is below the set threshold, the buffer is considered to be idle and can receive a new round of DMA transfer. The terminal device sets a readable flag for each message block in the buffer and maintains the readable flag status of the message blocks in the buffer. When a message block is moved into the buffer, the readable flag at the corresponding position is set to 1. When the message block at that position is taken out, the readable flag is set to 0.

[0014] Furthermore, N queue counters are provided in the N queue linked lists of the terminal device. When DMA transfers a message block to the buffer, the queue counter corresponding to the message block is increased by 1. When a message block is taken out from the buffer to the TSN network processing unit, the queue counter corresponding to the message block is decreased by 1.

[0015] In a second aspect, a system for implementing TSN network access flow control based on a PCIE query method is provided, comprising a host end, a memory and a terminal device, wherein the host end communicates with the terminal device through a PCIE interface; the host end comprises a message collection and processing module, a message arbitration mapping module, a timer module and a DMA module, and the terminal device comprises a buffer and a read buffer arbitration module; The message collection and processing module is used to collect messages during the operation of the aircraft and process the collected messages to generate messages to be sent; The message arbitration mapping module is used to map and store the messages to be sent into N queues in the memory; The timer module is used to query the buffer idle state of the terminal device and the yellow-green light state of N queues by using a timing query method with time jitter tolerance; The DMA module is used to determine whether to enable DMA transfer and which queue data to transfer based on the idle state of the buffer of the queried terminal device and the yellow-green light states of the N queues, and transfer the corresponding queue data to the buffer of the terminal device through DMA according to the decision; The read buffer arbitration module is used to take out queue messages from the buffer according to the yellow-green light status of the N queues and input them into the TSN network.

[0016] Compared with the prior art, the present invention has the following beneficial effects: (1) In the present invention, the host end uses a timing query method with time jitter tolerance to query the buffer idle state of the terminal device and the yellow-green light state of N queues. By periodically filling different types of messages, it not only provides a guarantee for the time certainty and low latency of critical messages, ensures the certainty of the time for multiple types of messages to enter the network, but also completes the flow control of messages entering the TSN network; (2) In the present invention, the host queries the yellow-green light status of the queue before sending data. If the queue is queried to be yellow, the current transmission content does not include the queue message. This method of controlling the sending content by periodically querying the yellow-green light status of the queue effectively reduces the delay effect of the congested queue caused by the terminal device queue multiplexing buffer on the loose queue; (3) In the present invention, the host side determines whether to enable DMA transfer and which queue data to transfer based on the idle state of the buffer of the queried terminal device and the yellow-green light state of the N queues, and transfers the corresponding queue data to the buffer of the terminal device through DMA according to the decision. By adopting the DMA transfer method, the present invention realizes that even if discontinuous data is transferred, the host does not need to participate, which effectively reduces the work pressure of the host; (4) In the present invention, when the host transmits data to the terminal device, a buffer is set to cache the data, which effectively solves the problem of balancing the data bandwidth of the two asynchronous clock domains, thereby effectively ensuring the reliability of data transmission; (5) In the present invention, the terminal device adopts a method of sharing multiple queue buffers but independent queue linked lists, thereby realizing the independence of each queue. By establishing a multi-queue mapping linked list and a buffer random address offset access method, the problem of insufficient internal storage resources of the terminal device is effectively solved, avoiding the increase of external storage and increasing costs; (6) The present invention realizes the control of the flow of different types of messages entering the TSN network when the host and the terminal device communicate through the PCIE interface. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a flow chart of a method for implementing TSN network access flow control based on PCIE query method in an embodiment of the present invention; Figure 2 is a schematic diagram of allocating memory blocks for short messages and long messages in an embodiment of the present invention; Figure 3 Schematic diagram of message contents stored in a descriptor linked list in an embodiment of the present invention; Figure 4 is a schematic diagram of a timing query method with time jitter tolerance in an embodiment of the present invention; Figure 5 It is a schematic diagram of four execution strategies for dynamically adjusting DMA transfer according to the execution state of the current task in an embodiment of the present invention; Figure 6 is a schematic diagram of message contents stored in a descriptor linked list in an embodiment of the present invention; Figure 7 It is a schematic diagram of a DMA message block transport in an embodiment of the present invention; Figure 8 is a schematic diagram of a queue linked list structure of a terminal device in an embodiment of the present invention; Fig. 9 It is a schematic diagram of five decision results of a terminal device taking out a message to a TSN network in an embodiment of the present invention; Fig.10 It is a schematic diagram of the system structure for implementing TSN network access flow control based on the PCIE query method in an embodiment of the present invention. DETAILED DESCRIPTION

[0018] The technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations on the technical solution of the present invention. The embodiments of the present invention and the technical features in the embodiments may be combined with each other unless there is a conflict.

[0019] The term "and / or" is only a description of the association relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " generally indicates that the related objects are in an "or" relationship.

[0020] Example 1

[0021] like Figure 1 As shown, this embodiment provides a method for implementing TSN network access flow control based on PCIE query mode, including a host end, a memory and a terminal device, the host end and the terminal device communicate through a PCIE interface, and the method includes the following steps: Step 1: The Host collects messages during the operation of the aircraft, processes the collected messages and generates messages to be sent (control messages or other categories of messages), and then maps the messages to be sent and stores them in N queues in the memory.

[0022] The specific method of mapping and storing the messages to be sent into N queues in the memory is as follows: Step 1.1: Figure 2 As shown, a 2KB memory block is allocated for each short message, and multiple 2KB memory blocks are allocated for each long message.

[0023] Step 1.2: Design N queues and allocate appropriate memory space to each queue. The size of the memory space is an integer multiple of 2KB.

[0024] Step 1.3: Design the mapping relationship between the VC number or port number of the message and the queue, and put all the messages belonging to a queue into the memory corresponding to the queue in order.

[0025] Step 1.4: Set up a circular descriptor linked list for each queue, and record the descriptor of each message stored in turn. The descriptor includes the VC number or port number of the message, the effective length of the message, the head and tail identifiers of the message, etc. Figure 3 shown.

[0026] Step 1.5: Count the number of message blocks stored in each queue in the current memory.

[0027] Step 2: The host uses a timing query method with jitter tolerance to query the buffer idle status of the terminal device and the yellow-green light status of N queues. The specific method is as follows: Step 2.1: Figure 4 As shown, a periodic signal is sent out through a timer pre-configured according to scenario requirements.

[0028] Step 2.2: By using a pre-configured time jitter tolerance, the DMA transfer request is allowed to be executed within a preset time after the periodic signal arrives, instead of being executed immediately.

[0029] Step 2.3: When the periodic time point arrives, dynamically adjust the DMA transfer execution strategy according to the execution status of the current task.

[0030] like Figure 5 As shown, four execution strategies for dynamically adjusting DMA transfers according to the execution status of the current task are described (where critical tasks are tasks with time determinism requirements, and ordinary tasks are tasks without time determinism requirements).

[0031] (1) If Figure 5 As shown in part (a), if the critical task K has not been completed when the periodic time point arrives, but is completed within the time jitter tolerance, the terminal device is queried when the critical task K is completed. If the terminal device is ready, the DMA engine is initialized and the terminal device is notified to initiate a DMA transfer. The data in this DMA transfer contains the message of the critical task K.

[0032] (2) If Figure 5 As shown in part (b), if both the critical task and the common task have been completed before the periodic time point, the terminal device is queried at the periodic time point. If the terminal device is ready, the DMA engine is initialized and the terminal device is notified to initiate a DMA transfer. The data in this DMA transfer includes the messages of the critical task and the common task. (3) If Figure 5 As shown in part (c), if the ordinary task M has not been completed when the periodic time point arrives, the terminal device is queried at the periodic time point. If the terminal device is ready, the DMA engine is initialized and the terminal device is notified to initiate a DMA transfer. The data in this DMA transfer does not contain the message of the ordinary task M. (4) If Figure 5 As shown in part (d), if the critical task K has not been completed when the periodic time point arrives, and has not been completed within the time jitter tolerance, the terminal device is queried at the time jitter tolerance boundary. If the terminal device is ready, the DMA engine is initialized and the terminal device is notified to initiate a DMA transfer. The data in this DMA transfer does not contain the message of the critical task K.

[0033] Step 3: The Host side determines whether to enable DMA transfer and which queue data to transfer based on the idle state of the buffer of the queried terminal device and the yellow-green light state of the N queues, and transfers the corresponding queue data to the buffer of the terminal device through DMA according to the decision.

[0034] Step 3.1: If it is found that the terminal device buffer is not idle, no DMA transfer action will be performed in this query cycle.

[0035] Step 3.2: If it is found that the buffer in the terminal device is idle, the message in the yellow light queue is removed according to the yellow and green light status of the N queues, and the message block is taken from the memory of the green light queue according to the round-robin strategy.

[0036] Step 3.3: If there is no message in the memory of the green light queue in step 3.2, no DMA transfer action will be performed in this query cycle.

[0037] Step 3.4: If the number of message blocks in the green light queue in step 3.2 does not exceed the number of free message blocks in the buffer of the terminal device, all messages are transferred to the terminal device via DMA.

[0038] Step 3.5: If the number of message blocks in the green light queue in step 3.2 exceeds the number of free message blocks in the buffer of the terminal device, the number of message blocks that the buffer can receive is taken according to the round-robin strategy and transmitted to the terminal device through DMA.

[0039] The DMA transfer method in step 3.4 and step 3.5 is as follows: (1) The host initializes the DMA engine and puts the queue information to be transferred into the descriptor list. Each line of the descriptor list includes the VC number or port number of the message, the head and tail identifiers of the message, the effective length of the message, and the memory offset address of the message, such as Figure 6 shown.

[0040] (2) The host configures the descriptor list to the terminal device and configures the length of the descriptor list for DMA transfer to the terminal device.

[0041] (3) After the terminal device receives the configuration information, it initiates a DMA transfer operation and sequentially transfers a specified number of message blocks from the memory to the specified buffer of the terminal device according to the descriptor linked list.

[0042] Among them, since the free area of ​​the buffer is discontinuous, the message block transferred by DMA is written to the free area pointed to by the read-write pointer. The terminal device records the write address and writes the write address and the message related information in the descriptor into the queue linked list corresponding to the terminal device according to the port number corresponding to the message block. After each write, the write pointer moves to the next blank area until the data transfer is completed. Figure 7 As shown, the blank blocks in the figure are free areas of the buffer.

[0043] (4) After the DMA transfer is completed, the terminal device sends an interrupt signal to the Host.

[0044] (5) The host responds to the DMA transfer interrupt signal sent by the terminal device, shuts down the DMA engine, and completes a DMA transfer.

[0045] Step 4: The terminal device takes out the queue message from the buffer according to the yellow-green light status of the N queues and inputs it into the TSN network. The specific method is as follows: Step 4.1, the terminal device is provided with N queue linked lists corresponding to the buffer, and fills each received message block information into its corresponding queue linked list according to the VC number or port number (Port number) of the message block. The queue linked list information includes the offset address of the message block in the buffer, the head and tail identifiers of the message block, the effective length of the message block, etc. Figure 8 shown.

[0046] Step 4.2: The terminal device decides which messages to retrieve based on the yellow-green light status of the N queues and the empty or full status of the messages in each queue.

[0047] Step 4.3: The terminal device takes out one message from the buffer or does not take any message to enter the TSN network processing unit according to the decision result, and enters the TSN network after network processing. Fig. 9 As shown, five decision results are demonstrated, and the data fetching addresses are random.

[0048] The buffer of the terminal device is equipped with a buffer counter. When DMA transfers a message block to the buffer, the buffer counter is incremented by 1. When a message block is taken out of the buffer and sent to the TSN network processing unit, the buffer counter is decremented by 1. When the number of the buffer counter is below the set threshold, the buffer is considered to be idle and can receive a new round of DMA transfer.

[0049] The terminal device sets a readable flag for each message block in the buffer and maintains the readable flag status of the message blocks in the buffer. When a message block is moved into the buffer, the readable flag at the corresponding position is set to 1. When the message block at that position is taken out, the readable flag is set to 0.

[0050] There are N corresponding queue counters in the N queue linked lists of the terminal device. When DMA transfers a message block to the buffer, the queue counter corresponding to the message block is increased by 1. When a message block is taken out from the buffer to the TSN network processing unit, the queue counter corresponding to the message block is reduced by 1.

[0051] The read and write pointers of the buffer of the terminal device are circular pointers, and the next hop pointing to the end of the buffer queue will point back to the head of the buffer queue.

[0052] The terminal device allocates a storage unit to store the descriptor linked list configured for the DMA transfer operation. The descriptors in the descriptor linked list correspond one-to-one to the message blocks transmitted by the DMA transfer, and the read and write pointers of the descriptor linked list are also ring pointers.

[0053] Example 2

[0054] Based on the same inventive concept as in Example 1, Fig.10 As shown, this embodiment provides a system for implementing TSN network access flow control based on PCIE query method, including a host end, a memory and a terminal device, and the host end communicates with the terminal device through a PCIE interface.

[0055] The host side includes the following modules: The message collection and processing module is used to collect various messages during the operation of the aircraft, such as message A...message N, and generate messages to be sent after calculation and decision processing of the collected messages, such as control messages and other types of messages.

[0056] The message arbitration mapping module is used to map and store N messages to be sent into N queues in the memory. Specifically, the N messages to be sent are arbitrated and mapped. After the arbitration is completed, the messages are written into the memory through the only interface of the memory in a time-sharing manner, and the mapping of the N messages to the N queues is completed.

[0057] The timer module is used to query the buffer idle state of the terminal device and the yellow-green light state of N queues by using a timing query method with time jitter tolerance.

[0058] The DMA module specifically includes a DMA preparation program module and a DMA engine; wherein the DMA preparation program module is used to decide whether to start DMA transfer and which queue data to transfer based on the buffer idle state of the queried terminal device, the yellow-green light state of the N queues of the terminal device, and the task status message information in the memory. If the conditions meet the requirements for initiating a DMA transfer, the DMA preparation program component establishes a DMA transfer descriptor linked list based on the decision, configures the descriptor linked list to the terminal device, and starts the DMA engine at the same time. The DMA engine is used to transfer data from the memory to the terminal device based on the request of the terminal device.

[0059] The terminal device includes the following modules: The buffer is used to cache the data transferred by DMA. The buffer is equipped with a buffer counter. When DMA transfers a message block to the buffer, the buffer counter increases by 1. When a message block is taken out of the buffer and sent to the TSN network processing unit, the buffer counter decreases by 1. When the number of buffer counters is below the set threshold, the buffer is considered to be idle and can receive a new round of DMA transfer.

[0060] The N-queue yellow-green light status module is used to display the yellow-green light status of N queues.

[0061] The descriptor linked list module is used to store the descriptor linked list configured for DMA transfer operations. The descriptors in the descriptor linked list correspond one-to-one to the message blocks transmitted by DMA.

[0062] The queue linked list module is used to store the message block information of the current port in the buffer, including the offset address of the message block in the buffer, the head and tail identifiers of the message block, the effective length of the message block, etc. N queue linked lists are provided with N queue counters. When DMA moves a message block to the buffer, the queue counter corresponding to the message block is increased by 1. When a message block is taken out of the buffer to the TSN network processing module, the queue counter corresponding to the message block is decreased by 1.

[0063] The read buffer arbitration module is used to take out queue messages from the buffer according to the yellow-green light status of the N queues and input them into the TSN network.

[0064] Read FLAG management module, in which the read FLAG register bit field corresponds to the message block area of ​​the buffer one by one. When the message block is filled, the FLAG of the corresponding bit field is set high. When the message block is read out, the FLAG of the corresponding bit field is set low.

[0065] The TSN network processing module is used to process the retrieved messages and input them into the TSN network.

[0066] The specific functional implementation of each of the above modules can be found in the relevant contents of the method in Example 1 and will not be elaborated here.

[0067] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0068] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0069] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0070] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0071] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for implementing TSN network access flow control based on PCIE query mode, characterized in that: The method is applied to a host end, the host end communicates with a terminal device via a PCIE interface, and the method includes: Collect messages during the operation of the aircraft, process the collected messages to generate messages to be sent, and then map and store the messages to be sent into N queues in the memory; Use a timing query method with time jitter tolerance to query the buffer idle status of the terminal device and the yellow-green light status of N queues; According to the buffer idle state of the queried terminal device and the yellow-green light state of N queues, a decision is made on whether to enable DMA transfer and which queue data to transfer; According to the decision, the corresponding queue data is DMA-transferred to the buffer of the terminal device, so that the terminal device can take out the queue message from the buffer according to the yellow-green light status of the N queues and input it into the TSN network.

2. The method for implementing TSN network access flow control based on PCIE query method according to claim 1 is characterized in that: The method of mapping and storing the messages to be sent into N queues in the memory includes: Allocate a 2KB memory block for each short message and multiple 2KB memory blocks for each long message; Design N queues and allocate appropriate memory space to each queue. The size of the memory space is an integer multiple of 2KB. Design the mapping relationship between the VC number or port number of the message and the queue, and put the messages belonging to a queue into the memory corresponding to the queue in order; Set up a circular descriptor linked list for each queue, and record the descriptor of each stored message in turn. The descriptor includes the VC number or port number of the message, the effective length of the message, and the first and last identifier information of the message; Count the number of message blocks currently stored in each queue in memory.

3. The method for implementing TSN network access flow control based on PCIE query method according to claim 1 is characterized in that: The method for querying a terminal device by using a timing query mode with time jitter tolerance includes: Send out periodic signals through timers pre-configured according to scenario requirements; Through the pre-configured time jitter tolerance, the DMA transfer request is allowed to be executed within the preset time after the periodic signal arrives, instead of being executed immediately; When the periodic time point arrives, the DMA transfer execution strategy is dynamically adjusted according to the execution status of the current task.

4. The method for implementing TSN network access flow control based on PCIE query method according to claim 3 is characterized in that: The dynamically adjusting the DMA transfer execution strategy according to the execution status of the current task includes: If the critical task has not been completed when the periodic time point arrives, but is completed within the time jitter tolerance, the terminal device is queried when the critical task is completed. If the terminal device is ready, the DMA engine is initialized and the terminal device is notified to initiate a DMA transfer. The data in this DMA transfer contains the message of the critical task. If both critical tasks and common tasks are completed before the periodic time point, the terminal device is queried at the periodic time point. If the terminal device is ready, the DMA engine is initialized and the terminal device is notified to initiate a DMA transfer. The data in this DMA transfer includes messages of critical tasks and common tasks. If the common task has not been completed when the periodic time point arrives, the terminal device is queried at the periodic time point. If the terminal device is ready, the DMA engine is initialized and the terminal device is notified to initiate a DMA transfer. The data in this DMA transfer does not contain the message of the common task. If the critical task has not been completed when the periodic time point arrives, and has not been completed within the time jitter tolerance, the terminal device is queried at the time jitter tolerance boundary. If the terminal device is ready, the DMA engine is initialized and the terminal device is notified to initiate a DMA transfer. The data in this DMA transfer does not contain the message of the critical task.

5. The method for implementing TSN network access flow control based on PCIE query method according to claim 1 is characterized in that: The decision of whether to start DMA transfer and which queue data to transfer is obtained based on the buffer idle state of the queried terminal device and the yellow-green light states of the N queues, including: If the query finds that the terminal device buffer is not idle, no DMA transfer action will be performed during this query cycle; If it is found that the buffer in the terminal device is free, the message in the yellow light queue is removed according to the yellow and green light status of the N queues, and the message block is taken from the memory of the green light queue according to the round-robin strategy; If there is no message in the memory of the green light queue, no DMA transfer action will be performed in this query cycle; If the number of message blocks in the green light queue does not exceed the number of free message blocks in the terminal device buffer, all messages are transferred to the terminal device via DMA. If the number of message blocks in the green light queue exceeds the number of free message blocks in the terminal device buffer, the number of message blocks that the buffer can receive is taken according to the round-robin strategy and transmitted to the terminal device through DMA.

6. The method for implementing TSN network access flow control based on PCIE query method according to claim 5 is characterized in that: The DMA handling includes: Initialize the DMA engine and put the queue information to be moved into the descriptor list. Each line of the descriptor list includes the VC number or port number of the message, the head and tail identifiers of the message, the effective length of the message, and the memory offset address of the message. Configure the descriptor list to the terminal device, and configure the length of the descriptor list for DMA transfer to the terminal device; After the terminal device receives the configuration information, it initiates a DMA transfer operation, and sequentially transfers a specified number of message blocks from the memory to the specified buffer of the terminal device according to the descriptor linked list; wherein, since the free area of ​​the buffer is discontinuous, the message blocks transferred by DMA are written into the free area pointed to by the read-write pointer, and the terminal device records the write address, and writes the write address and the relevant information of the message in the descriptor into the queue linked list corresponding to the terminal device according to the port number corresponding to the message block. Each time a write is completed, the write pointer moves to the next blank area until the data transfer is completed; In response to the DMA transfer interrupt signal sent by the terminal device, the DMA engine is turned off to complete a DMA transfer.

7. The method for implementing TSN network access flow control based on PCIE query method according to claim 1 is characterized in that: The terminal device takes out queue messages from the buffer according to the yellow-green light status of the N queues and inputs them into the TSN network, including: The terminal device decides which messages to retrieve based on the yellow-green light status of the N queues and the empty or full status of each queue; Based on the decision result, the terminal device takes out one message from the buffer or does not take any message into the TSN network processing unit each time, and enters the TSN network after network access processing.

8. The method for implementing TSN network access flow control based on PCIE query method according to claim 7 is characterized in that: The buffer of the terminal device is provided with a buffer counter. When DMA transfers a message block to the buffer, the buffer counter is incremented by 1. When a message block is taken out of the buffer to the TSN network processing unit, the buffer counter is decremented by 1. When the number of the buffer counter is below the set threshold, the buffer is considered to be idle and can receive a new round of DMA transfer. The terminal device sets a readable flag for each message block in the buffer and maintains the readable flag status of the message blocks in the buffer. When a message block is moved into the buffer, the readable flag at the corresponding position is set to 1. When the message block at that position is taken out, the readable flag is set to 0.

9. The method for implementing TSN network access flow control based on PCIE query method according to claim 7 is characterized in that: N queue counters are set in the N queue linked lists of the terminal device. When DMA transfers a message block to the buffer, the queue counter corresponding to the message block is increased by 1. When a message block is taken out from the buffer to the TSN network processing unit, the queue counter corresponding to the message block is reduced by 1.

10. A system for implementing TSN network access flow control based on PCIE query method, characterized in that: It includes a host end, a memory and a terminal device, wherein the host end communicates with the terminal device through a PCIE interface; the host end includes a message collection and processing module, a message arbitration mapping module, a timer module and a DMA module, and the terminal device includes a buffer and a read buffer arbitration module; The message collection and processing module is used to collect messages during the operation of the aircraft and process the collected messages to generate messages to be sent; The message arbitration mapping module is used to map and store the messages to be sent into N queues in the memory; The timer module is used to query the buffer idle state of the terminal device and the yellow-green light state of N queues by using a timing query method with time jitter tolerance; The DMA module is used to determine whether to enable DMA transfer and which queue data to transfer based on the idle state of the buffer of the queried terminal device and the yellow-green light states of the N queues, and transfer the corresponding queue data to the buffer of the terminal device through DMA according to the decision; The read buffer arbitration module is used to take out queue messages from the buffer according to the yellow-green light status of the N queues and input them into the TSN network.