Communication detection method and device of DDS network, electronic equipment and vehicle
By responding to RTPS call instructions in the DDS network, obtaining and recording the calling parameters of the target call function, and obtaining communication parameters from the communication layer, generating comparison values to detect the communication status of the DDS network, the problem of difficult to detect DDS communication exceptions caused by unreliable extraction of data on the RTPS layer is solved, and the communication detection reliability of the DDS network is improved.
Patent Information
- Application Number
- CN202311754514.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-19
- Publication Date
- 2025-06-20
AI Technical Summary
When verifying the transmission reliability of DDS, if the communication data extracted by the RTPS layer is unreliable, it is difficult to detect communication abnormalities of DDS in a timely manner.
By responding to the calling instructions of the real-time publish-subscribe protocol in the RTPS, we obtain the target calling function executed by RTPS during the call process, record the calling parameters, and obtain the communication parameters from the communication layer within the time period corresponding to the execution of the target calling function, generate parameter comparison values, and obtain communication detection results based on the comparison results.
The parameter extraction and comparison of RTPS and communication layer is realized, ensuring that when the communication data extracted by the RTPS layer is unreliable, the RTPS call parameters can be communicated and verified by the parameters obtained by the communication layer, thereby improving the reliability of DDS network communication detection.
Smart Images

