A multi-machine distributed data transmission method and device

By creating publisher and subscriber models in the autonomous driving multi-machine distributed data transmission scenario, supporting multiple data transmission channels and regular expression functions, and using Protocol Buffer for data encoding and decoding, ZeroMQ's communication and efficiency problems in this scenario are solved, and efficient multi-machine distributed data transmission is achieved.

CN116112491BActive Publication Date: 2025-06-03BEIJING MECHANICAL EQUIP INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310058048.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-19
Publication Date
2025-06-03
Estimated Expiration
2043-01-19

AI Technical Summary

Technical Problem

In the distributed data transmission scenario of autonomous driving multi-machine, the ZeroMQ subscription-Publishing mode based on the EPGM protocol cannot realize publisher and subscriber communication on the same machine. Topic does not support regular filtering, and the data transmission efficiency is low.

Method used

By creating a publisher model and a subscriber model, configuring the publishing interface and subscription interface respectively, it supports multiple data transmission channels such as EPGM, TCP, serial port, PCIe, and CAN, extends regular expression function support, and uses Protocol Buffer for data encoding and decoding.

Benefits of technology

It realizes data transmission between publishers and subscribers on the same machine, improves the efficiency of the subscription-publishing mode, supports data transmission of multiple interfaces, reduces data footprint, and improves data transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116112491B_ABST
    Figure CN116112491B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a multi-machine distributed data transmission method, apparatus, electronic device, and storage medium. Among them, the method includes: solving the problem that publishers and subscribers on the same machine cannot perform data transmission based on the ZeroMQ publish-subscribe mode, EPGM communication protocol, and TCP communication protocol, and realizing multi-machine distributed data transmission; by expanding the support for regular expression functions, the efficiency of performing publish-subscribe is higher, which is convenient for software development and business processing; by configuring multiple data transmission channels, serial ports, PCIe interfaces, and CAN interfaces can be incorporated into the multi-machine distributed data transmission network, enhancing the multi-machine distributed data transmission ability; by introducing Protocol Buffer, encoding and decoding data, reducing the space occupied by data, and further enhancing the data transmission efficiency. The present disclosure not only ensures the universality of engineering applications but also ensures the high efficiency of multi-machine distributed data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] Autopilot is the product of the deep integration of the automotive industry and new generation information technology. As a strategic high point scrambled by countries around the world, autonomous vehicles need to connect numerous cameras, sensors, diagnostic tools, etc. These technologies will generate, send, receive, and process a large amount of data. Traditional automotive communication uses CAN for data transmission. However, with the increase in massive multi-source heterogeneous data, high real-time data transmission is required for autopilot. At the same time, the architecture of automotive electronics has gradually evolved into a heterogeneous distributed hardware architecture, which poses new requirements for efficient data transmission between interfaces such as PCIe, CAN, serial ports, and Ethernet among heterogeneous systems.

[0003] ZeroMQ (hereinafter referred to as ZMQ), as a broker-less communication library, has characteristics such as a friendly interface, high data transmission efficiency, and strong scalability. ZMQ provides various communication methods, such as subscribe-publish, request-response, push-pull, etc. ZMQ supports multiple communication protocols, such as TCP, UDP, PGM, EPGM, etc. However, the following deficiencies have also been found during use:

[0004] 1. For the multi-machine distributed data transmission scenario of autopilot, when data transmission is based on the EPGM protocol and uses the subscribe-publish mode, the publisher and subscriber on the same machine cannot communicate;

[0005] 2. When using the ZMQ subscribe-publish mode for data transmission, the Topic used for subscribe-publish does not support regular filtering;

[0006] 3. When using ZMQ for data transmission, the transmitted data is not further encapsulated, which affects the data transmission efficiency.

[0007] Therefore, one or more methods are needed to solve the above problems.

[0008] It should be noted that the information disclosed in the above background art section is only used to strengthen the understanding of the background of the present disclosure, and thus may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention

[0009] The purpose of the present disclosure is to provide a multi-machine distributed data transmission method, device, electronic device, and computer-readable storage medium, thereby at least to some extent overcoming one or more problems caused by the limitations and defects of related technologies.

[0010] According to one aspect of the present disclosure, a multi-machine distributed data transmission method is provided, including:

[0011] By creating the PubChannel input parameter of the publisher model, the PubConfig input parameter of the publisher model, creating a data transmission channel for the publisher model according to the PubChannel input parameter and the PubConfig input parameter of the publisher model, configuring the publishing interface of the publisher model, completing the creation of the publisher model based on the ZeroMQ communication library, communicating with the application program to be published based on the publishing interface of the publisher model, and publishing the data of the application program to be published based on the data transmission channel of the publisher model;

