Data transmission method and related device
By using a serial peripheral interface and Ethernet connection in the 1553B module to replace the PCIe interface, cross-operating system compatibility and flexible expansion are achieved. This solves the problem of poor data transmission compatibility of the 1553B module between different operating systems and improves the maintainability and data transmission efficiency of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-03-27
AI Technical Summary
The existing 1553B module uses a PCIe interface, which results in poor data transmission compatibility between different operating systems, makes it impossible to hot-swap, limits expansion, and has low fault detection efficiency.
The 1553B module responds to client requests, writes configuration registers using the serial peripheral interface, and transmits data via Ethernet connection, replacing the PCIe physical connection. It adopts standardized network protocols, combined with Ethernet remote call channels and priority scheduling strategies, and supports multi-module addressing and load balancing.
The 1553B module has improved compatibility across different operating systems, supports hot-swapping, enhanced scalability and fault detection efficiency, reduced dependence on the operating system, and improved the stability and efficiency of data transmission.
Smart Images

Figure CN121750684A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of data transmission, and in particular to a data transmission method and related apparatus. BACKGROUND
[0002] The 1553B module is a hardware interface module complying with the MIL-STD-1553B protocol, and is widely used in deterministic communication scenarios of strong real-time, high-reliability distributed systems due to its high reliability, strong real-time and high fault tolerance.
[0003] The current 1553B module adopts a peripheral component interconnect express (PCIE) interface. Since different operating systems have differences in kernel abstraction, driver framework and resource management rules of the PCIE interface, and the driver program needs to be deeply bound with the operating system kernel to realize functions such as configuration access and data transmission of the PCIE interface. Therefore, when the 1553B module interacts with different operating systems, the corresponding driver program needs to be developed for different operating systems, resulting in the current data transmission method having poor compatibility.
[0004] Therefore, there is an urgent need for a solution to solve the above technical problems. SUMMARY
[0005] In view of the above problems, embodiments of the present application provide a data transmission method and related apparatus, aiming to solve the above technical problems.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] In a first aspect, the embodiments of the present application provide a data transmission method, comprising:
[0008] The 1553B module writes first configuration information into a configuration register of a 1553B protocol controller based on a serial peripheral interface in response to request information sent by a client, and obtains a configured 1553B protocol controller; the 1553B module is connected with the client through an Ethernet.
[0009] The 1553B module reads data corresponding to the request information based on the configured 1553B protocol controller.
[0010] The 1553B module sends the data to the client based on a remote invocation channel of the Ethernet.
[0011] In a possible implementation, the 1553B module writes the first configuration information into a configuration register of the 1553B protocol controller based on a serial peripheral interface in response to the request information sent by the client, and the writing includes:
[0012] The 1553B module configures a 1553B protocol controller channel based on a serial peripheral interface in response to the request information sent by the client.
[0013] The first configuration information is written into a configuration register of the 1553B protocol controller based on the 1553B protocol controller channel.
[0014] In a possible implementation, the 1553B module reads data corresponding to the request information based on the configured 1553B protocol controller, and the reading includes:
[0015] The 1553B module sends a data message to a remote terminal based on the configured 1553B protocol controller.
[0016] The data corresponding to the request information is read in response to status information sent by the remote terminal.
[0017] In a possible implementation, the 1553B module sends the data to the client based on an Ethernet remote invocation channel, and the sending further includes:
[0018] When the Ethernet connection between the 1553B module and the client is interrupted, the Ethernet remote invocation channel between the 1553B module and the client is established in response to a reconnection request sent by the client.
[0019] The 1553B module sends untransmitted data to the client based on the Ethernet remote invocation channel.
[0020] In a possible implementation, the 1553B module writes the first configuration information into a configuration register of the 1553B protocol controller based on a serial peripheral interface in response to the request information sent by the client, and obtains a configured 1553B protocol controller, and the writing includes:
[0021] The 1553B module processes the first configuration information into a message format defined based on Msgpack according to a real-time scheduling strategy based on priority in response to the request information sent by the client, and obtains processed first configuration information.
[0022] The processed first configuration information is written into a configuration register of the 1553B protocol controller based on a serial peripheral interface, and the configured 1553B protocol controller is obtained.
[0023] In a possible implementation, the 1553B module writes first configuration information into a configuration register of the 1553B protocol controller based on a serial peripheral interface in response to request information sent by a client, and obtains a configured 1553B protocol controller, including:
[0024] The 1553B module receives the request information sent by the client, and matches first information identification in the request information with second information identification built in the 1553B module.
[0025] When the first information identification matches the second information identification, the first configuration information is written into the configuration register of the 1553B protocol controller based on the serial peripheral interface, and the configured 1553B protocol controller is obtained.
[0026] In a possible implementation, before the 1553B module writes the first configuration information into the configuration register of the 1553B protocol controller based on the serial peripheral interface in response to the request information sent by the client, and obtains the configured 1553B protocol controller, the method further includes:
[0027] Register a device node based on a Linux kernel SPI subsystem;
[0028] Load a network card driver and configure a static IP address;
[0029] Listen to the request information of the client based on a TCP protocol.
[0030] The second aspect: an embodiment of the present application provides a data transmission device, including:
[0031] A writing unit, a reading unit and a sending unit;
[0032] The writing unit is configured to write first configuration information into a configuration register of a 1553B protocol controller based on a serial peripheral interface in response to request information sent by a client, and obtain a configured 1553B protocol controller; the 1553B module is connected with the client through an Ethernet.
[0033] The reading unit is configured to read data corresponding to the request information based on the configured 1553B protocol controller.
[0034] The sending unit is configured to send the data to the client based on a remote invocation channel of the Ethernet.
[0035] In a possible implementation, the writing unit is specifically configured to:
[0036] The 1553B module writes the first configuration information into a configuration register of the 1553B protocol controller based on the 1553B protocol controller channel.
[0037] The 1553B module writes the first configuration information into a configuration register of the 1553B protocol controller based on the 1553B protocol controller channel.
[0038] In a possible implementation, the reading unit is specifically configured to:
[0039] The 1553B module sends a data message to the remote terminal based on the configured 1553B protocol controller.
[0040] The 1553B module reads data corresponding to the request information in response to state information sent by the remote terminal.
[0041] In a possible implementation, the apparatus further includes a reconnection unit.
[0042] The reconnection unit is specifically configured to:
[0043] When the Ethernet connection between the 1553B module and the client is interrupted, the reconnection unit establishes a remote invocation channel of the Ethernet between the 1553B module and the client in response to a reconnection request sent by the client, and the 1553B module sends untransmitted data to the client based on the remote invocation channel of the Ethernet.
[0044] In a possible implementation, the writing unit is specifically configured to:
[0045] The 1553B module processes the first configuration information into a message format defined based on Msgpack according to a real-time scheduling strategy based on priorities in response to request information sent by the client, and obtains processed first configuration information.
[0046] The 1553B module writes the processed first configuration information into a configuration register of the 1553B protocol controller based on a serial peripheral interface, and obtains a configured 1553B protocol controller.
[0047] In a possible implementation, the writing unit is specifically configured to:
[0048] The 1553B module receives request information sent by the client, and matches a first information identifier in the request information with a second information identifier built in the 1553B module.
[0049] When the first information identifier matches the second information identifier, the 1553B module writes the first configuration information into a configuration register of the 1553B protocol controller based on a serial peripheral interface, and obtains a configured 1553B protocol controller.
[0050] In a possible implementation, the apparatus further includes an initialization unit.
[0051] The initialization unit is specifically configured to register a device node based on a Linux kernel SPI subsystem, load a network card driver, configure a static IP address, and listen to request information of a client based on a TCP protocol.
[0052] A third aspect: a computer device, the computer device includes a processor and a memory;
[0053] The memory is configured to store program code and transmit the program code to the processor.
[0054] The processor is configured to execute steps of a data transmission method according to instructions in the program code.
[0055] A fourth aspect: an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement steps of a data transmission method.
[0056] A fifth aspect: an embodiment of the present application provides a computer program product, when the computer program product runs on a computer, the computer executes steps of a data transmission method.
[0057] A sixth aspect: an embodiment of the present application provides a chip, including a processor, the processor is coupled with a memory, and is configured to execute a computer program or instructions stored in the memory, so that the chip implements steps of a data transmission method.
[0058] Compared with the prior art, the embodiment of the present application has the following beneficial effects:
[0059] The embodiment of the present application provides a data transmission method and related apparatus, a 1553B module responds to request information sent by a client, first configuration information is written into a configuration register of a 1553B protocol controller based on a serial peripheral interface, and a configured 1553B protocol controller is obtained; the 1553B module is connected with the client through an Ethernet; the 1553B module reads data corresponding to the request information based on the configured 1553B protocol controller; and the 1553B module sends the data to the client based on a remote invocation channel of the Ethernet. In the embodiment of the present application, the configured 1553B protocol controller and the remote invocation channel of the Ethernet replace a PCIE physical connection, and on this basis, communication can be realized by using a standardized network protocol, without the need of a customized driver program, and the compatibility is effectively improved. BRIEF DESCRIPTION OF DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, the accompanying drawings in the following description only represent some embodiments of the present application, and for those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0061] Figure 1 A system block diagram of a data transmission method provided by an embodiment of the present application;
[0062] Figure 2 A flowchart of a data transmission method provided by an embodiment of the present application;
[0063] Figure 3 A software architecture schematic diagram of a data transmission method provided by an embodiment of the present application;
[0064] Figure 4 A structural schematic diagram of a data transmission device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0065] The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present application. The terms used in the following embodiments are only for the purpose of describing the specific embodiments and are not intended to be limiting to the present application. As used in the specification and the appended claims of the present application, the singular forms “a”, “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that “one or more” in the embodiments of the present application means one, two or more than two; “and / or” describes the association relationship of the associated objects, which means that there can be three kinds of relationships; for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone, wherein A and B can be singular or plural. The character “ / ” generally represents an “or” relationship between the associated objects before and after it.
[0066] Reference in this specification to "one embodiment" or "some embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearances of the phrase "in one embodiment" or "in some embodiments" in various places in the specification are not necessarily all referring to the same embodiment, although it can. The terms "including," "comprising," "having" and variations thereof are meant to encompass the items listed thereafter and equivalents thereof as well as additional items.
[0067] The plurality referred to in the embodiments of the application refers to greater than or equal to two. It should be noted that in the description of the embodiments of the application, the terms "first", "second", and the like are used only for the purpose of distinguishing the described purposes, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0068] The 1553B module is a hardware interface module that complies with the MIL-STD-1553B protocol, and is widely used in deterministic communication scenarios of strong real-time, high-reliability distributed systems due to its high reliability, strong real-time, and high fault tolerance.
[0069] For example, the transmission rate of the 1553B module can reach 1 Mbps, each message can contain a maximum of 32 words (each word is 20 bits), the message transmission time is short, and it is suitable for real-time control scenarios; a double-redundant bus design is adopted to support fault tolerance and automatic retransmission mechanisms to ensure data transmission integrity; the bus controller (BC) can uniformly schedule remote terminals (RTs) and bus monitors (MTs), support broadcast communication and RT-RT direct transmission; the protocol specification defines the transmission format of command words, data words and status words, as well as synchronization fields, parity check mechanisms, etc., to ensure signal analysis accuracy.
[0070] However, the current 1553B module uses a PCIE interface. Due to differences in kernel abstraction, driver framework, and resource management rules of the PCIE interface for different operating systems, and the need for the driver program to be deeply bound with the operating system kernel to realize functions such as configuration access and data transmission of the PCIE interface. Therefore, when the 1553B module interacts with different operating systems, the corresponding driver program needs to be developed for different operating systems, resulting in the current data transmission method having poor compatibility.
[0071] At the same time, the PCIE interface has the problems of not supporting hot plugging, being limited by the number of physical chassis expansion slots, being strongly bound with the operating system, and needing to be physically disassembled for detection when a fault occurs.
[0072] For example, because PCIe interfaces do not support hot-swapping, hardware replacement or upgrades must be performed with the system shut down, affecting the continuity and efficiency of task execution; because PCIe interfaces are limited by the number of physical chassis expansion slots, it is difficult to achieve flexible expansion of multiple modules and remote deployment of devices; because PCIe driver interfaces are strongly bound to the operating system, adaptation development needs to be repeated in cross-platform reuse scenarios; and because physical disassembly and testing of hardware is required when PCIe interfaces fail, fault detection efficiency is low.
[0073] Based on this, embodiments of this application provide a data transmission method and related apparatus. A 1553B module responds to a request from a client by writing first configuration information into the configuration register of a 1553B protocol controller via a serial peripheral interface, thereby obtaining a configured 1553B protocol controller. The 1553B module is connected to the client via Ethernet. Based on the configured 1553B protocol controller, the 1553B module reads data corresponding to the request information. The 1553B module then sends the data to the client via a remote access channel over Ethernet.
[0074] In this embodiment, a configured 1553B protocol controller and an Ethernet remote call channel replace the PCIe physical connection. Based on this, communication can be achieved using standardized network protocols without the need for customized drivers, effectively improving compatibility.
[0075] like Figure 1 As shown in the figure, this figure is a system framework diagram of a data transmission method provided in an embodiment of this application. The system consists of two parts: a 1553B module and a personal computer (PC) host, which are connected by a Category 6 twisted-pair cable (RJ45 interface).
[0076] The 1553B module includes a system-on-a-chip (SoC), a 1553B protocol controller, a network interface card (NIC) module, and a first RJ45 interface. The SoC acts as the master controller, directly connecting to the slave side of the 1553B protocol controller (e.g., a B6131 chip) via a Serial Peripheral Interface (SPI) master terminal (e.g., MOSI, MISO, SCLK, CS, etc.). The SoC connects to the first RJ45 interface through the NIC module to achieve network communication.
[0077] Among them, Master Out Slave In (MOSI) is the signal line for the master to send data to the slave; Master In Slave Out (MISO) is the signal line for the master to receive data sent by the slave; Serial Clock (SCLK) is the clock signal line in serial communication, used to synchronize data transmission; Chip Select (CS) is used to select the slave device.
[0078] The RJ45 interface is a network connection standard interface, and the RJ45 interface transmits differential signals through twisted pair lines, that is, the signals transmitted by two lines have the same amplitude and opposite phase. This transmission mode can effectively reduce electromagnetic interference (EMI) and radio frequency interference (RFI), and improve the stability and reliability of signal transmission.
[0079] In the embodiment of the application, a Linux system can be deployed on the system-on-chip, and SPI drivers and network card drivers are integrated. A server program developed based on the rest_rpc framework is adopted, and the server program can provide bus controller function interfaces (such as BC_Init, BC_Run, BC_read_msg, etc.).
[0080] The personal computer host includes a central processing unit (CPU), a network card chip, and a second RJ45 interface.
[0081] The CPU can be connected to the network card chip (for example, RTL8111H) through a PCIE bus, and the network card chip is connected to the second RJ45 interface. The second RJ45 interface is connected to the first RJ45 interface through a category 6 twisted pair network cable, thereby realizing the interconnection between the personal computer host and the 1553B module.
[0082] In the embodiment of the application, the operating system of the personal computer host supports the client program to call the server interface of the 1553B module through rest_rpc.
[0083] In summary, in the embodiment of the application, for the 1553B module, the 1553B protocol controller is separated from the system-on-chip, and the coupling between the two is reduced through the SPI interface. In the software layered architecture, the server and the client are separated, thereby improving the maintainability of the system.
[0084] On the basis of the above system framework, a data transmission method provided by an embodiment of the application is provided, as shown in Figure 2 The figure is a flowchart of the data transmission method provided by the embodiment of the application, and includes S201-S203.
[0085] S201, the 1553B module writes first configuration information into a configuration register of the 1553B protocol controller based on a serial peripheral interface in response to request information sent by a client, and obtains a configured 1553B protocol controller.
[0086] The 1553B module is connected to the client through an Ethernet.
[0087] In the embodiments of the present application, the 1553B module writes the first configuration information into the configuration register of the 1553B protocol controller based on the serial peripheral interface in response to the request information sent by the client, and obtains the configured 1553B protocol controller. Before this, the device node can be registered based on the Linux kernel SPI subsystem, the network card driver is loaded, and a static Internet Protocol Address (IP) address such as 192.168.1.100 is configured. The request information of the client is listened based on the Transmission Control Protocol (TCP) protocol.
[0088] In a possible implementation, in the process that the 1553B module writes the first configuration information into the configuration register of the 1553B protocol controller based on the serial peripheral interface in response to the request information sent by the client, the 1553B module can configure the 1553B protocol controller channel based on the serial peripheral interface in response to the request information sent by the client.
[0089] For example, the example code for configuring the 1553B protocol controller channel based on the serial peripheral interface is as follows:
[0090] void BC_Init(rpc_conn conn, int channel) {
[0091] spi_write(B6131_REG_CONFIG, channel);
[0092] }
[0093] On this basis, the first configuration information can be written into the configuration register of the 1553B protocol controller based on the 1553B protocol controller channel.
[0094] In a possible implementation, the 1553B module can process the first configuration information into a message format defined based on Msgpack according to a real-time scheduling strategy based on priority in response to the request information sent by the client, and obtain the processed first configuration information. The 1553B module writes the processed first configuration information into the configuration register of the 1553B protocol controller based on the serial peripheral interface, and obtains the configured 1553B protocol controller.
[0095] The Msgpack is a high-efficiency and compact binary serialization format, and the message format defined based on the Msgpack includes a terminal address (rt_address), a subaddress, and a payload. The Msgpack has the characteristics of small data volume, fast transmission speed, and cross-language compatibility.
[0096] In the embodiments of the present application, the first configuration information is processed as a message format defined based on Msgpack, so that only necessary fields such as terminal address, sub-address, and load are transmitted, thereby realizing minimization of data transmission volume and encoding / decoding time consumption, reducing network bandwidth occupation or local bus transmission delay, and reducing CPU overhead between the client and the 1553B module.
[0097] The priority-based real-time scheduling strategy (SCHED_FIFO) is a non-preemptive real-time scheduling strategy, which realizes preemptive response based on task priority.
[0098] If the preemption occurs within the same priority, the currently running task can run until it voluntarily gives up the CPU; if the preemption occurs between tasks of different priorities, the high-priority task can preempt the currently running low-priority task.
[0099] Therefore, in the embodiments of the present application, the high priority can be set for the data transmission task, so that it can preempt the low-priority task, thereby obtaining approximate real-time response capability.
[0100] For example, in the embodiments of the present application, the SCHED_FIFO priority of the data transmission task between the client and the 1553B module can be set to be greater than or equal to 90, so as to avoid competition for cache and execution resources with other processes, and improve response stability.
[0101] In the embodiments of the present application, the Ethernet switch can realize unified addressing and load balancing of multiple 1553B modules, breaking through the single-machine expansion limit. The method provided in the embodiments of the present application supports that the client simultaneously sends corresponding request information to multiple 1553B modules, the 1553B module receives the request information sent by the client, and matches a first information identifier in the request information with a second information identifier built-in in the 1553B module; when the first information identifier matches the second information identifier, the first configuration information is written into a configuration register of the 1553B protocol controller based on a serial peripheral interface, and a configured 1553B protocol controller is obtained.
[0102] For example, the 1553B module is built-in with a second information identifier (ID), and the client can send request information to the corresponding multiple 1553B modules in a directional manner through multiple second information identifiers and message types.
[0103] S202, the 1553B module reads data corresponding to the request information based on the configured 1553B protocol controller.
[0104] In a possible implementation, the 1553B module sends a data message to a remote terminal based on the configured 1553B protocol controller; and reads data corresponding to the request information in response to state information sent by the remote terminal.
[0105] The data message can be a 1553B message, which can be composed of three types of words, i.e., a command word, a data word, and a status word. Such a structured design can guarantee the accuracy and analyzability of data transmission.
[0106] The command word is sent by a bus controller, and is used to specify a remote terminal address and a data transmission direction; the data word is used to carry actual transmission data, and can be sent by a BC or an RT; and the status word is returned by an RT to a BC, and is used to feed back a message processing result, such as success / failure, error type, and the like.
[0107] For example, the 1553B module sends a data message to a remote terminal (RT) based on the configured 1553B protocol controller. After receiving the data message, the remote terminal feeds back state information, which is used to indicate that the remote terminal has received the data message. On this basis, the 1553B module can notify a system-level chip through an SPI interrupt, and read data by calling BC_read_msg().
[0108] S203. The 1553B module sends the data to the client based on an Ethernet remote invocation channel.
[0109] The Ethernet remote invocation channel can include, but is not limited to, a transmission protocol such as TCP, a user datagram protocol (UDP), and a WebSocket.
[0110] In a possible implementation, when an Ethernet connection between the 1553B module and the client is interrupted, the Ethernet remote invocation channel between the 1553B module and the client can be established in response to a reconnection request sent by the client; and the 1553B module sends untransmitted data to the client based on the Ethernet remote invocation channel.
[0111] For example, the client can detect a state of the Ethernet remote invocation channel in real time, and can automatically restore a session context when a reconnection operation is triggered. The server can guarantee that the control logic can be quickly restored after reconnection by using a hardware state caching mechanism (for example, caching last bus configuration information).
[0112] In summary, in the embodiment of the application, the 1553B protocol controller configured and the remote call channel of the Ethernet are used to replace the PCIE physical connection, and on this basis, the standardized network protocol can be used for communication, without the need of customized driver program, and the compatibility is effectively improved.
[0113] As shown in the figure, the figure is a software architecture schematic diagram of a data transmission method provided by the embodiment of the application, the 1553B module corresponds to a server program, and the personal computer host corresponds to a client program. Figure 3
[0114] The server includes a Linux driver layer, a server logic layer, a server local interface, and a server registration function interface.
[0115] The Linux driver layer includes but is not limited to an SPI driver and a network card driver. The SPI driver is used to realize the registration of a device node based on a Linux kernel SPI subsystem; and the network card driver is used to load a network card module driver and configure a static IP address (such as 192.168.1.100).
[0116] The server logic layer adopts a rest_rpc framework, which is used to listen to the request information sent by the client based on the remote call channel of the Ethernet.
[0117] For example, in the case that the remote call channel of the Ethernet adopts the TCP protocol, the server logic layer adopts the rest_rpc framework, listens to the request information based on the TCP protocol (port number 5000), and uses the Boost.Asio library to process concurrent connections.
[0118] The rest_rpc framework is a high-performance and easy-to-use remote procedure call (RPC) framework based on modern C++, and has the characteristics of simple and easy use, high performance, cross-platform compatibility and the like.
[0119] The Boost.Asio library is a cross-platform C++ library for network and bottom I / O programming, which is used to provide a simple and efficient way to process asynchronous event-driven network programming.
[0120] The server local interface includes but is not limited to a BC function interface, such as BC_Init(), BC_Run(), BC_Read_msg() and the like.
[0121] The server registration function interface example code can be represented as follows:
[0122] int main() {
[0123] rpc_server server(5000); / / create an RPC server and listen to port 5000
[0124] BCService bc_service; / / Create BCService instance
[0125] / / Register BC_Init function
[0126] server.register_handler("BC_Init", &BCService::BC_Init, &bc_service);
[0127] / / Start the service
[0128] server.run();
[0129] return 0;
[0130] }
[0131] The client in the client program can remotely call the server interface through the rest_rpc framework. The example code is as follows:
[0132] int main() {
[0133] / / Create an RPC client instance and connect to the server address and port
[0134] rpcclient client("192.168.1.100", 5000);
[0135] / / Ensure that the client is connected successfully
[0136] if (!client.connect()) {
[0137] std::cerr << "Failed to connect to server" << std::endl;
[0138] return -1;
[0139] }
[0140] / / Call the BC_Init function
[0141] try {
[0142] client.call("BC_Init");
[0143] std::cout << "BC_Init called successfully" << std::endl;
[0144] } catch (const std::exception& e) {
[0145] std::cerr << "Failed to call BC_Init: " << e.what() << std::endl;
[0146] }
[0147] return 0;
[0148] }
[0149] In this embodiment of the application, after the client calls the BC_Init() function, the server can write to the configuration register of the B6131 via SPI.
[0150] After the client initiates bus communication by calling the BC_Run() function, the server triggers the B6131 to send a data message to the remote terminal. Upon receiving the response from the remote terminal, the B6131 notifies the SOC via an SPI interrupt, reads the data by calling the BC_read_msg() function, and then transmits the data back to the client via an Ethernet-based remote call channel.
[0151] In summary, this embodiment combines the RPC framework with the hardware operation of the 1553B module. By using Ethernet instead of the traditional PCIe or serial port physical interface, it achieves decoupling of hardware control logic and physical interface. An automatic reconnection mechanism is designed to address the characteristics of the Ethernet physical layer, and a state synchronization algorithm is introduced, solving the problem of the traditional 1553B module's inability to be hot-swapped. Simultaneously, to meet the real-time requirements of the 1553B module, this embodiment constructs a dual optimization system including low-overhead serialization and priority preemption scheduling mechanisms, enabling end-to-end latency to approach hardware bus-level performance in an Ethernet environment. In this embodiment, unified addressing and load balancing of multiple 1553B modules can be achieved through an Ethernet switch, breaking through single-machine expansion limitations and improving data transmission efficiency, system throughput, and reliability.
[0152] This application provides a data transmission device, see [link to relevant documentation] Figure 4 The figure is a schematic diagram of the structure of a data transmission device provided in an embodiment of this application. Its specific implementation method is consistent with the implementation method and the technical effect achieved in the above-described method embodiment, and some contents will not be repeated.
[0153] This application provides a data transmission device 4100, including:
[0154] Write unit 4101, read unit 4102 and send unit 4103;
[0155] The write unit 4101 is configured to write, in response to request information sent by a client, first configuration information into a configuration register of a 1553B protocol controller based on a serial peripheral interface, and obtain the 1553B protocol controller after configuration; the 1553B module and the client are connected through an Ethernet.
[0156] The read unit 4102 is configured to read, based on the 1553B protocol controller after configuration, data corresponding to the request information.
[0157] The sending unit 4103 is configured to send, based on a remote invocation channel of the Ethernet, the data to the client.
[0158] In a possible implementation, the write unit is specifically configured to:
[0159] The 1553B module configures a 1553B protocol controller channel based on a serial peripheral interface in response to request information sent by a client.
[0160] The first configuration information is written into a configuration register of the 1553B protocol controller based on the 1553B protocol controller channel.
[0161] In a possible implementation, the read unit is specifically configured to:
[0162] The 1553B module sends a data message to a remote terminal based on the 1553B protocol controller after configuration.
[0163] The data corresponding to the request information is read in response to state information sent by the remote terminal.
[0164] In a possible implementation, the apparatus further includes a reconnection unit.
[0165] The reconnection unit is specifically configured to:
[0166] When the Ethernet connection between the 1553B module and the client is interrupted, the remote invocation channel of the Ethernet between the 1553B module and the client is established in response to a reconnection request sent by the client; and the 1553B module sends, based on the remote invocation channel of the Ethernet, untransmitted data to the client.
[0167] In a possible implementation, the write unit is specifically configured to:
[0168] The 1553B module processes the first configuration information into a message format defined based on Msgpack according to a real-time scheduling strategy based on priority in response to the request information sent by the client, to obtain processed first configuration information;
[0169] The processed first configuration information is written into a configuration register of the 1553B protocol controller based on a serial peripheral interface, to obtain a configured 1553B protocol controller.
[0170] In a possible implementation, the writing unit is specifically configured to:
[0171] The 1553B module receives request information sent by the client, and matches a first information identifier in the request information with a second information identifier built in the 1553B module;
[0172] When the first information identifier matches the second information identifier, the first configuration information is written into a configuration register of the 1553B protocol controller based on a serial peripheral interface, to obtain a configured 1553B protocol controller.
[0173] In a possible implementation, the apparatus further includes an initialization unit.
[0174] The initialization unit is specifically configured to register a device node based on a Linux kernel SPI subsystem, load a network card driver, configure a static IP address, and listen to request information of the client based on a TCP protocol.
[0175] A computer device includes a processor and a memory.
[0176] The memory is configured to store program code and transmit the program code to the processor.
[0177] The processor is configured to execute steps of a data transmission method according to instructions in the program code.
[0178] Embodiments of the present application provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement steps of a data transmission method.
[0179] Embodiments of the present application provide a computer program product. When the computer program product is run on a computer, the computer executes steps of a data transmission method.
[0180] Embodiments of the present application provide a chip, which includes a processor coupled with a memory. The processor is configured to execute a computer program or instructions stored in the memory, so that the chip implements steps of a data transmission method.
[0181] It should be noted that each of the embodiments described in the specification illustrates at least part of an aspect of the application. Embodiments of the application can be implemented in any of the following means, items, units, components, elements, parts, or the like, alone or in any combination. The embodiments described in the specification are intended to be illustrative only and the specification is intended to be taken only by way of example. Other suitable embodiments of the application will be apparent to those skilled in the art in view of the following claims without departing from the scope of the application.
[0182] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application without creative labor, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A data transmission method, characterized in that, include: In response to the request information sent by the client, the 1553B module writes the first configuration information into the configuration register of the 1553B protocol controller based on the serial peripheral interface, thereby obtaining the configured 1553B protocol controller. The 1553B module is connected to the client via Ethernet; The 1553B module, based on the configured 1553B protocol controller, reads the data corresponding to the request information; The 1553B module sends the data to the client via a remote call channel over Ethernet.
2. The method according to claim 1, characterized in that, In response to a request from the client, the 1553B module writes first configuration information into the configuration register of the 1553B protocol controller via the serial peripheral interface, including: The 1553B module responds to the request information sent by the client and configures the 1553B protocol controller channel based on the serial peripheral interface; Based on the 1553B protocol controller channel, the first configuration information is written into the configuration register of the 1553B protocol controller.
3. The method according to claim 1, characterized in that, The 1553B module, based on the configured 1553B protocol controller, reads data corresponding to the request information, including: The 1553B module sends data messages to remote terminals based on the configured 1553B protocol controller; In response to the status information sent by the remote terminal, data corresponding to the request information is read.
4. The method according to claim 1, characterized in that, After sending the data to the client via an Ethernet remote access channel, the 1553B module further includes: When the Ethernet connection between the 1553B module and the client is interrupted, in response to the reconnection request sent by the client, a remote call channel for Ethernet between the 1553B module and the client is established. The 1553B module sends untransmitted data to the client via a remote call channel over Ethernet.
5. The method according to claim 1, characterized in that, In response to a request from the client, the 1553B module writes first configuration information into the configuration register of the 1553B protocol controller via the serial peripheral interface, thereby obtaining the configured 1553B protocol controller, including: The 1553B module responds to the request information sent by the client and processes the first configuration information into a message format defined by Msgpack according to the priority-based real-time scheduling strategy to obtain the processed first configuration information. Based on the serial peripheral interface, the processed first configuration information is written into the configuration register of the 1553B protocol controller to obtain the configured 1553B protocol controller.
6. The method according to claim 1, characterized in that, In response to a request from the client, the 1553B module writes first configuration information into the configuration register of the 1553B protocol controller via the serial peripheral interface, thereby obtaining the configured 1553B protocol controller, including: The 1553B module receives request information sent by the client and matches the first information identifier in the request information with the second information identifier built into the 1553B module. When the first information identifier matches the second information identifier, the first configuration information is written into the configuration register of the 1553B protocol controller based on the serial peripheral interface, and the configured 1553B protocol controller is obtained.
7. The method according to any one of claims 1-6, characterized in that, In response to a request from the client, the 1553B module writes the first configuration information into the configuration register of the 1553B protocol controller via the serial peripheral interface. Before obtaining the configured 1553B protocol controller, the module further includes: Register device nodes based on the Linux kernel SPI subsystem; Load the network card driver and configure a static IP address; Listen for client request information based on the TCP protocol.
8. A data transmission device, characterized in that, include: Write unit, read unit, and send unit; The writing unit is used by the 1553B module to respond to the request information sent by the client and write the first configuration information into the configuration register of the 1553B protocol controller based on the serial peripheral interface, so as to obtain the configured 1553B protocol controller. The 1553B module is connected to the client via Ethernet; The reading unit is used by the 1553B module to read data corresponding to the request information based on the configured 1553B protocol controller. The sending unit is used by the 1553B module to send the data to the client via a remote call channel based on Ethernet.
9. A computer device, characterized in that, The computer device includes: a processor and a memory; The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the steps of a data transmission method as described in any one of claims 1-7 according to instructions in the program code.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of a data transmission method as described in any one of claims 1-7.