CN112445631A - RTPS process communication method, device, electronic equipment and storage medium - Google Patents

RTPS process communication method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112445631A
CN112445631A CN202011406320.9A CN202011406320A CN112445631A CN 112445631 A CN112445631 A CN 112445631A CN 202011406320 A CN202011406320 A CN 202011406320A CN 112445631 A CN112445631 A CN 112445631A
Authority
CN
China
Prior art keywords
message queue
message
xenomai
rtps
communication
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202011406320.9A
Other languages
Chinese (zh)
Inventor
黄祺乐
陈和任
丁智辉
蒋涛江
刘清
满文佳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Bozhilin Robot Co Ltd
Original Assignee
Guangdong Bozhilin Robot Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Bozhilin Robot Co Ltd filed Critical Guangdong Bozhilin Robot Co Ltd
Priority to CN202011406320.9A priority Critical patent/CN112445631A/en
Publication of CN112445631A publication Critical patent/CN112445631A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Abstract

The application discloses a process communication method and a device of RTPS, comprising the following steps: when the state of the Xenomai message queue is a sending state, establishing a first message queue object in the Xenomai message queue, setting the size and the port number of the first message queue, connecting the application memory with the tail end of the first message queue, writing the message into the first message queue, and releasing the first message queue after finishing writing the message; or when the state of the Xenomai message queue is a receiving state, establishing a second message queue object in the Xenomai message queue, determining a port number for receiving the second message queue, initializing the second message queue to extract all messages of the second message queue until the second message queue is empty, and releasing the second message queue after the second message queue is empty, so that the problem of common DDS communication delay in the related technology is solved, and the delay influence caused by switching is greatly reduced by introducing a real-time kernel to replace the memory management of Linux.

Description