Figure CN120186044A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a communication detection method, device, electronic equipment and vehicle for a DDS network. Background Art
[0002] DDS (Data Distribution Service) is composed of object management group DDS is a middleware protocol and API standard that adopts a publish / subscribe architecture, emphasizes data-centricity, and provides rich QoS (Quality of Service) to ensure real-time, efficient, and flexible data distribution, which can meet the needs of various distributed real-time communication applications. In the process of executing DDS, the existing method uses RTPS (The Real-time Publish-Subscribe Protocol) to achieve communication between publishers and subscribers. In order to ensure the quality of communication, the communication data is collected and analyzed during the communication process to verify the transmission reliability of DDS. However, the collected and analyzed communication data comes from the RTPS communication layer. When the communication data extracted from the RTPS communication layer is unreliable, the communication anomaly of DDS cannot be discovered in time. Summary of the invention
[0003] In view of this, the present application provides a communication detection method, device, electronic device and vehicle for a DDS network, the main purpose of which is to solve the problem that when verifying the transmission reliability of DDS, it is difficult to confirm the communication reliability of DDS if the communication data extracted by the RTPS layer is unreliable.
[0004] To achieve the above-mentioned purpose, the first aspect of the embodiment of the present application discloses a communication detection method of a DDS network, the method comprising:
[0005] In response to a call instruction for the RTPS real-time publish-subscribe protocol, obtaining a target call function executed by the RTPS during the call process, wherein the target call function is used to publish subscription data according to the call instruction;
[0006] Recording the calling parameters of the target calling function, wherein the calling parameters include at least one of a calling time, a calling node, and a subscription parameter, and the subscription parameter is used to represent the subscription data;
[0007] During the time period corresponding to the execution of the target call function, obtain communication parameters when executing the communication instruction from the communication layer, where the communication parameters include at least one of communication time, communication starting point, and transmission target; when the RTPS executes the target call function, use the communication instruction in the target call function to control the communication layer for communication transmission;
[0008] Generate a parameter comparison value using the call parameters and the communication parameters, and obtain a communication detection result based on the comparison result between the parameter comparison value and a preset parameter value.
[0009] Optionally, the obtaining of the target call function executed by the RTPS during the call process in response to a call instruction for the RTPS real-time publish-subscribe protocol includes:
[0010] In response to a call instruction for the RTPS real-time publish-subscribe protocol, confirm the publisher address and the subscriber address;
[0011] Determine the communication content and communication topic corresponding to the call instruction;
[0012] Based on the publisher address, the subscriber address, the communication content, and the communication topic, generate the target call function executed by the RTPS during the call process.
[0013] Optionally, the call parameters include: call time, the publisher address, the subscriber address, the communication content, and the communication topic;
[0014] Use the publisher address and the subscriber address as the call nodes;
[0015] Use the communication content and the communication topic as the subscribed data.
[0016] Optionally, the obtaining of the communication parameters when executing the communication instruction from the communication layer during the time period corresponding to the execution of the target call function includes:
[0017] Identify the kernel module of the communication layer;
[0018] During the time period corresponding to the execution of the target call function, obtain the communication parameters when executing the communication instruction from the communication layer through kernel observation technology, where the kernel observation technology is used to track the communication instruction according to the kernel module.
[0019] Optionally, the generating of a parameter comparison value using the call parameters and the communication parameters, and obtaining a communication detection result based on the comparison result between the parameter comparison value and a preset parameter value includes:
[0020] Establish a parameter correspondence between the call parameters and the communication parameters using a time-series database or a streaming data processing method;
[0021] Establish a data flow under the target call function according to the parameter correspondence, and the data flow is represented by the parameter comparison value;
[0022] Calculate the comparison result between the parameter comparison value and a preset parameter value, where the preset parameter value is the historical normal value during the execution of the call instruction;
[0023] If the comparison result is greater than a preset difference, confirm that the communication detection result is abnormal.
[0024] Optionally, after the step of if the comparison result is greater than a preset difference and confirm that the communication detection result is abnormal, the method further includes:
[0025] Extract a target parameter value from the parameter comparison value, and the comparison result between the target parameter value and the corresponding parameter value in the preset parameter value is greater than the preset difference;
[0026] Restore the parameter source of the target parameter value, where the parameter source includes the call parameters and the communication parameters;
[0027] Confirm the abnormal source of the communication detection result according to the parameter source.
[0028] Optionally, after obtaining the communication parameters during the execution of the communication instruction from the communication layer within the time period corresponding to the execution of the target call function, the method further includes:
[0029] Generate a data flow diagram between the RTPS and the communication layer by combining the call parameters and the communication parameters.
[0030] In the second aspect of the embodiments of the present application, a communication detection device for a DDS network is provided, and the device includes:
[0031] An acquisition module, configured to obtain a target call function executed by the RTPS during the call in response to a call instruction for the RTPS real-time publish-subscribe protocol, where the target call function is used to publish and subscribe data according to the call instruction;
[0032] A recording module, configured to record the call parameters of the target call function, where the call parameters include at least one of a call time, a call node, and a subscription parameter, and the subscription parameter is used to represent the subscribed data;
[0033] An acquisition module, configured to acquire communication parameters during the time period when the target call function is executed, from a communication layer, where the communication parameters include at least one of communication time, a communication start point, and a transmission target; when the RTPS executes the target call function, the communication layer is controlled to perform communication transmission by using the communication instruction in the target call function;
[0034] A comparison module, configured to generate a parameter comparison value by using the call parameter and the communication parameter, and obtain a communication detection result according to a comparison result between the parameter comparison value and a preset parameter value.
[0035] In a third aspect of the embodiments of the present application, an electronic device is provided, including:
[0036] At least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the method according to any one of the first aspect disclosed above.
[0037] In a fourth aspect of the embodiments of the present application, 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 the first aspect is implemented.
[0038] In a fifth aspect of the embodiments of the present application, a vehicle is provided, and a communication detection device of the DDS network according to the second aspect or the electronic device according to the third aspect is mounted in the vehicle.
[0039] In summary, according to the technical solution disclosed in the embodiments of the present application, in response to the problem that it is difficult to confirm the communication reliability of DDS when the communication data extracted by the RTPS layer is unreliable during the verification of the transmission reliability of DDS, in the solution disclosed in the embodiments of the present application, first, in response to a call instruction for the RTPS real-time publish-subscribe protocol, a target call function executed by the RTPS during the call is obtained, and the target call function is used to publish and subscribe data according to the call instruction; then the call parameters of the target call function are recorded, and the call parameters include at least one of the call time, call node, and subscription parameters, and the subscription parameters are used to represent the subscribed data; then during the time period corresponding to the execution of the target call function, communication parameters when executing the communication instruction are obtained from the communication layer, and the communication parameters include at least one of the communication time, communication start point, and transmission target; when the RTPS executes the target call function, the communication layer is controlled to perform communication transmission by using the communication instruction in the target call function; finally, a parameter comparison value is generated by using the call parameters and the communication parameters, and a communication detection result is obtained according to the comparison result with the preset parameter value. The solution of the embodiments of the present application extracts parameters from both the RTPS and the communication layer, and comprehensively uses the comparison of the parameters of the two aspects with the preset parameter value to realize communication detection through two levels, ensuring that when the communication data extracted by the RTPS layer is unreliable, the call parameters of the RTPS can also be verified by relying on the communication parameters obtained from the communication layer. By calling the method of the embodiments of the present application at a preset time node, the monitoring of the operation quality of the DDS network is realized, and the reliability of the DDS network communication detection is further ensured.
[0040] The above description is only an overview of the technical solution of the embodiments of the present application. In order to be able to understand the technical means of the embodiments of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features, and advantages of the embodiments of the present application more obvious and understandable, the following specifically describes the specific implementation manners of the embodiments of the present application. Brief Description of the Drawings
[0041] The accompanying drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to these drawings.
[0043] Figure 1 It shows a flowchart of a communication detection method for a DDS network provided by an embodiment of the present application;
[0044] Figure 2Shows a hierarchical distribution diagram of a DDS network provided by an embodiment of the present application;
[0045] Figure 3 Shows the structural diagram of a communication detection device of a DDS network provided by an embodiment of the present application. Detailed implementation manners
[0046] In order to more clearly understand the above objects, features, and advantages of the embodiments of the present application, the solutions of the embodiments of the present application will be further described below. It should be noted that, without conflict, the embodiments of the present application and the features in the embodiments may be combined with each other.
[0047] To solve the problem that it is difficult to confirm the communication reliability of the DDS network when the communication data extracted by the RTPS layer is unreliable during the verification of the transmission reliability of DDS. The present application provides the following embodiments to solve the above problems:
[0048] This embodiment provides a communication detection method for a DDS network, as Figure 1 shown, is the flowchart of the method of this embodiment. The method of this embodiment may specifically include the following steps:
[0049] Step 101, in response to a call instruction for the RTPS real-time publish-subscribe protocol, obtain the target call function executed by the RTPS during the call, where the target call function is used to transmit subscription data according to the call instruction.
[0050] The communication model adopted by the DDS network is a many-to-many one-way data exchange, in which the application program that generates data publishes the data to the local cache of the subscriber belonging to the application program that uses the data. The information flow is controlled by the quality of service (QoS) policy established between the entities responsible for data exchange.
[0051] As a data-centric model, the DDS network is based on the concept of a "global data space" that can be accessed by all interested application programs. The application program that provides information acts as a publisher, and the application program that accesses part of the data space acts as a subscriber. Whenever the publisher publishes subscription data to this space, the middleware spreads this information to all interested subscribers. In the DDS network, the main components include:
[0052] Domain: This is a concept used to link all publishers and subscribers, belonging to one or more application programs that exchange data under different topics. The domain of DDS is identified by the domain ID
[0053] Communication Topic: An entity that binds a publisher and a subscriber, which is unique in the DDS domain. A message of data that can be exchanged between processes, and the data is represented as a structure that can contain different data types, such as integers, strings, etc.;
[0054] Publisher: An entity responsible for creating and configuring the DataWriters it implements. A DataWriter is an entity responsible for publishing messages using the RTPS Real-Time Publish-Subscribe protocol. Each communication content has an assigned communication topic, and messages are published under this topic;
[0055] Subscriber: An entity responsible for receiving data published under the topics it subscribes to. It serves one or more DataReader objects, and a DataReader is an entity responsible for reading subscribed data.
[0056] In the above DDS network, the RTPS Real-Time Publish-Subscribe protocol is the protocol used to exchange messages on a standard network. Based on the above description of the functions of the DDS network, in the content of this embodiment, a call instruction refers to controlling the RTPS Real-Time Publish-Subscribe protocol to execute corresponding functions. Specifically, it can include the transmission of subscribed data, the establishment of the relationship between the subscriber and the publisher, etc. In this embodiment and subsequent embodiment contents, the publication of commonly used subscribed data is used as an example to illustrate the call instruction, but the technical solutions of the embodiments of this application can simultaneously support other functions executed using the RTPS Real-Time Publish-Subscribe protocol.
[0057] In the DDS network, when a call instruction is sent to the RTPS Real-Time Publish-Subscribe protocol, in order to implement the function of the call instruction, RTPS reads the call function corresponding to the call instruction and uses this function as the target call data. When the command of the call instruction is the publication of subscribed data, the function of the target call function is to publish the subscribed data from the publisher to the subscriber.
[0058] In a possible embodiment, the target call function can be a callback function. A callback function is a function that can be passed to another function and is called by another function at a certain time or when a certain condition occurs.
[0059] In a possible embodiment, in response to a call instruction for the RTPS Real-Time Publish-Subscribe protocol, obtaining the target call function executed by RTPS during the call includes:
[0060] In response to a call instruction for the RTPS (Real - Time Publish - Subscribe Protocol), confirm the publisher address and the subscriber address; determine the communication content and the communication topic corresponding to the call instruction; based on the publisher address, the subscriber address, the communication content, and the communication topic, generate the target call function executed by RTPS during the call.
[0061] In the content of this embodiment, when implementing the determination of the target call function, it further includes extracting relevant data when subscribing to data publication. The relevant data includes: the publisher address, the subscriber address, the communication content, and the communication topic. At the same time, based on the subscription - publication establishment in this embodiment, the target call function is established when the subscriber and the publisher are in the same domain. Before calling the target call function, a connection needs to be established between the publisher and the subscriber. At the same time, the subscriber needs to subscribe to the content under the communication topic published by the subscriber. Thus, the target call function can successfully establish communication between the subscriber and the publisher relying on the publisher address, the subscriber address, the communication content, and the communication topic.
[0062] Step 102, record the call parameters of the target call function. The call parameters include at least one of the call time, the call node, and the subscription parameter, and the subscription parameter is used to represent the subscribed data.
[0063] When successfully implementing the subscription data publication between the publisher and the subscriber using the target call function, record the call parameters. Among them, the call parameters include: the call time, the call node, and the subscription parameter.
[0064] In a possible embodiment, the call parameters include: the call time, the publisher address, the subscriber address, the communication content, and the communication topic;
[0065] Take the publisher address and the subscriber address as the call node; take the communication content and the communication topic as the subscribed data.
[0066] During the process of using the target call function to subscribe data between the publisher and the subscriber, record the corresponding call parameters. The call parameters include: call time, publisher address, subscriber address, communication content, and communication topic. At the same time, divide the call parameters. The publisher address and the subscriber address are used as call nodes. That is, when subscribing data is published, the subscribing data is published from the publisher address to the subscriber address. The publisher address can be used as the starting node, and the subscriber address can be used as the ending node. The two together are used as call nodes. The communication content and the communication topic can be used as subscribing data together. Specifically, the communication content is the content of the subscribing data published specifically under the communication topic. Under the communication topic, only the communication content corresponding to the topic can be transmitted. On the basis of confirming the publisher address, subscriber address, communication content, and communication topic, when using the target call function to successfully publish subscribing data, it is also necessary to synchronously record the call time of the subscribing data. Among them, the call time includes at least the time when the communication content leaves the publisher and the time when it arrives at the subscriber. The call time is used as a node reference for the data transmission of the subscribing data.
[0067] Step 103, within the time period corresponding to the execution of the target call function, obtain the communication parameters when executing the communication instruction from the communication layer. The communication parameters include at least one of communication time, communication starting point, and transmission target; when RTPS executes the target call function, it uses the communication instruction in the target call function to control the communication layer to perform communication transmission.
[0068] On the basis that RTPS uses the target call function to publish subscribing data and records the call parameters, this embodiment further proposes to obtain communication parameters from the perspective of the communication layer. The communication layer provides communication services for the DDS network and is responsible for actually sending and receiving data through physical transmission. As Figure 2 shown, Figure 2 shows a hierarchical distribution diagram of a DDS network provided by an embodiment of the present application. When DDS is applied to a vehicle, from the perspective of the first-level application layer, it can achieve sending a single instruction from the central control system to multiple devices at the same time, such as the engine management system 11, the braking system 12, the transmission system 13, etc. From the second level of implementing the above functions, when the DDS network executes functions, it is necessary to define the domain 21, the publisher / subscriber 22, and the communication topic 23. When using the above DDS network to execute various functions, use the third-level RTPS to successfully control the function content of the target call function. Based on the RTPS real-time publish-subscribe protocol, functions such as static discovery 31, communication content transmission 32, and heartbeat detection 33 between the publisher and the subscriber can be realized. When implementing the above functions, it is necessary to rely on the successful connection of the fourth-level communication layer to ensure the normal execution of communication. The communication methods can include: TCP communication 41, UDP communication 42, and SHM communication 43.
[0069] In the content of this embodiment, when executing the target call function, communication parameters are obtained from the direction of the communication layer. Conventionally, when the target call function is executed, the parameters corresponding to the function of the RTPS where the target call function is located are directly extracted. However, when the content transmitted by RTPS is unreliable, in combination with the content of this embodiment, communication parameters can be further extracted from the perspective of the communication layer. In terms of the function of the communication layer, the communication layer can support subscribing to data for data transmission. It is a single function when implementing the RTPS function. Therefore, there are differences between the communication time and the communication starting point obtained from the communication layer and the call time and the call node.
[0070] Step 104: Generate a parameter comparison value using the call parameters and the communication parameters, and obtain a communication detection result according to the comparison result between the parameter comparison value and the preset parameter value.
[0071] When obtaining the call parameters from RTPS and the communication parameters from the communication layer respectively, the two are combined to generate a parameter comparison value, where the parameter comparison value is used to represent the parameter representation situations when RTPS and the communication layer respectively perform subscribing data transmission. By comparing the parameter comparison value with the preset parameter value, the communication detection during this subscription data publication using the DDS network can be reflected according to the comparison result. Among them, the preset parameter value can be obtained by inputting the call parameters and / or the communication parameters into the trained corresponding AI model at the same time.
[0072] In the above embodiment content of this application, during the process of subscribing data distribution based on the DDS network, in combination with the call parameters when executing the target call function of RTPS and the communication parameters when the communication layer performs data transmission, the two are combined to judge the communication status of the DDS network operation this time. By extracting parameters from both the RTPS and the communication layer, and comprehensively using the comparison of the parameters from both aspects with the preset parameter value, communication detection at two levels is realized, ensuring that when the communication data extracted at the RTPS layer is unreliable, the call parameters of RTPS can also be verified for communication relying on the communication parameters obtained from the communication layer, further ensuring the reliability of the DDS network communication detection.
[0073] In a possible embodiment, during the time period corresponding to the execution of the target call function, obtain the communication parameters when executing the communication instruction from the communication layer, including:
[0074] Identify the kernel module of the communication layer; during the time period corresponding to the execution of the target call function, obtain the communication parameters when executing the communication instruction from the communication layer through kernel observation technology, and the kernel observation technology is used to track the communication instruction according to the kernel module.
[0075] When implementing the communication function, several kernel modules in the communication layer cooperate to achieve the transmission of subscribed data. Based on this, the kernel observation technology eBPF is proposed in this embodiment. By tracking the execution status of the normal kernel in the communication layer and related key data, communication parameters can be observed more conveniently.
[0076] The content of this embodiment proposes the application of the kernel observation technology eBPF to realize the feasibility of obtaining communication parameters from the communication layer. At the same time, it further explains the corresponding time of the target call function in the communication layer to ensure the corresponding relationship between RTPS and the communication layer, that is, the corresponding relationship between the call parameters and the communication parameters in terms of time relationship. In terms of the time range, the starting range of the starting time point of the communication parameters belongs to the node range of the call node, and the starting time point of the communication parameters corresponds to both ends of the node range of the call node.
[0077] In a possible embodiment, a parameter comparison value is generated using the call parameters and the communication parameters, and a communication detection result is obtained according to the comparison result between the parameter comparison value and a preset parameter value, including:
[0078] Establish the parameter correspondence between the call parameters and the communication parameters using a time series database or a streaming data processing method; according to the parameter correspondence, establish the data flow direction under the target call function, and the data flow direction is represented by the parameter comparison value; calculate the comparison result between the parameter comparison value and the preset parameter value, and the preset parameter value is the historical normal value during the execution of the call instruction; if the comparison result is greater than the preset difference, confirm that the communication detection result is abnormal.
[0079] Since the DDS network is constantly being applied, it is constantly generating data streams. In order not to affect the normal publication of data, the communication detection method of this application embodiment should be able to be executed during the data publication process. Therefore, before the call parameters and the communication parameters are combined to generate the parameter comparison value, the correspondence between the corresponding call parameters and the communication parameters should be realized. This embodiment uses a time series database or a streaming data processing method to establish the relationship between the two, and realizes the connection of the two parameters based on this correspondence. Among them, the connection of the two parameters can be used to represent the data flow direction of the DDS network, and its specific flow order can be: 1. Publisher address; 2. Communication starting point; 3. Communication end point; 4. Subscriber address. And the data flow direction is represented by the parameter comparison value, where the parameter comparison value can be at least one numerical value. The communication detection result is generated using the comparison result between the parameter comparison value and the preset parameter comparison value. When the difference between the parameter comparison value and the preset parameter value is too large, it can be considered that an abnormality occurs during data publication.
[0080] In the content of this embodiment, it is proposed to combine the call parameters and communication parameters to restore the overall parameter comparison value of the subscription data during the publishing process, and compare it with the preset parameter value. By using the parameters at two levels, communication detection is performed from multiple angles, providing a broader perspective for communication detection and effectively improving the effectiveness of communication detection.
[0081] In a possible implementation, after confirming that the communication detection result is abnormal if the comparison result is greater than the preset difference, the method further includes:
[0082] Extract the target parameter value from the parameter comparison value. The comparison result of the target parameter value with the corresponding parameter value in the preset parameter value is greater than the preset difference; restore the parameter source of the target parameter value, and the parameter source includes call parameters and communication parameters; confirm the source of the abnormality of the communication detection result according to the parameter source.
[0083] On the basis of implementing communication detection using the combined parameter comparison values of call parameters and communication parameters respectively, this embodiment further proposes that when a communication abnormality is detected, the data of the communication abnormality can be obtained from the parameter comparison value, and the abnormal location can be confirmed according to the source of the abnormal data. Among them, the abnormal location can be a service abnormality corresponding to RTPS or a communication abnormality corresponding to the communication layer.
[0084] On the basis of implementing multi-level judgment of communication detection, this embodiment further proposes to perform abnormal detection for each level to ensure the application stability of the communication detection in this embodiment.
[0085] In a possible implementation, after obtaining the communication parameters when executing the communication instruction from the communication layer during the time period corresponding to the execution of the target call function, the method further includes:
[0086] Combine the call parameters and communication parameters to generate a data flow diagram between RTPS and the communication layer.
[0087] When confirming a subscription data distribution process, the call parameters of RTPS can represent the call time, call node, and subscription parameters during the data distribution process, and the communication time, communication starting point, and transmission target represented by the communication parameters of the communication layer. Through the generated data flow diagram, users can conveniently observe the data flow situation. For example, in the form of a flow diagram, it can be conveniently observed that at exactly ten o'clock, the subscription data a is published from the publisher A to the subscribers B and C according to the call instruction. At the same time, the communication topic topic of the subscription data a and the communication content under the communication topic are displayed. The communication content can be data attribute information such as the data size and data format of the subscription data.
[0088] In addition, to facilitate the display of communication detection to the user, the data flow diagram can further display the comparison result between the parameter comparison value and the preset parameter value, so that the user can intuitively understand the entire process of communication detection.
[0089] As shown in this embodiment Figure 3 a structural diagram of a communication detection device for a DDS network is disclosed, including: an acquisition module 31, a recording module 32, an acquisition module 33, and a comparison module 34;
[0090] The acquisition module 31 is configured to, in response to a call instruction for the RTPS real-time publish-subscribe protocol, determine a target call function executed during the call of the RTPS, and the target call function is used to publish and subscribe to data according to the call instruction;
[0091] The recording module 32 is configured to record the call parameters of the target call function, where the call parameters include at least one of a call time, a call node, and a subscription parameter, and the subscription parameter is used to represent the subscribed data;
[0092] The acquisition module 33 is configured to obtain communication parameters during the execution of a communication instruction from the communication layer within a time period corresponding to the execution of the target call function, where the communication parameters include at least one of a communication time, a communication start point, and a transmission target; when the RTPS executes the target call function, the communication layer is controlled to perform communication transmission by using the communication instruction in the target call function;
[0093] The comparison module 34 is configured to generate a parameter comparison value by using the call parameters and the communication parameters, and obtain a communication detection result according to a comparison result between the parameter comparison value and a preset parameter value.
[0094] In a possible embodiment, the acquisition module 31 is specifically configured to:
[0095] In response to a call instruction for the RTPS real-time publish-subscribe protocol, confirm the publisher address and the subscriber address;
[0096] Determine the communication content and communication topic corresponding to the call instruction;
[0097] Based on the publisher address, the subscriber address, the communication content, and the communication topic, generate a target call function executed during the call of the RTPS.
[0098] In a possible embodiment, the call parameters further include: the communication content and the communication topic;
[0099] The publisher address and the subscriber address serve as the call node;
[0100] In a possible embodiment, the obtaining module 33 is specifically configured to:
[0101] Identify the kernel module of the communication layer;
[0102] During the time period corresponding to the execution of the target call function, obtain communication parameters during the execution of communication instructions from the communication layer through kernel observation technology, where the kernel observation technology is used to track the communication instructions according to the kernel module.
[0103] In a possible embodiment, the comparison module 34 is specifically configured to:
[0104] Establish a parameter correspondence between the call parameters and the communication parameters by using a time series database or a streaming data processing method;
[0105] According to the parameter correspondence, establish the data flow direction under the target call function, and the data flow direction is represented by the parameter comparison value;
[0106] Calculate the comparison result between the parameter comparison value and a preset parameter value, where the preset parameter value is a historical normal value during the execution of the call instruction;
[0107] If the comparison result is greater than a preset difference, confirm that the communication detection result is abnormal.
[0108] In a possible embodiment, the comparison module 34 further includes:
[0109] Extract a target parameter value from the parameter comparison values, where the comparison result of the target parameter value compared with the corresponding parameter value in the preset parameter value is greater than a preset difference;
[0110] Restore the parameter source of the target parameter value, where the parameter source includes the call parameters and the communication parameters;
[0111] Confirm the abnormal source of the communication detection result according to the parameter source.
[0112] In a possible embodiment, the communication detection device further includes a drawing module 35 for:
[0113] Combine the call parameters and the communication parameters to generate a data flow diagram between the RTPS and the communication layer.
[0114] Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of various implementation scenarios of the present application.
[0115] Based on the method as described above Figure 1 shown, and Figure 3 the virtual device embodiment shown, to achieve the above object, an embodiment of the present application further provides an electronic device, which can be configured on the vehicle side (such as a new energy vehicle). The device includes at least one processor and a memory communicatively connected to the at least one processor; the memory is used to store instructions executable by the at least one processor. The instructions are executed by the at least one processor, and the processor is used to execute a computer program to implement the method as described above Figure 1 shown.
[0116] Optionally, the above-mentioned physical device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, sensors, an audio circuit, a WI-FI module, and so on. The user interface may include a display screen (Display), an input unit such as a keyboard (Keyboard), etc. Optionally, the user interface may further include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
[0117] Those skilled in the art can understand that the structure of the above-mentioned physical device provided in this embodiment does not limit the physical device, and it may include more or fewer components, or combine certain components, or have different component arrangements.
[0118] Based on the method as described above Figure 1 shown, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the method corresponding to any embodiment. The storage medium may further include an operating system and a network communication module. The operating system is a program for managing the hardware and software resources of the above-mentioned physical device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to implement communication between components inside the storage medium, and communication with other hardware and software in the information processing physical device.
[0119] Based on the above-mentioned electronic device, an embodiment of the present application further provides a vehicle, which specifically may include: the device as described above Figure 3 shown or the above-mentioned electronic device. The vehicle may specifically be a new energy vehicle or a traditional vehicle, etc.
[0120] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, or can also be implemented by hardware. By applying the solution of this embodiment, compared with the current existing technologies, by adopting the technical solution of the present application, after identifying a call instruction, call parameters are recorded from RTPS according to the target call function, communication parameters are obtained from the communication layer, and the comparison results of the call parameters and the communication parameters with the preset parameter values are comprehensively utilized, so as to realize the communication detection of the DDS network. The solution of the present application extracts parameters from both the RTPS and the communication layer, and comprehensively utilizes the comparison of the parameters of the two aspects with the preset parameter values to realize communication detection through two levels, ensuring that when the communication data extracted at the RTPS layer is unreliable, the communication parameters obtained from the communication layer can also be used to verify the call parameters of the RTPS, further ensuring the reliability of the DDS network communication detection.
[0121] It should be noted that in this text, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the said element.
[0122] The above are only specific embodiments of the present application, enabling those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A communication detection method for a DDS network, characterized in that, Including: In response to a call instruction for the RTPS (Real - Time Publish - Subscribe Protocol), obtain the target call function executed by the RTPS during the call, where the target call function is used to publish subscription data according to the call instruction; Record the call parameters of the target call function, where the call parameters include at least one of call time, call node, and subscription parameters, and the subscription parameters are used to represent the subscription data; During the time period when the target call function is executed, obtain the communication parameters when executing the communication instruction from the communication layer, where the communication parameters include at least one of communication time, communication starting point, and transmission target; when the RTPS executes the target call function, it controls the communication layer to perform communication transmission using the communication instruction in the target call function; Generate a parameter comparison value using the call parameters and the communication parameters, and obtain a communication detection result based on the comparison result between the parameter comparison value and a preset parameter value.
2. The method according to claim 1, characterized in that, The step of, in response to a call instruction for the RTPS (Real - Time Publish - Subscribe Protocol), obtaining the target call function executed by the RTPS during the call includes: In response to a call instruction for the RTPS (Real - Time Publish - Subscribe Protocol), confirm the publisher address and the subscriber address; Determine the communication content and communication topic corresponding to the call instruction; Based on the publisher address, the subscriber address, the communication content, and the communication topic, generate the target call function executed by the RTPS during the call.
3. The method according to claim 2, characterized in that, The call parameters further include: the communication content and the communication topic; The publisher address and the subscriber address serve as the call node; The communication content and the communication topic serve as the subscription data.
4. The method according to claim 1, characterized in that, The step of, during the time period when the target call function is executed, obtaining the communication parameters when executing the communication instruction from the communication layer includes: Identify the kernel module of the communication layer; During the time period when the target call function is executed, obtain the communication parameters when executing the communication instruction from the communication layer through kernel observation technology, where the kernel observation technology is used to track the communication instruction according to the kernel module.
5. The method according to claim 1, characterized in that, The step of generating a parameter comparison value using the call parameters and the communication parameters, and obtaining a communication detection result based on the comparison result between the parameter comparison value and a preset parameter value includes: Establish a parameter correspondence relationship between the call parameters and the communication parameters using a time - series database or a streaming data processing method; According to the parameter correspondence relationship, establish the data flow direction under the target call function, where the data flow direction is represented by the parameter comparison value; Calculate the comparison result between the parameter comparison value and a preset parameter value, where the preset parameter value is the historical normal value during the execution of the call instruction; If the comparison result is greater than a preset difference, confirm that the communication detection result is abnormal.
6. The method according to claim 5, characterized in that, After the step of, if the comparison result is greater than a preset difference, confirm that the communication detection result is abnormal, the method further includes: Extract a target parameter value from the parameter comparison value, where the comparison result of the target parameter value compared with the corresponding parameter value in the preset parameter value is greater than the preset difference; Restore the parameter source of the target parameter value, where the parameter source includes the call parameter and the communication parameter; Confirm the abnormal source of the communication detection result according to the parameter source.
7. The method according to claim 1, characterized in that, After obtaining the communication parameter when executing the communication instruction from the communication layer during the time period corresponding to the execution of the target call function, the method further includes: Combine the call parameter and the communication parameter to generate a data flow diagram between the RTPS and the communication layer.
8. A communication detection device for a DDS network, characterized in that, Include: An acquisition module, configured to, in response to a call instruction for the RTPS real-time publish-subscribe protocol, acquire a target call function executed by the RTPS during the call, where the target call function is used to publish and subscribe to data according to the call instruction; A recording module, configured to record the call parameter of the target call function, where the call parameter includes at least one of a call time, a call node, and a subscription parameter, and the subscription parameter is used to represent the subscribed data; An acquisition module, configured to, during the time period corresponding to the execution of the target call function, acquire the communication parameter when executing the communication instruction from the communication layer, where the communication parameter includes at least one of a communication time, a communication starting point, and a transmission target; when the RTPS executes the target call function, it controls the communication layer to perform communication transmission by using the communication instruction in the target call function; A comparison module, configured to generate a parameter comparison value by using the call parameter and the communication parameter, and obtain a communication detection result according to a comparison result between the parameter comparison value and a preset parameter value.
9. An electronic device, characterized in that,Include: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program, when executed by a processor, implements the method according to any one of claims 1-7.
11. A vehicle, characterized in that, The vehicle is equipped with the device according to claim 8, or the electronic device according to claim 9.
Citation Information
Cited By
Method and system for DDS static discovery
CN122317148A