[0012] By creating the SubChannel input parameter of the subscriber model, the SubConfig input parameter of the subscriber model, creating a data transmission channel for the subscriber model according to the SubChannel input parameter and the SubConfig input parameter of the subscriber model, configuring the subscription interface of the subscriber model, completing the creation of the subscriber model based on the ZeroMQ communication library, communicating with the application program to receive data based on the subscription interface of the subscriber model, and enabling the application program to receive data based on the data transmission channel of the subscriber model.

[0013] In an exemplary embodiment of the present disclosure, the method further includes:

[0014] The parameter data type of the PubChannel input parameter of the publisher model is character type, which occupies 1 byte in memory. Each bit from low to high address represents whether a data transmission channel is enabled, where 0 represents not enabled and 1 represents enabled;

[0015] The parameter data type of the SubChannel input parameter of the subscriber model is character type, which occupies 1 byte in memory; Each bit from low to high address represents whether a data transmission channel is enabled, where 0 represents not enabled and 1 represents enabled.

[0016] In an exemplary embodiment of the present disclosure, the method further includes:

[0017] The parameter data type of the PubConfig input parameter of the publisher model is a structure, and the member variables of the PubConfig input parameter of the publisher model are the EPGM data transmission channel address, the TCP data transmission channel address, the serial port data transmission channel configuration, the PCIe data transmission channel configuration, and the CAN data transmission channel configuration;

[0018] The parameter data type of the SubConfig input parameter of the subscriber model is a structure, and the member variables of the SubConfig input parameter of the subscriber model are the EPGM data transmission channel address, the TCP data transmission channel address, the serial port data transmission channel configuration, the PCIe data transmission channel configuration, and the CAN data transmission channel configuration, respectively.

[0019] In an exemplary embodiment of the present disclosure, the method further includes:

[0020] When creating the data transmission channel of the publisher model according to the PubChannel input parameter of the publisher model and the PubConfig input parameter of the publisher model, the EPGM data transmission channel is responsible for completing data publication between multiple machines; the TCP data transmission channel is responsible for completing data publication between processes within the machine where the publisher model is located; the serial port data transmission channel is responsible for completing data publication of the serial port device of the machine where the publisher model is located; the PCIe data transmission channel is responsible for completing data publication of the PCIe device of the machine where the publisher model is located; the CAN data transmission channel is responsible for completing data publication of the CAN device of the machine where the publisher model is located;

[0021] When creating the data transmission channel of the subscriber model according to the SubChannel input parameter of the subscriber model and the SubConfig input parameter of the subscriber model, the EPGM data transmission channel is responsible for completing data subscription between multiple machines; the TCP data transmission channel is responsible for completing data subscription between processes within the machine where the subscriber model is located; the serial port data transmission channel is responsible for completing data subscription of the serial port device of the machine where the subscriber model is located; the PCIe data transmission channel is responsible for completing data subscription of the PCIe device of the machine where the subscriber model is located; the CAN data transmission channel is responsible for completing data subscription of the CAN device of the machine where the subscriber model is located.

[0022] In an exemplary embodiment of the present disclosure, the method further includes:

[0023] Configuring the publishing interface of the publisher model includes configuring the Topic parameter of the publisher model and the message parameter of the publisher model, and configuring the publishing interface of the publisher model includes configuring the Topic parameter of the publisher model of the publishing interface as a regular expression pattern;

[0024] Configuring the subscription interface of the subscriber model includes configuring the Topic parameter of the subscriber model and the message parameter of the subscriber model, and configuring the subscription interface of the subscriber model includes configuring the Topic parameter of the subscriber model of the subscription interface as a regular expression pattern.

[0025] In an exemplary embodiment of the present disclosure, the method further includes:

[0026] The publisher model encodes the data of the application with data to be published based on Protocol Buffer, and publishes the data of the application with data to be published based on the data transmission channel of the publisher model.

[0027] In an exemplary embodiment of the present disclosure, the method further includes:

[0028] Based on the data transmission channel of the subscriber model, the application with data to be received receives data, and the data is decoded based on Protocol Buffer.

[0029] In one aspect of the present disclosure, a multi-machine distributed data transmission device is provided, including:

[0030] A publisher model, configured to create a PubChannel input parameter of the publisher model and a PubConfig input parameter of the publisher model, create a data transmission channel of the publisher model according to the PubChannel input parameter of the publisher model and the PubConfig input parameter of the publisher model, configure a publishing interface of the publisher model, complete the creation of the publisher model based on the ZeroMQ communication library, communicate with the application with data to be published based on the publishing interface of the publisher model, and publish the data of the application with data to be published based on the data transmission channel of the publisher model;

[0031] A subscriber model, configured to create a SubChannel input parameter of the subscriber model and a SubConfig input parameter of the subscriber model, create a data transmission channel of the subscriber model according to the SubChannel input parameter of the subscriber model and the SubConfig input parameter of the subscriber model, configure a subscription interface of the subscriber model, complete the creation of the subscriber model based on the ZeroMQ communication library, communicate with the application with data to be received based on the subscription interface of the subscriber model, and enable the application with data to be received to receive data based on the data transmission channel of the subscriber model.

[0032] In one aspect of the present disclosure, an electronic device is provided, including:

[0033] A processor; and

[0034] A memory, on which computer-readable instructions are stored, and when the computer-readable instructions are executed by the processor, the method according to any one of the above is implemented.

[0035] In one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the method according to any one of the above is implemented.

[0036] A multi-machine distributed data transmission method in an exemplary embodiment of the present disclosure, wherein the method includes: solving the problem that publishers and subscribers on the same machine cannot perform data transmission based on the ZeroMQ publish-subscribe mode, the EPGM communication protocol, and the TCP communication protocol, and realizing multi-machine distributed data transmission; by expanding the support for regular expression functions, the efficiency of performing publish-subscribe is higher, which is convenient for software development and business processing; by configuring multiple data transmission channels, serial ports, PCIe interfaces, and CAN interfaces can be incorporated into the multi-machine distributed data transmission network, enhancing the multi-machine distributed data transmission ability; by introducing Protocol Buffer, encoding and decoding data, reducing the space occupied by data, and further enhancing the data transmission efficiency. The present disclosure not only ensures the universality of engineering applications but also ensures the high efficiency of multi-machine distributed data transmission.

[0037] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The above and other features and advantages of the present disclosure will become more obvious by referring to the accompanying drawings to describe its exemplary embodiments in detail.

[0039] Figure 1 FIG. shows a flowchart of a multi-machine distributed data transmission method according to an exemplary embodiment of the present disclosure;

[0040] Figures 2A - 2B FIG. shows a data publish / subscribe flowchart of a multi-machine distributed data transmission method according to an exemplary embodiment of the present disclosure;

[0041] Figure 3 FIG. shows a schematic diagram of input parameters of PubChannel of a multi-machine distributed data transmission method according to an exemplary embodiment of the present disclosure;

[0042] Figure 4 FIG. shows a schematic block diagram of a multi-machine distributed data transmission device according to an exemplary embodiment of the present disclosure;

[0043] Figure 5 FIG. schematically shows a block diagram of an electronic device according to an exemplary embodiment of the present disclosure; and

[0044] Figure 6 FIG. schematically shows a schematic diagram of a computer-readable storage medium according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0045] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. Like reference numerals in the figures denote like or similar parts, and thus their repetitive description will be omitted.

[0046] In addition, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present disclosure. However, those skilled in the art will realize that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, materials, devices, steps, etc. may be used. In other cases, well-known structures, methods, devices, implementations, materials, or operations are not shown or described in detail to avoid obscuring aspects of the present disclosure.

[0047] The block diagrams shown in the drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more software-hardened modules, or in different networks and / or processor devices and / or microcontroller devices.

[0048] In the present example embodiment, first, a multi-machine distributed data transmission method is provided; as shown in Figure 1 , the multi-machine distributed data transmission method may include the following steps:

[0049] Step S110, by creating the PubChannel input parameter of the publisher model, the PubConfig input parameter of the publisher model, and creating a data transmission channel of the publisher model according to the PubChannel input parameter of the publisher model and the PubConfig input parameter of the publisher model, configuring the publishing interface of the publisher model, completing the creation of the publisher model based on the ZeroMQ communication library, communicating with the application program of the data to be published based on the publishing interface of the publisher model, and publishing the data of the application program of the data to be published based on the data transmission channel of the publisher model;

[0050] Step S120: Create the SubChannel input parameter of the subscriber model and the SubConfig input parameter of the subscriber model, create a data transmission channel for the subscriber model according to the SubChannel input parameter of the subscriber model and the SubConfig input parameter of the subscriber model, configure the subscription interface of the subscriber model, complete the creation of the subscriber model based on the ZeroMQ communication library, communicate with the application program to receive data based on the subscription interface of the subscriber model, and enable the application program to receive data based on the data transmission channel of the subscriber model.

[0051] A multi-machine distributed data transmission method in an exemplary embodiment of the present disclosure, wherein the method includes: solving the problem that data cannot be transmitted between the publisher and the subscriber on the same machine based on the ZeroMQ publish-subscribe mode, the EPGM communication protocol, and the TCP communication protocol, and realizing multi-machine distributed data transmission; by extending the support for the regular expression function, the efficiency of performing publish-subscribe is higher, which is convenient for software development and business processing; by configuring multiple data transmission channels, serial ports, PCIe interfaces, and CAN interfaces can be incorporated into the multi-machine distributed data transmission network, enhancing the multi-machine distributed data transmission ability; by introducing Protocol Buffer, encoding and decoding data, reducing the data occupancy space, and further enhancing the data transmission efficiency. The present disclosure ensures both the universality of engineering applications and the efficiency of multi-machine distributed data transmission.

[0052] Next, a multi-machine distributed data transmission method in the present exemplary embodiment will be further described.

[0053] Embodiment 1:

[0054] In step S110, the PubChannel input parameter of the publisher model and the PubConfig input parameter of the publisher model can be created, a data transmission channel for the publisher model can be created according to the PubChannel input parameter of the publisher model and the PubConfig input parameter of the publisher model, the publishing interface of the publisher model can be configured, the creation of the publisher model based on the ZeroMQ communication library can be completed, communication can be performed with the application program to publish data based on the publishing interface of the publisher model, and the data of the application program to publish data can be published based on the data transmission channel of the publisher model.

[0055] In step S120, the subscriber model can be created by creating the SubChannel input parameter of the subscriber model and the SubConfig input parameter of the subscriber model, creating a data transmission channel for the subscriber model according to the SubChannel input parameter and the SubConfig input parameter of the subscriber model, configuring the subscription interface of the subscriber model, completing the creation of the subscriber model based on the ZeroMQ communication library, communicating with the application program to receive data based on the subscription interface of the subscriber model, and enabling the application program to receive data based on the data transmission channel of the subscriber model.

[0056] In the embodiment of this example, the method further includes:

[0057] The parameter data type of the PubChannel input parameter of the publisher model is character type, which occupies 1 byte in memory. Each bit from low to high address represents whether a data transmission channel is enabled, where 0 represents not enabled and 1 represents enabled.

[0058] The parameter data type of the SubChannel input parameter of the subscriber model is character type, which occupies 1 byte in memory. Each bit from low to high address represents whether a data transmission channel is enabled, where 0 represents not enabled and 1 represents enabled.

[0059] In the embodiment of this example, the method further includes:

[0060] The parameter data type of the PubConfig input parameter of the publisher model is a structure. The member variables of the PubConfig input parameter of the publisher model are the EPGM data transmission channel address, the TCP data transmission channel address, the serial port data transmission channel configuration, the PCIe data transmission channel configuration, and the CAN data transmission channel configuration respectively.

[0061] The parameter data type of the SubConfig input parameter of the subscriber model is a structure. The member variables of the SubConfig input parameter of the subscriber model are the EPGM data transmission channel address, the TCP data transmission channel address, the serial port data transmission channel configuration, the PCIe data transmission channel configuration, and the CAN data transmission channel configuration respectively.

[0062] In the embodiment of this example, the method further includes:

[0063] When creating a data transmission channel for the publisher model based on the PubChannel input parameter of the publisher model and the PubConfig input parameter of the publisher model, the EPGM data transmission channel is responsible for completing data publication between multiple machines; the TCP data transmission channel is responsible for completing data publication between processes within the machine where the publisher model is located; the serial port data transmission channel is responsible for completing data publication for the serial port devices of the machine where the publisher model is located; the PCIe data transmission channel is responsible for completing data publication for the PCIe devices of the machine where the publisher model is located; the CAN data transmission channel is responsible for completing data publication for the CAN devices of the machine where the publisher model is located.

[0064] When creating a data transmission channel for the subscriber model based on the SubChannel input parameter of the subscriber model and the SubConfig input parameter of the subscriber model, the EPGM data transmission channel is responsible for completing data subscription between multiple machines; the TCP data transmission channel is responsible for completing data subscription between processes within the machine where the subscriber model is located; the serial port data transmission channel is responsible for completing data subscription for the serial port devices of the machine where the subscriber model is located; the PCIe data transmission channel is responsible for completing data subscription for the PCIe devices of the machine where the subscriber model is located; the CAN data transmission channel is responsible for completing data subscription for the CAN devices of the machine where the subscriber model is located.

[0065] In the embodiment of this example, the method further includes:

[0066] Configuring the publishing interface of the publisher model includes configuring the Topic parameter of the publisher model and the message parameter of the publisher model. Configuring the publishing interface of the publisher model includes configuring the Topic parameter of the publisher model of the publishing interface as a regular expression pattern;

[0067] Configuring the subscription interface of the subscriber model includes configuring the Topic parameter of the subscriber model and the message parameter of the subscriber model. Configuring the subscription interface of the subscriber model includes configuring the Topic parameter of the subscriber model of the subscription interface as a regular expression pattern.

[0068] In the embodiment of this example, the method further includes:

[0069] The publisher model encodes the data of the application program of the data to be published based on Protocol Buffer, and publishes the data of the application program of the data to be published based on the data transmission channel of the publisher model.

[0070] In the embodiment of this example, the method further includes:

[0071] The data transmission channel based on the subscriber model enables the application to receive data to be received and decodes the data based on Protocol Buffer.

[0072] Embodiment 2:

[0073] An embodiment of the present invention provides a multi-machine distributed data transmission method and device, which can provide support for the multi-machine distributed data transmission scenario of autonomous driving. As Figures 2A - 2B shown, the invention includes the following steps:

[0074] Create a publisher model (hereinafter referred to as Publisher) based on the ZMQ publish-subscribe mode.

[0075] Publisher obtains the input parameter PubChannel. The data type of this parameter is character type and it occupies 1 byte in memory, that is, 8 bits. As Figure 3 shown, each bit from low to high of the address represents whether a data transmission channel is enabled, where 0 represents not enabled and 1 represents enabled.

[0076] Publisher obtains the input parameter PubConfig. The data type of this parameter is a structure, and its member variables are respectively the EPGM data transmission channel address, the TCP data transmission channel address, the serial port data transmission channel configuration (address, baud rate, etc.), the PCIe data transmission channel configuration, the CAN data transmission channel configuration, etc. The member variables need to be initialized. If a certain data transmission channel is not enabled, the corresponding channel configuration is the initial value.

[0077] Publisher creates the data transmission channels that need to be enabled according to the parameters PubChannel and PubConfig. Among them, the EPGM data transmission channel is responsible for completing data publication between multiple machines; the TCP data transmission channel is responsible for completing data publication between processes within the machine where Publisher is located; the serial port data transmission channel is responsible for completing data publication of the serial port device of the machine where Publisher is located; the PCIe data transmission channel is responsible for completing data publication of the PCIe device of the machine where Publisher is located; the CAN data transmission channel is responsible for completing data publication of the CAN device of the machine where Publisher is located.

[0078] The Publisher provides a publishing interface externally, including the parameters Topic and message. For efficient communication, Topic can be designed in the style of A / B / C / D / E / F…; message is the data to be published. The Publisher has extended the function of supporting regular expressions. Based on this function, the Publisher can complete the publishing of multiple Topic data by configuring Topic as a regular expression pattern. For example, if there are multiple subscribed Topics (A / B1 / C / D / E, A / B2 / C / D / E, A / B3 / C / D / E, A / B4 / C / D / E) and the published Topic is A / * / C / D / E, then the above four Topic data can be published, which brings convenience to system design and development as well as business processing.

[0079] The application program calls the Publisher's publishing interface, and the input parameters are Topic and message.

[0080] Based on Protocol Buffer, the Publisher encodes the message, reducing the space occupied by the data and increasing the data transmission efficiency.

[0081] The Publisher publishes the encoded data through the data transmission channel.

[0082] A subscriber model (hereinafter referred to as Subscriber) is created based on the ZMQ publish-subscribe mode.

[0083] The Subscriber obtains the input parameter SubChannel. The data type of this parameter is character type, which occupies 1 byte in memory, that is, 8 bits. As Figure 3 shown, each bit from low to high address represents whether a data transmission channel is enabled, where 0 represents not enabled and 1 represents enabled.

[0084] The Subscriber obtains the input parameter SubConfig. The data type of this parameter is a structure, and its member variables are the EPGM data transmission channel address, TCP data transmission channel address, serial port data transmission channel configuration (address, baud rate, etc.), PCIe data transmission channel configuration, CAN data transmission channel configuration, etc. The member variables need to be initialized. If a certain data transmission channel is not enabled, the corresponding channel configuration is the initial value.

[0085] The Subscriber creates the data transmission channels to be enabled according to the parameters SubChannel and SubConfig. Among them, the EPGM data transmission channel is responsible for completing data subscription among multiple machines; the TCP data transmission channel is responsible for completing data subscription among processes within the machine where the Subscriber is located; the serial port data transmission channel is responsible for completing data subscription for the serial port devices of the machine where the Subscriber is located; the PCIe data transmission channel is responsible for completing data subscription for the PCIe devices of the machine where the Subscriber is located; the CAN data transmission channel is responsible for completing data subscription for the CAN devices of the machine where the Subscriber is located.

[0086] The Subscriber provides an external subscription interface, including the parameter Topic. For efficient communication, Topic can be designed in the style of A / B / C / D / E / F…. The Subscriber extends the function of supporting regular expressions. Based on this function, the Subscriber can complete the subscription of multiple Topic data by configuring Topic as a regular expression pattern. For example, if there are multiple published Topics (A / B1 / C / D / E, A / B2 / C / D / E, A / B3 / C / D / E, A / B4 / C / D / E) and the subscribed Topic is A / * / C / D / E, then the subscription of the above four Topic data can be completed, which brings convenience to system design and development and business processing.

[0087] The application program calls the Subscriber subscription interface and performs data subscription according to the subscribed Topic.

[0088] Based on Protocol Buffer, the Subscriber decodes the message after receiving it from the data transmission channel and returns the decoded data to the application program.

[0089] In the embodiment of this example, the present invention can solve the problem that the publisher and subscriber on the same machine cannot perform data transmission by configuring the EPGM data transmission channel and the TCP data transmission channel; by extending the support for regular expression functions, the efficiency of subscription-publishing is higher, which is convenient for software R & D and business processing; by configuring multiple data transmission channels, serial ports, PCIe interfaces, and CAN interfaces can be incorporated into the multi-machine distributed data transmission network, enhancing the multi-machine distributed data transmission ability; by introducing Protocol Buffer to encode and decode data, the data occupancy space is reduced, further enhancing the data transmission efficiency.

[0090] It should be noted that although the steps of the methods in the present disclosure are described in a specific order in the accompanying drawings, this does not require or imply that these steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution, etc.

[0091] In addition, in the present exemplary embodiment, a multi-machine distributed data transmission device is also provided. Referring to Figure 4 as shown, the multi-machine distributed data transmission device 400 may include: a publisher model 410 and a subscriber model 420. Among them:

[0092] The publisher model 410 is used to create the PubChannel input parameter of the publisher model and the PubConfig input parameter of the publisher model, and create a data transmission channel of the publisher model according to the PubChannel input parameter of the publisher model and the PubConfig input parameter of the publisher model, configure the publishing interface of the publisher model, complete the creation of the publisher model based on the ZeroMQ communication library, communicate with the application program of the data to be published based on the publishing interface of the publisher model, and publish the data of the application program of the data to be published based on the data transmission channel of the publisher model;

[0093] The subscriber model 420 is used to create the SubChannel input parameter of the subscriber model and the SubConfig input parameter of the subscriber model, and create a data transmission channel of the subscriber model according to the SubChannel input parameter of the subscriber model and the SubConfig input parameter of the subscriber model, configure the subscription interface of the subscriber model, complete the creation of the subscriber model based on the ZeroMQ communication library, communicate with the application program of the data to be received based on the subscription interface of the subscriber model, and enable the application program of the data to be received to receive data based on the data transmission channel of the subscriber model.

[0094] The specific details of each module of the above multi-machine distributed data transmission device have been described in detail in the corresponding multi-machine distributed data transmission method, so they will not be elaborated here.

[0095] It should be noted that although several modules or units of a multi-machine distributed data transmission device 400 are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0096] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.

[0097] Those skilled in the art can understand that various aspects of the present invention can be implemented as a system, a method, or a program product. Therefore, various aspects of the present invention can be specifically implemented in the following forms, namely: a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which can be collectively referred to as "circuit", "module", or "system" here.

[0098] Next, refer to Figure 5 to describe the electronic device 500 according to this embodiment of the present invention. Figure 5 The shown electronic device 500 is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present invention.

[0099] As Figure 5 shown, the electronic device 500 is presented in the form of a general-purpose computing device. The components of the electronic device 500 may include but are not limited to: at least one of the above-mentioned processing units 510, at least one of the above-mentioned storage units 520, a bus 530 connecting different system components (including the storage unit 520 and the processing unit 510), and a display unit 540.