RTPS process communication method, device, electronic equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for process communication of an RTPS, an electronic device, and a storage medium.
Background
Currently, a Robot Operating System (ROS) combines a Data Distribution Service (DDS) to support Data publishing and subscribing of a Real-Time publishing-subscribing (RTPS) protocol based on the ROS. The real-time publish-subscribe protocol divides a communication interval by using a domain concept, each domain can contain a plurality of participants, after each Participant is online, other online participants in the domain can be matched through a Participant Discovery Protocol (PDP) and an Endpoint Discovery Protocol (EDP), and the matched participants can communicate with other participants through the subscribers and the publishers in the domain. The existing communication Protocol includes a User Datagram Protocol (UDP), a Transmission Control Protocol (TCP), and a Shared Memory (SHM).
However, as the complexity of the robot increases, the real-time performance of the operating system of the robot is required to be higher and higher, and once the communication efficiency cannot meet the requirement, the control accuracy of the robot cannot meet the requirement, so that the executed action is deviated, and even the task execution fails. Therefore, in the shared memory communication method of the related art, a shared storage area is established in a memory by a process, and a shared memory segment is attached to an address space of the shared memory segment, and shared memory communication is considered as a fastest communication method among processes.
Content of application
The application provides a process communication method and device of an RTPS, an electronic device and a storage medium, which are used for solving the problems that tasks with high real-time requirements cannot be met in the prior art and the like.
An embodiment of a first aspect of the present application provides an RTPS process communication method, including the following steps:
when the state of a Xenomai message queue is a sending state, establishing a first message queue object in the Xenomai message queue, determining the size and the port number of the first message queue, connecting an application memory with the tail end of the first message queue, writing a message into the first message queue, and releasing the first message queue after finishing writing the message; or
When the state of the Xenomai message queue is a receiving state, establishing a second message queue object in the Xenomai message queue, determining a port number for receiving the second message queue, and initializing the second message queue to extract data with a preset length from the second message queue, wherein if a data packet exists at the head end of the second message queue, the data with the preset length is extracted from the data packet; otherwise, blocking for a preset time or directly returning error information until the second message queue is empty, and releasing the second message queue after the second message queue is empty.
Optionally, the method further comprises:
and after determining the port numbers of the first message queue and the second message queue, using the port numbers as communication identifiers to communicate with other processes.
Optionally, the method further comprises:
detecting a message interaction mode for communicating with the other processes;
and if the message interaction mode is a message interaction mode between endpoints in the host, carrying out real-time communication based on the Xenomai message queue based on an RTPS protocol.
Optionally, the performing, by the RTPS-based protocol, real-time communication based on a Xenomai message queue includes: transmitting a message through a locator, the locator consisting of first through third bytes, wherein,
the first byte represents that the locator is used for unicast or multicast, and if the locator is used for unicast, the locator is represented by a first identifier; otherwise, the second identifier is used for representing, and the second byte and the third byte are combined to represent the host ID obtained by the host IP address conversion.
Optionally, the method further comprises:
and judging whether the host ID of the opposite side and the host ID of the opposite side meet the message interaction condition according to the locator so as to carry out matching before real-time communication when the interaction condition is met.
An embodiment of a second aspect of the present application provides a process communication apparatus for RTPS, including:
the device comprises a writing module, a sending module and a sending module, wherein the writing module is used for establishing a first message queue object in a Xenomai message queue when the state of the Xenomai message queue is a sending state, determining the size and the port number of the first message queue, writing a message into the first message queue after connecting an application memory with the tail end of the first message queue, and releasing the first message queue after finishing writing the message;
an extracting module, configured to establish a second message queue object in the Xenomai message queue when the state of the Xenomai message queue is a receiving state, determine a port number for receiving the second message queue, initialize the second message queue, and extract data with a preset length from the second message queue, where if a data packet exists at a head end of the second message queue, the data with the preset length is extracted from the data packet; otherwise, blocking the preset time or directly returning error information until the second message queue is empty.
Optionally, the method further comprises:
and the first communication module is used for taking the port numbers as communication identifiers to communicate with other processes after determining the port numbers of the first message queue and the second message queue.
Optionally, the method further comprises:
the detection module is used for detecting a message interaction mode of communication with the other processes;
and the second communication module is used for carrying out real-time communication based on the Xenomai message queue based on an RTPS protocol when the message interaction mode is a message interaction mode between endpoints in the host.
An embodiment of a third aspect of the present application provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being configured to perform the process communication method of the RTPS as described in the above embodiments.
A fourth aspect of the present application provides a computer-readable storage medium, which stores computer instructions for causing the computer to execute the process communication method of the RTPS according to the foregoing embodiment.
Therefore, the state of the Xenomai message queue can be detected, when the state is a sending state, a first message queue object is established, the size and the port number of the first message queue are determined, the application memory is connected to the tail end of the first message queue so as to write the message into the first message queue, when the state is a receiving state, a second message queue object is established, the port number of the second message queue is determined so as to read all the messages into the second message queue, the problem of common DDS communication delay in the related technology is solved, and the time delay influence caused by switching is greatly reduced.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a flowchart of a process communication method of an RTPS according to an embodiment of the present application;
FIG. 2 is a flow diagram of a sending process when the status of a message queue is a send status according to one embodiment of the present application;
FIG. 3 is a flow diagram of a receive process when the status of a message queue is a receive status according to one embodiment of the present application;
FIG. 4 is a block diagram of a process communication device of the RTPS according to an embodiment of the present application;
fig. 5 is a block diagram of an electronic device according to an embodiment of the application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
A process communication method, an apparatus, an electronic device, and a storage medium of the RTPS according to the embodiments of the present application are described below with reference to the drawings.
Specifically, fig. 1 is a flowchart illustrating a process communication method of an RTPS according to an embodiment of the present application. In this embodiment, the method is used for robot communication, and a Xenomai message queue is maintained in a heap memory of Xenomai.
As shown in fig. 1, the process communication method of the RTPS includes the following steps:
in step S101, when the state of the Xenomai message queue is the sending state, a first message queue object in the Xenomai message queue is established, the size and the port number of the first message queue are determined, after the application memory is connected to the tail end of the first message queue, the message is written into the first message queue, and the first message queue is released after the writing of the message is finished.
It can be understood that the state of the Xenomai message queue includes a receiving state and a sending state, so that the embodiments of the present application can detect the state of the Xenomai message queue.
It should be noted that, at present, the most commonly used DDS communication method is based on network protocols such as UDP and TCP, and the network protocol is more suitable for communication between hosts. When a network protocol is applied to communication in a single host, the format of the message is required to comply with the protocol specification, and the message is required to contain redundant protocol contents, which causes unnecessary operations such as data formatting and transmission of useless data.
Therefore, the embodiment of the application needs to add a communication mechanism in the existing RTPS protocol, and the mechanism is implemented by an inter-process communication method based on Xenomai. The above inter-process communication method is to maintain a message queue in the heap memory of Xenomai, and the process can send and acquire data through the message queue.
The message queue can provide a synchronous communication mode, and the synchronous communication mode can ensure that only one process accesses one message queue each time, namely when two processes access the same message queue, the latter process can choose to block and wait until the other process finishes accessing, or choose not to block and wait, and return to the access failure. If the process chooses to block wait, a wait time can be specified, and when the wait time is exceeded, an access failure is returned.
Specifically, as shown in fig. 2, when detecting that the state of the Xenomai message queue is the sending state, the method mainly includes the following steps:
s201, a first message queue object is newly built, and the configuration of all first message queues is initialized to an initial value.
S202, presetting a space that may be occupied by the entire first message queue, where the memory space is only used for receiving data and is not used in the message sending process, and setting the size and port number of the first message queue.
S203, in the process of initializing the first message queue, memory space is distributed from the Xenomai memory according to the set size of the message queue; and registering mapping information of the port number.
S204, the writing into the first message queue is started.
S205, judging whether to finish writing into the first message queue, if so, executing step S206, otherwise, executing step S204.
And S206, ending.
It should be noted that, the sending process in the embodiment of the present application may apply for allocating a memory and according to the port number of the receiving process, that is, after step S203, the embodiment of the present application may further link the memory to the tail end of the first message queue of the receiving process, and write the data into the memory; and after the sending process is finished, the first message queue and related resources are released after data writing and other operations.
In step S102, when the state of the Xenomai message queue is the receiving state, establishing a second message queue object in the Xenomai message queue, determining a port number for receiving the second message queue, and initializing the second message queue to extract data with a preset length from the second message queue, wherein if a data packet exists at the head end of the second message queue, the data with the preset length is extracted from the data packet; otherwise, blocking the preset time or directly returning error information until the second message queue is empty, and releasing the second message queue after the second message queue is empty.
Specifically, as shown in fig. 3, when detecting that the state of the Xenomai message queue is the receiving state, the method mainly includes the following steps:
s301, a second message queue object is newly built, and the configuration of all second message queues is initialized to an initial value.
S302, presetting the space possibly occupied by the whole second message queue; setting a port number of the received message queue.
S303, in the process of initializing the second message queue, allocating a memory space from the Xenomai memory according to the set size of the second message queue; and registering mapping information of the port number.
S304, reading the second message queue is started.
S305, judging whether the second message queue is empty, if so, executing the step S306, otherwise, executing the step S304.
And S306, ending.
It should be noted that, the receiving process in the embodiment of the present application may read data with a custom length from the second message queue, if a data packet exists at the head end of the second message queue, read data with a custom length from the data packet, and if the custom length is greater than the size of the data packet, read data with the size of the data packet; if no data packet exists at the head end of the second message queue, the data packet is blocked for a specified time or error information is directly returned. And the receiving process is finished, and the message queue and related resources are released after data reading and other operations.
Optionally, in some embodiments, the method further comprises: and after determining the port numbers of the first message queue and the second message queue, using the port numbers as communication identifiers to communicate with other processes.
It will be appreciated that each message queue is identified by a unique port number, and that a process can form a communication binding with other processes through this port number or a custom name.
Optionally, in some embodiments, the method further comprises: detecting a message interaction mode for communicating with other processes; and if the message interaction mode is the message interaction mode among endpoints in the host, carrying out real-time communication based on the Xenomai message queue based on the RTPS protocol.
It is understood that the embodiment of the present application may be described in the RTPS protocol, and when creating a domain participant, 8 default built-in endpoints may be created at the same time, wherein 6 built-in endpoints may be used for sending and receiving the information data of the dynamic discovery protocol PDP and EDP. In addition to the default built-in endpoint, an endpoint is created that is used for the transmission or reception of real user data after the discovery process is finished.
The above-described message interaction between the endpoints may occur between different hosts or within one host. The RTPS protocol defines three transport modules. The network communication protocols UDP and TCP can be used for message interaction between hosts or within hosts, and the shared memory communication can be used for message interaction within hosts. The application provides a new message transmission module, and the real-time communication method based on the Xenomai message queue is used for message interaction between endpoints in a host in an RTPS protocol.
In order to complete message interaction between endpoints in a host, the embodiment of the present application defines a new message transmission module as follows:
when a message transmission module is constructed, the default configuration locator type is a message queue locator, the maximum size of transmission data is 16384KB, the port capacity is 32, and the timeout time of a heartbeat packet is 1000 milliseconds;
when initializing a message transmission module, newly building a message queue object, and setting the size and the port number of a message queue according to configuration information when constructing the transmission module;
when a message receiving channel of a message transmission module is opened, a message receiving object is constructed, and message reading operation of a message queue is started in a thread function of the message receiving object;
when a message sending channel of a message transmission module is opened, a message sending object is constructed according to the port number of the opposite side obtained in the discovery process, and message sending operation of a message queue is started in a thread function of the message sending object, wherein the message sending operation comprises applying for a memory to be linked at the tail end of the message queue of the opposite side and writing a message into the memory.
Optionally, in some embodiments, the real-time communication based on the Xenomai message queue is performed based on the RTPS protocol, including: transmitting a message through a locator, wherein the locator consists of first to third bytes, the first byte represents that the locator is used for unicast or multicast, and if the locator is used for unicast, the first byte represents that the locator is used for unicast and the first byte represents that the locator is used for multicast; otherwise, the second identifier is used for representing, and the second byte and the third byte are combined to represent the host ID obtained by the host IP address conversion.
It will be appreciated that each message transport module, as described in the RTPS protocol, requires a corresponding locator, for example a UDP locator consisting of an IP address and a port number.
It is assumed that the above-mentioned locator of the message queue communication scheme of the RTPS is composed of three bytes: the first byte indicates that the locator is used for unicast or multicast. If used for unicast, denoted by 'U'; otherwise, it is represented by 'M'; the second byte and the third byte are combined to represent the host ID obtained by the host IP address conversion, the host ID consists of two bytes, the second byte of the locator represents the first byte of the host ID, and the third byte of the locator represents the second byte of the host ID;
further, in some embodiments, the method further comprises: and judging whether the host ID of the opposite side and the host ID of the host meet the message interaction condition according to the locator so as to carry out matching before real-time communication when the interaction condition is met.
According to the RTPS process communication method provided by the embodiment of the application, the state of a Xenomai message queue can be detected, a first message queue object is established when the state is a sending state, the size and the port number of the first message queue are determined, an application memory is connected to the tail end of a received first message queue so as to write all messages into the first message queue, a second message queue object is established when the state is a receiving state, the port number of the received second message queue is determined so as to extract the messages of the second message queue until the second message queue is empty, and therefore the problem of common DDS communication delay in the related technology is solved, and delay influence caused by switching is greatly reduced.
Next, a process communication apparatus of the RTPS proposed according to an embodiment of the present application is described with reference to the drawings.
Fig. 4 is a block diagram illustrating a process communication apparatus of an RTPS according to an embodiment of the present application. In this embodiment, the device is used for robot communication, and a Xenomai message queue is maintained in a heap memory of Xenomai.
As shown in fig. 4, the process communication apparatus 10 of the RTPS includes: a write module 100 and an extract module 200.
The write-in module 100 is configured to, when the state of the Xenomai message queue is a sending state, establish a first message queue object in the Xenomai message queue, determine the size and the port number of the first message queue, connect the application memory to the tail end of the first message queue, write a message into the first message queue, and release the first message queue after the write-in of the message is completed;
the extracting module 200 is configured to, when the state of the Xenomai message queue is a receiving state, establish a second message queue object in the Xenomai message queue, determine a port number for receiving the second message queue, initialize the second message queue, and extract data with a preset length from the second message queue, where if a data packet exists at a head end of the second message queue, the data with the preset length is extracted from the data packet; otherwise, blocking the preset time or directly returning error information until the second message queue is empty, and releasing the second message queue after the second message queue is empty.
Optionally, in some embodiments, the above-mentioned process communication apparatus 10 of the RTPS further includes: and the first communication module is used for taking the port numbers as communication identifiers after determining the port numbers of the first message queue and the second message queue so as to communicate with other processes.
Optionally, in some embodiments, the above-mentioned process communication apparatus 10 of the RTPS further includes:
the detection module is used for detecting a message interaction mode of communication with other processes;
and the second communication module is used for carrying out real-time communication based on the Xenomai message queue based on the RTPS protocol when the message interaction mode is the message interaction mode between the endpoints in the host.
Optionally, in some embodiments, the second communication module is specifically configured to: transmitting a message through a locator, the locator consisting of first through third bytes, wherein,
the first byte represents that the locator is used for unicast or multicast, and if the locator is used for unicast, the locator is represented by a first identifier; otherwise, the second identifier is used for representing, and the second byte and the third byte are combined to represent the host ID obtained by the host IP address conversion.
It should be noted that the explanation of the embodiment of the process communication method of the RTPS is also applicable to the process communication apparatus of the RTPS of the embodiment, and is not repeated herein.
According to the process communication device of the RTPS provided in the embodiment of the present application, the state of the Xenomai message queue can be detected, and when the state is the sending state, the first message queue object is established, the size and the port number of the first message queue are determined, and the application memory is connected to the tail end of the first message queue to write the message into the first message queue, and when the state is the receiving state, the second message queue object is established, and the port number of the second message queue is determined, so that all messages are read from the second message queue until the second message queue is empty, thereby solving the problem of common DDS communication delay in the related art, and greatly reducing the delay influence caused by switching.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device may include:
a memory 1201, a processor 1202, and a computer program stored on the memory 1201 and executable on the processor 1202.
The processor 1202 implements the process communication method of the RTPS provided in the above-described embodiment when executing the program.
Further, the electronic device further includes:
a communication interface 1203 for communication between the memory 1201 and the processor 1202.
A memory 1201 for storing computer programs executable on the processor 1202.
The memory 1201 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
If the memory 1201, the processor 1202 and the communication interface 1203 are implemented independently, the communication interface 1203, the memory 1201 and the processor 1202 may be connected to each other through a bus and perform communication with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
Optionally, in a specific implementation, if the memory 1201, the processor 1202, and the communication interface 1203 are integrated on a chip, the memory 1201, the processor 1202, and the communication interface 1203 may complete mutual communication through an internal interface.
Processor 1202 may be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present Application.
The present embodiment also provides a computer-readable storage medium having stored thereon a computer program, characterized in that the program, when executed by a processor, implements the process communication method of the above RTPS.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or N embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "N" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more N executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of implementing the embodiments of the present application.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or N wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (10)

1. A process communication method of RTPS is characterized by comprising the following steps:
when the state of a Xenomai message queue is a sending state, establishing a first message queue object in the Xenomai message queue, determining the size and the port number of the first message queue, connecting an application memory with the tail end of the first message queue, writing a message into the first message queue, and releasing the first message queue after finishing writing the message; or
When the state of the Xenomai message queue is a receiving state, establishing a second message queue object in the Xenomai message queue, determining a port number for receiving the second message queue, and initializing the second message queue to extract data with a preset length from the second message queue, wherein if a data packet exists at the head end of the second message queue, the data with the preset length is extracted from the data packet; otherwise, blocking for a preset time or directly returning error information until the second message queue is empty, and releasing the second message queue after the second message queue is empty.
2. The method of claim 1, further comprising:
and after determining the port numbers of the first message queue and the second message queue, using the port numbers as communication identifiers to communicate with other processes.
3. The method of claim 2, further comprising:
detecting a message interaction mode for communicating with the other processes;
and if the message interaction mode is a message interaction mode between endpoints in the host, carrying out real-time communication based on the Xenomai message queue based on an RTPS protocol.
4. The method of claim 1, wherein the RTPS-based protocol for Xenomai-based message queue real-time communication comprises: transmitting a message through a locator, the locator consisting of first through third bytes, wherein,
the first byte represents that the locator is used for unicast or multicast, and if the locator is used for unicast, the locator is represented by a first identifier; otherwise, the second identifier is used for representing, and the second byte and the third byte are combined to represent the host ID obtained by the host IP address conversion.
5. The method of claim 4, further comprising:
and judging whether the host ID of the opposite side and the host ID of the opposite side meet the message interaction condition according to the locator so as to carry out matching before real-time communication when the interaction condition is met.
6. An apparatus for process communication of an RTPS, comprising:
the device comprises a writing module, a sending module and a sending module, wherein the writing module is used for establishing a first message queue object in a Xenomai message queue when the state of the Xenomai message queue is a sending state, determining the size and the port number of the first message queue, writing a message into the first message queue after connecting an application memory with the tail end of the first message queue, and releasing the first message queue after finishing writing the message;
an extracting module, configured to establish a second message queue object in the Xenomai message queue when the state of the Xenomai message queue is a receiving state, determine a port number for receiving the second message queue, initialize the second message queue, and extract data with a preset length from the second message queue, where if a data packet exists at a head end of the second message queue, the data with the preset length is extracted from the data packet; otherwise, blocking for a preset time or directly returning error information until the second message queue is empty, and releasing the second message queue after the second message queue is empty.
7. The apparatus of claim 6, further comprising:
and the first communication module is used for taking the port numbers as communication identifiers to communicate with other processes after determining the port numbers of the first message queue and the second message queue.
8. The apparatus of claim 6, further comprising:
the detection module is used for detecting a message interaction mode of communication with the other processes;
and the second communication module is used for carrying out real-time communication based on the Xenomai message queue based on an RTPS protocol when the message interaction mode is a message interaction mode between endpoints in the host.
9. An electronic device, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor executing the program to implement the process communication method of the RTPS according to any one of claims 1 to 5.
10. A computer-readable storage medium on which a computer program is stored, the program being executable by a processor for implementing the process communication method of the RTPS according to any one of claims 1 to 5.
CN202011406320.9A 2020-12-02 2020-12-02 RTPS process communication method, device, electronic equipment and storage medium Withdrawn CN112445631A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011406320.9A CN112445631A (en) 2020-12-02 2020-12-02 RTPS process communication method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011406320.9A CN112445631A (en) 2020-12-02 2020-12-02 RTPS process communication method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112445631A true CN112445631A (en) 2021-03-05

