CN112291336B - Multichannel parallel data loading method of ARINC429 network card - Google Patents
Multichannel parallel data loading method of ARINC429 network card Download PDFInfo
- Publication number
- CN112291336B CN112291336B CN202011164225.2A CN202011164225A CN112291336B CN 112291336 B CN112291336 B CN 112291336B CN 202011164225 A CN202011164225 A CN 202011164225A CN 112291336 B CN112291336 B CN 112291336B
- Authority
- CN
- China
- Prior art keywords
- data
- channel
- ith
- arinc429
- thread
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Memory System Of A Hierarchy Structure (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention discloses a multichannel parallel data loading method of an ARINC429 network card, relating to the field of aviation equipment, the method creates a driving calling thread and creates a data processing thread for each channel, the driving calling thread adopts a quick polling mechanism to process the data receiving and sending requests of the data processing threads of each channel in sequence, multiple channels of the network card can be utilized to the maximum extent, the loading of multiple ARINC429 devices by one ARINC429 network card is realized, since the control takes time to process the data, and the transmission protocol dictates the existence of data intervals, the delay of data receiving and sending of each channel can not be caused basically under the rapid polling, the experience is actually similar to parallel loading, the time-consuming extension of a single loading task can not be caused, the speed is not influenced, the data loading efficiency is greatly improved, and the utilization rate of the network card is improved.
Description
Technical Field
The invention relates to the field of aviation equipment, in particular to a multichannel parallel data loading method for an ARINC429 network card.
Background
The ARINC429 bus has the advantages of simple structure, stable performance, strong anti-interference performance and high reliability, and is a common digital information transmission form between avionic equipment and related systems. Data loading and downloading are carried out on ARINC429 equipment, channel direct connection communication is mainly carried out through an ARINC429 network card, the ARINC429 network card is generally provided with a plurality of channels, 4-channel and 8-channel systems are common, and different channels are distributed with different transmission rates to adapt to different scene requirements. However, each channel inside the ARINC429 network card cannot share a handle and therefore cannot perform parallel communication, so that no matter how many channels exist in the existing ARINC429 network card, one ARINC429 device can be loaded through one channel when data is loaded, and waste of the other channels is caused. If a plurality of ARINC429 devices are loaded, the loading can be queued and carried out sequentially, or each ARINC429 device is provided with an ARINC429 network card for loading, so that the loading efficiency is low and the loading cost is increased.
Disclosure of Invention
The invention provides a multichannel parallel data loading method of an ARINC429 network card aiming at the problems and the technical requirements, and the technical scheme of the invention is as follows:
a multichannel parallel data loading method of an ARINC429 network card comprises the following steps:
creating a drive calling thread, and creating corresponding data processing threads for each channel of an ARINC429 network card respectively, wherein the ARINC429 network card comprises N channels which are connected with ARINC429 equipment respectively, and N is more than or equal to 2;
the driving calling thread detects whether an ith data processing thread corresponding to the ith channel has a data receiving and sending request, wherein i is a parameter and the initial value of i is 1;
if the ith data processing thread has no data transceiving request, directly executing a step of detecting whether i is less than N;
if the ith data processing thread has a data receiving and sending request, the driving calling thread calls an interface function provided by an ARINC429 network card according to the data receiving and sending request of the ith data processing thread, a data cache region based on the ith channel receives and sends data with corresponding ARINC429 equipment through the ith channel, and the step of detecting whether i is less than N is executed;
and detecting whether i is less than N, if i is less than N, making i equal to i +1, and if i is equal to N, making i equal to 1, and executing the step of driving the calling thread to process the data transceiving request of the ith data processing thread corresponding to the ith channel again, wherein the (i + 1) th channel is the next channel of the ith channel according to the preset sequence.
The further technical scheme is that the method also comprises the following steps:
creating a global channel state array, wherein the channel state array comprises N member variables, the N member variables respectively correspond to N channels, and the value of each member variable is an initial identifier or a preset identifier;
the driving and calling thread detects whether the ith data processing thread corresponding to the ith channel has a data transceiving request, including:
and the drive calling thread detects the member variable corresponding to the ith channel in the channel state array, if the detected corresponding member variable is a preset identifier, the ith data processing thread is determined to have a data transceiving request, and otherwise, the ith data processing thread is determined to have no data transceiving request.
The further technical scheme is that the method also comprises the following steps:
when each data processing thread requests to receive and transmit data, inquiring the value of the corresponding member variable in the channel state array until the corresponding member variable is currently an initial identifier, setting the corresponding member variable as a preset identifier and indicating that the data receiving and transmitting request exists;
and after the drive calling thread receives and transmits data with the corresponding ARINC429 device through the ith channel, setting member variables corresponding to the ith channel in the channel state array as initial identifications.
The further technical scheme is that the data receiving and sending request of each data processing thread comprises a data sending request, the preset identifier of the corresponding member variable comprises a sending identifier, and then:
when the ith data processing thread requests to send data and inquires that the corresponding member variable in the channel state array is the initial identifier currently, writing the data to be sent into a data cache region corresponding to the ith channel, and setting the corresponding member variable as a sending identifier to indicate that a data sending request exists;
the driving calling thread calls an interface function provided by the ARINC429 network card according to the data sending request of the ith data processing thread to send the data to be sent in the data cache region corresponding to the ith channel to the connected ARINC429 device through the ith channel.
A further technical solution is that, the data transceiving request of each data processing thread includes a data receiving request, and the predetermined identifier of the corresponding member variable includes a receiving identifier, then:
when the ith data processing thread requests to receive data and inquires that the corresponding member variable in the channel state array is currently the initial identifier, setting the corresponding member variable as a receiving identifier to indicate that the data receiving request exists; the ith data processing thread inquires the value of the corresponding member variable in the channel state array again until the corresponding member variable is set as the initial identifier again by the driving calling thread, and reads the data to be received from the corresponding data cache region;
the data to be received is data which is sent by an ARINC429 device connected and received by the ith channel by the driving calling thread according to the data receiving request of the ith data processing thread and is written into the data cache region corresponding to the ith channel.
The further technical scheme is that the data buffer area of each channel comprises a buffer area to be sent and a buffer area to be received, the data to be sent in the buffer area to be sent comprises a data length and a data main body, and the data to be received in the buffer area to be received comprises a data length and a data main body, so when the calling thread is driven to process the data receiving and sending request of the ith data processing thread:
the drive calling thread sends a data main body to the connected ARINC429 equipment according to the data length of the data to be sent in the cache region to be sent corresponding to the ith channel;
or the ith data processing thread reads the data main body from the corresponding data cache region according to the data length of the data to be received.
A further technical solution is that the data buffer area of each channel includes a buffer area to be transmitted and a buffer area to be received, and the method includes:
and allocating a buffer area to be sent and a buffer area to be received for each channel respectively, wherein the buffer area to be sent and the buffer area to be received of each channel occupy continuous and independent memory spaces respectively, and the size of the memory space occupied by each buffer area to be sent and the buffer area to be received is matched with the maximum data length of single receiving and sending of the ARINC429 network card.
The beneficial technical effects of the invention are as follows:
the application discloses a multichannel parallel data loading method of an ARINC429 network card, the method can utilize a plurality of channels of the ARINC429 network card to the maximum extent, the loading of a plurality of ARINC429 devices by utilizing one ARINC429 network card is realized, the control processing data needs time, and a transmission protocol specifies the existence of data interval time, the delay of data receiving and sending of each channel can not be basically caused under the condition of quick polling, the experience is actually similar to parallel loading, the time-consuming extension of a single loading task can not be caused, the speed is not influenced, the data loading efficiency is greatly improved, and the utilization rate of the ARINC429 network card is improved.
Drawings
Fig. 1 is a system architecture diagram in the present application.
Fig. 2 is a schematic diagram illustrating a scheduling flow of the method disclosed in the present application when a channel needs to transmit data.
Fig. 3 is a schematic diagram illustrating a scheduling flow of the method disclosed in the present application when a channel needs to receive data.
Detailed Description
The following description of the embodiments of the present invention will be made with reference to the accompanying drawings.
The application discloses a multichannel parallel data loading method of an ARINC429 network card, please refer to a system architecture diagram shown in fig. 1, and the method includes the following contents:
firstly, the hardware structure based on the method is as follows:
the network card mainly comprises an ARINC429 network card and N ARINC429 devices connected with the ARINC429 network card, wherein N is more than or equal to 2. The ARINC429 network card comprises a plurality of channels (channels), the number of the channels contained in the ARINC429 network card is larger than or equal to N, and each ARINC429 device is connected with one channel of the ARINC429 network card.
Actually, each channel of the ARINC429 network card can be connected with an ARINC429 device, or only a part of channels can be connected with ARINC429 devices. In fig. 1, the ARINC429 network card includes four channels C0-C3, and the four channels are sequentially connected to one ARINC429 device T0-T3, respectively.
And secondly, preparing in the early stage.
1. It should be noted that each channel referred to in this application is each channel in the network card to which the ARINC429 device is connected, and is not each channel in all channels actually included in the network card, that is, N data processing threads are created for N channels. For example, in FIG. 1, four data processing threads X0X 3 are created for four channels C0C 3 in sequence.
2. And creating a drive calling thread which is responsible for initializing the ARINC429 network card and calling an interface function (API) provided by the ARINC429 network card to realize data receiving and sending of the ARINC429 network card. Specifically, a send interface function provided by the ARINC429 network card is called to realize data transmission, and a receive interface function is called to realize data reception.
3. A continuous memory space is opened up for each channel, the memory space in the memory is divided into N parts which are respectively used as the data cache region of each channel, and the data cache regions respectively occupy the continuous and independent memory space. Further, the data buffer area of each channel includes a buffer area to be sent and a buffer area to be received, and a buffer area to be sent and a buffer area to be received are respectively allocated to each channel, and the buffer area to be sent and the buffer area to be received of each channel respectively occupy continuous and independent memory spaces. Taking the case of 4 channels as an example, a schematic diagram of memory layout formed by the data cache regions of each channel is shown in fig. 1.
The size of the memory space occupied by each buffer area to be transmitted and the buffer area to be received is matched with the maximum data length of single transceiving of the ARINC429 network card, the unit of each transmission of the ARINC429 network card is a word (word), one word is 4 bytes, and the maximum data length of single transceiving of the ARINC429 network card is the number of the maximum A429 word capable of transceiving each time. The method and the device have the advantages that the maximum data length which can be sent by the ARINC429 network card each time is recorded as maxSendWordCount, the maximum data length which can be received each time is recorded as maxReceiveWordCount, the two lengths can be set by self, the set value is recommended to be less than 256, and therefore only one byte is needed to be stored (0-255).
The method includes the steps that the size of a memory space of a cache region to be sent is distributed according to the maximum data length maxSendWordCount which can be sent by an ARINC429 network card every time, the size of the memory space of the cache region to be sent is set to be maxSendWordCount 4+1, one byte is used for storing the data length of a data body, and the rest bytes are used for storing the data body, and usually the first byte.
The size of the memory space of the cache region to be received is allocated according to the maximum data length maxreceiveWordCount which can be received by the ARINC429 network card every time, the size of the memory space of the cache region to be received is set to be maxreceiveWordCount 4+1, one byte is used for storing the data length of the data body, and the rest bytes are used for storing the data body, usually the first byte.
4. A global channel state array is created, which can be called by a driver calling thread and N data processing threads. The channel state array channeltatearr comprises N member variables, the N member variables respectively correspond to N channels, and the value of each member variable is an initial identifier or a preset identifier. When the value of the member variable corresponding to one channel is the initial identifier, the channel does not need to receive and transmit data, and when the value of the member variable corresponding to one channel is the preset identifier, the channel needs to receive and transmit data. Further, the predetermined identifier includes a sending identifier and a receiving identifier, and when the value of the member variable corresponding to one channel is the sending identifier, it indicates that the channel needs to send data; when the value of the member variable corresponding to one channel is the receiving identifier, it indicates that the channel needs to receive data. The specific form of the initial identifier and the predetermined identifier may be customized, for example, the initial identifier is set to be 0, the sending identifier is set to be 1, and the receiving identifier is set to be 2.
And thirdly, data loading process.
(1) The scheduling process of the data processing thread is as follows:
when each channel needs to transmit and receive data with the ARINC429 network card correspondingly connected, the data processing thread of the channel sends out a data transmitting and receiving request and interacts with the data cache region of the channel, and the data transmitting and receiving request is processed by a driving calling thread subsequently. The processing procedure of each channel is similar, and for any channel, the scheduling procedure is as follows:
the data processing thread of the channel sends out a data transceiving request by modifying the value of the corresponding member variable in the channel state array, when the data processing thread requests to receive and transmit data, the data processing thread firstly inquires whether the value of the corresponding member variable in the channel state array is the initial identifier at present, if the value of the corresponding member variable is the preset identifier at present, it indicates that the channel may currently have data transceiving requests that have not been processed by the driver calling thread, the data processing thread circularly queries the value of the corresponding member variable in the channel state array until the corresponding member variable is currently the initial identifier, and the data processing thread modifies the value of the corresponding member variable in the channel state array from the initial identifier to a predetermined identifier and indicates that the data processing thread has the data transceiving request.
The data receiving and sending requests comprise a data sending request for requesting to send data outwards and a data receiving request for requesting to receive external data, and according to different receiving and sending conditions, some differences exist in actual operation, and the application separately introduces the following, taking the ith data processing thread corresponding to the ith channel as an example:
a. when the ith data processing thread requests to send data out.
And when the ith data processing thread requests to send data and inquires that the corresponding member variable in the channel state array is the initial identifier currently, writing the data to be sent into the cache region to be sent corresponding to the ith channel, and setting the corresponding member variable as the sending identifier to indicate that a data sending request exists.
Specifically, the data in the cache region to be sent includes the data length of the data to be sent and a data main body, the ith data processing thread counts the length of the data main body to be sent, stores the length of the data main body as the data length in the cache region to be sent in a first byte, and then writes the data main body into a subsequent memory space. And if the data size of the data to be sent is larger than the memory space size of the cache region to be sent, dividing the data to be sent into a plurality of times of data to be sent, and sending the data in sequence.
b. When the ith data processing thread requests to receive external data.
When the ith data processing thread requests to receive data and inquires that the corresponding member variable in the channel state array is currently the initial identifier, setting the corresponding member variable as the receiving identifier to indicate that the channel state array has a data receiving request, then circularly inquiring the value of the corresponding member variable in the channel state array again by the ith data processing thread until the ith data processing thread detects that the ith data processing thread is set as the initial identifier again (the ith data processing thread is set as the initial identifier again after the data receiving request is processed by the driving calling thread), and reading the data to be received from the data cache region corresponding to the ith channel.
Specifically, the data in the buffer to be received includes the data length of the data to be received and a data main body, the ith data processing thread reads the first byte in the buffer to be received to determine the data length, and then reads the data with the data length in the subsequent memory space, which is the data main body.
(2) And driving a scheduling process of the calling thread.
The data processing thread of each channel sends out corresponding requests according to the data receiving and sending requirements, the drive calling thread can adopt a polling mechanism to sequentially process the requests of each channel according to a preset sequence, the preset sequence can be configured by a user in a self-defined way, and the scheduling process is as follows:
in step S1, the driver invoking thread detects whether the ith data processing thread corresponding to the ith channel has a data transceiving request, where i is a parameter and the initial value of i is 1.
In the application, the driving calling thread determines whether the ith data processing thread has a data transceiving request or not by detecting the value of the member variable corresponding to the ith channel in the channel state array channelStateArr, if the member variable corresponding to the ith channel is detected to be a preset identifier, the ith data processing thread is determined to have the data transceiving request, and if not, the ith data processing thread is determined to have no data transceiving request. Further, when it is detected that the member variable corresponding to the ith channel is the sending identifier, it is determined that the ith data processing thread has a data sending request, and when it is detected that the member variable corresponding to the ith channel is the receiving identifier, it is determined that the ith data processing thread has a data receiving request.
In step S2, if the ith data processing thread has no data transceiving request, the step of detecting whether i is less than N is directly performed, that is, the following step S4 is performed, that is, the ith channel is directly skipped corresponding to the actual scene, and the next channel is directly queried whether there is a data transceiving request.
Step S3, if the ith data processing thread has a data transceiving request, the driver calling thread calls an interface function provided by the ARINC429 network card according to the data transceiving request of the ith data processing thread, and the data buffer area based on the ith channel performs data transceiving with the corresponding ARINC429 device through the ith channel, where the transceiving conditions are as follows:
and if the ith data processing thread has a data sending request, the drive calling thread calls a send interface function provided by the ARINC429 network card to send the data in the to-be-sent cache region of the ith channel to the ARINC429 device correspondingly connected through the ith channel. Specifically, the drive calling thread reads a to-be-sent buffer area of the ith channel, determines the data length of the to-be-sent data which needs to be sent at this time according to the first byte, the data of the data length stored in the subsequent memory space is a data main body, and the drive calling thread calls a sending send interface function of the ARINC429 network card in a loop to send the data main body out through the ith channel.
If the ith data processing thread has a data receiving request, the drive calling thread calls a receive interface function provided by the ARINC429 network card to receive the ARINC429 equipment correspondingly connected through the ith channel and write the ARINC429 equipment into a buffer area to be received of the ith channel. Specifically, the drive call thread counts the number length of the received data main body as the data length of the data to be received, and then writes the data length into the first byte of the buffer to be received of the ith channel, and writes the data main body into the subsequent memory space.
In the case of receiving or sending, after the drive calling thread performs data transceiving with the corresponding ARINC429 device through the ith channel, the member variable corresponding to the ith channel in the channel state array is set as the initial identifier again. Subsequently, a step of detecting whether i < N is satisfied is performed, that is, the following step S4 is performed.
Step S4 is to detect whether i < N is satisfied, if i < N, i is made equal to i +1, and if i is made equal to N, i is made equal to 1, and the above-described step S1 is executed again, and the loop processing is continued.
For more clearly explaining the scheduling process, it is assumed that the driver call thread sequentially processes the requests of the channels according to the sequence of the channels C0 to C3 based on the structure shown in fig. 1, the polling process of the driver call thread is shown by a dotted line in fig. 1, and meanwhile, it is assumed that the initial identifier is 0, the transmission identifier is 1, and the reception identifier is 2, the scheduling process is introduced in the present application, the scheduling process when the channel needs to transmit data refers to fig. 2, and the scheduling process when the channel needs to receive data refers to fig. 3:
assuming that the value of the member variable in the initial channel state array is 0, the channel C0 needs to send data, the channel C2 needs to receive data, and the channels C1 and C3 do not need to send nor receive data, the scheduling of each data processing thread is as follows: the data processing thread X0 of the channel C0 checks that the corresponding member variable 0 in the channel state array currently takes a value of 0, writes the data to be sent into the to-be-sent cache region of the channel C0, and then sets the member variable 0 to 1. And the data processing thread X2 of the channel C2 checks that the current value of the corresponding member variable 0 in the channel state array is 0, sets the corresponding member variable 2 to be 2, and continuously and circularly queries the value of the member variable 2. The member variable for channel C1 and channel C3 remains unchanged at 0.
Assuming that the current channel state array is as follows, the scheduling process of the driving calling thread is as follows:
1. and the driver calls a thread processing channel C0 request, the driver calls a thread to detect that a corresponding member variable 0 in the channel state array is 1, which indicates that the data processing thread X0 requests to send data, the driver calls a thread to read data in a to-be-sent cache region of a channel C0, calls a send interface function of an ARINC429 network card to send the data to an ARINC429 device T0 through a channel C0, and then resets the value of the member variable 0 in the channel state array to 0 again.
2. The driving calling thread processes the requests of the channel C1 in sequence, detects that the corresponding member variable 1 in the channel state array is 0, and indicates that the channel C1 does not need to receive and send data, the driving calling program directly skips the channel C1 and continues to process the requests of the channel C2.
3. The drive calling thread processes the requests of the channel C2 in sequence, detects that the corresponding member variable 2 in the channel state array is 2, and indicates that the data processing thread X2 has a data receiving request, the drive calling program calls a receive interface function of an ARINC429 network card to receive data of an ARINC429 device T2 through the channel C2 and writes the data into a buffer area to be received of the channel C2, and then sets the value of the member variable 2 in the channel state array to be 0. Then the data processing thread X2 inquires that the value of the member variable 2 becomes 0 again, and the data processing thread X2 reads the data sent by the ARINC429 device T2 from the to-be-received buffer of the channel C2.
4. And the driving calling thread processes the requests of the channel C3 in sequence, detects that the corresponding member variable 3 in the channel state array is 0, indicates that the channel C3 does not need to transmit and receive data, and the driving calling program directly skips the channel C3 and continues to process the requests of the channel C1 and loops back and forth.
What has been described above is only a preferred embodiment of the present application, and the present invention is not limited to the above embodiment. It is to be understood that other modifications and variations directly derivable or suggested by those skilled in the art without departing from the spirit and concept of the present invention are to be considered as included within the scope of the present invention.
Claims (6)
1. A multichannel parallel data loading method of an ARINC429 network card is characterized by comprising the following steps:
creating a drive calling thread, and creating corresponding data processing threads for each channel of an ARINC429 network card respectively, wherein the ARINC429 network card comprises N channels which are connected with ARINC429 equipment respectively, and N is more than or equal to 2;
the driving calling thread detects whether an ith data processing thread corresponding to the ith channel has a data receiving and sending request, wherein i is a parameter and the initial value of i is 1;
if the ith data processing thread has no data transceiving request, directly executing a step of detecting whether i is less than N;
if the ith data processing thread has a data receiving and sending request, the driving calling thread calls an interface function provided by an ARINC429 network card according to the data receiving and sending request of the ith data processing thread, performs data receiving and sending with corresponding ARINC429 equipment through the ith channel based on a data cache region of the ith channel, and performs the step of detecting whether i is less than N;
detecting whether i is less than N, if i is less than N, making i = i +1, if i = N, making i =1, and if i = N, executing the step of processing the data transceiving request of the ith data processing thread corresponding to the ith channel by the driving calling thread again, wherein the (i + 1) th channel is the next channel of the ith channel according to the preset sequence;
wherein the method further comprises: establishing a global channel state array, wherein the channel state array comprises N member variables, the N member variables respectively correspond to N channels, and the value of each member variable is an initial identifier or a preset identifier; the step of detecting, by the drive call thread, whether the ith data processing thread corresponding to the ith channel has a data transceiving request includes: and the drive calling thread detects a member variable corresponding to the ith channel in the channel state array, if the detected member variable is a preset identifier, the ith data processing thread is determined to have a data transceiving request, and otherwise, the ith data processing thread is determined to have no data transceiving request.
2. The method of claim 1, further comprising:
when each data processing thread requests to receive and transmit data, inquiring the value of the corresponding member variable in the channel state array until the corresponding member variable is currently an initial identifier, and setting the corresponding member variable as a preset identifier to indicate that the data receiving and transmitting request exists;
and after the drive calling thread receives and transmits data with the corresponding ARINC429 equipment through the ith channel, setting member variables corresponding to the ith channel in the channel state array as initial identifiers.
3. The method of claim 2, wherein the data transceiving requests for each data processing thread comprises data send requests, and the predetermined identification of the corresponding member variable comprises a send identification, then:
when the ith data processing thread requests to send data and inquires that the corresponding member variable in the channel state array is the initial identifier currently, writing the data to be sent into a data cache region corresponding to the ith channel, and setting the corresponding member variable as a sending identifier to indicate that a data sending request exists;
the driver calling thread calls an interface function provided by an ARINC429 network card according to the data sending request of the ith data processing thread to send the data to be sent in the data cache region corresponding to the ith channel to the connected ARINC429 device through the ith channel.
4. The method of claim 2, wherein the data transceiving requests for each data processing thread comprises a data receive request, and the predetermined identification of the corresponding member variable comprises a receive identification, then:
when the ith data processing thread requests to receive data and inquires that the corresponding member variable in the channel state array is currently the initial identifier, setting the corresponding member variable as a receiving identifier to indicate that the data receiving request exists; the ith data processing thread inquires the value of the corresponding member variable in the channel state array again until the corresponding member variable is set as the initial identifier again by the driving calling thread, and reads the data to be received from the corresponding data cache region;
the data to be received is data which is sent by an ARINC429 device connected and received by the ith channel through an interface function provided by an ARINC429 network card and written into a data cache region corresponding to the ith channel, and is called by the driving calling thread according to a data receiving request of the ith data processing thread.
5. The method according to claim 3 or 4, wherein the data buffer area of each channel comprises a to-be-sent buffer area and a to-be-received buffer area, the to-be-sent data in the to-be-sent buffer area comprises a data length and a data body, and the to-be-received data in the to-be-received buffer area comprises a data length and a data body, when the driving calling thread processes a data transceiving request of the ith data processing thread:
the drive calling thread sends a data main body to the connected ARINC429 equipment according to the data length of the data to be sent in the cache region to be sent corresponding to the ith channel;
or the ith data processing thread reads the data main body from the corresponding data cache region according to the data length of the data to be received.
6. The method of claim 1, wherein the data buffer of each channel comprises a buffer to be transmitted and a buffer to be received, the method comprising:
and allocating a buffer area to be sent and a buffer area to be received for each channel respectively, wherein the buffer area to be sent and the buffer area to be received of each channel occupy continuous and independent memory spaces respectively, and the size of the memory space occupied by each buffer area to be sent and the buffer area to be received is matched with the maximum data length of single receiving and sending of the ARINC429 network card.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011164225.2A CN112291336B (en) | 2020-10-27 | 2020-10-27 | Multichannel parallel data loading method of ARINC429 network card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011164225.2A CN112291336B (en) | 2020-10-27 | 2020-10-27 | Multichannel parallel data loading method of ARINC429 network card |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112291336A CN112291336A (en) | 2021-01-29 |
CN112291336B true CN112291336B (en) | 2022-08-12 |
Family
ID=74373418
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011164225.2A Active CN112291336B (en) | 2020-10-27 | 2020-10-27 | Multichannel parallel data loading method of ARINC429 network card |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112291336B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112887319B (en) * | 2021-02-01 | 2022-07-01 | 上海帆一尚行科技有限公司 | Network state monitoring method and device based on downlink traffic and electronic equipment |
CN114598497B (en) * | 2022-01-26 | 2023-10-20 | 南京南瑞信息通信科技有限公司 | Data isolation device and method based on transmission card error-correcting multichannel |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102932489A (en) * | 2012-10-28 | 2013-02-13 | 中国电子科技集团公司第十研究所 | Multi-channel ARINC429 bus interface |
CN104050121A (en) * | 2014-06-13 | 2014-09-17 | 四川亚美动力技术有限公司 | Double-receiving double-emitting programmable ARINC 429 communication interface chip |
CN109445325A (en) * | 2018-10-15 | 2019-03-08 | 四川九洲空管科技有限责任公司 | A kind of high speed ARINC429 data processing method based on FPGA |
-
2020
- 2020-10-27 CN CN202011164225.2A patent/CN112291336B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102932489A (en) * | 2012-10-28 | 2013-02-13 | 中国电子科技集团公司第十研究所 | Multi-channel ARINC429 bus interface |
CN104050121A (en) * | 2014-06-13 | 2014-09-17 | 四川亚美动力技术有限公司 | Double-receiving double-emitting programmable ARINC 429 communication interface chip |
CN109445325A (en) * | 2018-10-15 | 2019-03-08 | 四川九洲空管科技有限责任公司 | A kind of high speed ARINC429 data processing method based on FPGA |
Non-Patent Citations (3)
Title |
---|
ARINC429-USB接口卡软件设计;杨志强;《中国优秀硕士学位论文全文数据库 (信息科技辑)》;20130615(第6期);正文第4-54页 * |
基于SystemVerilog的多通道ARINC429总线通讯板卡的设计;崔惠珊;《现代电子技术》;20140815;第37卷(第16期);全文 * |
某型直升机自动驾驶仪综合测试设备的研制;叶思隽;《中国优秀硕士学位论文全文数据库 (信息科技辑)》;20070715(第1期);正文第22-70页 * |
Also Published As
Publication number | Publication date |
---|---|
CN112291336A (en) | 2021-01-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5175818A (en) | Communication interface for independently generating frame information that is subsequently stored in host memory and sent out to transmitting fifo by dma | |
CN112291336B (en) | Multichannel parallel data loading method of ARINC429 network card | |
CN103064807B (en) | Hyperchannel DMA controller | |
US20070002172A1 (en) | Linking frame data by inserting qualifiers in control blocks | |
EP4002137B1 (en) | Secure digital (sd) direct command for improving throughput with a reduced memory footprint | |
WO1984002629A1 (en) | Method and apparatus for bus contention resolution | |
KR100919159B1 (en) | Multimedia card interface method, computer program product and apparatus | |
CN111221759A (en) | Data processing system and method based on DMA | |
CN114020662B (en) | Bridging module, data transmission system and data transmission method | |
US20040085996A1 (en) | High-throughput UART interfaces | |
US6542941B1 (en) | Efficient command delivery and data transfer | |
EP0523878A1 (en) | Deterministic method for allocation of a shared resource | |
CN113079113B (en) | Data transmission device and data transmission system | |
KR20030019093A (en) | Packet control system and communication method | |
KR100560277B1 (en) | Assignment of packet descriptor field positions in a network processor | |
US7840722B2 (en) | Method for receiving data over an SDIO interface and device using the same | |
CN113157465A (en) | Message sending method and device based on pointer linked list | |
CN116233036B (en) | DMA transmission control method and device | |
CN111767154B (en) | Method for realizing non-lock ring queue for non-blocking communication | |
CN111245794B (en) | Data transmission method and device | |
CN108234352B (en) | Electronic control unit and data transmission method | |
US20030093594A1 (en) | Apparatus and method for controlling block signal flow in a multi digital signal processor configuration from a shared peripheral direct memory controller to high level data link controller | |
CN118132474A (en) | DMA-based data transmission system | |
CN111124987B (en) | PCIE-based data transmission control system and method | |
CN113268358A (en) | Data communication method, device and system and multi-equipment cascade system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |