A method and system for measuring transmission delay of a secure real-time bus (SRB)
By receiving data packets in a secure real-time bus and calculating message digest values, the problem of insufficient calculation accuracy of link transmission delay is solved, and higher calculation accuracy and packet security are achieved.
Patent Information
- Application Number
- CN202411834145.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2044-12-13
AI Technical Summary
When the existing secure real-time bus calculates the link transmission delay, there is a problem of insufficient calculation accuracy, mainly due to the delay and uncertainty of the CPU accessing the FPGA to obtain time information.
By receiving the data packet and obtaining the reception time, it is written to the packet field of the data packet, calculates the message digest value, and writes it to the end of the data packet, sends it to the chip and transmits it through the link. The receiving end calculates the target message digest value. If it is consistent, obtains the reception time and calculates the link delay time.
The calculation accuracy of link transmission delay is improved, the delay of CPU accessing FPGA to obtain time information is reduced, and the integrity and security of data packets are ensured through the message digest algorithm.
Smart Images

Figure CN119341948B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method and system for measuring transmission delay of a secure real-time bus (SRB). Background Art
[0002] Link transmission delay refers to the time required for data packets to be transmitted between link devices. The existing secure real-time bus mainly calculates the time required for link transmission delay by: the CPU processor of the sending device obtains the transmission time information from the local FPGA register, and then fills the transmission time information into the specific field in the transmission message for packet assembly, and then sends the message with time information to the local FPGA through the parallel interface. Then the CPU processor of the receiving device will receive the message from the local FPGA register, and then obtain the reception time information of the message from the local FPGA register, and finally calculate the difference with the transmission time information in the message, so as to measure the link transmission delay.
[0003] However, the entire process from the sending end's CPU obtaining the sending time information from the local FPGA register to filling it into the message, and finally assembling it and sending it to the link through the FPGA, takes a long time and has time uncertainty (because the CPU has task scheduling), which will cause the time when the message starts to be transmitted on the link to be inconsistent with the sending time information carried in the message, and there is a large deviation. In addition, the receiving end's CPU obtains the receiving time information of the message from the FPGA register, which is inconsistent with the time when the message ends transmission on the link, and there is a large deviation. Therefore, the link transmission delay calculation method is to subtract the sending time information from the receiving time information, which will cause the calculated link transmission delay to be insufficiently accurate. Summary of the invention
[0004] Based on the above-mentioned deficiencies of the prior art, the present application provides a method and system for measuring transmission delay of a secure real-time bus (SRB) to solve the problem of insufficient calculation accuracy of link transmission delay caused by the prior art.
[0005] In order to achieve the above objectives, this application provides the following technical solutions:
[0006] The first aspect of the present application provides a method for measuring transmission delay of a secure real-time bus (SRB), comprising:
[0007] Receive a data packet and obtain a receiving time of the data packet;
[0008] Writing the receiving time into the first message specific field contained in the data packet to obtain a target data packet;
[0009] Calculating a message digest value of the target data packet;
[0010] Writing the message digest value to the end of the target data packet to obtain a new data packet, and sending the new data packet to the chip, which sends the new data packet to the link and obtains the new data packet from the link;
[0011] receiving the new data packet sent by the chip, and calculating a target message digest value of the new data packet;
[0012] Comparing the message digest value with the target message digest value to see whether they are consistent;
[0013] If the message digest value is consistent with the target message digest value, the target receiving time of the new data packet is obtained, and the target receiving time is written into the second message specific field included in the new data packet to obtain the target new data packet;
[0014] The link delay time is calculated based on the receiving time in the target new data packet and the target receiving time.
[0015] Optionally, in the above-mentioned secure real-time bus SRB transmission delay measurement method, the calculating the message digest value of the target data packet includes:
[0016] Filling the target data packet;
[0017] Initialize the filled target data packet;
[0018] Divide the target data packet after the initialization process into equal lengths to obtain multiple groups;
[0019] The message digest value of each packet is calculated using a message digest algorithm, and the message digest value of each packet is concatenated to obtain the message digest value of the target data packet.
[0020] Optionally, in the above-mentioned secure real-time bus SRB transmission delay measurement method, the calculating of the target message digest value of the new data packet includes:
[0021] Filling the new data packet;
[0022] Initialize the new data packet after filling;
[0023] Divide the new data packet after initialization processing into equal lengths to obtain multiple target groups;
[0024] The message digest value of each target packet is calculated using a message digest algorithm, and the message digest value of each target packet is concatenated to obtain the target message digest value of the new data packet.
[0025] Optionally, in the above-mentioned method for measuring transmission delay of the secure real-time bus SRB, the method further includes:
[0026] If the message digest value is inconsistent with the target message digest value, it is determined that the new data packet has been tampered with, and the new data packet is deleted.
[0027] Optionally, in the above-mentioned transmission delay measurement method of the secure real-time bus SRB, the link delay time is calculated based on the receiving time in the target new data packet and the target receiving time, including:
[0028] Extracting the first message specific field and the second message specific field from the target new data packet;
[0029] Extracting the receiving time from the first message specific field, and extracting the target receiving time from the second message specific field;
[0030] The difference between the target receiving time and the receiving time is calculated, and the difference is determined as the link delay time.
[0031] The second aspect of the present application provides a transmission delay measurement system for a secure real-time bus SRB, comprising:
[0032] A time acquisition unit, used to receive a data packet and acquire a reception time of the data packet;
[0033] A writing unit, used for writing the receiving time into the first message specific field included in the data packet to obtain a target data packet;
[0034] A first calculation unit, used to calculate the message digest value of the target data packet;
[0035] A sending unit, used for writing the message digest value to the end of the target data packet to obtain a new data packet, and sending the new data packet to the chip, which sends the new data packet to the link and obtains the new data packet from the link;
[0036] A second calculation unit, configured to receive the new data packet sent by the chip, and calculate a target message digest value of the new data packet;
[0037] A comparing unit, used to compare whether the message digest value is consistent with the target message digest value;
[0038] an acquiring unit, configured to acquire a target receiving time of the new data packet if the message digest value is consistent with the target message digest value, and write the target receiving time into a second message specific field included in the new data packet to obtain a target new data packet;
[0039] A time calculation unit is used to calculate the link delay time based on the receiving time in the target new data packet and the target receiving time.
[0040] Optionally, in the above-mentioned transmission delay measurement system of the secure real-time bus SRB, the first calculation unit includes:
[0041] A first filling unit, used for filling the target data packet;
[0042] A first initialization unit, used for initializing the filled target data packet;
[0043] A first division unit is used to divide the target data packet after the initialization process into equal lengths to obtain a plurality of groups;
[0044] The first concatenation unit is used to calculate the message digest value of each packet by using a message digest algorithm, and concatenate the message digest value of each of the packets to obtain the message digest value of the target data packet.
[0045] Optionally, in the above-mentioned transmission delay measurement system of the secure real-time bus SRB, the second calculation unit includes:
[0046] A second filling unit, used for filling the new data packet;
[0047] A second initialization unit, used for initializing a new data packet after filling;
[0048] The second division unit is used to divide the new data packet after the initialization process into equal lengths to obtain a plurality of target groups;
[0049] The second concatenation unit is used to calculate the message digest value of each target packet by using a message digest algorithm, and concatenate the message digest values of each target packet to obtain a target message digest value of the new data packet.
[0050] Optionally, in the above-mentioned transmission delay measurement system of the secure real-time bus SRB, it also includes:
[0051] The deleting unit is used to determine that the new data packet has been tampered with and delete the new data packet if the message digest value is inconsistent with the target message digest value.
[0052] Optionally, in the above-mentioned transmission delay measurement system of the secure real-time bus SRB, the time calculation unit includes:
[0053] A field extraction unit, configured to extract the first message specific field and the second message specific field from the target new data packet;
[0054] A time extraction unit, configured to extract the receiving time from the first message specific field, and to extract the target receiving time from the second message specific field;
[0055] The time sub-calculation unit is used to calculate the difference between the target receiving time and the receiving time, and determine the difference as the link delay time.
[0056] The present application provides a transmission delay measurement method for a secure real-time bus SRB, which receives a data packet and obtains the receiving time of the data packet, then writes the receiving time into the first message specific field contained in the data packet to obtain a target data packet, then calculates the message digest value of the target data packet, and then writes the message digest value into the end of the target data packet to obtain a new data packet, and sends the new data packet to the chip, the chip sends the new data packet to the link, and obtains the new data packet from the link, then receives the new data packet sent by the chip, and calculates the target message digest value of the new data packet, then compares the message digest value with the target message digest value to see if they are consistent, if the message digest value is consistent with the target message digest value, then obtains the target receiving time of the new data packet, and writes the target receiving time into the second message specific field contained in the new data packet to obtain the target new data packet, and finally calculates the link delay time based on the receiving time and the target receiving time in the target new data packet. Thus, the delay consumed by the low-performance CPU accessing the FPGA to obtain time information is saved, the calculation accuracy required for the link transmission delay is improved, and the possibility of tampering or bit error is ensured by calling the message digest algorithm, thereby effectively improving security. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0058] Figure 1 A flow chart of a method for measuring transmission delay of a secure real-time bus SRB provided in an embodiment of the present application;
[0059] Figure 2 A flowchart of a method for calculating a message digest value provided by another embodiment of the present application;
[0060] Figure 3 A flowchart of a method for calculating a target message digest value provided by another embodiment of the present application;
[0061] Figure 4A flowchart of a method for calculating link delay time provided in another embodiment of the present application;
[0062] Figure 5 A structural diagram of a transmission delay measurement system for a secure real-time bus (SRB) provided in another embodiment of the present application. DETAILED DESCRIPTION
[0063] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0064] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0065] The present application embodiment provides a method for measuring the transmission delay of a secure real-time bus SRB, such as Figure 1 As shown, the specific steps include:
[0066] S101: Receive a data packet and obtain the receiving time of the data packet.
[0067] It can be understood that the embodiments of the present application are applied to the CPU and FPGA chip, so the CPU will pre-packetize the data message to obtain the data packet, and then send the data packet to the FPGA chip so that the FPGA chip receives the data packet.
[0068] It should be noted that a system time timer is maintained in the FPGA chip. When the FPGA chip receives a data packet sent by the CPU, it checks the current time of the system time timer and determines the current time as the reception time of the data packet.
[0069] S102: Write the receiving time into the first message specific field included in the data packet to obtain a target data packet.
[0070] It should be noted that the data packet contains a first message-specific field 1 for filling in the receiving time. Therefore, when the receiving time of the data packet is obtained, the receiving time needs to be filled into the first message-specific field 1, so as to achieve the ability to track the transmission delay of the data packet between different network nodes.
[0071] S103: Calculate the message digest value of the target data packet.
[0072] It is understandable that in order to know whether the target data packet has been tampered with during transmission to ensure data consistency, it is necessary to pre-calculate the message digest value of the target data packet. Specifically, the message digest algorithm can be used for calculation, such as SM3 or MD5.
[0073] Optionally, in another embodiment of the present application, a specific implementation of step S103 is as follows: Figure 2 As shown, the following steps are included:
[0074] S201, filling the target data packet.
[0075] Specifically, the target data packet is filled to a fixed length, for example, symmetric encryption or hashing algorithms such as AES may be used for filling, thereby ensuring that the length of the data meets the requirements of the algorithm.
[0076] S202: Initialize the filled target data packet.
[0077] Specifically, in the process of encryption, hashing or other algorithms, in order to ensure that the algorithm can run correctly, it is usually necessary to preprocess and configure the input data, algorithm status or other necessary conditions, that is, to use the initialization algorithm to initialize the calculation parameters in the filled target data packet.
[0078] S203, dividing the initialized target data packet into equal lengths to obtain a plurality of groups.
[0079] It is understandable that in order to improve encryption efficiency, ensure that the encryption algorithm can smoothly process fixed-size data blocks, and enhance the stability of data transmission, the target data packet after initialization processing can be divided into equal lengths.
[0080] S204: Calculate the message digest value of each packet using a message digest algorithm, and concatenate the message digest values of each packet to obtain the message digest value of the target data packet.
[0081] Specifically, for each packet, the message digest algorithm MD5 is applied to calculate the message digest value of each packet. The output of each packet is a digest value of a fixed length, and then the message digest values calculated for all packets are concatenated in order. Assuming there are N packets, and the message digest value of each packet is 256 bits (32 bytes), the final concatenated result is a byte string of length 32 * N. Finally, the concatenated message digest value is used as input, and the final hash value is calculated again through the message digest algorithm MD5. This final hash value is the message digest value of the entire target data packet, which can represent the unique identifier of the entire data packet. Any slight change in the data will result in a significant change in the message digest.
[0082] S104, write the message digest value to the end of the target data packet to obtain a new data packet, and send the new data packet to the chip, the chip sends the new data packet to the link, and obtains the new data packet from the link.
[0083] It should be noted that after obtaining the message digest value, the message digest value needs to be placed at the end of the target data packet to ensure the integrity of the data, and then the written new data packet is sent to the PHY chip, and the PHY chip sends the new data packet to the link for data transmission. The new data packet sent by the PHY chip will then be returned to the link, and the PHY chip will send the new data packet to the FPGA chip.
[0084] S105 , receiving a new data packet sent by the chip, and calculating a target message digest value of the new data packet.
[0085] Specifically, when the FPGA chip receives a new data packet sent by the PHY chip, in order to find out whether the new data packet previously transmitted by the FPGA chip has been tampered with, it is necessary to calculate the target message digest value of the new data packet through a message digest algorithm, such as SM3 or MD5.
[0086] Optionally, in another embodiment of the present application, a specific implementation of calculating the target message digest value of the new data packet in step S105 is as follows: Figure 3 As shown, the following steps are included:
[0087] S301, filling a new data packet.
[0088] It should be noted that the specific implementation method in step S301 and the specific implementation method in step S201 are only different in the implementation objects, and the specific implementation methods are the same. Therefore, the specific implementation method of step S301 can refer to step S201 in the above method embodiment accordingly, and will not be repeated here.
[0089] S302: Initialize the new filled data packet.
[0090] It should be noted that the specific implementation method in step S302 and the specific implementation method in step S202 are only different in the implementation objects, and the specific implementation methods are the same. Therefore, the specific implementation method of step S302 can refer to step S202 in the above method embodiment accordingly, and will not be repeated here.
[0091] S303, dividing the initialized new data packet into equal lengths to obtain multiple target groups.
[0092] It should be noted that the specific implementation method in step S303 and the specific implementation method in step S203 are only different in the implementation objects, and the specific implementation methods are consistent. Therefore, the specific implementation method of step S303 can refer to step S203 in the above method embodiment accordingly, and will not be repeated here.
[0093] S304: Calculate the message digest value of each target packet using a message digest algorithm, and concatenate the message digest values of each target packet to obtain a target message digest value of a new data packet.
[0094] It should be noted that the specific implementation method in step S304 and the specific implementation method in step S204 are only different in the implementation objects, and the specific implementation methods are the same. Therefore, the specific implementation method of step S304 can refer to step S204 in the above method embodiment accordingly, and will not be repeated here.
[0095] S106: Compare the message digest value and the target message digest value to see if they are consistent.
[0096] It should be noted that in order to know whether the data packet in step S101 has been attacked or modified, thereby affecting the stability of the system and the consistency of the data, it is necessary to compare whether the message digest value and the target message digest value are consistent. If the message digest value and the target message digest value are consistent, it means that the data packet has not been attacked or modified, so execute step S107.
[0097] Optionally, after executing step S106, the method further includes:
[0098] If the message digest value is inconsistent with the target message digest value, it is determined that the new data packet has been tampered with and the new data packet is deleted.
[0099] It can be understood that when the message digest value and the target message digest value are inconsistent, it means that the data packet of step S101 has been attacked or tampered with, so the receiving time corresponding to the first message specific field 1 in the new data packet is invalid, so the new data packet can be discarded, that is, the new data packet is deleted.
[0100] S107 , obtaining a target receiving time of a new data packet, and writing the target receiving time into a second message specific field included in the new data packet to obtain a target new data packet.
[0101] It should be noted that when the message digest value and the target message digest value are consistent, it means that the new data packet has not been modified during the transmission process. Therefore, the receiving time corresponding to the first message specific field 1 in the new data packet is determined to be valid. At this time, the FPGA chip can check the current time t2 of the system time timer as the target receiving time for obtaining the new data packet, and then fill the target receiving time t2 into the second message specific field 2 contained in the new data packet to reflect the moment when the data packet actually ends transmission on the link.
[0102] S108: Calculate the link delay time based on the receiving time in the target new data packet and the target receiving time.
[0103] It should be noted that in the embodiment of the present application, an FPGA chip is used on the sending device to fill the sending time information t1, that is, the receiving time t1, into a specific field 1 in the message, and an FPGA chip is used on the receiving device to fill the receiving time information t2 into a specific field 2 in the message, thereby ensuring that the sending time information t1 can accurately reflect the moment when the message actually starts to be transmitted on the link, and the receiving time information t2 can accurately reflect the moment when the message actually ends transmission on the link, thereby ensuring the high accuracy of the link transmission delay.
[0104] In addition, the FPGA chip needs to send the target new data packet to the CPU so that the CPU calculates the two times in the target new data packet to calculate the link delay time.
[0105] Optionally, in another embodiment of the present application, a specific implementation of step S108 is as follows: Figure 4 As shown, the following steps are included:
[0106] S401. Extract a first message specific field and a second message specific field from a target new data packet.
[0107] Specifically, since the target new data packet includes not only the first message specific field and the second message specific field but also other data, in order to flexibly and conveniently calculate the link delay time, the first message specific field and the second message specific field can be extracted from the target new data packet in advance.
[0108] S402: Extract the receiving time from the first message specific field, and extract the target receiving time from the second message specific field.
[0109] S403: Calculate the difference between the target receiving time and the receiving time, and determine the difference as the link delay time.
[0110] Specifically, the calculation formula for link delay time is:
[0111] Link delay time = target receiving time t2 - receiving time t1
[0112] The present application provides a transmission delay measurement method for a secure real-time bus SRB, which receives a data packet and obtains the receiving time of the data packet, then writes the receiving time into the first message specific field contained in the data packet to obtain a target data packet, then calculates the message digest value of the target data packet, and then writes the message digest value into the end of the target data packet to obtain a new data packet, and sends the new data packet to the chip, the chip sends the new data packet to the link, and obtains the new data packet from the link, then receives the new data packet sent by the chip, and calculates the target message digest value of the new data packet, then compares the message digest value with the target message digest value to see if they are consistent, if the message digest value is consistent with the target message digest value, then obtains the target receiving time of the new data packet, and writes the target receiving time into the second message specific field contained in the new data packet to obtain the target new data packet, and finally calculates the link delay time based on the receiving time and the target receiving time in the target new data packet. Thus, the delay consumed by the low-performance CPU accessing the FPGA to obtain time information is saved, the calculation accuracy required for the link transmission delay is improved, and the possibility of tampering or bit error is ensured by calling the message digest algorithm, thereby effectively improving security.
[0113] Another embodiment of the present application provides a transmission delay measurement system for a secure real-time bus SRB, such as Figure 5 As shown, it includes the following units:
[0114] The time acquisition unit 501 is used to receive a data packet and acquire the receiving time of the data packet.
[0115] The writing unit 502 is used to write the receiving time into the first message specific field included in the data packet to obtain a target data packet.
[0116] The first calculation unit 503 is used to calculate the message digest value of the target data packet.
[0117] The sending unit 504 is used to write the message digest value to the end of the target data packet to obtain a new data packet, and send the new data packet to the chip, which sends the new data packet to the link and obtains the new data packet from the link.
[0118] The second calculation unit 505 is used to receive a new data packet sent by the chip and calculate a target message digest value of the new data packet.
[0119] The comparing unit 506 is used to compare whether the message digest value is consistent with the target message digest value.
[0120] The acquisition unit 507 is used to acquire the target receiving time of the new data packet if the message digest value is consistent with the target message digest value, and write the target receiving time into the second message specific field included in the new data packet to obtain the target new data packet.
[0121] The time calculation unit 508 is used to calculate the link delay time based on the receiving time in the target new data packet and the target receiving time.
[0122] It should be noted that the specific working process of the above modules in the embodiment of the present application can refer to steps S101 to S108 in the above method embodiment, which will not be repeated here.
[0123] Optionally, in a transmission delay measurement system of a secure real-time bus SRB provided by another embodiment of the present application, the first calculation unit 503 includes:
[0124] The first filling unit is used to fill the target data packet.
[0125] The first initialization unit is used to perform initialization processing on the filled target data packet.
[0126] The first division unit is used to divide the target data packet after the initialization process into equal lengths to obtain multiple groups.
[0127] The first concatenation unit is used to calculate the message digest value of each packet by using a message digest algorithm, and concatenate the message digest values of each packet to obtain the message digest value of the target data packet.
[0128] Optionally, in a transmission delay measurement system of a secure real-time bus SRB provided by another embodiment of the present application, the second calculation unit 505 includes:
[0129] The second filling unit is used to fill the new data packet.
[0130] The second initialization unit is used to initialize the new data packet after filling.
[0131] The second dividing unit is used to divide the new data packet after the initialization process into equal lengths to obtain multiple target groups.
[0132] The second splicing unit is used to calculate the message digest value of each target group by using a message digest algorithm, and splice the message digest value of each target group to obtain a target message digest value of a new data packet.
[0133] Optionally, a transmission delay measurement system of a secure real-time bus SRB provided in another embodiment of the present application further includes:
[0134] The deleting unit is used to determine that the new data packet has been tampered with and delete the new data packet if the message digest value is inconsistent with the target message digest value.
[0135] Optionally, in a transmission delay measurement system of a secure real-time bus SRB provided by another embodiment of the present application, the time calculation unit 508 includes:
[0136] The field extraction unit is used to extract the first message specific field and the second message specific field from the target new data packet.
[0137] The time extraction unit is used to extract the receiving time from the specific field of the first message and to extract the target receiving time from the specific field of the second message.
[0138] The time sub-calculation unit is used to calculate the difference between the target receiving time and the receiving time, and determine the difference as the link delay time.
[0139] It should be noted that the specific working process of each module provided in the above embodiments of the present application can refer to the corresponding steps in the above method embodiments, which will not be repeated here.
[0140] It should also be noted that the transmission delay measurement system of a secure real-time bus SRB provided in an embodiment of the present application has the technical effects of any of the above embodiments, and the embodiments of the present application are not described in detail here.
[0141] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0142] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for measuring transmission delay of a secure real-time bus (SRB), characterized in that: include: Receive a data packet and obtain a receiving time of the data packet; Writing the receiving time into the first message specific field contained in the data packet to obtain a target data packet; Calculating a message digest value of the target data packet; Writing the message digest value to the end of the target data packet to obtain a new data packet, and sending the new data packet to the chip, which sends the new data packet to the link and obtains the new data packet from the link; receiving the new data packet sent by the chip, and calculating a target message digest value of the new data packet; Comparing the message digest value with the target message digest value to see whether they are consistent; If the message digest value is consistent with the target message digest value, the target receiving time of the new data packet is obtained, and the target receiving time is written into the second message specific field included in the new data packet to obtain the target new data packet; The link delay time is calculated based on the receiving time in the target new data packet and the target receiving time.
2. The method according to claim 1, characterized in that The calculating the message digest value of the target data packet comprises: Filling the target data packet; Initialize the filled target data packet; Divide the target data packet after the initialization process into equal lengths to obtain multiple groups; The message digest value of each packet is calculated using a message digest algorithm, and the message digest value of each packet is concatenated to obtain the message digest value of the target data packet.
3. The method according to claim 1, characterized in that The calculating the target message digest value of the new data packet comprises: Filling the new data packet; Initialize the new data packet after filling; Divide the new data packet after initialization processing into equal lengths to obtain multiple target groups; The message digest value of each target packet is calculated using a message digest algorithm, and the message digest value of each target packet is concatenated to obtain the target message digest value of the new data packet.
4. The method according to claim 1, characterized in that: Also includes: If the message digest value is inconsistent with the target message digest value, it is determined that the new data packet has been tampered with, and the new data packet is deleted.
5. The method according to claim 1, characterized in that The calculating the link delay time based on the receiving time and the target receiving time in the target new data packet comprises: Extracting the first message specific field and the second message specific field from the target new data packet; Extracting the receiving time from the first message specific field, and extracting the target receiving time from the second message specific field; The difference between the target receiving time and the receiving time is calculated, and the difference is determined as the link delay time.
6. A transmission delay measurement system for a secure real-time bus SRB, characterized in that: include: A time acquisition unit, used to receive a data packet and acquire a reception time of the data packet; A writing unit, used for writing the receiving time into the first message specific field included in the data packet to obtain a target data packet; A first calculation unit, used to calculate the message digest value of the target data packet; A sending unit, used for writing the message digest value to the end of the target data packet to obtain a new data packet, and sending the new data packet to the chip, which sends the new data packet to the link and obtains the new data packet from the link; A second calculation unit, configured to receive the new data packet sent by the chip, and calculate a target message digest value of the new data packet; A comparing unit, used to compare whether the message digest value is consistent with the target message digest value; an acquiring unit, configured to acquire a target receiving time of the new data packet if the message digest value is consistent with the target message digest value, and write the target receiving time into a second message specific field included in the new data packet to obtain a target new data packet; A time calculation unit is used to calculate the link delay time based on the receiving time in the target new data packet and the target receiving time.
7. The system according to claim 6, characterized in that The first computing unit comprises: A first filling unit, used for filling the target data packet; A first initialization unit, used for initializing the filled target data packet; A first division unit is used to divide the target data packet after the initialization process into equal lengths to obtain a plurality of groups; The first concatenation unit is used to calculate the message digest value of each packet by using a message digest algorithm, and concatenate the message digest value of each of the packets to obtain the message digest value of the target data packet.
8. The system according to claim 6, characterized in that The second computing unit comprises: A second filling unit, used for filling the new data packet; A second initialization unit, used for initializing a new data packet after filling; The second division unit is used to divide the new data packet after the initialization process into equal lengths to obtain a plurality of target groups; The second concatenation unit is used to calculate the message digest value of each target packet by using a message digest algorithm, and concatenate the message digest values of each target packet to obtain the target message digest value of the new data packet.
9. The system according to claim 6, characterized in that Also includes: The deleting unit is used to determine that the new data packet has been tampered with and delete the new data packet if the message digest value is inconsistent with the target message digest value.
10. The system according to claim 6, characterized in that The time calculation unit comprises: A field extraction unit, configured to extract the first message specific field and the second message specific field from the target new data packet; A time extraction unit, configured to extract the receiving time from the first message specific field, and to extract the target receiving time from the second message specific field; The time sub-calculation unit is used to calculate the difference between the target receiving time and the receiving time, and determine the difference as the link delay time.
Citation Information
Patent Citations
Time delay measurement method and device, communication equipment and storage medium
CN115987848A
Chip clock precision test method based on FPGA (Field Programmable Gate Array) and related device
CN119070941A