[0100] Among them, the storage unit stores program codes, and the program codes can be executed by the processing unit 510, so that the processing unit 510 executes the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of this specification. For example, the processing unit 510 can execute steps S110 to S120 as Figure 1 shown.

[0101] The storage unit 520 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 5201 and / or a cache storage unit 5202, and may further include a read-only storage unit (ROM) 5203.

[0102] The storage unit 520 may also include a program / utilities 5204 having a set (at least one) of program modules 5203. Such program modules 5205 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment.

[0103] The bus 550 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus structures.

[0104] The electronic device 500 may also communicate with one or more external devices 570 (such as a keyboard, a pointing device, a Bluetooth device, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 500, and / or may communicate with any device that enables the electronic device 500 to communicate with one or more other computing devices (such as a router, a modem, etc.). Such communication may be through the input / output (I / O) interface 550. Also, the electronic device 500 may communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 560. As shown in the figure, the network adapter 560 communicates with other modules of the electronic device 500 through the bus 550. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0105] Through the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or can be implemented by the way of software combined with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.

[0106] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is further provided, on which a program product capable of implementing the above methods of this specification is stored. In some possible embodiments, various aspects of the present invention can also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of this specification.

[0107] Reference Figure 6 As shown, a program product 600 for implementing the above method according to an embodiment of the present invention is described. It can be a portable compact disc read-only memory (CD-ROM) and includes program code, and can run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited to this. In this document, a readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0108] The program product can adopt any combination of one or more readable media. The readable media can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0109] The computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium can also be any readable medium other than the readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0110] The program code contained on the readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination of the above.

[0111] The program code for performing the operations of the present invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, executed as a stand-alone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0112] In addition, the above-mentioned drawings are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present invention, rather than for limiting purposes. It is easy to understand that the processes shown in the above-mentioned drawings do not indicate or limit the chronological order of these processes. Additionally, it is also easy to understand that these processes can be executed synchronously or asynchronously in, for example, multiple modules.

[0113] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the claims.

[0114] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. A multi-machine distributed data transmission method, characterized in that, the method includes: By creating the PubChannel input parameter of the publisher model, the PubConfig input parameter of the publisher model, and creating a data transmission channel for the publisher model according to the PubChannel input parameter of the publisher model and the PubConfig input parameter of the publisher model, configuring the publishing interface of the publisher model, completing the creation of the publisher model based on the ZeroMQ communication library, communicating with the application program of the data to be published based on the publishing interface of the publisher model, and publishing the data of the application program of the data to be published based on the data transmission channel of the publisher model; By creating the SubChannel input parameter of the subscriber model, the SubConfig input parameter of the subscriber model, and creating a data transmission channel for the subscriber model according to the SubChannel input parameter of the subscriber model and the SubConfig input parameter of the subscriber model, configuring the subscription interface of the subscriber model, completing the creation of the subscriber model based on the ZeroMQ communication library, communicating with the application program of the data to be received based on the subscription interface of the subscriber model, and enabling the application program of the data to be received to receive data based on the data transmission channel of the subscriber model; The method further includes: When creating a data transmission channel for the publisher model according to the PubChannel input parameter of the publisher model and the PubConfig input parameter of the publisher model, the EPGM data transmission channel is responsible for completing data publication between multiple machines; the TCP data transmission channel is responsible for completing data publication between processes within the machine where the publisher model is located; the serial port data transmission channel is responsible for completing data publication of the serial port device within the machine where the publisher model is located; the PCIe data transmission channel is responsible for completing data publication of the PCIe device within the machine where the publisher model is located; the CAN data transmission channel is responsible for completing data publication of the CAN device within the machine where the publisher model is located; When creating a data transmission channel for the subscriber model according to the SubChannel input parameter of the subscriber model and the SubConfig input parameter of the subscriber model, the EPGM data transmission channel is responsible for completing data subscription between multiple machines; the TCP data transmission channel is responsible for completing data subscription between processes within the machine where the subscriber model is located; the serial port data transmission channel is responsible for completing data subscription of the serial port device within the machine where the subscriber model is located; the PCIe data transmission channel is responsible for completing data subscription of the PCIe device within the machine where the subscriber model is located; the CAN data transmission channel is responsible for completing data subscription of the CAN device within the machine where the subscriber model is located.

