A method for accurately controlling the RTPS connection rate and number of connections in DDS communication

By configure the user configuration rate and number of the terminal in DDS communication, and manage the storage space of the RTPS connection, the RTPS participants have been solved in the instantaneous connection. Reliability improvement.

CN117499374BActive Publication Date: 2025-01-28AUTOCORE INTELLIGENT TECH (NANJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311449243.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-02
Publication Date
2025-01-28
Estimated Expiration
2043-11-02

AI Technical Summary

Technical Problem

In DDS communication, when RTPS participants instantly need to establish connections with multiple SUB ends or PUB ends, the memory will instantly surge, which may cause device downtime and affect normal business development.

Method used

By providing users with the configuration of the connection rate and the number of connected access to the end, and allocate the storage space of the currently being established and the number of pairs that have been built, control the RTPS connection rate and the number of connection numbers , Avoid high memory.

Benefits of technology

Effectively reduced the impact of equipment memory on equipment memory on the instant network, reduced the threat of normal operation of the system, and improved the reliability and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117499374B_ABST
    Figure CN117499374B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for accurately controlling the RTPS connection rate and the number of connections in DDS communication, providing users with configuration of the peer access rate and the number of peer accesses, and allocating two storage spaces; after receiving the data(p) message, the RTPS participant determines whether the number of peer accesses allowed is exceeded, and if not, searches in two storage spaces for whether the participant represented by the data(p) already exists; if the participant does not exist, determines whether the allowed peer access rate is exceeded, and if not, records the data(p) in the storage space of the number of peers currently being connected, and the participant enters the connection establishment process with the local participant. The present invention provides a method for configuring the speed of instantaneous connection and the number of overall connections when the system is stable, thereby effectively protecting the normal operation of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to DDS communication technology, and in particular to a method for accurately controlling RTPS connection rate and connection quantity in DDS communication. Background Art

[0002] Each RTPS participant in DDS communication announces its existence by sending data(p) messages to the network. After receiving the data(p) messages, other RTPS participants in the network will reply to the sender. Then the two ends start to establish an RTPS connection in order to establish a data communication link between the two parties and realize the final data communication.

[0003] After receiving the data(p) message on the network, the PUB and SUB ends of RTPS will reply with a data(p) message to the sender of the message, and then the two sides will start to establish a connection. When multiple PUB and SUB ends are started at the same time on the network, the PUB or SUB end will need to establish connections with multiple SUB or PUB ends instantly, which will cause the local memory to surge instantly. For resource-constrained devices, it is likely to cause device downtime and affect the development of the entire business. Summary of the invention

[0004] To address the deficiencies in the prior art, the present invention aims to provide a method for accurately controlling the RTPS connection rate and the number of connections in DDS communication.

[0005] To achieve the purpose of the present invention, the technical solution adopted by the present invention is:

[0006] A method for accurately controlling the RTPS connection rate and the number of connections in DDS communication, comprising the steps of:

[0007] (1) Provide users with two configurations: peer access rate and peer access number, and allocate two storage spaces: storage space for the number of peers currently being connected and storage space for the number of peers that have already been connected;

[0008] (2) The RTPS participant sends a data(p) message to the network to announce its existence. After receiving the data(p) message, other RTPS participants in the network first determine whether the number of peer accesses exceeds the allowed number. If not, they search in the two storage spaces to see whether the participant represented by the data(p) already exists. If the participant represented by the data(p) does not exist, they determine whether the allowed peer access rate exceeds the allowed peer access rate. If not, they record the data(p) in the storage space of the number of peers currently being connected, and the participant enters the process of establishing a connection with the local participant.

[0009] (3) When the thread is scheduled to the next operation cycle of the RTPS protocol stack, the RTPS protocol stack detects the connection processes of all participants who are currently establishing connections with the local participant, and deletes the participants whose connections have been established from the storage space of the number of peers currently being connected.

[0010] Furthermore, the method further includes step (4): when the RTPS participant receives a data(p[UD]) message from the network, the participant represented by data(p[UD]) is searched for and deleted in the storage space of the number of peers currently being connected and the storage space of the number of peers already connected.

[0011] Furthermore, in step (1), the peer access rate, the maximum number of peers allowed to be in a connected state at the same time, is represented by max_connecting_num; the number of peer accesses, the maximum number of peers allowed by the system, is represented by max_connected_num;

[0012] The storage space for the number of peers currently being connected is used to control the access rate of the peers and is represented by connecting_space. The storage space for the number of peers that have been connected is used to control the maximum number of peers allowed by the system and is represented by connected_space.

[0013] Furthermore, in step (2), if the number of connected peers does not exceed max_connected_num, then the storage space connected_space for the number of connected peers is searched to see whether the participant of data(p) is a connected peer; if the participant represented by data(p) exists in connected_space, the data(p) processing flow is terminated;

[0014] If the participant represented by data(p) does not exist in connected_space, search for the participant represented by data(p) in the storage space connecting_space of the number of peers currently being connected; if the participant represented by data(p) exists in connecting_space, end the data(p) processing flow;

[0015] If the participant represented by data(p) does not exist in connecting_space, it is determined whether the number of currently connected peers exceeds the peer access rate max_connecting_num.

[0016] Furthermore, in step (2), if the number of currently connected peers does not exceed max_connecting_num, this data (p) is recorded in the storage space connecting_space that stores the number of currently connected peers, and the number of currently connected peers is increased, and this participant enters the process of establishing a connection with the local participant.

[0017] Furthermore, in step (3), if a participant has completed the connection establishment operation, the participant information is removed from the connecting_space information, and the number of connected peers is reduced. At the same time, the participant information is stored in the connected_space, and then the number of connected peers is increased. Otherwise, if a participant is still in the process of establishing a connection, the traversal continues to the next participant.

[0018] Furthermore, in step (4), the participant represented by data(p[UD]) is searched in the storage space connected_space for the number of connected peers. If the corresponding participant is found in connected_space, the participant is removed from connected_space and the number of connected peers is reduced. Otherwise, the participant corresponding to data(p[UD]) is searched in connecting_space. If the corresponding participant is found in connecting_space, the participant is removed from connecting_space and the number of connected peers is reduced. If the corresponding participant is not found in connecting_space, no processing is performed.

[0019] The beneficial effect of the present invention is that, compared with the prior art, the method of the present invention can effectively reduce the impact on the device memory caused by a large number of data(p) messages appearing on the instantaneous network, and greatly reduce the threat of a large number of data(p) messages to the normal operation of the system, especially during the entire service startup process or when responding to network attacks. At the same time, it also allows users to flexibly control the number of peers connected to the system according to the system's own resources and business characteristics, thereby greatly reducing the harm caused by network attack messages and improving the reliability and stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a schematic diagram of the RTPS negotiation process;

[0021] Figure 2 It is a flow chart of the method for accurately controlling the RTPS connection rate and the number of connections in DDS communication described in the present invention. DETAILED DESCRIPTION

[0022] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of this application.

[0023] like Figure 1 , the RTPS (Real-Time Publish-Subscribe) negotiation process includes the following steps:

[0024] (1) RTPS notification phase: After the PUB (publisher) creates a participant, it sends a data(p) message to notify the P1 operation; after the SUB (subscriber) creates a participant, it also sends a data(p) message to notify the S1 operation.

[0025] (2) Writer notification phase: The PUB sends a heartbeat message P2 to the SUB. After receiving the heartbeat request, the SUB checks whether the writer information notified in the heartbeat has been stored locally, and returns an acknack message S2 according to the situation. The PUB parses the acknack message from the SUB, sends a data(w) message to the SUB according to the information in the message, and sends a heartbeat message P3 again, waiting for the SUB's confirmation again. After receiving the data(w) message, the SUB stores the writer information locally and replies to the heartbeat request with an acknack message S3. If the SUB completes the storage of all the writer information on the PUB, the writer notification is completed.

[0026] (3) Reader notification stage: SUB sends a heartbeat message S4 to PUB. After receiving the heartbeat request, PUB checks whether the reader information notified in the heartbeat has been stored locally, and returns an acknack message P4 according to the situation. SUB parses the acknack message from PUB, sends a data(r) message to PUB according to the information in the message, and sends a heartbeat message S5 again, waiting for the confirmation from PUB again. After receiving the data(r) message, PUB stores the reader information locally and replies to the heartbeat request with an acknack message P5. If PUB completes the storage of all the reader information of SUB, the reader notification is completed.

[0027] (4) PMD notification stage: PMD is a message channel for participants to automatically keep alive. The notification method is bidirectional, that is, the PUB end notifies the SUB end, and the SUB end also notifies the PUB end. The two directions exist independently without any influence. Taking the notification from the PUB end to the SUB end as an example, the PUB end sends a heartbeat message P6 to the SUB end. After receiving the heartbeat message, the SUB end queries whether the local has received the corresponding sequence number information, and replies to the PUB end with an acknack message S6 according to the situation. The PUB end parses the acknack message from the SUB end, and then sends the data (m) message and the heartbeat message P7 to the SUB end according to the information in the message. After receiving the message, the SUB end updates the local keep alive information of the participants on the PUB end, and replies with an acknack message S7 to the PUB end. At this point, the PUB end's PMD notification is completed. The SUB end's PMD notification is similar to this.

[0028] (5) User writer confirmation phase: When the PUB and SUB complete the above notification phases, the user writer on the PUB sends a heartbeat request P10 to the SUB to finally confirm whether the user writer and user reader are matched successfully and can communicate. After receiving the heartbeat request, the SUB queries the storage status of the local writer and returns an acknack message S10. If the returned message is an ack, it means that the match is successful and the PUB can send data to the SUB. If the returned message is a nack, it means that the match fails and the PUB and SUB cannot communicate.

[0029] The method for accurately controlling the RTPS connection rate and the number of connections in DDS communication described in the present invention is implemented based on the above negotiation process.

[0030] The present invention provides a method for configuring the speed of instantaneous connection and the number of overall connections when the system is stable, so that customers can conveniently set the maximum number of connections that the system can support at the same time and the maximum number of peers that the system can support when the system is stable according to actual business scenarios and actual hardware conditions, thereby effectively protecting the normal operation of hardware and systems.

[0031] like Figure 2 As shown, the method for accurately controlling the RTPS connection rate and the number of connections in DDS communication described in the present invention is as follows:

[0032] (1) To facilitate user control, the system provides two configurations and allocates two storage spaces;

[0033] The two configurations include: peer access rate, that is, the maximum number of peers allowed to be connected at the same time, denoted by max_connecting_num; peer access number, that is, the maximum number of peers allowed by the system, denoted by max_connected_num.

[0034] The two storage spaces include: a storage space for the number of peers currently being connected, which is used to control the access rate of the peers and is hereinafter represented by connecting_space; a storage space for the number of peers that have been connected, which is used to control the maximum number of peers allowed by the system and is hereinafter represented by connected_space.

[0035] (2) The RTPS participant sends a data(p) message to the network to announce its existence. After receiving the data(p) message, other RTPS participants in the network first determine whether the maximum number of peer accesses is exceeded. If not, they search in the two storage spaces to see whether the participant represented by the data(p) already exists. If the participant represented by the data(p) does not exist, they determine whether the maximum peer access rate is exceeded. If not, they record the data(p) in the storage space connecting_space of the number of peers currently being connected, and the participant enters the process of establishing a connection with the local participant.

[0036] When an RTPS participant receives a data(p) notification message on the network, it first determines whether the sum of the number of peers currently being connected and the number of already connected peers exceeds the max_connected_num number of connected peers; if so, it is not allowed to establish a connection with the participant represented by data(p), and the connection establishment failure is directly returned; if it does not exceed the max_connected_num number of connected peers, it searches the storage space connected_space for the number of already connected peers to see whether the participant of this data(p) is an already connected peer.

[0037] If the participant represented by data(p) exists in connected_space, the data(p) processing flow is terminated; if the participant represented by data(p) does not exist in connected_space, the participant represented by data(p) is searched in the storage space connecting_space for the number of peers currently being connected; if the participant represented by data(p) exists in connecting_space, the data(p) processing flow is terminated; if the participant represented by data(p) does not exist in connecting_space, it is determined whether the number of peers currently being connected exceeds the peer access rate max_connecting_num.

[0038] If the number of currently connected parties exceeds max_connecting_num, the data(p) processing flow is terminated; if the number of currently connected parties does not exceed max_connecting_num, this data(p) is recorded in the storage space connecting_space that stores the number of currently connected parties, and the number of currently connected parties is increased, and this participant enters the process of establishing a connection with the local participant.

[0039] If verification or matching fails between both parties during the connection establishment process, the participant represented by this data (p) will be removed from connecting_space.

[0040] (3) When the thread is scheduled to the next running cycle of the RTPS protocol stack, the RTPS protocol stack starts to detect the connection process of all participants who are currently establishing connections with the local participant, and deletes the participants whose connection establishment has been completed from the storage space connecting_space that stores the number of peers currently being connected;

[0041] If a participant does not find any relevant information in the connecting_space, delete the participant and reduce the number of peers being connected. Otherwise, if a participant has completed Figure 1 The operations of P10 and S10 in the figure indicate that the connection is established, then the participant information is removed from the connecting_space information, the number of connected peers is reduced, and the participant information is stored in the connected_space, and then the number of connected peers is increased. Otherwise, if a participant has not completed the connection, Figure 1If the operations of P10 and S10 in the above are still in the process of establishing a connection, the next participant will be traversed. The above steps are repeated for each participant until all participants are processed.

[0042] When the RTPS participant receives the data(p) message on the network again, it continues the operations of steps (2)-(3) above.

[0043] (4) When the RTPS participant receives the data(p[UD]) disconnect message on the network, it searches for and deletes the participant represented by data(p[UD]) in the storage space of the number of peers currently being connected and the storage space of the number of peers already connected;

[0044] First, search for the participant represented by data(p[UD]) in the storage space connected_space of the number of connected peers. If the corresponding participant is found in connected_space, remove this participant from connected_space and reduce the number of connected peers. Otherwise, search for the participant corresponding to data(p[UD]) in connecting_space. If the corresponding participant is found in connecting_space, remove this participant from connecting_space and reduce the number of connected peers. If the corresponding participant is not found in connecting_space, do not process it.

[0045] The beneficial effect of the present invention is that, compared with the prior art, the method of the present invention can effectively reduce the impact on the device memory caused by a large number of data(p) messages appearing on the instantaneous network, and greatly reduce the threat of a large number of data(p) messages to the normal operation of the system, especially during the entire service startup process or when responding to network attacks. At the same time, it also allows users to flexibly control the number of peers connected to the system according to the system's own resources and business characteristics, thereby greatly reducing the harm caused by network attack messages and improving the reliability and stability of the system.

[0046] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation schemes of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, but not to limit the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.

Claims

1. A method for accurately controlling the RTPS connection rate and the number of connections in DDS communication, characterized in that: Includes steps: (1) Provide users with two configurations: peer access rate and peer access number, and allocate two storage spaces: storage space for the number of peers currently being connected and storage space for the number of peers that have already been connected; The peer access rate, the maximum number of peers allowed to be connected at the same time, is represented by max_connecting_num; the number of peer accesses, the maximum number of peers allowed by the system, is represented by max_connected_num; The storage space for the number of peers currently being connected is used to control the access rate of the peers, represented by connecting_space; the storage space for the number of peers that have been connected is used to control the maximum number of peers allowed by the system, represented by connected_space; (2) The RTPS participant sends a data(p) message to the network to announce its existence. After receiving the data(p) message, other RTPS participants in the network first determine whether the number of peer accesses exceeds the allowed number. If not, they search in the two storage spaces to see whether the participant represented by the data(p) already exists. If the participant represented by the data(p) does not exist, they determine whether the allowed peer access rate exceeds the allowed peer access rate. If not, they record the data(p) in the storage space of the number of peers currently being connected, and the participant enters the process of establishing a connection with the local participant. If the number of connected peers does not exceed max_connected_num, then the connected peer number storage space connected_space is used to check whether the participant of data(p) is an established connected peer; if the participant represented by data(p) exists in connected_space, the data(p) processing flow is terminated; If the participant represented by data(p) does not exist in connected_space, then search for the participant represented by data(p) in the storage space connecting_space that stores the number of peers currently being connected; If the participant represented by data(p) exists in connecting_space, the data(p) processing flow ends; If the participant represented by data(p) does not exist in connecting_space, determine whether the number of currently connected peers exceeds the peer access rate max_connecting_num; If the number of currently connected peers does not exceed max_connecting_num, then this data(p) is recorded in the storage space connecting_space that stores the number of currently connected peers, and the number of currently connected peers is increased. This participant enters the process of establishing a connection with the local participant; (3) When the thread is scheduled to the next operation cycle of the RTPS protocol stack, the RTPS protocol stack detects the connection process of all participants who are currently establishing connections with the local participant, and deletes the participants who have completed the connection establishment from the storage space of the number of peers currently being connected.

2. The method for accurately controlling the RTPS connection rate and the number of connections in DDS communication according to claim 1, characterized in that: The method further includes step (4) that when the RTPS participant receives the data(p[UD]) message from the network, the participant represented by data(p[UD]) is searched for and deleted from the storage space of the number of peers currently being connected and the storage space of the number of peers already connected.

3. The method for accurately controlling the RTPS connection rate and the number of connections in DDS communication according to claim 1, characterized in that: In step (3), if a participant has completed the connection establishment operation, the participant information is removed from the connecting_space information, and the number of connected peers is reduced. At the same time, the participant information is stored in the connected_space, and the number of connected peers is increased. Otherwise, if a participant is still in the process of establishing a connection, the next participant is traversed.

4. The method for accurately controlling the RTPS connection rate and the number of connections in DDS communication according to claim 2, characterized in that: In step (4), the participant represented by data(p[UD]) is searched in the storage space connected_space for the number of connected peers. If the corresponding participant is found in connected_space, the participant is removed from connected_space and the number of connected peers is reduced. Otherwise, the participant corresponding to data(p[UD]) is searched in connecting_space. If the corresponding participant is found in connecting_space, the participant is removed from connecting_space and the number of connected peers is reduced. If the corresponding participant is not found in connecting_space, no processing is performed.

Citation Information

Patent Citations

  • Method and system for integrating RapidIO transmission by DDS communication middleware

    CN111400228A

  • DDS message processing method and device, vehicle and storage medium

    CN116132514A