Safety communication method, device and terminal equipment of laser radar system
By generating and verifying verification data frames in the lidar system, the problem of data transmission errors is solved, ensuring data integrity and accuracy, improving system security, and preventing losses caused by errors.
Patent Information
- Application Number
- CN202211707096.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2042-12-29
AI Technical Summary
In existing technologies, data communication processes of secure lidar are prone to errors such as misinterpretation, accidental duplication, out-of-order delivery, loss, unacceptable delays, insertion, spoofing, and addressing errors, which can lead to the failure of security functions and even cause property or loss of life.
By generating first and second verification data for the data to be sent, the data to be sent is encapsulated and verified at the communication peer to detect transmission errors, including verification of characteristic information such as frame header, frame length, timestamp, frame sequence number, and command number, to ensure data integrity and accuracy.
Effectively detect and correct data transmission errors, ensure the safety of lidar systems, and reduce property or loss of life in industrial production processes.
Smart Images

Figure CN116015905B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of radars, and particularly relates to a safety communication method and device of a laser radar system, a terminal device, and a computer readable storage medium. BACKGROUND
[0002] With the development and progress of society, the degree of automation in various industrial control application fields is gradually increasing, and intelligent technology is rapidly developing. However, there are also many potential dangers and risks. Functional safety and personal safety in the production process are increasingly valued. The emergence of safety laser radars greatly facilitates the solution of safety problems.
[0003] In related technologies, the safety of board-level data communication of a safety laser radar and data communication between the safety laser radar and other devices in a system directly affects whether the safety laser radar can realize safety functions. During data communication, errors such as distortion, accidental repetition, out-of-order, loss, unacceptable delay, insertion, disguise, addressing, and the like often occur. When these transmission errors occur, the safety functions of the safety laser radar fail, and in serious cases, property or life loss can even be caused. SUMMARY
[0004] Embodiments of the application provide a safety communication method and device of a laser radar system, a terminal device, and a storage medium, which can solve the problem that errors such as distortion, accidental repetition, out-of-order, loss, unacceptable delay, insertion, disguise, addressing, and the like often occur during data communication, which can cause the safety functions of the safety laser radar to fail, and in serious cases, property or life loss can even be caused.
[0005] In a first aspect, embodiments of the application provide a safety communication method of a laser radar system, including: obtaining to-be-sent data and feature information corresponding to the to-be-sent data; generating first check data of the to-be-sent data according to the feature information; generating second check data of the to-be-sent data according to the to-be-sent data and the first check data of the to-be-sent data; performing encapsulation processing on the to-be-sent data, the first check data of the to-be-sent data, and the second check data of the to-be-sent data to generate a first encapsulation data frame corresponding to the to-be-sent data; and sending the first encapsulation data frame to a communication opposite end.
[0006] In a possible implementation manner of the first aspect, the feature information includes at least one of a data type, a data length, time information, and a latest frame sequence number corresponding to an encapsulation data frame that has been sent, and the first check data includes at least one of a frame header, a frame length, a time stamp, a frame sequence number, a command number, and a frame tail.
[0007] Optionally, in a further possible implementation of the first aspect, the second check data comprises a first check value and a second check value; and correspondingly, the generating the second check data corresponding to the to-be-sent data according to the to-be-sent data and the first check data comprises:
[0008] checking the to-be-sent data and the first check data of the to-be-sent data by using the first data check algorithm to generate a first check value;
[0009] checking the to-be-sent data, the first check data of the to-be-sent data, and the first check value by using the second data check algorithm to generate a second check value.
[0010] Optionally, in a further possible implementation of the first aspect, the feature information comprises a data type, and the first check data comprises a frame header and a command number; and correspondingly, the generating the first check data of the to-be-sent data according to the feature information comprises:
[0011] determining the frame header and the command number according to the data type.
[0012] Optionally, in a further possible implementation of the first aspect, the first check data comprises a frame length; and correspondingly, the generating the first check data of the to-be-sent data according to the feature information comprises:
[0013] determining the frame length according to the data type.
[0014] Optionally, in a further possible implementation of the first aspect, the feature information comprises a data length; and correspondingly, the determining the frame length according to the data type comprises:
[0015] when the data type is a preset data type, determining the frame length as a preset frame length corresponding to the preset data type;
[0016] when the data type is not the preset data type, determining the frame length according to the data length.
[0017] Optionally, in a further possible implementation of the first aspect, the feature information comprises time information, and the first check data comprises a time stamp; and correspondingly, the generating the first check data of the to-be-sent data according to the feature information comprises:
[0018] determining the time information as the time stamp, wherein the time information is a system time at which the to-be-sent data is acquired.
[0019] Optionally, in a further possible implementation of the first aspect, the to-be-sent data comprises a latest frame sequence number corresponding to a sent encapsulated data frame, and the first check data comprises a frame sequence number; and correspondingly, the generating the first check data of the to-be-sent data according to the feature information comprises:
[0020] The latest frame sequence number is added by one to determine the frame sequence number.
[0021] Optionally, in a further possible implementation manner of the first aspect, the first check data comprises a frame tail; and correspondingly, the generating the first check data of the to-be-sent data according to the feature information comprises:
[0022] The frame tail is determined as a preset frame tail.
[0023] Alternatively,
[0024] When the feature information comprises a data type, the frame tail is determined according to the data type.
[0025] Optionally, in a further possible implementation manner of the first aspect, the method further comprises:
[0026] receiving a second encapsulated data frame sent by a communication peer end;
[0027] performing analysis processing on the second encapsulated data frame to determine to-be-received data, first check data of the to-be-received data and second check data of the to-be-received data comprised in the second encapsulated data frame;
[0028] performing check on the first check data and the second check data of the to-be-received data to determine whether the to-be-received data has transmission error;
[0029] if the to-be-received data has transmission error, discarding the to-be-received data;
[0030] if the to-be-received data has no transmission error, receiving the to-be-received data.
[0031] Optionally, in a further possible implementation manner of the first aspect, the performing check on the first check data and the second check data of the to-be-received data to determine whether the to-be-received data has transmission error comprises:
[0032] performing check on the first check data of the to-be-received data;
[0033] if the first check data of the to-be-received data is not checked successfully, determining that the to-be-received data has transmission error;
[0034] if the first check data of the to-be-received data is checked successfully, performing check on the second check data of the to-be-received data;
[0035] if the second check data of the to-be-received data is checked successfully, determining that the to-be-received data has no transmission error;
[0036] if the second check data of the to-be-received data is not checked successfully, determining that the to-be-received data has transmission error.
[0037] Optionally, in a further possible implementation manner of the first aspect, the first check data comprises at least one of a frame header, a frame length, a time stamp, a frame sequence number, a command number, and a frame tail, and the second check data comprises a first check value and a second check value, wherein the first check value is generated by performing check processing on the to-be-received data and the first check data of the to-be-received data by using a first data check algorithm, and the second check value is generated by performing check processing on the to-be-received data, the first check data of the to-be-received data, and the first check value by using a second data check algorithm.
[0038] Optionally, in a further possible implementation manner of the first aspect, the check on the first check data of the to-be-received data comprises:
[0039] checking each item of data in the first check data of the to-be-received data;
[0040] if any item of data in the first check data of the to-be-received data fails the check, determining that the first check data of the to-be-received data fails the check;
[0041] if all items of data in the first check data of the to-be-received data pass the check, determining that the first check data of the to-be-received data passes the check.
[0042] Optionally, in a further possible implementation manner of the first aspect, the first check data comprises a frame header and a command number, and the check on the first check data of the to-be-received data comprises:
[0043] determining whether the frame header and the command number in the first check data of the to-be-received data match;
[0044] if the frame header and the command number match, determining that the frame header and the command number in the first check data of the to-be-received data pass the check;
[0045] if the frame header and the command number do not match, determining that the first check data of the to-be-received data fails the check.
[0046] Optionally, in a further possible implementation manner of the first aspect, the first check data comprises a frame length, and the check on the first check data of the to-be-received data comprises:
[0047] determining a data length of the to-be-received data;
[0048] if the data length of the to-be-received data matches the frame length in the first check data of the to-be-received data, determining that the frame length in the first check data of the to-be-received data passes the check;
[0049] If the data length of the to-be-received data does not match the frame length in the first check data of the to-be-received data, it is determined that the first check data of the to-be-received data is not checked successfully.
[0050] Optionally, in a further possible implementation of the first aspect, the first check data comprises a timestamp; and correspondingly, the checking the first check data of the to-be-received data comprises:
[0051] obtaining a timestamp of a neighboring data frame corresponding to the second encapsulated data frame, wherein the neighboring data frame refers to a data frame received before the second encapsulated data frame and closest in time to the second encapsulated data frame;
[0052] If the difference between the timestamp in the first check data of the to-be-received data and the timestamp of the neighboring data frame is the preset time interval, it is determined that the timestamp in the first check data of the to-be-received data is checked successfully.
[0053] If the difference between the timestamp in the first check data of the to-be-received data and the timestamp of the neighboring data frame is not the preset time interval, it is determined that the first check data of the to-be-received data is not checked successfully.
[0054] Optionally, in a further possible implementation of the first aspect, the first check data comprises a frame sequence number; and correspondingly, the checking the first check data of the to-be-received data comprises:
[0055] obtaining a frame sequence number of a neighboring data frame corresponding to the second encapsulated data frame, wherein the neighboring data frame refers to a data frame received before the second encapsulated data frame and closest in time to the second encapsulated data frame;
[0056] If the difference between the frame sequence number in the first check data of the to-be-received data and the frame sequence number of the neighboring data frame is 1, it is determined that the frame sequence number in the first check data of the to-be-received data is checked successfully.
[0057] If the difference between the frame sequence number in the first check data of the to-be-received data and the frame sequence number of the neighboring data frame is not 1, it is determined that the first check data of the to-be-received data is not checked successfully.
[0058] Optionally, in a further possible implementation of the first aspect, the checking the second check data of the to-be-received data comprises:
[0059] checking the to-be-received data and the first check data of the to-be-received data by using a first data check algorithm to generate a third check value;
[0060] checking the to-be-received data, the first check data of the to-be-received data, and the third check value by using a second data check algorithm to generate a fourth check value.
[0061] If the first check value of the to-be-received data matches the third check value, and the second check value of the to-be-received data matches the fourth check value, it is determined that the second check data of the to-be-received data is checked successfully.
[0062] If the first check value of the to-be-received data does not match the third check value, or the second check value of the to-be-received data does not match the fourth check value, it is determined that the second check data of the to-be-received data is not checked successfully.
[0063] Optionally, in another possible implementation manner of the first aspect, after the to-be-received data is discarded if a transmission error occurs, the method further includes:
[0064] sending, to a communication peer, a retransmission request frame corresponding to the to-be-received data, wherein the retransmission request frame includes identification information of the to-be-received data.
[0065] Optionally, in another possible implementation manner of the first aspect, the data type includes any one of parameter configuration information, running state information, and probe data.
[0066] In a second aspect, an embodiment of the present application provides a safety communication device of a laser radar system, including: a first obtaining module, configured to obtain to-be-sent data and feature information corresponding to the to-be-sent data; a first generating module, configured to generate first check data of the to-be-sent data according to the feature information; a second generating module, configured to generate second check data of the to-be-sent data according to the to-be-sent data and the first check data of the to-be-sent data; a third generating module, configured to perform encapsulation processing on the to-be-sent data, the first check data of the to-be-sent data, and the second check data of the to-be-sent data, to generate a first encapsulation data frame corresponding to the to-be-sent data; and a first sending module, configured to send the first encapsulation data frame to a communication peer.
[0067] In a possible implementation manner of the second aspect, the feature information includes at least one of a data type of the to-be-sent data, a data length, time information, and a latest frame sequence number corresponding to an encapsulation data frame that has been sent, and the first check data includes at least one of a frame header, a frame length, a time stamp, a frame sequence number, a command number, and a frame tail.
[0068] Optionally, in another possible implementation manner of the second aspect, the second check data includes a first check value and a second check value; and correspondingly, the second generating module includes:
[0069] a first generating unit, configured to perform check processing on the to-be-sent data and the first check data of the to-be-sent data by using a first data check algorithm, to generate the first check value;
[0070] The second generating unit is configured to perform a check processing on the to-be-sent data, the first check data of the to-be-sent data and the first check value by using a second data check algorithm to generate a second check value.
[0071] Optionally, in a third possible implementation manner of the second aspect, the feature information comprises a data type, and the first check data comprises a frame header and a command number; correspondingly, the first generating module comprises:
[0072] The first determining unit is configured to determine the frame header and the command number according to the data type.
[0073] Optionally, in a fourth possible implementation manner of the second aspect, the first check data comprises a frame length; correspondingly, the first generating module comprises:
[0074] The second determining unit is configured to determine the frame length according to the data type.
[0075] Optionally, in a fifth possible implementation manner of the second aspect, the feature information comprises a data length; correspondingly, the second determining unit is specifically configured to:
[0076] when the data type is a preset data type, determine the frame length as a preset frame length corresponding to the preset data type;
[0077] when the data type is not the preset data type, determine the frame length according to the data length.
[0078] Optionally, in a sixth possible implementation manner of the second aspect, the feature information comprises time information, and the first check data comprises a time stamp; correspondingly, the first generating module comprises:
[0079] The third determining unit is configured to determine the time information as the time stamp, wherein the time information is a system time at which the to-be-sent data is acquired.
[0080] Optionally, in a seventh possible implementation manner of the second aspect, the to-be-sent data comprises a latest frame sequence number corresponding to a sent encapsulated data frame, and the first check data comprises a frame sequence number; correspondingly, the first generating module comprises:
[0081] The fourth determining unit is configured to determine the latest frame sequence number plus one as the frame sequence number.
[0082] Optionally, in an eighth possible implementation manner of the second aspect, the first check data comprises a frame tail; correspondingly, the first generating module comprises:
[0083] The fifth determining unit is configured to determine the frame tail as a preset frame tail.
[0084] or,
[0085] The sixth determining unit is configured to determine the frame tail according to the data type when the data type is included in the feature information.
[0086] Optionally, in a third possible implementation manner of the second aspect, the apparatus further includes:
[0087] The first receiving module is configured to receive a second encapsulated data frame sent by a communication opposite end;
[0088] The first determining module is configured to perform analysis processing on the second encapsulated data frame to determine to-be-received data, first check data of the to-be-received data, and second check data of the to-be-received data included in the second encapsulated data frame;
[0089] The first checking module is configured to check the first check data and the second check data of the to-be-received data to determine whether the to-be-received data has a transmission error;
[0090] The first discarding module is configured to discard the to-be-received data if the to-be-received data has the transmission error;
[0091] The second receiving module is configured to receive the to-be-received data if the to-be-received data does not have the transmission error.
[0092] Optionally, in another possible implementation manner of the second aspect, the first checking module includes:
[0093] The first checking unit is configured to check the first check data of the to-be-received data;
[0094] The seventh determining unit is configured to determine that the to-be-received data has the transmission error if the first check data of the to-be-received data is not checked successfully;
[0095] The second checking unit is configured to check the second check data of the to-be-received data if the first check data of the to-be-received data is checked successfully;
[0096] The eighth determining unit is configured to determine that the to-be-received data does not have the transmission error if the second check data of the to-be-received data is checked successfully;
[0097] The ninth determining unit is configured to determine that the to-be-received data has the transmission error if the second check data of the to-be-received data is not checked successfully.
[0098] Optionally, in a further possible implementation manner of the second aspect, the first check data includes at least one of a frame header, a frame length, a timestamp, a frame sequence number, a command number, and a frame tail, and the second check data includes a first check value and a second check value, where the first check value is generated by performing check processing on the to-be-received data and the first check data of the to-be-received data by using a first data check algorithm, and the second check value is generated by performing check processing on the to-be-received data, the first check data of the to-be-received data, and the first check value by using a second data check algorithm.
[0099] Optionally, in a further possible implementation manner of the second aspect, the first check unit is specifically configured to:
[0100] perform check on each item of data in the first check data of the to-be-received data;
[0101] if any item of data in the first check data of the to-be-received data fails the check, determine that the first check data of the to-be-received data fails the check;
[0102] if all items of data in the first check data of the to-be-received data pass the check, determine that the first check data of the to-be-received data passes the check.
[0103] Optionally, in a further possible implementation manner of the second aspect, the first check data includes a frame header and a command number, and the first check unit is further configured to:
[0104] determine whether the frame header and the command number in the first check data of the to-be-received data match;
[0105] if the frame header and the command number match, determine that the frame header and the command number in the first check data of the to-be-received data pass the check;
[0106] if the frame header and the command number do not match, determine that the first check data of the to-be-received data fails the check.
[0107] Optionally, in a further possible implementation manner of the second aspect, the first check data includes a frame length, and the first check unit is further configured to:
[0108] determine a data length of the to-be-received data;
[0109] if the data length of the to-be-received data matches the frame length in the first check data of the to-be-received data, determine that the frame length in the first check data of the to-be-received data passes the check;
[0110] if the data length of the to-be-received data does not match the frame length in the first check data of the to-be-received data, determine that the first check data of the to-be-received data fails the check.
[0111] Optionally, in a further possible implementation manner of the second aspect, the first check data comprises a time stamp; and the first check unit is further configured to:
[0112] acquire a time stamp of a neighboring data frame corresponding to the second encapsulated data frame, wherein the neighboring data frame refers to a data frame received before the second encapsulated data frame and closest in time to the second encapsulated data frame;
[0113] if a difference between the time stamp in the first check data of the to-be-received data and the time stamp of the neighboring data frame is the preset time interval, it is determined that the time stamp in the first check data of the to-be-received data is checked successfully;
[0114] if the difference between the time stamp in the first check data of the to-be-received data and the time stamp of the neighboring data frame is not the preset time interval, it is determined that the first check data of the to-be-received data is not checked successfully.
[0115] Optionally, in a further possible implementation manner of the second aspect, the first check data comprises a frame sequence number; and the first check unit is further configured to:
[0116] acquire a frame sequence number of a neighboring data frame corresponding to the second encapsulated data frame, wherein the neighboring data frame refers to a data frame received before the second encapsulated data frame and closest in time to the second encapsulated data frame;
[0117] if a difference between the frame sequence number in the first check data of the to-be-received data and the frame sequence number of the neighboring data frame is 1, it is determined that the frame sequence number in the first check data of the to-be-received data is checked successfully;
[0118] if the difference between the frame sequence number in the first check data of the to-be-received data and the frame sequence number of the neighboring data frame is not 1, it is determined that the first check data of the to-be-received data is not checked successfully.
[0119] Optionally, in a further possible implementation manner of the second aspect, the second check unit is specifically configured to:
[0120] perform check processing on the to-be-received data and the first check data of the to-be-received data by using a first data check algorithm, to generate a third check value;
[0121] perform check processing on the to-be-received data, the first check data of the to-be-received data, and the third check value by using a second data check algorithm, to generate a fourth check value;
[0122] if the first check value of the to-be-received data matches the third check value, and the second check value of the to-be-received data matches the fourth check value, it is determined that the second check data of the to-be-received data is checked successfully;
[0123] If the first check value of the to-be-received data does not match the third check value, or the second check value of the to-be-received data does not match the fourth check value, it is determined that the second check data of the to-be-received data is not checked successfully.
[0124] Optionally, in another possible implementation of the second aspect, the apparatus further includes:
[0125] The second sending module is configured to send, to a communication peer, a retransmission request frame corresponding to the to-be-received data, wherein the retransmission request includes identification information of the to-be-received data.
[0126] Optionally, in another possible implementation of the second aspect, the data type includes any one of parameter configuration information, running state information, and probe data.
[0127] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the safety communication method of the laser radar system when executing the computer program.
[0128] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is characterized in that the computer program is executed by a processor to implement the safety communication method of the laser radar system.
[0129] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on a terminal device, causes the terminal device to execute the safety communication method of the laser radar system.
[0130] Compared with the prior art, the embodiment of the present application has the beneficial effects that two check data of to-be-sent data are generated according to the to-be-sent data and the characteristic information of the to-be-sent data before the to-be-sent data is sent, so that the communication peer can check the obtained data according to the two check data when obtaining the to-be-sent data, and transmission errors in the data can be detected in time, thereby ensuring the safety of the laser radar system and reducing property or life loss in industrial production. BRIEF DESCRIPTION OF DRAWINGS
[0131] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0132] Figure 1is a flowchart of a safety communication method of a laser radar system provided by an embodiment of the present application;
[0133] Figure 2 is a structure diagram of a data frame encapsulation provided by an embodiment of the present application;
[0134] Figure 3 is a flowchart of a safety communication method of a laser radar system provided by another embodiment of the present application;
[0135] Figure 4 is a structure diagram of a safety communication device of a laser radar system provided by an embodiment of the present application;
[0136] Figure 5 is a structure diagram of a terminal device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0137] In the following description, for the purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
[0138] It should be understood that the term “includes” when used in the specification and the appended claims herein, specifies the presence of stated features, integers, steps, operations, elements, and / or components but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0139] It should also be understood that the term “and / or” when used in the specification and the appended claims herein, means any one or more of the associated listed items can be present or can be combined with any one or more of the associated listed items.
[0140] As used in the description of the application and the appended claims herein, the term “if’ can be interpreted as meaning “when” or “upon” or “in response to determining” or “in response to detecting,” depending on the context. Similarly, the phrase “if it is determined” or “if [the described condition or event] is detected” can be interpreted as meaning “upon determining” or “in response to determining” or “upon detecting [the described condition or event]” or “in response to detecting [the described condition or event],” depending on the context.
[0141] In addition, in the description of the application and the appended claims herein, the terms “first,” “second,” “third,” etc. are used only to distinguish descriptions, and cannot be understood as indicating or implying relative importance.
[0142] Reference within the specification to "one embodiment" or "some embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. The appearances of the phrase "in one embodiment" or "in some embodiments" in various places within specified
[0143] The safety communication method, device, terminal equipment, storage medium and computer program of the laser radar system provided by the present application are described in detail below with reference to the accompanying drawings.
[0144] Figure 1 A flowchart of a safety communication method of a laser radar system is shown.
[0145] Step 101, obtaining to-be-sent data and feature information corresponding to the to-be-sent data.
[0146] It should be noted that the safety communication method of the laser radar system of the present application can be executed by the safety communication device of the laser radar system of the present application. The safety communication device of the laser radar system of the present application can be configured in any terminal equipment to execute the safety communication method of the laser radar system of the present application.
[0147] For example, the laser radar system of the present application can be a laser radar system applied in an industrial safety production scene to ensure production safety. The laser radar system can include an upper computer for controlling and managing various devices in the laser radar system, a plurality of laser radars, and other devices working according to the detection data of the laser radars, etc., which are not limited by the present application. In addition, the laser radar can also include a top plate and a bottom plate, so the safety communication method of the present application can also be applied to the board-level communication within the laser radar to realize data interaction within the laser radar. For example, the top plate of the laser radar can process the data collected by the laser radar to generate detection data (such as ranging data, target detection results, etc.) and send it to the bottom plate, and then the bottom plate can also send the obtained detection data to external devices such as the upper computer.
[0148] The to-be-sent data can be data currently needed to be sent to other devices or other data boards of the same device.
[0149] For example, when the method of the embodiments of the present application is applied in a safety production system including a laser radar, the execution subject of the method of the embodiments of the present application can be a top plate, a bottom plate, an upper computer, each other device in the system, etc. of each laser radar in the system; for example, when the top plate of the laser radar needs to send data to the bottom plate, the execution subject is the top plate of the laser radar, and the to-be-sent data is the data to be sent by the top plate of the laser radar to the bottom plate; for another example, when the upper computer needs to manage or configure the laser radar, the execution subject can be the upper computer, and the to-be-sent data can be the bottom plate of the laser radar.
[0150] The characteristic information of the to-be-sent data can include at least one of a data type, a data length, time information, and a latest frame sequence number corresponding to an encapsulated data frame that has been sent.
[0151] The data type can include any one of parameter configuration information, running state information, and detection data.
[0152] For example, when the method of the embodiments of the present application is applied in a safety production system including a laser radar, the laser radar can send the detected environmental data to the bottom plate according to a preset frequency in the detection process; for example, the top plate of the laser radar can send the detected data to the bottom plate every time the laser radar collects data, that is, the data type of the to-be-sent data can be detection data (such as ranging data, etc.); for another example, the laser radar can also send its running state information to the bottom plate during the running process, so that the bottom plate or the upper computer can timely monitor the running state of the laser radar; for example, the laser radar can send its running state information to the bottom plate through the top plate every time the laser radar rotates one circle; for another example, the upper computer can also configure the parameters of the laser radar, so that the upper computer can send the parameter configuration information input by the user to the bottom plate of the laser radar as to-be-sent data.
[0153] The data length can refer to the number of bytes of the to-be-sent data.
[0154] The time information can refer to the system time when the to-be-sent data is acquired.
[0155] In step 102, first check data of the to-be-sent data is generated according to the characteristic information.
[0156] In the embodiments of the present application, in order to timely detect the transmission errors that can occur in the transmission process of the to-be-sent data, such as errors, accidental repetitions, wrong sequences, losses, unacceptable delays, insertions, disguises, addressing errors, etc., the first check data that can check the integrity, accuracy, timing, etc. of the to-be-sent data can be generated according to the characteristic information of the to-be-sent data.
[0157] It should be noted that the error is that the message can be destroyed due to the error in the communication participant, the error on the transmission medium or the message interference; the accidental repetition is that the old message which is not updated is repeated at an incorrect time point due to the error, the fault or the interference; the wrong sequence is that the sequence (for example, the natural number, the time reference) related to the message from a specific source point is incorrect due to the error, the fault or the interference; the loss is that a message or an acknowledgement is not received due to the error, the fault or the interference; the unacceptable delay is that the message can be delayed beyond the allowed arrival time window, for example, due to the error on the transmission medium, the crowded transmission line or the interference, or due to the center communication participant sending the message being in the mode of the delayed or refused service; the insertion is that a message related to an unexpected or unknown source point entity is received due to the error, the fault or the interference; the disguise is that a message related to an apparently valid source point entity is inserted due to the error, the fault or the interference, so that the non-safety-related message can be received by the safety-related communication participant and is treated as the safety-related message; the addressing is that the safety-related message is delivered to an incorrect safety-related communication participant due to the error, the fault or the interference, and the communication participant treats it as a correct message.
[0158] As a possible implementation manner, at least one of the frame header, the frame length, the time stamp, the frame sequence number, the command number and the frame tail can be included in the first check data, so as to detect different transmission errors in time by checking different check data.
[0159] Further, the frame header and the command number can be used to represent the classification information of the to-be-sent data, so the frame header and the command number in the first check data can be determined according to the data type of the to-be-sent data. That is, in a possible implementation manner of the embodiment of the application, the data type can be included in the above-mentioned feature information, and the frame header and the command number can be included in the above-mentioned first check data. Correspondingly, the step 102 can include:
[0160] The frame header and the command number are determined according to the data type.
[0161] As a possible implementation manner, the correspondence between the data type and the frame header and the command number can be preset, so after the to-be-sent data is acquired, the frame header and the command number corresponding to the data type of the to-be-sent data can be determined from the preset correspondence between the data type and the frame header and the command number according to the data type of the to-be-sent data, and the frame header and the command number corresponding to the data type of the to-be-sent data are determined as the frame header and the command number in the first check data of the to-be-sent data.
[0162] As an example, for the same type of data, the corresponding command number and frame header can be the same. For example, the corresponding command number of the parameter configuration information is A, and the corresponding frame header is B; the corresponding command number of the running status information is C, and the corresponding frame header is D, and the like.
[0163] As an example, for the same type of data, the corresponding command number can be the same, and the frame header corresponding to different parameters in the same type of data can be different. For example, the corresponding command number of all parameter configuration information is A, the frame header corresponding to parameter 1 in the parameter configuration information can be B1, and the frame header corresponding to parameter 2 can be B2.
[0164] As an example, for the same type of data, the corresponding frame header can be the same, and the command number corresponding to different parameters in the same type of data can be different. For example, the frame header corresponding to all parameter configuration information is B, the command number corresponding to parameter 1 in the parameter configuration information can be A1, and the command number corresponding to parameter 2 can be A2.
[0165] It should be noted that the above examples are only exemplary and should not be considered as limiting the present application. In actual use, the setting mode of the frame header and the command number can be determined according to actual needs and specific application scenarios, and the embodiments of the present application do not limit this.
[0166] Further, since the length of the data can reflect whether the data has a transmission error in the transmission process, the frame length can also be included in the first check data. That is, in a possible implementation manner of the present application, the first check data can include the frame length; correspondingly, the above step 102 can include:
[0167] determining the frame length according to the data type.
[0168] As a possible implementation manner, since the data lengths of different types of data are usually different, the correspondence between the data type and the frame length can be preset, so after obtaining the to-be-sent data, the frame length corresponding to the data type of the to-be-sent data can be determined from the preset correspondence between the data type and the frame length, and the frame length corresponding to the data type of the to-be-sent data is determined as the frame length in the first check data of the to-be-sent data. For example, the frame length corresponding to the probe data can be determined as 50 bytes.
[0169] It should be noted that when the frame length of each data type of data is set as a fixed value, and the first check data simultaneously includes the frame header, the frame length, and the command number, the correspondence between the frame header, the frame length, and the command number and the data type can also be preset, so that the frame header, the frame length, and the command number in the first check data of the to-be-sent data can be directly determined according to the data type of the to-be-sent data.
[0170] Further, since some types of data have fixed data length, and some types of data can not have fixed data length, the frame length of a certain type of data can also be determined according to whether the type of data has fixed length, to further ensure the accuracy of the generation of the first check data. That is, in a possible implementation of the embodiment of the present application, the above-mentioned feature information can include data length; and correspondingly, the above-mentioned determining the frame length according to the data type comprises:
[0171] determining the frame length as a preset frame length corresponding to the preset data type when the data type is the preset data type;
[0172] determining the frame length according to the data length when the data type is not the preset data type.
[0173] The preset data type can be a data type with fixed data length.
[0174] As a possible implementation, for a data type with fixed data length, the frame length of the to-be-sent data of the data type can be determined as a fixed value; for a data type with non-fixed data length, the frame length of the to-be-sent data can be determined according to the actual data length of the to-be-sent data. Therefore, after obtaining the to-be-sent data, the data type of the to-be-sent data can be determined first to determine whether the to-be-sent data belongs to a preset data type with fixed data length, and if the to-be-sent data belongs to the preset data type, the frame length in the first check data of the to-be-sent data can be determined as a preset frame length. If the to-be-sent data does not belong to the preset data type, the data length of the to-be-sent data can be determined as the frame length in the first check data of the to-be-sent data.
[0175] For example, when the data type of the to-be-sent data includes configuration parameter information, running state information and probe data, since the data format of the probe data is usually the same, the size of the probe data detected at different times is also the same, so the frame length of the probe data can be preset as a fixed value, such as 50 bytes; however, the sizes of different configuration parameters and running states are usually different, so the frame lengths of the configuration parameter information and the running state information can be determined according to the actual data length.
[0176] It should be noted that the frame header, the frame length and the command number in the first check data can be used to check the integrity of the to-be-sent data, to detect errors and disguises in the communication process.
[0177] Further, the time sequence, delay, etc. of the data can be verified through the time information of the data. That is, in a possible implementation of the embodiment of the present application, the feature information can include time information, and the first verification data can include a time stamp; correspondingly, the step 102 can include:
[0178] The time information is determined as a time stamp, wherein the time information is a system time when the to-be-sent data is acquired.
[0179] As a possible implementation, since the data may have transmission errors such as out-of-order, accidental repetition, unacceptable delay, etc. during transmission, a time stamp can be introduced in the first verification data to identify the sending time of each data, so that the transmission errors such as out-of-order, accidental repetition, unacceptable delay, etc. during data transmission can be detected through the time stamp in the first verification data. In the embodiment of the present application, the system time at the time when the to-be-sent data is acquired can be determined, and then the system time is determined as the time stamp in the first verification data of the to-be-sent data.
[0180] Further, each sent data can also be numbered to detect transmission errors such as accidental repetition, out-of-order, loss and insertion, etc. that may occur during transmission. That is, in a possible implementation of the embodiment of the present application, the to-be-sent data can include a latest frame sequence number corresponding to the sent encapsulated data frame, and the first verification data includes a frame sequence number; correspondingly, the step 102 can include:
[0181] The latest frame sequence number is incremented by one to determine the frame sequence number.
[0182] As a possible implementation, each to-be-sent data can be numbered, so that the communication opposite end can determine whether the data frame has transmission errors such as accidental repetition, out-of-order, loss and insertion, etc. according to the sequence number of the acquired data frame. Therefore, after the to-be-sent data is acquired, the latest frame sequence number of the encapsulated data frame sent before can be determined, and the latest frame sequence number is incremented by one to be the frame sequence number in the first verification data of the to-be-sent data.
[0183] Further, a frame tail can also be set in the first verification data, so that the communication opposite end can determine whether the data frame is received completely according to whether the frame tail is acquired. That is, in a possible implementation of the embodiment of the present application, the step 102 can include:
[0184] The frame tail is determined as a preset frame tail.
[0185] Or,
[0186] When the feature information includes a data type, the frame tail is determined according to the data type.
[0187] As a possible implementation, since the frame tail in the first check data is mainly used to indicate whether the data is received, the frame tail of all data can be set as a fixed value, so that the frame tail in the first check data of the to-be-sent data can be determined as a preset frame tail.
[0188] As a possible implementation, the frame tail corresponding to the data of different data types can also be determined as different values, so that the correspondence between the data type and the frame tail can be preset, and then the frame tail corresponding to the data type can be obtained from the preset correspondence between the data type and the frame tail according to the data type of the to-be-sent data, to determine the frame tail in the first check data of the to-be-sent data.
[0189] As a possible implementation, the first check data can include the frame header, the frame length, the timestamp, the frame sequence number, the command number, the frame tail and the like, in which case, the above-mentioned method can be used to determine the data in the first check data in sequence, which will not be repeated here.
[0190] In step 103, the second check data of the to-be-sent data is generated according to the to-be-sent data and the first check data of the to-be-sent data.
[0191] The second check data can be a check value generated by a data check algorithm.
[0192] As a possible implementation, the data check algorithm for generating the second check data can be preset, and after the first check data of the to-be-sent data is generated, the to-be-sent data and the first check data can be used as to-be-checked data, and the preset data check algorithm can be used to check the to-be-sent data and the first check data, and then the generated check value can be determined as the second check data.
[0193] For example, the preset data check algorithm can be a cyclic redundancy check (CRC), such as CRC16, CRC32, and the like, which is not limited in the embodiment of the application.
[0194] Further, since a data check algorithm is used for checking, either the reliability is low or the calculation complexity is high, so a combination of two check methods can be used to improve the check accuracy while reducing the calculation complexity. That is, in a possible implementation of the embodiment of the application, the second check data can include a first check value and a second check value, and the step 103 can include:
[0195] checking the to-be-sent data and the first check data of the to-be-sent data by using a first data check algorithm to generate a first check value;
[0196] The second data check algorithm is used to check the to-be-sent data, the first check data of the to-be-sent data and the first check value, to generate a second check value.
[0197] As a possible implementation, if a simpler data check algorithm (such as CRC16) is used to generate the second check data, the same check value may be generated for different to-be-checked data; and if a more complex data check algorithm (such as CRC32) is used to generate the second check data, the calculation complexity and time consumption of data check will be increased. Therefore, in the embodiments of the present application, two simpler data check algorithms can be combined to perform data check, so as to improve the efficiency of data check while ensuring the reliability of data check. Thus, the first data check algorithm can be used to check the to-be-sent data and the first check data, to generate a first check value, and then the second data check algorithm can be used to check the to-be-sent data, the first check data and the generated first check value, to generate a second check value. Then, the check results of the two check values can be used to determine whether a transmission error occurs in the transmission process of the to-be-sent data.
[0198] It should be noted that the second check data can be used to detect errors such as unexpected repetition, out-of-order, loss and insertion that may occur in the data transmission process.
[0199] In step 104, the to-be-sent data, the first check data of the to-be-sent data and the second check data of the to-be-sent data are encapsulated to generate a first encapsulated data frame corresponding to the to-be-sent data.
[0200] The first encapsulated data frame can include the to-be-sent data, the first check data and the second check data.
[0201] In the embodiments of the present application, after the first check data and the second check data of the to-be-sent data are determined, the to-be-sent data, the first check data and the second check data can be encapsulated to generate a first encapsulated data frame containing the three kinds of data.
[0202] For example, when the first check data includes a frame header, a frame length, a time stamp, a frame sequence number, a command number and a frame tail, and the second check data includes a first check value and a second check value, the structure of the generated first encapsulated data frame is as shown in Figure 2 .
[0203] In step 105, the first encapsulated data frame is sent to a communication peer.
[0204] In this embodiment of the application, after the data to be sent and its corresponding verification data are encapsulated, the generated first encapsulated data frame can be sent to the corresponding communication peer so that the communication peer can verify the data to be sent based on the verification data included in the first encapsulated data frame to determine whether a transmission error has occurred during the transmission process.
[0205] The secure communication method for a lidar system provided in this application generates first verification data for the data to be transmitted based on the characteristic information corresponding to the data to be transmitted. Then, it generates second verification data for the data to be transmitted based on the data to be transmitted and the first verification data. The data to be transmitted, the first verification data, and the second verification data are then encapsulated to generate a first encapsulated data frame corresponding to the data to be transmitted. This first encapsulated data frame is then sent to the communication peer. Therefore, by generating two types of verification data for the data to be transmitted based on its characteristic information before transmission, the communication peer can verify the acquired data using these two verification data, promptly detecting transmission errors and ensuring the security of the lidar system, thereby reducing property or loss of life in industrial production processes.
[0206] In one possible implementation of this application, after acquiring a data frame, each device in the lidar system can also verify the acquired data based on the verification data included in the data frame to determine the reliability of the acquired data, so as to use only safe and reliable data for operation, control or decision-making, thereby ensuring the safety of the lidar system.
[0207] The following is combined Figure 3 The secure communication method of the lidar system provided in the embodiments of this application will be further described.
[0208] Figure 3 A flowchart illustrating another secure communication method for a lidar system provided in an embodiment of this application is shown.
[0209] like Figure 3 As shown, the secure communication method of this lidar system includes the following steps:
[0210] Step 201: Obtain the data to be sent and the corresponding feature information.
[0211] Step 202: Generate the first verification data of the data to be sent based on the feature information.
[0212] Step 203: Generate the second verification data of the data to be sent based on the data to be sent and the first verification data of the data to be sent.
[0213] In step 204, the to-be-sent data, the first check data of the to-be-sent data, and the second check data of the to-be-sent data are encapsulated to generate a first encapsulated data frame corresponding to the to-be-sent data.
[0214] In step 205, the first encapsulated data frame is sent to a communication peer.
[0215] The specific implementation process and principle of the above steps 201-205 can be referred to the detailed description of the above embodiments, which will not be repeated here.
[0216] In step 206, a second encapsulated data frame sent by the communication peer is received.
[0217] The communication peer can be any device in the laser radar system except the execution subject. For example, if the execution subject is a top plate of the laser radar, the communication peer can be a bottom plate of the laser radar; if the execution subject is a bottom plate of the laser radar, the communication peer can be a top plate of the laser radar, a host computer, or other devices; if the execution subject is a host computer, the communication peer can be a bottom plate of the laser radar.
[0218] The second encapsulated data frame can be a data frame encapsulated and sent by the communication peer.
[0219] In the embodiments of the present application, when any device in the laser radar system is the execution subject of the method of the embodiments of the present application, the to-be-sent data can be encapsulated according to the method of the embodiments of the present application and sent to other devices, or the encapsulated data frame sent by other devices can be received, and the encapsulated data frame is checked when it is received to determine whether a transmission error occurs in the transmission process of the encapsulated data frame, so as to ensure the safety of the laser radar system.
[0220] In step 207, the second encapsulated data frame is parsed to determine the to-be-received data, the first check data of the to-be-received data, and the second check data of the to-be-received data included in the second encapsulated data frame.
[0221] In the embodiments of the present application, after the second encapsulated data frame sent by other devices in the system is obtained, the encapsulated data frame can be parsed to determine the to-be-received data and the first check data and the second check data of the to-be-received data in the second encapsulated data frame, and then the first check data and the second check data are checked to detect whether a transmission error occurs in the transmission process of the second encapsulated data frame.
[0222] In step 208, the first check data and the second check data of the to-be-received data are checked to determine whether a transmission error occurs in the to-be-received data. If yes, step 209 is performed; otherwise, step 210 is performed.
[0223] In the embodiment of the present application, if the first check data and the second check data of the to-be-received data are both checked successfully, it can be determined that the to-be-received data has not occurred transmission error; if the first check data or the second check data of the to-be-received data is not checked successfully, it can be determined that the to-be-received data has occurred transmission error.
[0224] As a possible implementation manner, since the second check data is generated by using the data check algorithm, the calculation complexity of checking the second check data is high, and the data form of the first check data is relatively simple, therefore, the first check data can be checked first, and then the second check data is checked, so that when the first check data fails, the second check data does not need to be checked, thereby improving the efficiency of data check. That is, in the possible implementation manner of the embodiment of the present application, the step 208 can include:
[0225] checking the first check data of the to-be-received data;
[0226] if the first check data of the to-be-received data is not checked successfully, determining that the to-be-received data has occurred transmission error;
[0227] if the first check data of the to-be-received data is checked successfully, checking the second check data of the to-be-received data;
[0228] if the second check data of the to-be-received data is checked successfully, determining that the to-be-received data has not occurred transmission error;
[0229] if the second check data of the to-be-received data is not checked successfully, determining that the to-be-received data has occurred transmission error.
[0230] As a possible implementation manner, if the first check data of the to-be-received data is not checked successfully, it can be directly determined that the to-be-received data has occurred transmission error, so that it is not necessary to continue to check the second check data; if the first check data of the to-be-received data is checked successfully, the second check data can be continued to be checked, and when the second check data is also checked successfully, it is determined that the to-be-received data has not occurred transmission error; if the second check data is not checked successfully, it can be determined that the to-be-received data has occurred transmission error.
[0231] As a possible implementation manner, the first check data can include at least one of a frame header, a frame length, a time stamp, a frame sequence number, a command number, and a frame tail.
[0232] Further, when the first check data includes multiple pieces of data, each piece of data can be checked one by one, and if any piece of data fails the check, it can be determined that the first check data fails the check, and there is no need to continue the check, so as to further improve the efficiency of the data check. That is, in a possible implementation of the embodiment of the application, the above-mentioned checking the first check data of the to-be-received data includes:
[0233] checking each piece of data in the first check data of the to-be-received data;
[0234] if any piece of data in the first check data of the to-be-received data fails the check, it is determined that the first check data of the to-be-received data fails the check;
[0235] if all pieces of data in the first check data of the to-be-received data pass the check, it is determined that the first check data of the to-be-received data passes the check.
[0236] As a possible implementation, when the first check data includes one or more of the frame header, the frame length, the timestamp, the frame sequence number, the command number, and the frame tail, each piece of data can be checked one by one, and if any piece of data fails the check, it is determined that the first check data fails the check, and there is no need to continue checking other pieces of data in the first check data and the second check data; if all pieces of data in the first check data pass the check, it is determined that the first check data passes the check.
[0237] Further, since the frame header and the command number in the first check data have a corresponding relationship, the frame header and the command number in the first check data can be checked according to whether the frame header and the command number in the first check data match. That is, in a possible implementation of the embodiment of the application, the first check data can include the frame header and the command number; and correspondingly, the above-mentioned checking the first check data of the to-be-received data includes:
[0238] determining whether the frame header and the command number in the first check data of the to-be-received data match;
[0239] if the frame header and the command number match, it is determined that the frame header and the command number in the first check data of the to-be-received data pass the check;
[0240] if the frame header and the command number do not match, it is determined that the first check data of the to-be-received data fails the check.
[0241] As a possible implementation, since the communication peer can determine the frame header and the command number according to the correspondence between the preset data type and the frame header and the command number when encapsulating the to-be-received data, whether the frame header and the command number of the received to-be-received data match can be determined according to the correspondence between the preset data type and the frame header and the command number.
[0242] For example, if the correspondence between the received frame header and the command number exists in the pre-set correspondence between the data type and the frame header and the command number, it can be determined that the received frame header and the command number match, and thus it can be determined that the frame header and the command number of the first check data of the to-be-received data pass the check; if the correspondence between the received frame header and the command number does not exist in the pre-set correspondence between the data type and the frame header and the command number, it can be determined that the received frame header and the command number do not match, i.e., it can be determined that the second encapsulated data frame may have transmission errors such as errors and disguises during transmission, and thus it can be determined that the first check data of the to-be-received data fails the check, i.e., the to-be-received data obtained is unreliable.
[0243] Further, the frame length in the first check data can also be checked according to whether the actual data length of the to-be-received data matches the frame length in the first check data. That is, in a possible implementation of the embodiment of the application, the first check data can include the frame length. Correspondingly, the checking of the first check data of the to-be-received data includes:
[0244] determining the data length of the to-be-received data;
[0245] if the data length of the to-be-received data matches the frame length in the first check data of the to-be-received data, it is determined that the frame length in the first check data of the to-be-received data passes the check;
[0246] if the data length of the to-be-received data does not match the frame length in the first check data of the to-be-received data, it is determined that the first check data of the to-be-received data fails the check.
[0247] As a possible implementation, since the frame length in the first check data of the to-be-received data is determined according to the data length of the to-be-received data, if it is determined that the data length of the to-be-received data is different from the frame length, it can be determined that the data length of the to-be-received data does not match the frame length, and thus it can be determined that the to-be-received data has transmission errors such as errors and disguises during transmission, i.e., it can be determined that the first check data fails the check; if the data length of the to-be-received data is the same as the frame length, it can be determined that the data length of the to-be-received data matches the frame length, and thus it can be determined that the frame length in the first check data passes the check.
[0248] Further, the time sequence, delay, etc. of the data can be checked through the timestamp in the first check data. That is, in a possible implementation of the embodiment of the application, the first check data can include the timestamp. Correspondingly, the checking of the first check data of the to-be-received data includes:
[0249] acquire a timestamp of a neighboring data frame corresponding to the second encapsulated data frame, wherein the neighboring data frame refers to a data frame received before the second encapsulated data frame and closest in time to the second encapsulated data frame;
[0250] If a difference between the timestamp in the first check data of the to-be-received data and the timestamp of the neighboring data frame is the preset time interval, it is determined that the timestamp in the first check data of the to-be-received data is checked successfully.
[0251] If the difference between the timestamp in the first check data of the to-be-received data and the timestamp of the neighboring data frame is not the preset time interval, it is determined that the first check data of the to-be-received data is not checked successfully.
[0252] As a possible implementation, since the time interval between the neighboring encapsulated data frames is the same when the sender sends the encapsulated data frames, whether the timestamp of the to-be-received data is checked successfully can be determined according to whether the difference between the timestamp of the to-be-received data and the timestamp of the neighboring data frame is the preset time interval. If the difference between the timestamp of the to-be-received data and the timestamp of the neighboring data frame is the preset time interval, it is determined that the timestamp in the first check data of the to-be-received data is checked successfully, that is, the to-be-received data does not have unexpected repetition, unacceptable delay, or other transmission errors. If the difference between the timestamp of the to-be-received data and the timestamp of the neighboring data frame is not the preset time interval, it is determined that the first check data is checked unsuccessfully, that is, the to-be-received data may have unexpected repetition, unacceptable delay, or other transmission errors.
[0253] Further, since the sender can number each sending data when encapsulating and sending the data, the unexpected repetition, out-of-order, loss, and insertion, and other transmission errors that may occur in the transmission process can be detected according to the frame sequence number of the received second encapsulated data frame. That is, in a possible implementation of the embodiment of the application, the first check data can include the frame sequence number. Correspondingly, the checking of the first check data of the to-be-received data includes:
[0254] acquire a frame sequence number of a neighboring data frame corresponding to the second encapsulated data frame, wherein the neighboring data frame refers to a data frame received before the second encapsulated data frame and closest in time to the second encapsulated data frame;
[0255] If the difference between the frame sequence number in the first check data of the to-be-received data and the frame sequence number of the neighboring data frame is 1, it is determined that the frame sequence number in the first check data of the to-be-received data is checked successfully.
[0256] If the difference between the frame sequence number in the first check data of the to-be-received data and the frame sequence number of the neighboring data frame is not 1, it is determined that the first check data of the to-be-received data is not checked successfully.
[0257] As a possible implementation, since the frame sequence number between adjacent data frames is continuous when the sender encapsulates the data, if the difference between the frame sequence number in the first check data of the to-be-received data and the frame sequence number of the adjacent data frame is 1, it can be determined that the frame sequence number in the first check data is checked successfully, that is, the to-be-received data does not occur unexpected repetition, out-of-order, loss and insertion and other transmission errors in the transmission process; if the difference between the frame sequence number in the first check data of the to-be-received data and the frame sequence number of the adjacent data frame is not 1, it can be determined that the first check data is not checked successfully, that is, the to-be-received data may have occurred unexpected repetition, out-of-order, loss and insertion and other transmission errors in the transmission process.
[0258] As a possible implementation, the first check data can include frame header, frame length, storage address, frame sequence number, command number, frame tail and other data, in which case, the method of the above embodiments can be used to check each data in the first check data in turn, which will not be repeated here.
[0259] As a possible implementation, since the second check data of the to-be-received data is generated by the sender using a preset data check algorithm to check the to-be-received data and the first check data, when checking the second check data of the to-be-received data, the same data check algorithm can be used to check and calculate the to-be-received data and the first check data to generate reference check data, if the reference check data is the same as the second check data, it can be determined that the second check data is checked successfully, that is, the to-be-received data does not occur unexpected repetition, out-of-order, loss and insertion and other errors in the transmission process; if the reference check data is not the same as the second check data, it can be determined that the second check data is not checked successfully, that is, the to-be-received data may have occurred unexpected repetition, out-of-order, loss and insertion and other errors in the transmission process.
[0260] Further, since using a data check algorithm for checking either has low reliability or high computational complexity, two check methods can be combined to improve the accuracy of the check while reducing the computational complexity. That is, in a possible implementation of the present application, the second check data described above can include a first check value and a second check value; correspondingly, the checking of the second check data of the to-be-received data includes:
[0261] checking the to-be-received data and the first check data of the to-be-received data using a first data check algorithm to generate a third check value;
[0262] checking the to-be-received data, the first check data of the to-be-received data and the third check value using a second data check algorithm to generate a fourth check value;
[0263] If the first check value of the to-be-received data matches the third check value, and the second check value of the to-be-received data matches the fourth check value, it is determined that the second check data of the to-be-received data is checked successfully.
[0264] If the first check value of the to-be-received data does not match the third check value, or the second check value of the to-be-received data does not match the fourth check value, it is determined that the second check data of the to-be-received data is not checked successfully.
[0265] As a possible implementation, since the first check value is generated by the communication peer by checking the to-be-received data and the first check data of the to-be-received data using the first data check algorithm, and the second check value is generated by the communication peer by checking the to-be-received data, the first check data of the to-be-received data, and the first check value using the second data check algorithm, when checking the first check value and the second check value, the third check value can be generated by checking the to-be-received data and the first check data using the first data check algorithm, and the fourth check value can be generated by checking the to-be-received data, the first check data of the to-be-received data, and the third check value using the second data check algorithm; if the third check value is the same as the first check value, and the fourth check value is the same as the second check value, it is determined that the second check data is checked successfully; otherwise, it is determined that the second check data is not checked successfully.
[0266] Step 209: discarding the to-be-received data.
[0267] In the embodiments of the present application, if it is determined that the to-be-received data has a transmission error in the transmission process, it can be determined that the to-be-received data is unreliable, and the to-be-received data can be discarded to ensure the safety function of the laser radar system and ensure the safety of life and property in the production process.
[0268] Further, when it is determined that the to-be-received data has a transmission error, the sender can also be requested to retransmit the data to further improve the communication safety of the laser radar system. That is, in a possible implementation of the embodiments of the present application, after the above step 209, the method can further include:
[0269] sending a retransmission request frame corresponding to the to-be-received data to the communication peer, wherein the retransmission request includes identification information of the to-be-received data.
[0270] The identification information of the to-be-received data can be a command number of the to-be-received data or other information that can identify the storage location of the to-be-received data.
[0271] In the embodiment of the present application, after determining that the to-be-received data has a transmission error, a retransmission request frame corresponding to the to-be-received data can be sent to the communication peer, so that the communication peer can retransmit the to-be-received data according to the identification information in the retransmission request after obtaining the retransmission request frame.
[0272] As a possible implementation, when the data transmitted by the laser radar in the system has a transmission error, the safety state information of the laser radar can also be output to the host computer of the laser radar and other devices using the detection data of the laser radar, to prompt each device that the laser radar may have a fault, so as to ensure safety.
[0273] Step 210, receiving to-be-received data.
[0274] In the embodiment of the present application, if it is determined that the to-be-received data has no transmission error, it can be determined that the to-be-received data is reliable, so that the to-be-received data can be received and used normally.
[0275] The safety communication method of the laser radar system provided in the embodiment of the present application generates first and second check data of to-be-sent data in the process of sending data, and encapsulates the to-be-sent data, the first check data of the to-be-sent data, and the second check data of the to-be-sent data to generate a first encapsulated data frame corresponding to the to-be-sent data, and then sends the first encapsulated data frame to the communication peer; and then, in the process of receiving data, the received second encapsulated data frame is analyzed to determine the to-be-received data, the first check data of the to-be-received data, and the second check data of the to-be-received data included in the second encapsulated data frame, and the first and second check data of the to-be-received data are checked to determine whether the to-be-received data has a transmission error, and then the to-be-received data is discarded when the to-be-received data has a transmission error, and the to-be-received data is received when the to-be-received data has no transmission error. Thus, by generating two kinds of check data of to-be-sent data when sending data, and checking the obtained data according to the two kinds of check data of the received data when receiving data, the transmission error in the data can be detected in time, thereby further ensuring the safety of the laser radar system and further reducing the property or life loss in the industrial production process.
[0276] It should be understood that the size of the serial number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
[0277] corresponding to the safety communication method of the laser radar system described in the above embodiment, Figure 4A structural block diagram of the safety communication device of the laser radar system provided in the embodiment of the present application is shown, and only parts related to the embodiment of the present application are shown for the convenience of description.
[0278] With reference to Figure 4 The device 30 comprises:
[0279] The first obtaining module 31 is configured to obtain to-be-sent data and feature information corresponding to the to-be-sent data.
[0280] The first generating module 32 is configured to generate first check data of the to-be-sent data according to the feature information.
[0281] The second generating module 33 is configured to generate second check data of the to-be-sent data according to the to-be-sent data and the first check data of the to-be-sent data.
[0282] The third generating module 34 is configured to perform encapsulation processing on the to-be-sent data, the first check data of the to-be-sent data and the second check data of the to-be-sent data, to generate a first encapsulation data frame corresponding to the to-be-sent data.
[0283] The first sending module 35 is configured to send the first encapsulation data frame to a communication peer.
[0284] In actual use, the safety communication device of the laser radar system provided in the embodiment of the present application can be configured in any terminal device to perform the safety communication method of the laser radar system.
[0285] The safety communication device of the laser radar system provided in the embodiment of the present application generates the first check data of the to-be-sent data according to the feature information corresponding to the to-be-sent data, and generates the second check data of the to-be-sent data according to the to-be-sent data and the first check data of the to-be-sent data, and then performs encapsulation processing on the to-be-sent data, the first check data of the to-be-sent data and the second check data of the to-be-sent data, to generate the first encapsulation data frame corresponding to the to-be-sent data, and further sends the first encapsulation data frame to the communication peer. In this way, two kinds of check data of the to-be-sent data are generated according to the to-be-sent data and the feature information of the to-be-sent data before the to-be-sent data is sent, so that the communication peer can check the acquired data according to the two kinds of check data when the data is acquired, and the transmission error in the data can be detected in time, to ensure the safety of the laser radar system and reduce the property or life loss in the industrial production process.
[0286] In a possible implementation form of the present application, the feature information includes at least one of a data type, a data length, time information and a latest frame sequence number corresponding to the encapsulation data frame that has been sent, and the first check data includes at least one of a frame header, a frame length, a time stamp, a frame sequence number, a command number and a frame tail.
[0287] Further, in a possible implementation form of the application, the second check data includes a first check value and a second check value; and the second generating module 33 includes:
[0288] a first generating unit configured to perform check processing on the to-be-sent data and the first check data of the to-be-sent data by using a first data check algorithm to generate a first check value;
[0289] a second generating unit configured to perform check processing on the to-be-sent data, the first check data of the to-be-sent data and the first check value by using a second data check algorithm to generate a second check value.
[0290] Further, in a possible implementation form of the application, the feature information includes a data type, and the first check data includes a frame header and a command number; and the first generating module 32 includes:
[0291] a first determining unit configured to determine the frame header and the command number according to the data type.
[0292] Further, in a possible implementation form of the application, the first check data includes a frame length; and the first generating module 32 includes:
[0293] a second determining unit configured to determine the frame length according to the data type.
[0294] Further, in a possible implementation form of the application, the feature information includes a data length; and the second determining unit is specifically configured to:
[0295] when the data type is a preset data type, determine the frame length as a preset frame length corresponding to the preset data type;
[0296] when the data type is not the preset data type, determine the frame length according to the data length.
[0297] Further, in a possible implementation form of the application, the feature information includes time information, and the first check data includes a time stamp; and the first generating module 32 includes:
[0298] a third determining unit configured to determine the time information as the time stamp, wherein the time information is a system time at which the to-be-sent data is acquired.
[0299] Further, in a possible implementation form of the application, the to-be-sent data includes a latest frame sequence number corresponding to a sent encapsulated data frame, and the first check data includes the frame sequence number; and the first generating module 32 includes:
[0300] The fourth determining unit is configured to determine the frame sequence number by adding one to the latest frame sequence number.
[0301] Further, in another possible implementation form of the present application, the first check data comprises a frame tail; and correspondingly, the first generating module 32 comprises:
[0302] The fifth determining unit is configured to determine the frame tail as a preset frame tail.
[0303] Alternatively,
[0304] The sixth determining unit is configured to determine the frame tail according to a data type when the data type is included in the feature information.
[0305] Further, in another possible implementation form of the present application, the apparatus 30 further comprises:
[0306] The first receiving module is configured to receive a second encapsulated data frame sent by a communication opposite end;
[0307] The first determining module is configured to perform parsing processing on the second encapsulated data frame to determine the to-be-received data, first check data of the to-be-received data, and second check data of the to-be-received data included in the second encapsulated data frame;
[0308] The first check module is configured to check the first check data and the second check data of the to-be-received data to determine whether the to-be-received data has a transmission error;
[0309] The first discarding module is configured to discard the to-be-received data if the to-be-received data has the transmission error.
[0310] The second receiving module is configured to receive the to-be-received data if the to-be-received data does not have the transmission error.
[0311] Further, in another possible implementation form of the present application, the first check module comprises:
[0312] The first check unit is configured to check the first check data of the to-be-received data.
[0313] The seventh determining unit is configured to determine that the to-be-received data has the transmission error if the first check data of the to-be-received data is not checked successfully.
[0314] The second check unit is configured to check the second check data of the to-be-received data if the first check data of the to-be-received data is checked successfully.
[0315] The eighth determining unit is configured to determine that the to-be-received data does not have the transmission error if the second check data of the to-be-received data is checked successfully.
[0316] The ninth determining unit is configured to determine that the to-be-received data has a transmission error if the second check data of the to-be-received data is not successfully checked.
[0317] Further, in another possible implementation of the present application, the first check data includes at least one of a frame header, a frame length, a timestamp, a frame sequence number, a command number, and a frame tail, and the second check data includes a first check value and a second check value, wherein the first check value is generated by a communication peer using a first data check algorithm to check the to-be-received data and the first check data of the to-be-received data, and the second check value is generated by the communication peer using a second data check algorithm to check the to-be-received data, the first check data of the to-be-received data, and the first check value.
[0318] Further, in another possible implementation of the present application, the first check unit is specifically configured to:
[0319] check each item of data in the first check data of the to-be-received data;
[0320] if any item of data in the first check data of the to-be-received data is not successfully checked, determine that the first check data of the to-be-received data is not successfully checked;
[0321] if each item of data in the first check data of the to-be-received data is successfully checked, determine that the first check data of the to-be-received data is successfully checked.
[0322] Further, in another possible implementation of the present application, the first check data includes a frame header and a command number; and correspondingly, the first check unit is further configured to:
[0323] determine whether the frame header and the command number in the first check data of the to-be-received data match;
[0324] if the frame header and the command number match, determine that the frame header and the command number in the first check data of the to-be-received data are successfully checked;
[0325] if the frame header and the command number do not match, determine that the first check data of the to-be-received data is not successfully checked.
[0326] Further, in another possible implementation of the present application, the first check data includes a frame length; and correspondingly, the first check unit is further configured to:
[0327] determine a data length of the to-be-received data;
[0328] if the data length of the to-be-received data matches the frame length in the first check data of the to-be-received data, determine that the frame length in the first check data of the to-be-received data is successfully checked;
[0329] If the data length of the to-be-received data does not match the frame length in the first check data of the to-be-received data, it is determined that the first check data of the to-be-received data is not checked successfully.
[0330] Further, in another possible implementation form of the present application, the first check data includes a time stamp; correspondingly, the first check unit is further configured to:
[0331] obtain a time stamp of a neighboring data frame corresponding to the second encapsulated data frame, wherein the neighboring data frame refers to a data frame received before the second encapsulated data frame and closest in time to the second encapsulated data frame;
[0332] If the difference between the time stamp in the first check data of the to-be-received data and the time stamp of the neighboring data frame is the preset time interval, it is determined that the time stamp in the first check data of the to-be-received data is checked successfully.
[0333] If the difference between the time stamp in the first check data of the to-be-received data and the time stamp of the neighboring data frame is not the preset time interval, it is determined that the first check data of the to-be-received data is not checked successfully.
[0334] Further, in another possible implementation form of the present application, the first check data includes a frame sequence number; correspondingly, the first check unit is further configured to:
[0335] obtain a frame sequence number of a neighboring data frame corresponding to the second encapsulated data frame, wherein the neighboring data frame refers to a data frame received before the second encapsulated data frame and closest in time to the second encapsulated data frame;
[0336] If the difference between the frame sequence number in the first check data of the to-be-received data and the frame sequence number of the neighboring data frame is 1, it is determined that the frame sequence number in the first check data of the to-be-received data is checked successfully.
[0337] If the difference between the frame sequence number in the first check data of the to-be-received data and the frame sequence number of the neighboring data frame is not 1, it is determined that the first check data of the to-be-received data is not checked successfully.
[0338] Further, in another possible implementation form of the present application, the second check unit is specifically configured to:
[0339] perform check processing on the to-be-received data and the first check data of the to-be-received data by using a first data check algorithm to generate a third check value;
[0340] perform check processing on the to-be-received data, the first check data of the to-be-received data, and the third check value by using a second data check algorithm to generate a fourth check value;
[0341] If the first check value of the to-be-received data matches the third check value, and the second check value of the to-be-received data matches the fourth check value, it is determined that the second check data of the to-be-received data is checked successfully.
[0342] If the first check value of the to-be-received data does not match the third check value, or the second check value of the to-be-received data does not match the fourth check value, it is determined that the second check data of the to-be-received data is not checked successfully.
[0343] Further, in another possible implementation form of the present application, the apparatus 30 further comprises:
[0344] The second sending module is configured to send a retransmission request frame corresponding to the to-be-received data to a communication peer, wherein the retransmission request frame comprises identification information of the to-be-received data.
[0345] Further, in another possible implementation form of the present application, the data type comprises any one of parameter configuration information, running state information, and probe data.
[0346] It should be noted that the information interaction and execution process between the above apparatuses / units are based on the same concept as the method embodiments of the present application, and the specific functions and technical effects brought by the method embodiments can be referred to the method embodiments part, which will not be repeated here.
[0347] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is exemplified, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to complete all or part of the above described functions. The functional units and modules in the embodiments can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit. In addition, the specific names of the functional units and modules are only for the convenience of mutual distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the system can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
[0348] In order to realize the above-mentioned embodiments, the present application further provides a terminal device.
[0349] Figure 5 The structure schematic diagram of the terminal device of one embodiment of the present application.
[0350] As shown in Figure 5 the terminal device 200 comprises:
[0351] The memory 210 and the at least one processor 220, a bus 230 connecting different components including the memory 210 and the processor 220, the memory 210 storing a computer program, when the processor 220 executes the program, realizing the method for secure communication of the laser radar system in the embodiments of the application.
[0352] The bus 230 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include, but are not limited to, industry standard architecture (ISA) bus, microchannel architecture (MAC) bus, enhanced ISA bus, video electronics standards association (VESA) local bus, and peripheral component interconnect (PCI) bus.
[0353] The terminal device 200 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by the terminal device 200 and includes both volatile and nonvolatile media, removable and non-removable media.
[0354] The memory 210 can also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 240 and / or cache memory 250. The terminal device 200 can further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, a storage system 260 can be provided for reading from and writing to a non-removable, non-volatile magnetic media (not shown and typically called a "hard drive"). Figure 5 Although not shown, a magnetic hard disk drive can be provided for reading from and writing to a removable, non-volatile magnetic media (e.g., a "floppy disk"), and an optical disk drive can be provided for reading from and writing to a removable, non-volatile optical disk (e.g., a CD-ROM, DVD-ROM or other optical media). In these instances, each drive can be connected to the bus 230 by one or more data media interfaces. The memory 210 can include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the application. Figure 5 The program / utility 280, having a set (at least one) of program modules 270, can be stored in, for example, the memory 210 by way of example, such program modules 270 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or a combination can include an implementation of the network environment. The program modules 270 generally carry out the functions and / or methodologies of embodiments described herein.
[0355]
[0356] Terminal device 200 can also be in communication with one or more external devices 290 such as a keyboard, a pointing device, a display 291, etc.; one or more devices that enable a user to interact with terminal device 200; and / or any devices (e.g., network card, modem, etc.) that enable terminal device 200 to communicate with one or more other computing devices. Such communication can be facilitated by an Input / Output (I / O) interface 292. Still yet, terminal device 200 can be in communication with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or the Internet) through a network adapter 293. As depicted, network adapter 293 communicates with the other components of terminal device 200 through bus 230. It should be appreciated that although not shown, other hardware and / or software modules could be used in conjunction with terminal device 200. Such modules include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc.
[0357] Processor 220 performs various function applications and data processing by running programs stored in memory 210.
[0358] It should be noted that the implementation process and technical principles of the terminal device of the present embodiment are described above in the explanation of the safety communication method of the laser radar system of the present embodiment, and will not be described here.
[0359] The present embodiment also provides a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps in each of the above method embodiments.
[0360] The present embodiment provides a computer program product, when the computer program product is run on a terminal device, the terminal device is caused to implement the steps in each of the above method embodiments.
[0361] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the present application can implement all or part of the processes in the above-mentioned embodiment methods through a computer program to instruct relevant hardware to complete, and the computer program can be stored in a computer readable storage medium. When the computer program is executed by a processor, the steps of each method embodiment described above can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms. The computer readable medium can at least include any entity or device capable of carrying the computer program code to the photographing device / terminal equipment, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, the computer readable medium can not be an electrical carrier signal and a telecommunication signal.
[0362] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0363] Those of ordinary skill in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0364] In the embodiments provided by the present application, it should be understood that the disclosed apparatus / terminal equipment and method can be implemented in other ways. For example, the above-described apparatus / terminal equipment embodiments are only schematic. The division of the modules or units is only a logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection between each displayed or discussed unit can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or in other forms.
[0365] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may also be distributed to multiple network units. Part or all of the units can be selected to achieve the purpose of the embodiment scheme according to actual needs.
[0366] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method for secure communication of a laser radar system, characterized by, The method comprises the following steps: acquiring to-be-sent data and feature information corresponding to the to-be-sent data, wherein the feature information comprises at least one of a data type, a data length, time information and a latest frame sequence number corresponding to a sent encapsulated data frame of the to-be-sent data; generating first check data of the to-be-sent data according to the feature information, wherein the first check data comprises at least one of a frame header, a frame length, a time stamp, a frame sequence number, a command number and a frame tail; generating second check data of the to-be-sent data according to the to-be-sent data and the first check data of the to-be-sent data; performing encapsulation processing on the to-be-sent data, the first check data of the to-be-sent data and the second check data of the to-be-sent data to generate a first encapsulated data frame corresponding to the to-be-sent data; sending the first encapsulated data frame to a communication opposite end; wherein the second check data comprises a first check value and a second check value, and the generating of the second check data of the to-be-sent data according to the to-be-sent data and the first check data comprises: performing check processing on the to-be-sent data and the first check data of the to-be-sent data by using a first data check algorithm to generate the first check value; performing check processing on the to-be-sent data, the first check data of the to-be-sent data and the first check value by using a second data check algorithm to generate the second check value.
2. The method of claim 1, wherein, The feature information comprises the data type, the first check data comprises the frame header and the command number, and the generating of the first check data of the to-be-sent data according to the feature information comprises: determining the frame header and the command number according to the data type.
3. The method of claim 2, wherein, The first check data comprises the frame length, and the generating of the first check data of the to-be-sent data according to the feature information comprises: determining the frame length according to the data type.
4. The method of claim 1, wherein, The feature information comprises the time information, the first check data comprises the time stamp, and the generating of the first check data of the to-be-sent data according to the feature information comprises: determining the time information as the time stamp, wherein the time information is a system time at which the to-be-sent data is acquired.
5. The method of claim 1, wherein, The to-be-sent data comprises the latest frame sequence number corresponding to the sent encapsulated data frame, the first check data comprises the frame sequence number, and the generating of the first check data of the to-be-sent data according to the feature information comprises: determining the frame sequence number by adding one to the latest frame sequence number.
6. The method of claim 1, wherein, The method further comprises the following steps: receiving a second encapsulated data frame sent by the communication opposite end; performing analysis processing on the second encapsulated data frame to determine to-be-received data, first check data of the to-be-received data and second check data of the to-be-received data comprised in the second encapsulated data frame; performing check on the first check data and the second check data of the to-be-received data to determine whether the to-be-received data has transmission error; if the to-be-received data has transmission error, discarding the to-be-received data. If the to-be-received data does not occur transmission error, receiving the to-be-received data.
7. The method of claim 6, wherein, The first check data and the second check data of the to-be-received data are checked to determine whether the to-be-received data occurs transmission error, comprising: The first check data of the to-be-received data is checked. If the first check data of the to-be-received data is not checked successfully, it is determined that the to-be-received data occurs transmission error. If the first check data of the to-be-received data is checked successfully, the second check data of the to-be-received data is checked. If the second check data of the to-be-received data is checked successfully, it is determined that the to-be-received data does not occur transmission error. If the second check data of the to-be-received data is not checked successfully, it is determined that the to-be-received data occurs transmission error.
8. The method of claim 7, wherein, The first check data includes the frame header and the command number, and the first check data of the to-be-received data is checked, comprising: It is determined whether the frame header and the command number in the first check data of the to-be-received data match. If the frame header and the command number match, it is determined that the frame header and the command number in the first check data of the to-be-received data are checked successfully. If the frame header and the command number do not match, it is determined that the first check data of the to-be-received data is not checked successfully.
9. The method of claim 7, wherein, The first check data includes the frame length, and the first check data of the to-be-received data is checked, comprising: The data length of the to-be-received data is determined. If the data length of the to-be-received data matches the frame length in the first check data of the to-be-received data, it is determined that the frame length in the first check data of the to-be-received data is checked successfully. If the data length of the to-be-received data does not match the frame length in the first check data of the to-be-received data, it is determined that the first check data of the to-be-received data is not checked successfully.
10. The method of claim 7, wherein, The first check data includes the timestamp, and the first check data of the to-be-received data is checked, comprising: The timestamp of the adjacent data frame corresponding to the second encapsulated data frame is obtained, wherein the adjacent data frame refers to the data frame received before the second encapsulated data frame and closest to the receiving time of the second encapsulated data frame. If the difference between the timestamp in the first check data of the to-be-received data and the timestamp of the adjacent data frame is the preset time interval, it is determined that the timestamp in the first check data of the to-be-received data is checked successfully. If the difference between the timestamp in the first check data of the to-be-received data and the timestamp of the adjacent data frame is not the preset time interval, it is determined that the first check data of the to-be-received data is not checked successfully.
11. The method of claim 7, wherein, The first check data includes the frame sequence number, and the first check data of the to-be-received data is checked, comprising: The frame sequence number of the adjacent data frame corresponding to the second encapsulated data frame is obtained, wherein the adjacent data frame refers to the data frame received before the second encapsulated data frame and closest to the receiving time of the second encapsulated data frame. If a difference between the frame sequence number in the first check data of the to-be-received data and the frame sequence number of the adjacent data frame is 1, it is determined that the frame sequence number in the first check data of the to-be-received data is checked successfully. If the difference between the frame sequence number in the first check data of the to-be-received data and the frame sequence number of the adjacent data frame is not 1, it is determined that the first check data of the to-be-received data is not checked successfully.
12. The method of claim 7, wherein, The checking of the second check data of the to-be-received data comprises: checking the to-be-received data and the first check data of the to-be-received data by using the first data check algorithm to generate a third check value; checking the to-be-received data, the first check data of the to-be-received data and the third check value by using the second data check algorithm to generate a fourth check value; If the first check value of the to-be-received data matches the third check value, and the second check value of the to-be-received data matches the fourth check value, it is determined that the second check data of the to-be-received data is checked successfully. If the first check value of the to-be-received data does not match the third check value, or the second check value of the to-be-received data does not match the fourth check value, it is determined that the second check data of the to-be-received data is not checked successfully.
13. The method of any one of claims 6-12, wherein, If the to-be-received data has a transmission error, the to-be-received data is discarded, and the method further comprises: sending a retransmission request frame corresponding to the to-be-received data to the communication peer end, wherein the retransmission request frame comprises identification information of the to-be-received data.
14. The method of any one of claims 1-12, wherein, The data type comprises any one of parameter configuration information, running state information and probe data.
15. A safety communication device of a laser radar system, characterized by Comprise: The first acquisition module is used for acquiring to-be-sent data and feature information corresponding to the to-be-sent data, wherein the feature information comprises at least one of a data type, a data length, time information and a latest frame sequence number corresponding to an already-sent encapsulated data frame of the to-be-sent data; The first generation module is used for generating first check data of the to-be-sent data according to the feature information, wherein the first check data comprises at least one of a frame header, a frame length, a time stamp, a frame sequence number, a command number and a frame tail; The second generation module is used for generating second check data of the to-be-sent data according to the to-be-sent data and the first check data of the to-be-sent data; The third generation module is used for performing encapsulation processing on the to-be-sent data, the first check data of the to-be-sent data and the second check data of the to-be-sent data to generate a first encapsulated data frame corresponding to the to-be-sent data; The first sending module is used for sending the first encapsulated data frame to a communication peer end; The second check data comprises a first check value and a second check value, and the second generation module comprises: The first generation unit is used for checking the to-be-sent data and the first check data of the to-be-sent data by using a first data check algorithm to generate the first check value; A second generating unit is configured to perform a check on the to-be-sent data, the first check data of the to-be-sent data and the first check value by using a second data check algorithm to generate the second check value.
16. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The computer program is executed by the processor to implement the method in any one of claims 1-14.
17. A computer-readable storage medium, the computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to implement the method in any one of claims 1-14.
Citation Information
Patent Citations
Method and System for Detecting Errors in the Transfer of Data from a Transmitter to At Least One Receiver
US20140372840A1
Data checking method and apparatus
WO2021134418A1