2. The method according to claim 1, characterized in that, the method further includes: The parameter data type of the PubChannel input parameter of the publisher model is character type, which occupies 1 byte in memory, and each bit from low to high address represents whether a data transmission channel is enabled, where 0 represents not enabled and 1 represents enabled; The parameter data type of the SubChannel input parameter of the subscriber model is character type and occupies 1 byte in memory; each bit from low to high of the address represents whether a data transmission channel is enabled, where 0 represents disabled and 1 represents enabled.

3. The method according to claim 1, wherein, the method further includes: the parameter data type of the PubConfig input parameter of the publisher model is a structure, and the member variables of the PubConfig input parameter of the publisher model are the EPGM data transmission channel address, the TCP data transmission channel address, the serial port data transmission channel configuration, the PCIe data transmission channel configuration, and the CAN data transmission channel configuration; the parameter data type of the SubConfig input parameter of the subscriber model is a structure, and the member variables of the SubConfig input parameter of the subscriber model are the EPGM data transmission channel address, the TCP data transmission channel address, the serial port data transmission channel configuration, the PCIe data transmission channel configuration, and the CAN data transmission channel configuration.

4. The method according to claim 1, wherein, the method further includes: Configuring the publishing interface of the publisher model includes configuring the Topic parameter of the publisher model and the message parameter of the publisher model, and configuring the publishing interface of the publisher model includes configuring the Topic parameter of the publisher model of the publishing interface as a regular expression pattern; Configuring the subscription interface of the subscriber model includes configuring the Topic parameter of the subscriber model and the message parameter of the subscriber model, and configuring the subscription interface of the subscriber model includes configuring the Topic parameter of the subscriber model of the subscription interface as a regular expression pattern.

5. The method according to claim 4, wherein, the method further includes: The publisher model encodes the data of the application program to be published based on Protocol Buffer and publishes the data of the application program to be published based on the data transmission channel of the publisher model.

6. The method according to claim 5, wherein, the method further includes: Based on the data transmission channel of the subscriber model, the application program to receive data receives the data and decodes the data based on Protocol Buffer.

7. A multi-machine distributed data transmission device, wherein, the device includes: A publisher model is used to create the PubChannel input parameter of the publisher model, the PubConfig input parameter of the publisher model, create a data transmission channel of the publisher model according to the PubChannel input parameter of the publisher model and the PubConfig input parameter of the publisher model, configure the publishing interface of the publisher model, complete the creation of the publisher model based on the ZeroMQ communication library, communicate with the application program of the data to be published based on the publishing interface of the publisher model, and publish the data of the application program of the data to be published based on the data transmission channel of the publisher model; wherein, when creating the data transmission channel of the publisher model according to the PubChannel input parameter of the publisher model and the PubConfig input parameter of the publisher model, the EPGM data transmission channel is responsible for completing data publishing between multiple machines; the TCP data transmission channel is responsible for completing data publishing between processes within the machine where the publisher model is located; the serial port data transmission channel is responsible for completing data publishing of the serial port device of the machine where the publisher model is located; the PCIe data transmission channel is responsible for completing data publishing of the PCIe device of the machine where the publisher model is located; the CAN data transmission channel is responsible for completing data publishing of the CAN device of the machine where the publisher model is located. A subscriber model is used to create the SubChannel input parameter of the subscriber model, the SubConfig input parameter of the subscriber model, create a data transmission channel of the subscriber model according to the SubChannel input parameter of the subscriber model and the SubConfig input parameter of the subscriber model, configure the subscription interface of the subscriber model, complete the creation of the subscriber model based on the ZeroMQ communication library, communicate with the application program of the data to be received based on the subscription interface of the subscriber model, and enable the application program of the data to be received to receive data based on the data transmission channel of the subscriber model; wherein, when creating the data transmission channel of the subscriber model according to the SubChannel input parameter of the subscriber model and the SubConfig input parameter of the subscriber model, the EPGM data transmission channel is responsible for completing data subscription between multiple machines; the TCP data transmission channel is responsible for completing data subscription between processes within the machine where the subscriber model is located; the serial port data transmission channel is responsible for completing data subscription of the serial port device of the machine where the subscriber model is located; the PCIe data transmission channel is responsible for completing data subscription of the PCIe device of the machine where the subscriber model is located; the CAN data transmission channel is responsible for completing data subscription of the CAN device of the machine where the subscriber model is located.

8. An electronic device characterized in that it includes a processor; and a memory, on which computer-readable instructions are stored, and when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Inter-process communication method and system based on publish-subscribe mode

    CN110569135A

  • Multi-link transmission system is provided

    CN111314217A