Gptp packet sending and receiving method and gptp packet communication device
By concatenating node digital signatures into gPTP messages and performing public key decoding verification, the problem of malicious attacks under the gPTP protocol is solved, and high reliability and time synchronization accuracy of the vehicle communication network are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN JIANGXIA CHUNENG AUTOMOBILE TECHNOLOGY R&D CO LTD
- Filing Date
- 2026-04-22
- Publication Date
- 2026-07-21
AI Technical Summary
Vehicle time synchronization networks under the gPTP protocol are vulnerable to malicious attacks, which can lead to time base offsets and affect the accuracy of data fusion and decision-making of communication nodes.
An additional node digital signature is appended to the gPTP message. The extended gPTP message is formed by signing and encrypting the message using the node's private key. The receiving end uses the public key to decode and verify the reliability of the sending timestamp.
It improves the reliability of gPTP communication, reduces the possibility of data offset, ensures the accuracy of timestamps, and enhances the security of the communication network.
Smart Images

Figure CN122437625A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle-mounted communication, specifically to a gPTP message sending method, a gPTP message receiving method, a gPTP message communication device, an electronic device, and a computer-readable storage medium. Background Technology
[0002] With the rapid development of automotive Ethernet technology, gPTP (Generic Precision Time Protocol), as a core protocol for achieving high-precision time synchronization, is gradually becoming a key technology for ensuring the functional safety of intelligent connected vehicles. gPTP employs a master-slave clock distribution mechanism, automatically electing the optimal master clock using BMCA (Best Master Clock Algorithm), and achieving coordinated time calibration across all network nodes by transmitting synchronization and delay measurement messages.
[0003] Compared to traditional NTP (Network Time Protocol) or other industrial PTP protocols, gPTP is designed with the special needs of automotive electronics in mind, reducing clock oscillations caused by network topology changes. This allows gPTP to achieve nanosecond (ns) level time synchronization accuracy, providing a crucial "time anchor" for multi-sensor data fusion (such as timing alignment of cameras, radar, and lidar), real-time decision control, and synchronized playback of in-vehicle audio-visual entertainment systems in ADAS (Advanced Driver Assistance Systems).
[0004] However, in-vehicle time synchronization networks under the gPTP protocol are highly vulnerable to malicious attacks. Attackers can impersonate a legitimate master clock and broadcast incorrect timestamps to slave nodes, causing a shift in the network's time base and resulting in all communication nodes synchronizing to the wrong time, triggering a severe cascading effect. For example, data collected by different sensors may fail to be correctly fused due to timestamp misalignment, leading to driver assistance systems misidentifying stationary objects as moving obstacles, or vice versa. Therefore, how to better protect communication networks under the gPTP protocol and improve the reliability of message transmission under the gPTP protocol has become an urgent problem to be solved. Summary of the Invention
[0005] In view of this, it is necessary to provide a gPTP message sending method, a gPTP message receiving method, a gPTP message communication device, an electronic device, and a computer-readable storage medium to achieve the technical effect of improving the reliability of gPTP communication.
[0006] To address the aforementioned technical problems, in a first aspect, this application provides a gPTP message transmission method, applied to any communication node in a vehicle-mounted communication network, wherein the vehicle-mounted communication network includes a vehicle-mounted root trusted CA, the vehicle-mounted root trusted CA includes the node gPTP message public key corresponding to each of the communication nodes, and the gPTP message transmission method includes: Construct a gPTP message, wherein the gPTP message includes at least a timestamp recording the time of transmission; Obtain the node gPTP message private key corresponding to the current communication node, sign the gPTP message based on the node gPTP message private key, and generate a node digital signature. The node gPTP message private key and the node gPTP message public key are uniquely associated. The gPTP message and the node digital signature are concatenated to form an extended gPTP message, which is then sent to the vehicle communication network.
[0007] In one possible embodiment, the step of concatenating the gPTP message and the node digital signature to form an extended gPTP message includes: The extended gPTP message is formed by adding a signature information field to the end of the gPTP message, and the node's digital signature is written into the signature information field.
[0008] In one possible embodiment, the gPTP message sending method further includes: The communication node certificate corresponding to the current communication node is written into the signature information field. The communication node certificate is a digital certificate uniquely corresponding to the current communication node, generated by the vehicle-mounted trusted root CA using the CA private key to sign the node information of the current communication node and the node gPTP message public key. The CA private key is the private key corresponding to the vehicle-mounted trusted root CA. The CA private key and the CA public key are uniquely corresponding. The CA public key is broadcast to each of the communication nodes.
[0009] In one possible embodiment, the gPTP message includes a message header field, a message body field, and a time field, and the step of writing the node's digital signature into the signature information field further includes: Data is simultaneously written to the message header field and / or the message body field and / or the time field.
[0010] Secondly, this application provides a gPTP message receiving method, applied to any communication node in a vehicle-mounted communication network, wherein the vehicle-mounted communication network includes a vehicle-mounted root trusted CA, the vehicle-mounted root trusted CA includes the node gPTP message public key corresponding to each of the communication nodes, and the gPTP message receiving method includes: The node digital signature and the gPTP message are extracted from the extended gPTP message received from the vehicle communication network as described in any one of claims 1 to 4. The node's digital signature is decoded using the node's gPTP message public key to obtain the decoding result. The sending timestamp in the gPTP message is verified based on the decoding result, and the verified extended gPTP message is retained.
[0011] In one possible embodiment, the extended gPTP message includes the communication node certificate, and the gPTP message receiving method includes: The communication node certificate is decoded using the CA public key to obtain the node's gPTP message public key.
[0012] Thirdly, this application provides a gPTP message communication device, installed in a vehicle-mounted communication network, wherein the vehicle-mounted communication network includes a vehicle-mounted root trusted CA, and the vehicle-mounted root trusted CA includes the node gPTP message public key corresponding to each of the communication nodes, including: A message construction module is used to construct gPTP messages, wherein the gPTP messages include at least a timestamp recording the sending time; The message extension module is used to obtain the node gPTP message private key corresponding to the current communication node, sign the gPTP message based on the node gPTP message private key, generate a node digital signature, the node gPTP message private key and the node gPTP message public key are uniquely associated, and the gPTP message and the node digital signature are concatenated to form an extended gPTP message; A message sending module, which is used to send the extended gPTP message.
[0013] Fourthly, this application provides a gPTP message communication device, installed in a vehicle-mounted communication network, wherein the vehicle-mounted communication network includes a vehicle-mounted root trusted CA, and the vehicle-mounted root trusted CA includes the node gPTP message public key corresponding to each of the communication nodes, including: A message receiving module, the message receiving module being used to receive the extended gPTP message sent by the gPTP message communication device as described in claim 7 from the vehicle communication network; The message parsing module is used to extract the node digital signature and the gPTP message from the extended gPTP message; The timestamp verification module is used to decode the node's digital signature using the node's gPTP message public key, obtain the decoding result, and verify the sending timestamp in the gPTP message based on the decoding result. The message receiving module is also used to retain the extended gPTP message that has passed verification.
[0014] Fifthly, this application also provides an electronic device, including a memory and a processor, wherein, The memory is used to store programs; The processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps in the gPTP message sending method and / or gPTP message receiving method described in any of the above implementations.
[0015] Sixthly, this application also provides a computer-readable storage medium for storing a computer-readable program or instructions, which, when executed by a processor, can implement the steps of the gPTP message sending method and / or gPTP message receiving method described in any of the above implementations.
[0016] The beneficial effects of this application are: Compared with related technologies, the gPTP message sending method, gPTP message receiving method, gPTP message communication device, electronic device, and computer-readable storage medium provided in this application extend the conventional gPTP message structure when sending gPTP messages. An extended gPTP message is formed by additionally concatenating a node digital signature onto the conventional gPTP message. The node digital signature is formed by encrypting the sending timestamp of the gPTP message using the current node's node gPTP message private key. The data in this signature is difficult to tamper with, and the possibility of data offset during transmission is low, resulting in high reliability of the sending timestamp stored in the node digital signature. Subsequently, after other gPTP message communication devices receive the extended gPTP message, they can decode the node's digital signature based on the node's gPTP message public key to obtain the stored sending timestamp. By comparing the sending timestamp of the regular gPTP message portion in the extended gPTP message with the sending timestamp obtained from decoding the node's digital signature, the reliability of the extended gPTP message can be verified. This determines whether the extended gPTP message has been tampered with or whether data offset has occurred during transmission. Based on the reliability verification result of the extended gPTP message, extended gPTP messages that have passed the reliability verification can be selectively received, thereby improving the technical effect of enhancing the reliability of the gPTP communication process. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating the gPTP message transmission method provided in an embodiment of this application. Figure 2 This is a flowchart illustrating the gPTP message receiving method provided in an embodiment of this application. Figure 3 This is a schematic diagram of the gPTP message sending device provided in an embodiment of this application; Figure 4 This is a schematic diagram of the gPTP message receiving device provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Detailed Implementation
[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0020] In the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0021] The terms "first," "second," etc., used in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a technical feature defined with "first" or "second" may explicitly or implicitly include at least one of those features.
[0022] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0023] This application provides a gPTP message sending method, a gPTP message receiving method, a gPTP message communication device, an electronic device, and a computer-readable storage medium, which are described below.
[0024] Message communication is a data transmission process that transfers data from one electronic device to another. It includes at least a data sending process and a data receiving process; one electronic device sends data, and another electronic device receives data, thus completing a data transmission process. Based on this, multiple electronic devices can be interconnected to form a communication network. Electronic devices within the communication network send and receive messages through other electronic devices in the network, achieving network communication.
[0025] Based on this, it can be understood that the gPTP message sending and receiving methods provided in this application embodiment are specifically applied to a vehicle-mounted communication network composed of the gPTP message communication devices provided in this application embodiment. That is, the gPTP message communication devices provided in this application embodiment achieve data transmission and time synchronization in the vehicle-mounted communication network by running the gPTP message sending and receiving methods provided in this application embodiment. The vehicle-mounted communication network includes a vehicle-mounted trusted root CA (Certificate Authority), which includes the node gPTP message public keys corresponding to each communication node. Specifically, each communication node in the vehicle-mounted communication network (i.e., each gPTP message communication device constituting the vehicle-mounted communication network) pre-sends its node gPTP message public key to the vehicle-mounted trusted root CA.
[0026] Please refer to Figure 1 Applied to any communication node in the aforementioned vehicle-mounted communication network, the gPTP message sending method provided in this application embodiment includes: Step S101: Construct a gPTP message, which includes at least a timestamp recording the sending time.
[0027] In this step, the gPTP message specifically includes a header field, a body field, and a timestamp field. The header field (head field) typically occupies 34 bytes and contains core information required for controlling and managing the protocol, including the sending node, message type, PTP version, message length, and flag fields. The body field carries the specific data transmitted in the gPTP message. The timestamp field carries a timestamp recording the sending time.
[0028] It is understood that the above is only an example of the structure of a gPTP message provided in one embodiment of this application. In some other embodiments of this application, the gPTP message may also have other structures, such as only including message header fields and message body fields, while writing the sending timestamp into the message body field, etc.
[0029] The gPTP message in this application does not limit the specific message structure. It can be the same as any gPTP message format in the prior art. That is, the specific structure of the gPTP message is not modified in this application. In this way, the original message structure can be preserved, which facilitates compatibility with existing gPTP equipment and reduces equipment costs.
[0030] Step S102: Obtain the node gPTP message private key corresponding to the current communication node, sign the gPTP message based on the node gPTP message private key, and generate a node digital signature.
[0031] Specifically, for each communication node in the vehicle communication network, a unique node gPTP message private key and a node gPTP message public key are pre-set. The node gPTP message private key is stored in each communication node, while the node gPTP message public key is pre-sent to the vehicle trusted root CA.
[0032] In this context, each node public-private key pair, consisting of the node gPTP message private key and the node gPTP message public key, is also uniquely associated with each node. That is, for each communication node in the vehicle communication network, its corresponding node public-private key pair is unique, and for each node public-private key pair, its corresponding communication node is also unique.
[0033] In this step, the gPTP message is signed based on the node's gPTP message private key to generate a node digital signature. Specifically, this includes: First, for all the data carried in the gPTP message, namely all the data in the message header field, message body field, and time field, a hash algorithm such as SHA-256 is used to perform a hash operation on all the data. The hash operation result is used as the node hash value corresponding to the node. Then, the calculated node hash value is encrypted and signed using the node's gPTP message private key. The signature result is the node digital signature in this step.
[0034] Step S103: Concatenate the gPTP message and the node digital signature to form an extended gPTP message.
[0035] In this step, a signature information field is added to the end of the gPTP message to form an extended gPTP message. Then, the node's digital signature is written into the signature information field to obtain the extended gPTP message. By concatenating the gPTP message and the node's digital signature in this way, the header of the gPTP message remains the same as the header of the extended gPTP message, making it easier to be compatible with existing gPTP devices.
[0036] It is understood that the foregoing is merely an example of the specific method for forming an extended gPTP message by concatenating gPTP messages and node digital signatures in this embodiment. In some other embodiments of this application, other structures may be formed, such as adding a signature information field before the gPTP message to form an extended gPTP message.
[0037] In some embodiments of this application, in addition to writing the node digital signature into the signature information field, the communication node certificate corresponding to the current communication node can also be written into the signature information field. The communication node certificate is a digital certificate uniquely corresponding to the current communication node, generated by the vehicle-mounted trusted root CA using the CA private key to sign the node information of the current communication node and the node gPTP message public key. The CA private key is the private key corresponding to the vehicle-mounted trusted root CA. The CA private key and the CA public key are uniquely corresponding. The CA public key is broadcast to each communication node.
[0038] In other words, the current communication node sends its own gPTP message public key and its own node information (such as device number, node type, network topology location) to the vehicle-mounted trusted root CA in advance. The vehicle-mounted trusted root CA calculates the unique digital certificate corresponding to the current communication node using the hash value and encrypts it with the CA's private key, and sends the communication node certificate back to the current communication node. When the current communication node constructs the extended gPTP message, it also writes its own communication node certificate into the signature information field.
[0039] In this application, when writing the node digital signature into the signature information field, data is simultaneously written into the message header field and / or the message body field and / or the time field. That is, the calculation and writing process of the node data signature begins immediately after the sending timestamp is determined. This process is executed in parallel with the gPTP message construction process, reducing the impact of the node data signature calculation and writing process on the gPTP message construction process. This ensures the original nanosecond-level synchronization accuracy of gPTP and reduces the time accuracy degradation caused by security mechanisms.
[0040] Step S104: Send an extended gPTP message to the vehicle communication network.
[0041] Through steps S101 to S104 described above, the gPTP message transmission process in the gPTP message transmission method provided in this application embodiment is completed. For the corresponding details, please refer to... Figure 2 The gPTP message receiving method provided in this application specifically includes: Step S201: Receive extended gPTP messages from the vehicle-mounted communication network, and extract the node digital signature and gPTP messages from the extended gPTP messages.
[0042] In this step, the extended gPTP message received by the gPTP message communication device from the vehicle communication network is the extended gPTP message constructed in steps S101 to S104 above. Its specific structure can be found in the detailed descriptions of steps S101 to S104 above. After receiving the extended gPTP message, it can be parsed to obtain the node digital signature and the gPTP message itself.
[0043] Step S202: Use the node's gPTP message public key to decode the node's digital signature, obtain the decoding result, and verify the sending timestamp in the gPTP message based on the decoding result.
[0044] In this step, the gPTP message communication device can determine the sending communication device for the extended gPTP message based on the data contained in the gPTP message, and obtain the node gPTP message public key corresponding to the sending node from the vehicle-mounted root of trust (CA) of the vehicular communication network. Then, it uses the node gPTP message public key to decode the node digital signature, obtaining the decoding result. The decoding result is the sender's hash value calculated in the sending node based on all the data carried in the gPTP message. At the receiving end, the same hash algorithm is used to hash all the data in the received gPTP message to obtain the receiver's hash value. By comparing the sender's hash value and the receiver's hash value, if there is a significant difference between them, the reliability of the extended gPTP message is low, and the verification fails; conversely, if the difference between them is small or even negligible, the reliability of the extended gPTP message is high, and the verification passes.
[0045] It is understood that the aforementioned method of obtaining the node gPTP message public key corresponding to the sending node from the vehicle-mounted trusted root CA of the vehicle communication network is merely an example of a specific method for obtaining the node gPTP message public key corresponding to the sending node in some embodiments of this application, and does not constitute a limitation. In some other embodiments of this application, for example, corresponding to the step S103 above where the communication node certificate is written into the signature information field, the received communication node certificate can be decoded according to the CA public key to obtain the node gPTP message public key contained in the communication node certificate. In this way, it is not necessary to widely disseminate and disclose the node gPTP message public key; only the CA public key needs to be disclosed to complete the acquisition of the node gPTP message public key, further improving the security and reliability of the gPTP communication process.
[0046] Step S203: Retain the verified extended gPTP message.
[0047] It is understood that the foregoing is only a description of the gPTP message sending and receiving process between two transmission nodes. In some embodiments of this application, for multi-node transmission processes, the bridging node can first execute the gPTP message receiving method provided in steps S201 to S203 above to receive the verified extended gPTP message, and then, based on the verified extended gPTP message, update the sending timestamp and execute the gPTP message sending method provided in steps S101 to S104 above to realize the forwarding process of the extended gPTP message.
[0048] By combining the gPTP message sending method provided in steps S101 to S104 and the gPTP message receiving method provided in steps S201 to S203, highly reliable gPTP communication can be achieved in the vehicle communication network.
[0049] Compared with related technologies, the gPTP message sending and receiving methods provided in this application extend the conventional gPTP message structure when sending gPTP messages. An extended gPTP message is formed by additionally appending a node digital signature to the conventional gPTP message. The node digital signature is formed by encrypting the sending timestamp of the gPTP message using the current node's node gPTP message private key. The data in this signature is difficult to tamper with, and the possibility of data offset during transmission is low, resulting in high reliability of the sending timestamp stored in the node digital signature. This ensures high reliability in subsequent gPTP message transmissions. After receiving an extended gPTP message, the communication device can decode the node's digital signature using the node's gPTP message public key to obtain the stored sending timestamp. By comparing the sending timestamp of the regular gPTP message portion in the extended gPTP message with the sending timestamp obtained from decoding the node's digital signature, the reliability of the extended gPTP message can be verified. This determines whether the extended gPTP message has been tampered with or whether data offset has occurred during transmission. Based on the reliability verification result of the extended gPTP message, the device can selectively receive extended gPTP messages that have passed the reliability verification, thereby improving the reliability of the gPTP communication process.
[0050] To better implement the gPTP packet transmission method in the embodiments of this application, based on the gPTP packet transmission method, correspondingly, such as Figure 3 As shown in the figure, this application embodiment also provides a gPTP message transmission device, which includes: The message construction module 301 is used to construct gPTP messages, which include at least a timestamp recording the sending time. The message extension module 302 is used to obtain the node gPTP message private key corresponding to the current communication node, sign the gPTP message based on the node gPTP message private key, generate a node digital signature, the node gPTP message private key and the node gPTP message public key are uniquely associated, and the gPTP message and the node digital signature are concatenated to form an extended gPTP message. The message sending module 303 is used to send extended gPTP messages.
[0051] Corresponding to the gPTP message sending method, this application also provides a gPTP message transmission apparatus for implementing the gPTP message receiving method provided in the foregoing embodiments, such as... Figure 4 As shown, the gPTP message transmission device includes: Message receiving module 401 is used to receive extended gPTP messages sent by the gPTP message communication device as described in claim 7 from the vehicle communication network; The message parsing module 402 is used to extract node digital signatures and gPTP messages from self-extending gPTP messages; The timestamp verification module 403 is used to decode the node's digital signature using the node's gPTP message public key, obtain the decoding result, and verify the sending timestamp in the gPTP message based on the decoding result; Furthermore, the message receiving module 401 is also used to retain verified extended gPTP messages.
[0052] The gPTP message transmission device provided in the above embodiments can implement the technical solutions described in the gPTP message sending method or gPTP message receiving method provided in the above embodiments. The specific implementation principles of each module or unit can be found in the corresponding content in the above gPTP message sending method or gPTP message receiving method embodiments, and will not be repeated here.
[0053] Please refer to Figure 5 This application also provides an electronic device 500. The electronic device 500 includes a processor 501, a memory 502, and a display 503. Figure 5 Only some components of the electronic device 500 are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
[0054] In some embodiments, processor 501 may be a central processing unit (CPU), microprocessor, or other data processing chip, used to run program code stored in memory 502 or process data, such as the gPTP message sending method and / or gPTP message receiving method in this application.
[0055] In some embodiments, processor 501 may be a single server or a group of servers. The server group may be centralized or distributed. In some embodiments, processor 501 may be local or remote. In some embodiments, processor 501 may be implemented on a cloud platform. In one embodiment, the cloud platform may include a private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, inter-cloud, multi-cloud, or any combination thereof.
[0056] In some embodiments, memory 502 may be an internal storage unit of electronic device 500, such as a hard disk or memory of electronic device 500. In other embodiments, memory 502 may also be an external storage device of electronic device 500, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on electronic device 500.
[0057] Furthermore, the memory 502 may include both internal storage units of the electronic device 500 and external storage devices. The memory 502 is used to store application software and various types of data installed on the electronic device 500.
[0058] In some embodiments, display 503 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 503 is used to display information from electronic device 500 and to display a visual user interface. Components 501-503 of electronic device 500 communicate with each other via a system bus.
[0059] In one embodiment, when processor 501 executes the gPTP message sending program in memory 502, the following steps can be implemented: Construct a gPTP message, which must include at least a timestamp recording the time of transmission; Obtain the node gPTP message private key corresponding to the current communication node, sign the gPTP message based on the node gPTP message private key, generate the node digital signature, and the node gPTP message private key and the node gPTP message public key are uniquely associated. The gPTP message and the node's digital signature are combined to form an extended gPTP message, which is then sent to the vehicle communication network.
[0060] When processor 501 executes the gPTP message receiving program in memory 502, the following steps can be implemented: Receive extended gPTP messages from the vehicle-mounted communication network as described in any one of claims 1 to 4, and extract the node digital signature and gPTP message from the extended gPTP message; The node's digital signature is decoded using the node's gPTP message public key. The decoding result is then used to verify the sending timestamp in the gPTP message, and the verified extended gPTP message is retained.
[0061] It should be understood that when the processor 501 executes the gPTP message sending program or the gPTP message receiving program in the memory 502, in addition to the functions mentioned above, it can also perform other functions, as can be found in the description of the corresponding method embodiments above.
[0062] Furthermore, this application does not specifically limit the type of electronic device 500 mentioned in the embodiments. Electronic device 500 can be a mobile phone, tablet computer, personal digital assistant (PDA), wearable device, laptop computer, or other portable electronic devices. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices running iOS, Android, Microsoft, or other operating systems. The aforementioned portable electronic device can also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of this application, electronic device 500 may not be a portable electronic device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0063] Accordingly, embodiments of this application also provide a computer-readable storage medium for storing computer-readable programs or instructions. When the programs or instructions are executed by a processor, they can implement the steps or functions in the gPTP message sending method and / or gPTP message receiving method provided in the above-described method embodiments.
[0064] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.), and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.
[0065] The foregoing has provided a detailed description of the gPTP message transmission method, gPTP message reception method, gPTP message communication device, electronic device, and computer-readable storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A gPTP message transmission method, applied to any communication node in a vehicular communication network, wherein the vehicular communication network includes a vehicular root trusted CA, and the vehicular root trusted CA includes the node gPTP message public key corresponding to each of the communication nodes, characterized in that, The gPTP message transmission method includes: Construct a gPTP message, wherein the gPTP message includes at least a timestamp recording the time of transmission; Obtain the node gPTP message private key corresponding to the current communication node, sign the gPTP message based on the node gPTP message private key, and generate a node digital signature. The node gPTP message private key and the node gPTP message public key are uniquely associated. The gPTP message and the node digital signature are concatenated to form an extended gPTP message, which is then sent to the vehicle communication network.
2. The gPTP message transmission method according to claim 1, characterized in that, The process of concatenating the gPTP message and the node digital signature to form an extended gPTP message includes: The extended gPTP message is formed by adding a signature information field to the end of the gPTP message, and the node's digital signature is written into the signature information field.
3. The gPTP message transmission method according to claim 2, characterized in that, The gPTP message transmission method further includes: The communication node certificate corresponding to the current communication node is written into the signature information field. The communication node certificate is a digital certificate uniquely corresponding to the current communication node, generated by the vehicle-mounted trusted root CA using the CA private key to sign the node information of the current communication node and the node gPTP message public key. The CA private key is the private key corresponding to the vehicle-mounted trusted root CA. The CA private key and the CA public key are uniquely corresponding. The CA public key is broadcast to each of the communication nodes.
4. The gPTP message transmission method according to claim 2, characterized in that, The gPTP message includes a message header field, a message body field, and a time field. Writing the node's digital signature into the signature information field further includes: Data is simultaneously written to the message header field and / or the message body field and / or the time field.
5. A gPTP message receiving method, applied to any communication node in a vehicle-mounted communication network, wherein the vehicle-mounted communication network includes a vehicle-mounted root trusted CA, and the vehicle-mounted root trusted CA includes the node gPTP message public key corresponding to each of the communication nodes, characterized in that... The gPTP message receiving method includes: The node digital signature and the gPTP message are extracted from the extended gPTP message received from the vehicle communication network as described in any one of claims 1 to 4. The node's digital signature is decoded using the node's gPTP message public key to obtain the decoding result. The sending timestamp in the gPTP message is verified based on the decoding result, and the verified extended gPTP message is retained.
6. The gPTP message transmission method according to claim 5, characterized in that, The extended gPTP message includes the communication node certificate, and the gPTP message receiving method includes: The communication node certificate is decoded using the CA public key to obtain the node's gPTP message public key.
7. A gPTP message communication device, installed in a vehicle-mounted communication network, the vehicle-mounted communication network including a vehicle-mounted root trusted CA, the vehicle-mounted root trusted CA including the node gPTP message public key corresponding to each of the communication nodes, characterized in that, include: A message construction module is used to construct gPTP messages, wherein the gPTP messages include at least a timestamp recording the sending time; The message extension module is used to obtain the node gPTP message private key corresponding to the current communication node, sign the gPTP message based on the node gPTP message private key, generate a node digital signature, the node gPTP message private key and the node gPTP message public key are uniquely associated, and the gPTP message and the node digital signature are concatenated to form an extended gPTP message; A message sending module, which is used to send the extended gPTP message.
8. A gPTP message communication device, installed in a vehicle-mounted communication network, the vehicle-mounted communication network including a vehicle-mounted root trusted CA, the vehicle-mounted root trusted CA including the node gPTP message public key corresponding to each of the communication nodes, characterized in that, include: A message receiving module, the message receiving module being used to receive the extended gPTP message sent by the gPTP message communication device as described in claim 7 from the vehicle communication network; The message parsing module is used to extract the node digital signature and the gPTP message from the extended gPTP message; The timestamp verification module is used to decode the node's digital signature using the node's gPTP message public key, obtain the decoding result, and verify the sending timestamp in the gPTP message based on the decoding result. The message receiving module is also used to retain the extended gPTP message that has passed verification.
9. An electronic device, characterized in that, Including memory and processor, among which, The memory is used to store programs; The processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps of the gPTP message sending method according to any one of claims 1 to 4 and / or the gPTP message receiving method according to any one of claims 5 to 6.
10. A computer-readable storage medium, characterized in that, Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps of the gPTP message sending method according to any one of claims 1 to 4 and / or the gPTP message receiving method according to any one of claims 5 to 6.