Family

ID=74739344

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011406320.9A Withdrawn CN112445631A (en) 2020-12-02 2020-12-02 RTPS process communication method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112445631A (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060059228A1 (en) * 2004-08-12 2006-03-16 Oracle International Corporation Capturing and re-creating the state of a queue when migrating a session
CN101448018A (en) * 2008-12-26 2009-06-03 中兴通讯股份有限公司 Interprocess communication method and device thereof
JP2009225241A (en) * 2008-03-18 2009-10-01 Brother Ind Ltd Telephone set
US20100083031A1 (en) * 2008-09-30 2010-04-01 Fujitsu Limited Method for queuing message and program recording medium thereof
US20120117186A1 (en) * 2010-11-04 2012-05-10 Electronics And Telecommunications Research Institute Dds structure with scalability and adaptability and node constituting the same
KR101157039B1 (en) * 2012-01-06 2012-06-21 국방과학연구소 Dds bridge communication system and method
CN104503854A (en) * 2014-12-29 2015-04-08 成都科来软件有限公司 Inter-process communication method and device
CN107688502A (en) * 2017-08-18 2018-02-13 苏州科达特种视讯有限公司 Inter-process communication methods and device
CN109150558A (en) * 2017-06-15 2019-01-04 北京京东尚科信息技术有限公司 The methods, devices and systems of managing message queues node
CN109885410A (en) * 2019-01-09 2019-06-14 广州视源电子科技股份有限公司 Message method, device, computer equipment and storage medium
CN111541749A (en) * 2020-04-14 2020-08-14 杭州涂鸦信息技术有限公司 Data communication method and system of embedded equipment and related equipment
CN111813522A (en) * 2020-07-09 2020-10-23 西北工业大学 Virtual ARINC653 simulation verification platform

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060059228A1 (en) * 2004-08-12 2006-03-16 Oracle International Corporation Capturing and re-creating the state of a queue when migrating a session
JP2009225241A (en) * 2008-03-18 2009-10-01 Brother Ind Ltd Telephone set
US20100083031A1 (en) * 2008-09-30 2010-04-01 Fujitsu Limited Method for queuing message and program recording medium thereof
CN101448018A (en) * 2008-12-26 2009-06-03 中兴通讯股份有限公司 Interprocess communication method and device thereof
US20120117186A1 (en) * 2010-11-04 2012-05-10 Electronics And Telecommunications Research Institute Dds structure with scalability and adaptability and node constituting the same
KR101157039B1 (en) * 2012-01-06 2012-06-21 국방과학연구소 Dds bridge communication system and method
CN104503854A (en) * 2014-12-29 2015-04-08 成都科来软件有限公司 Inter-process communication method and device
CN109150558A (en) * 2017-06-15 2019-01-04 北京京东尚科信息技术有限公司 The methods, devices and systems of managing message queues node
CN107688502A (en) * 2017-08-18 2018-02-13 苏州科达特种视讯有限公司 Inter-process communication methods and device
CN109885410A (en) * 2019-01-09 2019-06-14 广州视源电子科技股份有限公司 Message method, device, computer equipment and storage medium
CN111541749A (en) * 2020-04-14 2020-08-14 杭州涂鸦信息技术有限公司 Data communication method and system of embedded equipment and related equipment
CN111813522A (en) * 2020-07-09 2020-10-23 西北工业大学 Virtual ARINC653 simulation verification platform

Similar Documents

Publication Publication Date Title
CN108268328B (en) Data processing device and computer
US6757746B2 (en) Obtaining a destination address so that a network interface device can write network data without headers directly into host memory
US5577210A (en) Remote booting of an operating system by a network
US7069373B2 (en) USB endpoint controller flexible memory management
TW200522583A (en) IP-based method and apparatus for booting computers remotely in wide-area-network environment
US11449456B2 (en) System and method for scheduling sharable PCIe endpoint devices
CN115080479B (en) Transmission method, server, device, bare metal instance and baseboard management controller
CN112947857A (en) Data moving method, device, equipment and computer readable storage medium
CN113821309B (en) Communication method, device, equipment and storage medium between microkernel virtual machines
CN107453845B (en) Response confirmation method and device
CN113238856B (en) RDMA-based memory management method and device
CN113098955B (en) Data transmission method, device and equipment and computer readable storage medium
CN112445631A (en) RTPS process communication method, device, electronic equipment and storage medium
WO2023030178A1 (en) Communication method based on user-mode protocol stack, and corresponding apparatus
CN114579319B (en) Video memory management method, video memory management module, SOC and electronic equipment
JP2000112866A (en) Improvement of input/output performance by storing packeted operation information in local memory
CN111371799B (en) Method, device and equipment for controlling data receiving and transmitting of MCTP (Multi-channel media Port) controller
US11106359B1 (en) Interconnection of peripheral devices on different electronic devices
US20050080922A1 (en) Address translation program and address translation apparatus
US20030214909A1 (en) Data processing device and its input/output method and program
US9658970B1 (en) Interconnection of peripheral devices on different electronic devices
CN116743587B (en) Virtual network interface implementation method and device based on heterogeneous computing accelerator card
CN108810087B (en) Connection method, system and equipment of storage server
CN114296916B (en) Method, device and medium for improving RDMA release performance
CN115858434A (en) Computing equipment and request processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20210305