Communication method and device
By determining the communication method and memory management method based on application ID in the avionics system, generating a target configuration table, and unifying the abstraction of the transmission methods of multiple aviation buses into a point-to-point communication mode, the complexity of the communication interface and the coupling of software and hardware in the avionics system are solved, and the simplification of software development and the flexibility of system reconstruction are achieved.
Patent Information
- Application Number
- CN202211206136.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-09-30
AI Technical Summary
The diverse types of communication interfaces in avionics systems increase the complexity of software development, strengthen the coupling between software and hardware, and lack flexible communication link configuration methods, which affects software migration and reconstruction.
A communication method is provided. By determining the communication mode and memory management mode based on the application ID, a target configuration table is generated, and corresponding communication operations are performed through a preset interface, so as to unify and abstract the transmission modes of multiple aviation buses into a point-to-point communication mode.
It reduces the complexity of software development, achieves the decoupling of software and hardware, improves the convenience of software migration and the flexibility of system reconstruction, and simplifies the configuration of complex network structures.
Smart Images

Figure CN115604102B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a communication method and device. Background Art
[0002] As the complexity of avionics systems continues to increase and the complexity of airborne network topologies continues to increase, the requirements for bandwidth, latency, jitter, determinism and stability in the communication transmission process are constantly increasing.
[0003] In the process of avionics software development, a variety of different types of communication interfaces and different types of interface parameters are needed to meet different application scenarios. This also leads to the need to use multiple types of interfaces and pass multiple configuration parameters in the software development process, which increases the complexity of software development and the coupling of software and hardware. Summary of the Invention
[0004] In order to solve the problem in related technologies that software development requires the use of multiple types of interfaces and the transmission of multiple configuration parameters, which increases the complexity of software development and the coupling between software and hardware, the present invention provides a communication method and device. The technical solution is as follows:
[0005] In a first aspect, a communication method is provided, the method comprising:
[0006] Determine the communication method based on the application ID;
[0007] Determine a memory management mode, which is a buffer-one-to-one correspondence mode or a buffer-random correspondence mode;
[0008] Generate a target configuration table based on a pre-established configuration table model, the target configuration table including various parameters in a communication mode and a memory management mode based on an application ID;
[0009] Through the preset interface, corresponding communication operations are performed on the target configuration table. The preset interface includes: channel creation interface, data sending interface, data receiving interface, data sending completion detection interface, buffer release interface and channel cancellation interface.
[0010] Optionally, the communication mode based on the application ID is reflected through a configuration file based on a graphical interface, where the configuration file includes the application, the communication nodes in the application, and the communication parameters of the links between the communication nodes.
[0011] Optionally, the configuration file includes the relationship and quantity between groups in the entire network system, the relationship and quantity between nodes, and the transmission parameters of the link. Two communicating nodes correspond to one link, and each group, node, and link has a unique identifier, where the group is used to indicate the application and the node is used to indicate the communication node in each application.
[0012] Optionally, operations performed through the channel creation interface include: buffer initialization, remote buffer information exchange, configuration table initialization, driver type attachment, and communication link initialization;
[0013] The operations performed through the data sending interface include: sending operations, inter-process / inter-thread communication sending operations, interface timeout judgment and link status management;
[0014] The operations performed through the data receiving interface include: RDMA polling CQ operation, RDMA interrupt obtaining CQ operation, receiving timeout judgment, receiving operation, process / thread communication receiving operation and link status management;
[0015] The operations performed through the data sending completion detection interface include: polling to determine the completion of sending CQ;
[0016] The operations performed through the buffer release interface include: remote receive buffer address release;
[0017] Operations performed through the channel revocation interface include buffer release and communication link destruction.
[0018] Optionally, when the sending and receiving operations need to be performed in sequence, a one-to-one correspondence method of the buffers is adopted;
[0019] When multiple data processing units at both ends of the transmitter and receiver run concurrently, randomly, or without sequence requirements, a random correspondence method of the transmitter and receiver buffers is adopted.
[0020] Optionally, when a one-to-one correspondence between buffers is used, the interaction process between the sender and the receiver is as follows:
[0021] The sending end sends the service data of the sending buffer indicated by the buffer index value of the local end to the receiving buffer indicated by the buffer index value identical to the buffer index value of the receiving end according to the buffer index value specified by the application;
[0022] The receiving end takes data from the receiving buffer indicated by the buffer index value specified by the application; if the data in the receiving buffer is valid, the process ends; if there is no data in the receiving buffer, the data valid mark will be set for other receiving buffers that have received the same data, and then an error prompt message will be returned.
[0023] Optionally, the sending and receiving operations of the sender and the receiver have a random concurrent feature. When the buffer random correspondence method is adopted, the interaction process between the sender and the receiver is as follows:
[0024] The sending end obtains the target receiving buffer identifier from the idle receiving buffer maintenance table and sends the data to be sent to the target receiving buffer indicated by the target receiving buffer identifier;
[0025] When the target receive buffer is not released, the sender continues to obtain other receive buffer identifiers from the idle receive buffer maintenance table and sends the data to be sent to the receive buffer indicated by the other receive buffer identifiers;
[0026] When the data in the target receive buffer is processed, the sender adds the target receive buffer identifier to the idle receive buffer maintenance table, and the sender re-obtains the receive buffer identifier from the idle receive buffer maintenance table and performs a data sending operation.
[0027] Optionally, generating a target configuration table based on a pre-established configuration table model specifically includes:
[0028] A configuration table model is established for various aviation buses. The configuration table model is used to reflect the composition relationship of the entire network system, including: the number and identification of groups, the number and name of nodes, the node name of each link, the transmission mode of each link, and the configuration parameters of each link;
[0029] Create and configure the communication network topology based on the configuration table model. After configuring the communication network topology, generate the target configuration table with one click.
[0030] Check the correctness of the target configuration table. The test content includes: the memory usage required by the target configuration table and the error information in the target configuration table.
[0031] Optionally, the preset interface further includes: a log initialization interface, a buffer initialization interface, a log file initialization interface, a log recording interface, a log file writing interface, a log stop interface, a file writing interface, and a log buffer destruction interface. The method further includes: collecting and recording a communication log for the execution process of the communication operation:
[0032] Enable the logging function through the preset log flag and call the channel creation interface to perform initialization operations;
[0033] The log initialization interface calls the buffer initialization interface and the log file initialization interface to create a log buffer and log file respectively. When the same process calls the log initialization interface multiple times, no new log buffer and log file are created, and the existing log buffer and log file are used instead.
[0034] Call the channel creation interface, data sending interface, data receiving interface, data sending completion detection interface, buffer release interface and channel cancellation interface, and call the log recording interface at the same time to record the log content into the log buffer using protobuf encoding;
[0035] The log buffer write file task monitors the buffer status. When the log buffer records a preset number of logs, the log file write interface is called to write the log data in the log buffer to the log file.
[0036] When calling the channel cancellation interface, if the log flag is set to enable the log function and the log function has been initialized, and no other links in the current process are still using the log function, call the log stop interface;
[0037] The file writing interface is called through the log stop interface to write all the data in the log buffer that has not been written to the log file to the log file, and the log buffer destruction interface is called to release the log buffer.
[0038] According to a second aspect, a communication device is provided, the device comprising:
[0039] Identify modules for:
[0040] Determine the communication method based on the application ID;
[0041] Determine a memory management mode, which is a buffer-one-to-one correspondence mode or a buffer-random correspondence mode;
[0042] Communication middleware for:
[0043] Generate a target configuration table based on a pre-established configuration table model, the target configuration table including various parameters in a communication mode and a memory management mode based on an application ID;
[0044] Through the preset interface, corresponding communication operations are performed on the target configuration table. The preset interface includes: channel creation interface, data sending interface, data receiving interface, data sending completion detection interface, buffer release interface and channel cancellation interface.
[0045] According to a third aspect, a communication device is provided, comprising a processor and a memory, wherein the processor is configured to execute instructions stored in the memory, and the processor implements any communication method according to the first aspect by executing the instructions.
[0046] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a processing component of a computer, the processing component executes any communication method described in the first aspect.
[0047] In a fifth aspect, a computer program product comprising instructions is provided, which, when run on a computer, enables the computer to execute any communication method described in the first aspect.
[0048] The communication method and device provided by the present invention abstracts the transmission modes of aviation buses such as RDMA, TCP, UDP, FC, and AFDX into a point-to-point communication transmission mode, calls a preset interface, and greatly reduces the complexity of development. At the same time, due to the uniformity of the application interface, when the application software replaces the actual link of the interface, there is no need to modify the code; the communication method based on the application ID allows the application software to only focus on which two applications the data is transferred between during the development process, without having to focus on which two hardware modules the data is transferred between, which increases the convenience of software migration, realizes software reconfiguration, and increases the decoupling capability of software and hardware; uses a reasonable memory management method according to different airborne application scenarios to facilitate the effective management of the buffer memory resources used by the link; through the communication parameter configuration, configuration table generation and analysis process, it greatly simplifies the increasingly complex network structure configuration of future airborne vehicles and provides users with a user-friendly operation interface. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A flow chart of a communication method provided in an embodiment of the present application;
[0050] Figure 2 A software architecture diagram of the communication middleware provided in an embodiment of the present application;
[0051] Figure 3 A schematic diagram of the preset interface operation provided in an embodiment of the present application;
[0052] Figure 4 A schematic diagram of a configuration file provided in an embodiment of the present application;
[0053] Figure 5 A schematic diagram of a one-to-one correspondence between buffer zones provided in an embodiment of the present application;
[0054] Figure 6 A schematic diagram of interaction between a transmitting end and a receiving end provided in an embodiment of the present application;
[0055] Figure 7 A schematic diagram of a random buffer mapping method provided in an embodiment of the present application;
[0056] Figure 8 Another schematic diagram of interaction between a sending end and a receiving end provided in an embodiment of the present application;
[0057] Figure 9 A schematic diagram of another interaction between a sending end and a receiving end provided in an embodiment of the present application;
[0058] Figure 10 A schematic diagram of another interaction between a sending end and a receiving end provided in an embodiment of the present application;
[0059] Figure 11A schematic diagram of a target configuration table graphical interface provided in an embodiment of the present application;
[0060] Figure 12 Schematic diagram of the link parameter modification interface provided in the embodiment of the present application;
[0061] Figure 13 A schematic diagram showing memory usage provided in an embodiment of the present application;
[0062] Figure 14 Schematic diagram of the error message prompt interface in the target configuration table provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The present application is further described in detail below through specific implementation methods and drawings.
[0064] In related technologies, in the process of avionics software development, a variety of different types of communication interfaces and different types of interface parameters are needed to meet different application scenarios, resulting in the need to use multiple types of interfaces and transmit multiple configuration parameters during the software development process, increasing the complexity of software development and the coupling of software and hardware.
[0065] Specifically:
[0066] 1. There are many types of communication interfaces. Developers need to be familiar with the software development processes of various communication methods. Different communication methods usually have very different software development methods. Modifying or replacing communication links will involve a large number of code changes.
[0067] 2. The communication process requires attention to the specific hardware locations of the interfaces on both sides. When a hardware module fails and the application needs to be refactored to another module, the application software needs to make corresponding code modifications, and there is no hardware and software decoupling capability.
[0068] 3. Insufficient control over memory usage during communication. When multiple processes access communication resources, improper memory usage often leads to resource waste. This is especially true in high-bandwidth networks, where each link typically occupies a significant amount of memory. This waste of memory due to improper usage should be avoided as much as possible.
[0069] 4. There is a lack of dynamic configuration methods for communication links. Link configuration usually adopts static configuration, which is not conducive to software migration.
[0070] To address the above issues, the present invention provides a communication method and device that supports multiple aviation high-speed networks. Figure 1 , a communication method provided by the present invention includes the following steps:
[0071] Step 110: Determine a communication method based on the application ID.
[0072] The communication mode based on the application ID is determined based on the communication mode, link parameters, and link attributes required for each application process or application task. In the present invention, the communication mode based on the application ID can be reflected through a configuration file based on a graphical interface, which includes the communication parameters of the application, the communication nodes in the application, and the links between the communication nodes.
[0073] Step 120: Determine a memory management method to effectively manage buffer memory resources used by the link.
[0074] The memory management method is a one-to-one correspondence method for buffers or a random correspondence method for buffers.
[0075] Determine the corresponding memory management method according to the airborne application scenario, and select an effective memory management method for different airborne application scenarios.
[0076] Step 130: Generate a target configuration table based on a pre-established configuration table model. The target configuration table includes communication mode information and various parameters in the memory management mode.
[0077] Step 140: Perform corresponding communication operations on the target configuration table through the preset interface. The preset interface includes: channel creation interface, data transmission interface, data reception interface, data transmission completion detection interface, buffer release interface, and channel cancellation interface. The communication operations include initialization, transmission, reception, transmission completion detection, buffer release, and destruction.
[0078] The present invention abstracts the transmission modes of various aviation buses and provides a unified transmission interface, which is conducive to application and algorithm developers to conveniently use various interfaces, reduce development difficulty, and decouple software and hardware.
[0079] The communication device (also known as communication middleware) provided by the present invention is located between the application software and the underlying communication link driver interface, and includes six core functions: a communication path creation function XCreate(), a message sending function XSend(), a non-blocking sending completion function XIsSend(), a message receiving function XRecv(), a transmission path destruction function XDestory(), and a remote buffer release function XBufRelease().
[0080] Figure 2 The software architecture diagram of the communication middleware of the communication device of the present invention. Corresponding to the six core functions mentioned above, the six standardized interfaces of the present invention include: channel creation interface, data transmission interface, data reception interface, data transmission completion detection interface, buffer release interface and channel cancellation interface.
[0081] like Figure 3As shown, the channel creation interface is used for: buffer initialization, remote buffer information exchange, configuration table initialization, driver type attachment, communication link initialization, etc.
[0082] The data sending interface is used for: sending operations, inter-process / inter-thread communication sending operations, interface timeout judgment, link status management, etc.; sending operations include RDMA (RC / UC / UD), TCP, UDP, FC, AFDX, CAN, ARINC429, 1553, 1394, tte, rapidIO and other aviation buses sending operations;
[0083] The data receiving interface is used for: RDMA polling CQ operation, RDMA interrupt acquisition CQ operation, receiving timeout judgment, receiving operation, process / thread communication receiving operation, link status management, etc.; receiving operations include: receiving operations including TCP, UDP, FC, AFDX, CAN, ARINC429, 1553, 1394, tte, rapidIO and other aviation bus sending operations;
[0084] The data sending completion detection interface is used to: poll and determine the completion of sending CQ, etc.
[0085] The buffer release interface is used to release the address of the remote receiving buffer, etc.
[0086] The channel cancellation interface is used for: buffer release, communication link destruction, etc.
[0087] Furthermore, the communication device of the present invention may also be provided with an extended function interface and a collective group interface.
[0088] Among them, the extended function interface is used for: time processing; big-endian and small-endian processing;
[0089] The Collective Group interface is used for: Scatter function, Gather function, Barrier function, and Reduce function.
[0090] The present invention abstracts aviation bus transmission modes such as RDMA, TCP, UDP, FC, and AFDX into point-to-point communication transmission modes. During initialization, different transmission modes can be selected for communication by setting initialization parameters or configuring a configuration table during initialization. The present invention unifies different types of communication modes into the aforementioned communication interface, allowing developers to focus more on developing upper-layer application algorithms without having to worry about how to use the various underlying transmission modes. This reduces development difficulty and achieves decoupling of software and hardware.
[0091] If a new transmission method needs to be added, the driver can be abstracted into an end-to-end transmission mode and encapsulated into the above core interface, so that data transmission can be carried out without modifying the upper-level application.
[0092] All communication API interfaces are called in the form of dynamic link libraries, which are convenient for overloading. The driver library can be updated by simply rewriting the dynamic link library. When creating a link, the required transmission method can be selected to implement the new transmission method.
[0093] The present invention changes the communication routing based on hardware interface to the communication routing based on application ID. That is to say, software and algorithm developers do not need to pay attention to which hardware node the communicating parties are running on, but only need to pay attention to which application process the communicating parties are running on. This realizes the decoupling of communication interface hardware and software, facilitates application transplantation, and supports system reconstruction.
[0094] In order to realize the communication mode based on application ID, the present invention provides a configuration file based on a graphical interface, which contains the communication parameters of groups, nodes and links, specifically the relationship and quantity between each group in the entire network system, the relationship and quantity between nodes, the transmission parameter configuration of the link and other information. Two communicating nodes correspond to one link, and each group, node and link has a unique identifier. Among them, the group is used to indicate the application, and the node is used to indicate the communication node in each application (there may be multiple communication nodes in each application). For example, please refer to Figure 4 This configuration file uses nodes as parent-child nodes to illustrate the relationship. It should be noted that the relationship between nodes can be edited arbitrarily in actual use. Figure 4 The configuration file shown contains three attributes: group, node, and link.
[0095] When each end (i.e., CPU) system is created, the group ID, node name, and number of nodes to which it belongs are entered for initialization link creation. The relationships and properties between each link are determined by the link attributes in the configuration file.
[0096] The correspondence between the upper-layer application ID or process ID and the nodes and groups in the configuration file is determined by the user.
[0097] by Figure 4For example, if a user has four applications, they can correspond to Group 1, Group 2, Group 3, and Group 4 in the configuration file. Each user application has multiple message links that need to communicate. For example, Group 1 needs to communicate with Group 2 through UDP and with Group 3 through TCP. In this case, two nodes, Node 1 and Node 2, can be established in Group 1 to communicate with Node 3 and Node 4, respectively, thus forming two links, Link 1 and Link 2. For another example, if Group 4 has a message that needs to be multicast, Node 7 can multicast it to Node 5 and Node 6 in Group 3.
[0098] All content described in the configuration file can be determined each time the system is built.
[0099] When a device in the entire system fails, a new set of backup devices can be used directly. If the backup device and the failed device have the same configuration, the user can choose to load the same configuration file. It only needs to retrieve the link configuration attributes corresponding to the application ID in the configuration file, load the same application program for initialization, and follow the same sending and receiving operation process to achieve the fastest possible software migration.
[0100] When the system is built, the algorithm developers of the upper-level application software only need to focus on which process the communicating parties are running on rather than the specific hardware physical nodes, thereby achieving decoupling of communication interface software and hardware and simplifying application porting.
[0101] Each time a reconstruction is performed, if there is a change in the physical communication link, you only need to modify the configuration file again and reload it during initialization.
[0102] The present invention provides reasonable memory management methods for different airborne application scenarios. For example, a one-to-one buffer mapping method meets the requirement for sequential execution of transmit and receive operations and is applicable to scenarios such as data streaming, signal processing, and radar acquisition where data order must be guaranteed. A random mapping method for transmit and receive buffers can meet application models such as RDMA-based data storage, where multiple data processing units on both ends require concurrent, random, or unordered operation. During initialization, the communication device selects one of these memory management methods based on user requirements.
[0103] 1) Buffer one-to-one correspondence method
[0104] The buffer one-to-one correspondence method means that the buffers have a one-to-one correspondence relationship. Figure 5 As shown in the figure, the interaction process between the sender and the receiver is as follows:
[0105] The sending end A sends the service data of the sending buffer indicated by the buffer index value buffer_index of the local end (i.e., the sending end A) to the receiving buffer indicated by the buffer index value buffer_index of the receiving end B according to the buffer index value buffer_index specified by the application;
[0106] Receiver B retrieves data from the receive buffer indicated by the buffer index value buffer_index specified by the application. If the data in the receive buffer is valid, the process returns TRUE and ends. If there is no data in the receive buffer, the process marks the data valid for other receive buffers that have received the same data and returns FALSE.
[0107] The one-to-one correspondence mode of the buffers provided by the present invention can meet the application model requirements that the sending and receiving operations are performed in sequence and the receiving end needs to specify the location of the processing data.
[0108] For example, the execution process of the application at the sending end and the receiving end is determined, that is, the sending end and the receiving end perform the sending and receiving operations in sequence, and the application at the receiving end specifies the location of the received data when performing the receiving operation. When a one-to-one correspondence method of the buffer is used, for example, Figure 6 As shown in the figure, since the sender and the receiver have agreed on the corresponding relationship of the buffers in advance, the sender only needs to send the data in the send buffer 0 to the receive buffer 0 of the receiver according to the buffer identifier 0; the sender continues to send the data in the send buffer 1 to the receive buffer 1 of the receiver; the sender continues to send the data in the send buffer n to the receive buffer n of the receiver; until the sender and the receiver have finally used up the buffers, the application completes a buffer synchronization process, and the sender repeats the above process.
[0109] 2) Buffer random correspondence method
[0110] When using the random buffer correspondence method, the number of sending and receiving buffers at both ends can be unequal, that is, the number of sending buffers at the sending end and the number of receiving buffers at the receiving end can be unequal. Figure 7 As shown in the figure, the interaction process between the sender and the receiver is as follows:
[0111] The sending end determines the sending buffer according to the buffer index value buffer_index specified by the application, and takes out a buffer index value buffer_index from the idle receiving buffer record table of the receiving end recorded in the current path as the buffer index value of the receiving buffer for this sending operation, and then sends the data to the receiving buffer indicated by the buffer index value of the receiving end.
[0112] The application obtains the buffer index value buffer_index of the idle receive buffer on the receiving end, calls the remote buffer release function XBufRelease(), and adds the buffer index value buffer_index of the idle receive buffer to the idle receive buffer record table of the receiving end of the current path record. When to call the remote buffer release function XBufRelease() is determined by the application.
[0113] The receiving end performs a receive operation, assigns the buffer index value buffer_index of the valid data to *pBuffer_index, and notifies the application where to get the data and process it.
[0114] The random buffer correspondence method provided by the present invention can meet the application model requirements of having multiple data processing units running concurrently or randomly at both the sending and receiving ends.
[0115] For example, the sending and receiving operations on both ends have the characteristics of random concurrency, that is, the sending process of the sending end and the receiving process of the receiving end are executed randomly concurrently. The random correspondence of the sending and receiving buffers can meet the application requirements. For example, see Figure 8 、 Figure 9 and Figure 10 , the interaction process between the sender and the receiver is as follows:
[0116] (1) The sending end obtains the target receiving buffer identifier from the free receiving buffer maintenance table, performs the current sending operation based on the target receiving buffer identifier, and sends the data to be sent to the target receiving buffer indicated by the target receiving buffer identifier;
[0117] like Figure 8 As shown, the sending end consists of two threads sendThread1 and sendThread2, which obtain the receiving buffer identifiers 1 and 4 from the free receiving buffer maintenance table; the sending end sends the data in the sending buffer 0 (specified by the application) and the sending buffer 2 (specified by the application) to the receiving end's receiving buffer 1 and receiving buffer 4 respectively by sendThread1 and sendThread2.
[0118] (2) When the target receive buffer is not released, the sender continues to obtain other receive buffer identifiers from the idle receive buffer maintenance table and sends the data to be sent to the receive buffer indicated by the other receive buffer identifier.
[0119] like Figure 9As shown in the figure, the receiving process randomly processes the data in receive buffer 1 and receive buffer 4, so receive buffer 1 and receive buffer 4 have not yet been released. At this time, the sending thread, sendThread1 and sendThread2, continue to obtain receive buffer identifiers 0 and 2 from the free receive buffer maintenance table; sendThread1 and sendThread2 send the data in send buffer 1 (specified by the application) and send buffer 2 (specified by the application) to receive buffer 0 and receive buffer 2 on the receiving end, respectively.
[0120] (3) When the data in the target receive buffer is processed, the sender adds the target receive buffer identifier to the free receive buffer maintenance table, and the sender re-obtains the receive buffer identifier from the free receive buffer maintenance table and performs the data sending operation.
[0121] After the buffer synchronization is completed between applications, the application at the sending end calls the remote buffer release function XBufRelease() to add the receive buffer identifier of the idle receive buffer at the receiving end to the space receive buffer maintenance table to prepare for subsequent sending operations.
[0122] like Figure 10 As shown in the figure, the receiving end has processed the data in receive buffer 1 and receive buffer 4, and the application sends a notification that the buffer is used up to the sending end; after the sending end receives the notification, the application calls the remote buffer release function XBufRelease() to add the receive buffer identifiers 1 and 4 of receive buffer 1 and receive buffer 4 to the free receive buffer maintenance table; the sending end has two threads sendThread1 and sendThread2, which respectively obtain receive buffer identifiers 3 and 4 from the free receive buffer maintenance table; the sending end has two threads sendThread1 and sendThread2, which send the data in send buffer 0 (specified by the application) and send buffer 1 (specified by the application) to receive buffer 3 and receive buffer 4 of the receiving end.
[0123] The present invention provides a communication parameter configuration, generation, and analysis method based on a configuration table: first, a unified configuration table model is abstracted for various aviation buses; then, using a graphical tool, a target configuration table is generated based on the configuration table model and the communication topology; and finally, the correctness of the target configuration table is analyzed. Specifically, the following steps are included:
[0124] 1. Establish a configuration table model
[0125] A unified configuration table model is abstracted for various aviation buses (such as RDMA, TCP, UDP, FC, AFDX, CAN, ARINC429, 1553, 1394, tte, rapidIO, etc.). This configuration table model is used to reflect the composition relationship of the entire network system, including: the number of groups, group identification, the number of nodes, the name of the node, the node name of each link, the transmission mode of each link, and the configuration parameters of each link.
[0126] For the process of establishing the configuration table model, please refer to the relevant technology and will not be repeated here.
[0127] 2. Generate target configuration table based on configuration table model
[0128] The configuration table model is configured in the graphical interface tool. The user creates and configures the communication network topology based on the configuration table model on the operation interface of the graphical interface tool. After configuring the communication network topology, the target configuration table is generated with one click. The target configuration table includes communication mode information and various parameters in the memory management mode.
[0129] For example, the graphical interface diagram may be as follows: Figure 11 As shown, click each node or link to view and modify its parameters. Figure 12This is a diagram of the parameter modification interface for a link, where the parameter IsPolling is used to indicate whether the link is receiving through query mode and interrupt mode; the parameter AbortOhnFailure is used to indicate whether the link abandons the process and returns an exception after an error occurs; the parameter Verbosity is used to indicate the link tag bit description, which can be used to control the debug print switch, log record switch, etc.; the parameter PathCreateTimeout is used to indicate the timeout period of the link creation interface; the parameter SendStartTimeout is used to indicate the timeout period of the sending interface starting to send; the parameter SendFinishTimeout is used to indicate the timeout period of the sending interface ending to send; the parameter Recv StartTimeout is used to indicate the timeout period of the receiving interface starting to receive; the parameter Recv FinishTimeout is used to indicate the timeout period for the receiving interface to complete reception; the parameter PathDestroyTimeout is used to indicate the timeout period for the link destruction interface; the parameter NbufsAtoB is used to indicate the number of send buffers sent by end A to end B, and the number of receive buffers sent by end A to end B; the parameter NbufsBtoA is used to indicate the number of receive buffers sent by end B to end A, and the number of send buffers sent by end B to end A; the parameter SenderMaxBytesList is used to indicate the maximum length of the send buffer; the parameter RecverMaxBytesList is used to indicate the maximum length of the receive buffer; the parameter SenderAddrList is used to indicate the initial value of the send buffer pointer; the parameter RecvrAddrList is used to indicate the initial value of the send buffer pointer.
[0130] The target configuration table is sent to the logging module via Ethernet. Therefore, in order to facilitate configuration and friendly parsing with the lower computer, the target configuration table uses the ProtoBuf encapsulation data format and is serialized and deserialized directly through the calling interface.
[0131] 3. Analyze the correctness of the target configuration table
[0132] Analyzing the correctness of the target configuration table specifically includes the following steps:
[0133] 31. Analyze the memory usage required by the target configuration table;
[0134] The memory usage in the target configuration table can be analyzed and displayed in a visual way. For example, Figure 13 As shown in Figure 2, the analysis mainly includes the memory usage of each communication channel.
[0135] 32. Detect error information in the target configuration table and provide prompts for error information;
[0136] Detect the correctness of the content and format of the data in the target configuration table, and prompt the error information and the location where it appears in the target configuration table. For example, the prompt interface can be as follows: Figure 14 shown.
[0137] Furthermore, the present invention can also record the communication logs collected during the communication process through a log recording module. In order to perform log recording, the present invention also provides a log initialization interface, a buffer initialization interface, a log file initialization interface, a log recording interface, a log file writing interface, a log stop interface, a file writing interface, and a log buffer destruction interface. The specific flow of log recording is as follows:
[0138] 1) Enable the logging function through the preset logging flag and call the channel creation interface to perform initialization operations.
[0139] 2) Call the buffer initialization interface and log file initialization interface through the log initialization interface to create a log buffer and log file. When the same process calls the log initialization interface multiple times, no new log buffer and log file are created, and the existing log buffer and log file are used.
[0140] 3) Call the preset interfaces (xCreate, xSend, xRecv, xIsSent, xBufRelease, xDestroy), and call the logging interface at the same time to record the log content into the log buffer using protobuf encoding.
[0141] 4) The task of writing files in the log buffer monitors the buffer status. When the number of logs recorded in the log buffer reaches a certain number, the log file writing interface is called to write the log data in the log buffer into the log file.
[0142] 5) When calling the channel cancellation interface, if the log flag is to enable the log function and the log function has been initialized, and no other links in the current process are still using the log function, call the log stop interface.
[0143] 6) The log stop interface calls the file write interface to write all the data in the log buffer that has not been written into the log file into the log file, and calls the log buffer destruction interface to release the log buffer.
[0144] The present invention also provides a communication device, comprising:
[0145] Identify modules for:
[0146] Determine the communication method based on the application ID;
[0147] Determine a memory management mode, which is a buffer-one-to-one correspondence mode or a buffer-random correspondence mode;
[0148] Communication middleware for:
[0149] Generate a target configuration table based on a pre-established configuration table model, the target configuration table including various parameters in a communication mode and a memory management mode based on an application ID;
[0150] Through the preset interface, corresponding communication operations are performed on the target configuration table. The preset interface includes: channel creation interface, data sending interface, data receiving interface, data sending completion detection interface, buffer release interface and channel cancellation interface.
[0151] The specific execution process of the determination module and the communication middleware can refer to the corresponding process described in the above communication method, and will not be repeated here.
[0152] The communication method and device provided by the present invention have the following advantages:
[0153] 1) Aviation bus transmission methods such as RDMA, TCP, UDP, FC, and AFDX are abstracted into point-to-point communication transmission modes and unified into six interfaces. Application software development only needs to call these six interfaces, greatly reducing development complexity. Furthermore, due to the unified application interface, when the application software replaces the actual link of the interface, it does not need to modify the code, but only needs to modify the configuration parameters in the configuration file.
[0154] 2) The proposed application ID-based communication method allows application software development to focus only on the two applications between which data is transferred, rather than the two hardware modules between which it is transferred. When an application is migrated to another module, no code modification is required. This facilitates software migration, enables software reconfiguration, and enhances the decoupling of software and hardware.
[0155] 3) Buffer memory resources used by the link are managed through a one-to-one buffer mapping approach and a random buffer mapping approach. Different memory management approaches are used according to different airborne application scenarios. For example, a one-to-one buffer mapping approach is used for scenarios such as radar acquisition and signal processing, while a random buffer mapping approach is used for scenarios such as high-speed storage.
[0156] 4) Through the communication parameter configuration, configuration table generation, and analysis process, users can use a graphical interface to intuitively configure complex network topologies using simple wiring, while also supporting configuration table generation and correctness analysis. This process significantly simplifies the configuration of increasingly complex airborne network structures in the future.
[0157] The above merely describes the embodiments of the present application, which are described in a relatively specific and detailed manner, but should not be construed as limiting the scope of the invention. It should be noted that a person skilled in the art may make various modifications and improvements without departing from the concept of the present application, and these modifications and improvements are all within the scope of protection of the present application.
Claims
1. A communication method, characterized in that: The method comprises: Determine a communication mode based on an application ID; the communication mode based on the application ID is reflected through a configuration file based on a graphical interface, the configuration file including communication parameters of the application, the communication nodes in the application, and the links between the communication nodes; Determine a memory management method, which is a one-to-one buffer correspondence method or a random buffer correspondence method; determine the corresponding memory management method according to the airborne application scenario, and select an effective memory management method for different airborne application scenarios; Generate a target configuration table based on a pre-established configuration table model, the target configuration table including various parameters in a communication mode and a memory management mode based on an application ID; Through the preset interface, the corresponding communication operations are performed on the target configuration table. The preset interfaces include: channel creation interface, data sending interface, data receiving interface, data sending completion detection interface, buffer release interface and channel cancellation interface; the channel creation interface is used for buffer initialization, remote buffer information interaction, configuration table initialization, driver type attachment, and communication link initialization; the data sending interface is used for sending operations, process / thread communication sending operations, interface timeout judgment, and link status management. The sending operations include RDMA, TCP, UDP, FC, AFDX, CAN, ARINC429, 1553, 1394, tte, and rapidIO aviation bus sending operations; the data receiving interface is used for RDMA polling CQ operations, RDMA interrupt acquisition CQ operations, receive timeout judgment, receive operations, process / thread communication receiving operations, and link status management; the data sending completion detection interface is used to poll and judge the completion of sending CQ; the buffer release interface is used to release the remote receiving buffer address; the channel cancellation interface is used to release the buffer and destroy the communication link; The configuration file contains the relationship and quantity between groups in the entire network system, the relationship and quantity between nodes, and the transmission parameters of the link. Two communicating nodes correspond to one link. Each group, node, and link has a unique identifier. The group is used to indicate the application, and the node is used to indicate the communication node in each application. Generating a target configuration table based on a pre-established configuration table model specifically includes: A configuration table model is established for various aviation buses. The configuration table model is used to reflect the composition relationship of the entire network system, including: the number and identification of groups, the number and name of nodes, the node name of each link, the transmission mode of each link, and the configuration parameters of each link; Create and configure the communication network topology based on the configuration table model. After configuring the communication network topology, generate the target configuration table with one click. Check the correctness of the target configuration table. The test content includes: the memory usage required by the target configuration table and the error information in the target configuration table.
2. The method according to claim 1, characterized in that When the sending and receiving operations need to be performed in sequence, a one-to-one buffer correspondence method is used; When multiple data processing units at both ends of the transmitter and receiver run concurrently, randomly, or without sequence requirements, a random correspondence method of the transmitter and receiver buffers is adopted.
3. The method according to claim 1, characterized in that When using a one-to-one buffer correspondence method, the interaction process between the sender and the receiver is as follows: The sending end sends the service data of the sending buffer indicated by the buffer index value of the local end to the receiving buffer indicated by the buffer index value identical to the buffer index value of the receiving end according to the buffer index value specified by the application; The receiving end takes data from the receiving buffer indicated by the buffer index value specified by the application; if the data in the receiving buffer is valid, the process ends; if there is no data in the receiving buffer, the data valid mark will be set for other receiving buffers that have received the same data, and then an error prompt message will be returned.
4. The method according to claim 1, wherein The sending and receiving operations of the sender and receiver are characterized by random concurrency. When the buffer random correspondence method is adopted, the interaction process between the sender and receiver is as follows: The sending end obtains the target receiving buffer identifier from the idle receiving buffer maintenance table and sends the data to be sent to the target receiving buffer indicated by the target receiving buffer identifier; When the target receive buffer is not released, the sender continues to obtain other receive buffer identifiers from the idle receive buffer maintenance table and sends the data to be sent to the receive buffer indicated by the other receive buffer identifiers; When the data in the target receive buffer is processed, the sender adds the target receive buffer identifier to the idle receive buffer maintenance table, and the sender re-obtains the receive buffer identifier from the idle receive buffer maintenance table and performs a data sending operation.
5. The method according to claim 1, characterized in that The preset interface also includes: a log initialization interface, a buffer initialization interface, a log file initialization interface, a log recording interface, a log file writing interface, a log stop interface, a file writing interface, and a log buffer destruction interface. The method also includes: collecting and recording communication logs for the execution process of the communication operation: Enable the logging function through the preset log flag and call the channel creation interface to perform initialization operations; The log initialization interface calls the buffer initialization interface and the log file initialization interface to create a log buffer and log file respectively. When the same process calls the log initialization interface multiple times, no new log buffer and log file are created, and the existing log buffer and log file are used instead. Call the channel creation interface, data sending interface, data receiving interface, data sending completion detection interface, buffer release interface and channel cancellation interface, and call the log recording interface at the same time to record the log content into the log buffer using protobuf encoding; The log buffer write file task monitors the buffer status. When the log buffer records a preset number of logs, the log file write interface is called to write the log data in the log buffer to the log file. When calling the channel cancellation interface, if the log flag is set to enable the log function and the log function has been initialized, and no other links in the current process are still using the log function, call the log stop interface; The file writing interface is called through the log stop interface to write all the data in the log buffer that has not been written to the log file to the log file, and the log buffer destruction interface is called to release the log buffer.
6. A communication device, characterized in that: The device comprises: Identify modules for: Determine a communication mode based on an application ID; the communication mode based on the application ID is reflected through a configuration file based on a graphical interface, the configuration file including communication parameters of the application, the communication nodes in the application, and the links between the communication nodes; Determine a memory management method, which is a one-to-one buffer correspondence method or a random buffer correspondence method; determine the corresponding memory management method according to the airborne application scenario, and select an effective memory management method for different airborne application scenarios; Communication middleware for: Generate a target configuration table based on a pre-established configuration table model, the target configuration table including various parameters in a communication mode and a memory management mode based on an application ID; Through the preset interface, the corresponding communication operations are performed on the target configuration table. The preset interfaces include: channel creation interface, data sending interface, data receiving interface, data sending completion detection interface, buffer release interface and channel cancellation interface; the channel creation interface is used for buffer initialization, remote buffer information interaction, configuration table initialization, driver type attachment, and communication link initialization; the data sending interface is used for sending operations, process / thread communication sending operations, interface timeout judgment, and link status management. The sending operations include RDMA, TCP, UDP, FC, AFDX, CAN, ARINC429, 1553, 1394, tte, and rapidIO aviation bus sending operations; the data receiving interface is used for RDMA polling CQ operations, RDMA interrupt acquisition CQ operations, receive timeout judgment, receive operations, process / thread communication receiving operations, and link status management; the data sending completion detection interface is used to poll and judge the completion of sending CQ; the buffer release interface is used to release the remote receiving buffer address; the channel cancellation interface is used to release the buffer and destroy the communication link.
Citation Information
Patent Citations
Method of data decoupling interactive structure based on communication middleware
CN107959709A
Universal processing system for multi-bus data conversion of avionics system
CN112068808A