Communication method and apparatus, computer device, and storage medium

By broadcasting a message to elect a key server immediately in the vehicle Ethernet network and determining itself as the key server based on the response, the problem of excessively long convergence time of the MACsec Key Agreement protocol is solved, and real-time communication in the vehicle network is realized.

CN116489255BActive Publication Date: 2026-11-06NIO SOFTWARE TECH (SHANGHAI) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310473682.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-27
Publication Date
2026-11-06
Estimated Expiration
2043-04-27

AI Technical Summary

Technical Problem

In multi-participant environments, the MACsec Key Agreement protocol suffers from excessively long convergence times due to waiting periods, making it difficult to meet the real-time requirements of vehicular networks.

Method used

In vehicular Ethernet, network devices immediately broadcast messages for electing key servers based on the established communication link, start a timer according to a preset duration, determine themselves as key servers after receiving response messages, generate election result messages, establish communication relationships, and avoid waiting for timeouts to send messages.

Benefits of technology

It accelerates protocol convergence time, improves the communication efficiency of in-vehicle networks, and meets real-time requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116489255B_ABST
    Figure CN116489255B_ABST
Patent Text Reader

Abstract

The application relates to a communication method, device, computer equipment, storage medium and computer program product. The method comprises the following steps: any network equipment in a vehicle-mounted Ethernet can broadcast a first message for electing a key server based on an established communication link, a timer is started according to a preset time length, a first response message is received before the timer expires, a first election result message is generated when it is determined according to the first response message that the network equipment is the key server, and a communication relationship with other network equipment in the communication link is established according to the first election result message, so that the protocol convergence time is accelerated, and the real-time requirement of the vehicle-mounted network is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network communication technology, and in particular to a communication method, apparatus, computer equipment, storage medium, and computer program product. Background Technology

[0002] With the rapid development of communication technology, the concept of key negotiation has been proposed. On the one hand, it can provide identity authentication for participants, and on the other hand, it can negotiate and share session keys with participants.

[0003] Meanwhile, with the increasing adoption of Ethernet in automobiles, MACsec (Media Access Control Security) is considered the most promising in-vehicle Ethernet security solution. MACsec shares a session key among parties on a point-to-multipoint network. This key is generated by one of the participants elected as the key server and broadcast to the other participants. The key server election and key generation and distribution process is defined by the MACsec Key Agreement (IEEE 8021X). Typically, for security reasons, the MACsec Key Agreement also stipulates that key server election and session key generation and distribution must be conducted with all participants present. If other participants join after key distribution, all participants must re-elect a key server, and the newly elected key server must regenerate and distribute the key to prevent later-joining participants from using the session key previously used by other participants to decrypt encrypted communications that occurred between other participants before they joined.

[0004] To minimize protocol interactions in a multi-participant environment and prevent new participants from triggering key server re-election and session key redistribution shortly after key server election and session key distribution, the MACsec Key Agreement protocol incorporates a waiting period (typically 2 seconds) during the key server election phase. This allows each participant to include as many participants as possible before making a key server election decision. However, this waiting period results in a longer overall protocol convergence time. Even with only two communicating participants, the protocol convergence time is as long as 4 seconds under the default configuration, making it difficult to meet the real-time requirements of vehicular networks. Summary of the Invention

[0005] Therefore, it is necessary to provide a communication method, apparatus, computer device, computer-readable storage medium, and computer program product that can accelerate protocol convergence time in response to the above-mentioned technical problems.

[0006] Firstly, this application provides a communication method. The method is applied to any network device in an in-vehicle Ethernet system, and the method includes:

[0007] A first message is broadcast based on the established communication link. The first message is used to elect the key server. The first message includes at least the identification information of any of the network devices.

[0008] Start the timer according to the preset duration;

[0009] Before the timer expires, a first response message is received, and the user determines itself to be the key server based on the first response message. Then, a first election result message is generated. The first response message is a response returned by other network devices in the communication link after receiving the first message.

[0010] Based on the first election result message, establish communication relationships with other network devices in the communication link.

[0011] In one embodiment, the method further includes: receiving the first response message before the timer expires, and determining that it is not a key server based on the first response message, sending a second response message in response to the first response message, wherein the second response message is used to instruct other network devices in the communication link to return a second election result message upon receiving the second response message.

[0012] In one embodiment, the method further includes: stopping the timer when the second election result message is received before the timer expires; and establishing a communication relationship with other network devices in the communication link based on the second election result message.

[0013] In one embodiment, the method further includes: when the timer times out and no second election result message is received, rebroadcasting the first message and returning to the step of starting the timer according to a preset duration.

[0014] In one embodiment, the method further includes: when the timer times out and the first response message is not received, rebroadcasting the first message and returning to the step of starting the timer according to a preset duration.

[0015] In one embodiment, after starting the timer according to a preset duration, the method further includes: when, before the timer expires, a second message for electing a key server is received from another network device based on an established communication link, a third response message is broadcast in response to the second message, wherein the second message includes at least the identification information of the other network device, and the third response message is used to indicate that any network device has received the second message; and a communication relationship with other network devices in the communication link is established based on the third response message.

[0016] In one embodiment, establishing a communication relationship with other network devices in the communication link based on the third response message includes: receiving a third election result message returned by other network devices in the communication link in response to the third response message before the timer expires, stopping the timer; and establishing a communication relationship with other network devices in the communication link based on the third election result message.

[0017] In one embodiment, establishing a communication relationship with other network devices in the communication link based on the third response message includes: receiving a fourth response message returned by other network devices in the communication link in response to the third response message before the timer expires, and generating a fourth election result message when determining itself as a key server based on the fourth response message; distributing the fourth election result message to other network devices in the communication link to establish a communication relationship with other network devices in the communication link.

[0018] In one embodiment, establishing a communication relationship with other network devices in the communication link based on the first election result message includes: distributing the first election result message to other network devices in the communication link; stopping the timer after the first election result message has been distributed before the timer expires, so as to establish a communication relationship with other network devices in the communication link.

[0019] In one embodiment, the method includes: when the timer times out and the first election result message has not been fully distributed, rebroadcasting the first message and returning to the step of starting the timer according to a preset duration.

[0020] In one embodiment, before starting the timer according to the preset duration, the method further includes: obtaining the link rate of the communication link and the processor speed of the vehicle Ethernet; and determining the preset duration based on the target requirement parameters, the link rate, and the processor speed.

[0021] Secondly, this application also provides a communication device. The device includes:

[0022] The broadcast module is used to broadcast a first message based on the established communication link. The first message is used to elect the key server and includes at least the identification information of any of the network devices.

[0023] The timing module is used to start a timer according to a preset duration;

[0024] The result generation module is used to receive a first response message before the timer expires, and generate a first election result message when it determines itself to be a key server based on the first response message. The first response message is a response returned by other network devices in the communication link after receiving the first message.

[0025] The communication establishment module is used to establish communication relationships with other network devices in the communication link based on the first election result message.

[0026] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described in the first aspect above.

[0027] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the method described in the first aspect above.

[0028] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the method described in the first aspect above.

[0029] The aforementioned communication method, apparatus, computer equipment, storage medium, and computer program product enable any network device connected to the vehicle Ethernet to broadcast a first message for electing a key server based on an established communication link. Simultaneously, a timer is started according to a preset duration. Before the timer expires, a first response message is received. If the device determines itself to be the key server based on the first response message, a first election result message is generated. Based on the first election result message, communication relationships with other network devices in the communication link are established, thereby accelerating the protocol convergence time to meet the real-time requirements of the vehicle network. Attached Figure Description

[0030] Figure 1 This is a schematic diagram of a conventional communication method in one embodiment;

[0031] Figure 2 This is a diagram illustrating the application environment of a communication method in one embodiment;

[0032] Figure 3 This is a flowchart illustrating a communication method in one embodiment;

[0033] Figure 4 This is a flowchart illustrating the communication method in another embodiment;

[0034] Figure 5 This is a flowchart illustrating the steps for establishing a communication relationship in one embodiment;

[0035] Figure 6 This is a flowchart illustrating the communication method in yet another embodiment;

[0036] Figure 7 This is a flowchart illustrating the steps for establishing a communication relationship in another embodiment;

[0037] Figure 8 This is a flowchart illustrating the steps for establishing a communication relationship in yet another embodiment;

[0038] Figure 9 This is an interactive diagram of a communication method in one embodiment;

[0039] Figure 10 This is a structural block diagram of a communication device in one embodiment;

[0040] Figure 11 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0041] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0042] Figure 1 This is a diagram illustrating the communication between participants in a traditional Ethernet technology, such as... Figure 1 As shown, the communication process is as follows:

[0043] Step 101, at time T A0 Participant A is ready and starts the first timer, with a duration of MKA hello time.

[0044] Step 102, at time T B0 Participant B is ready. Start the second timer, with a duration of MKA hello time.

[0045] Step 103, at time T A1If participant A's first timer expires, participant A will broadcast an MKAPDU (MACsecKey Agreement Protocol Data Unit) message containing its identification information and restart the first timer. If participant B receives this message, it will not respond but will continue to wait for the second timer to expire.

[0046] Step 104, at time T B1 If participant B's second timer expires, participant B broadcasts an MKAPDU message. This message contains participant B's identification information and carries the identification information of participant A from the previously broadcast MKAPDU message, indicating that participant B witnessed participant A's participation in this key server election. Participant A does not respond after receiving this message but continues to wait for its first timer to expire.

[0047] Step 105, at time T A2 When participant A's first timer expires, participant A compares its own identification information with the identification information of participant B carried in a previously broadcast message, as well as the identification information carried in messages broadcast by other participants (if received before this timer expires). If participant A determines that it should be elected as the key server, it sends an MKAPDU, declaring itself the key server and distributing the session key for symmetric encrypted communication. This message also carries the identification information of other participants, including B, carried in previous broadcasts, indicating that all participants are indeed present. This allows subsequent communication between participants based on the session key, thus establishing communication relationships between them.

[0048] As can be seen from the above process, during the key server election phase, each participant does not immediately send a message after it is ready or after receiving a message from another participant. Instead, it waits for the set timer to expire before sending, resulting in a long overall convergence time for the protocol. When the MKA hello time of the timer is set to 2 seconds, even with only two communicating participants, the protocol convergence time is as long as 4 seconds under the default configuration, making it difficult to meet the real-time requirements of the vehicular network.

[0049] Based on this, the communication method provided in the embodiments of this application can be applied to, for example... Figure 2The illustrated vehicular Ethernet includes at least two network devices, such as at least vehicle-side device 202 and mobile device 204. A data storage system can store the data that the vehicle-side device 202 needs to process. The data storage system can be integrated onto the vehicle-side device 202 or located in the cloud or on another network server. In this embodiment, any participant accessing the vehicular Ethernet (vehicle-side device 202 or mobile device 204) can immediately broadcast an MKAPDU upon link readiness or when a key update is required, without waiting. The participant receiving this message can immediately broadcast a response message without waiting. This accelerates protocol convergence time to meet the real-time requirements of the vehicular network.

[0050] Specifically, the vehicle-mounted device 202 can be an integrated in-vehicle information processing system formed by using a dedicated in-vehicle central processing unit, based on the vehicle bus system and internet services. The mobile device 204 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc.

[0051] In one embodiment, such as Figure 3 As shown, a communication method is provided, which is applied to Figure 2 Taking any network device in an in-vehicle Ethernet system as an example, the following steps may be included:

[0052] Step 302: Broadcast the first message based on the established communication link.

[0053] The first message, specifically the MKAPDU message, is used for electing the key server. It is understood that the format and content of this first message conform to the standard MACsec Key Agreement protocol. In this embodiment, the first message includes at least the identification information of any network device that sent the message. Specifically, the identification information is used to uniquely identify the network device, meaning that the corresponding network device can be uniquely determined based on the identification information. Any network device can be a ready-to-use network device in the vehicular Ethernet, for example, it could be vehicle-side device 202 or mobile device 204.

[0054] In this embodiment, when the communication link of any network device connected to the vehicle Ethernet is ready, it can broadcast a first message based on the established communication link to participate in the election of the key server.

[0055] Step 304: Start the timer according to the preset duration.

[0056] The preset duration can be a pre-defined time required for the network to complete key server election under normal circumstances, i.e., the shortest time from when any network device sends its first MKAPDU message to when session key distribution is completed. This preset duration is also used to ensure that the protocol can still complete key server election and session key generation and distribution in the event of message loss.

[0057] Specifically, when any network device broadcasts the first message based on the established communication link, a timer can be started according to a preset duration.

[0058] Step 306: Before the timer expires, the first response message is received, and when the first response message determines that the user is the key server, the first election result message is generated.

[0059] The first response message can be a response returned by other network devices in the communication link after receiving the first message, indicating that it has witnessed any network device that sent the first message participating in this key server election. Specifically, the first response message may include the identification information of the other network device responding, as well as the identification information of any network device carried in the first message received by the other network device.

[0060] In this embodiment, before the timer expires, when any network device that sent the first message receives the first response message and determines itself to be the key server based on the first response message, it can generate a first election result message. The first election result message represents the election result of the key server and the corresponding session key. Specifically, by comparing its own identification information with the identification information of other network devices carried in their response messages, if the network device determines that it should be elected as the key server, it can generate a first election result message including the session key and the fact that it is the key server.

[0061] Step 308: Establish communication relationships with other network devices in the communication link based on the first election result message.

[0062] In this embodiment, after any network device determines itself as a key server through the above steps and generates a first election result message, it can establish communication relationships with other network devices in the communication link based on the first election result message. Specifically, any network device can broadcast the first election result message based on the communication link to distribute the session key, thereby enabling subsequent communication between network devices in the communication link based on the session key, that is, establishing communication relationships with other network devices in the communication link.

[0063] In the above communication method, any network device accessing the vehicle Ethernet can broadcast a first message for electing a key server based on the established communication link. At the same time, a timer is started according to a preset duration. Before the timer expires, a first response message is received. When the device determines itself to be the key server based on the first response message, a first election result message is generated. The device then establishes communication relationships with other network devices in the communication link based on the first election result message, thereby accelerating the protocol convergence time to meet the real-time requirements of the vehicle network.

[0064] In one embodiment, after starting the timer according to the preset duration in step 304, the above method may further include the following steps: when the timer expires, if a first response message is received and it is determined from the first response message that the user is not a key server, then a second response message is sent in response to the first response message.

[0065] The first response message can be a response returned by other network devices in the communication link after receiving the first message, indicating that it has witnessed any network device that sent the first message participating in this key server election. Specifically, the first response message may include the identification information of the other network device responding, as well as the identification information of any network device carried in the first message received by the other network device.

[0066] The second response message can be a response from any network device that sent the first message to a first response message sent by other network devices in the communication link. Specifically, before the timer expires, when any of the aforementioned network devices that sent the first message receives the first response message and determines from the first response message that it is not a key server, it can send a second response message in response to the first response message. This instructs other network devices in the communication link to return a second election result message upon receiving the second response message. This allows the network devices in the communication link to establish communication relationships through this second election result message.

[0067] In one embodiment, when any network device that sent the first message receives the first response message before the timer expires, determines that it is not a key server based on the first response message, and sends a second response message in response to the first response message, the above method may further include: stopping the timer when a second election result message is received before the timer expires; and establishing a communication relationship with other network devices in the communication link based on the second election result message.

[0068] The second election result message represents the election result of the key server and the corresponding session key. Specifically, since the second response message is sent by any network device when it determines from the first response message that it is not the key server, if the network device receives the second election result message before the timer expires after sending the second response message to the first response message, it indicates that the key server election was successful. Therefore, the timer can be stopped, and communication relationships with other network devices in the communication link can be established based on the second election result message. That is, any network device can communicate with other network devices in the communication link based on the session key in the second election result message.

[0069] In one scenario, the above method may further include: when the timer times out and no second election result message is received, broadcasting the first message again and returning to the step of starting the timer according to the preset duration.

[0070] Specifically, since the timer is set based on the minimum duration required to complete the key server election under normal network conditions, if any network device sends a second response message to the first response message and does not receive the second election result message by the timer expires, it indicates that a message may have been lost. Therefore, when the timer expires and the network device has not received the second election result message, it can rebroadcast the first message, i.e., re-initiate the key server election, and return to the step of starting the timer according to the preset duration. This ensures that the key server election and session key generation and distribution can be completed, avoiding the situation where the key server election cannot be completed due to message loss.

[0071] In one scenario, the above method may further include: when the timer times out and no first response message is received, rebroadcasting the first message and returning to the step of starting the timer according to the preset duration.

[0072] Since the timer is set based on the minimum duration required to complete key server election under normal network conditions, if any network device broadcasts the first message based on the established communication link and does not receive a first response message for that first message by the timer expires, it indicates that message loss may have occurred. Therefore, when the timer expires and any network device does not receive the first response message, it can rebroadcast the first message, i.e., re-initiate key server election, and return to the step of starting the timer according to the preset duration. This ensures that key server election and session key generation and distribution can be completed, avoiding the situation where key server election cannot be completed due to message loss.

[0073] In one embodiment, such as Figure 4 As shown, the above communication method may specifically include the following steps:

[0074] Step 402: Broadcast the first message based on the established communication link.

[0075] Step 404: Start the timer according to the preset duration.

[0076] The implementation of steps 402 and 404 can be referred to Figure 3 The corresponding steps 302 and 304 are not described again in this embodiment.

[0077] Step 406: Determine whether the first response message has been received in a timely manner based on the timer.

[0078] Specifically, if any network device that sent the first message receives the first response message before the timer expires, then step 408 is executed. If the timer expires and any network device that sent the first message does not receive the first response message, then the process returns to step 402, that is, the first message is broadcast again, and the timer is restarted according to a preset duration.

[0079] Step 408: Determine whether you are a key server based on the first response message.

[0080] Specifically, when any network device determines itself to be a key server based on the first response message, step 410 is executed; when any network device determines itself not to be a key server based on the first response message, step 412 is executed.

[0081] Step 410: Generate the first election result message and establish communication relationships with other network devices in the communication link based on the first election result message.

[0082] Specifically, when any network device determines itself to be a key server based on the first response message, it generates a first election result message and establishes communication relationships with other network devices in the communication link based on the first election result message.

[0083] Step 412: Broadcast the second response message in response to the first response message.

[0084] When any network device determines that it is not a key server based on the first response message, it broadcasts a second response message in response to the first response message to instruct other network devices in the communication link to return a second election result message upon receiving the second response message.

[0085] Step 414: Determine whether the second election result message has been received in a timely manner based on the timer.

[0086] Specifically, if any network device receives the second election result message before the timer expires, step 416 is executed. If the timer expires and the network device does not receive the second election result message, the process returns to step 402, which involves rebroadcasting the first message and restarting the timer according to a preset duration.

[0087] Step 416: Stop the timer and establish communication relationships with other network devices in the communication link based on the second election result message.

[0088] Specifically, when any network device receives a second election result message before the timer expires, it stops the timer and establishes a communication relationship with other network devices in the communication link based on the second election result message.

[0089] In the above embodiments, any network device in the vehicle Ethernet that is ready can immediately initiate a first message for electing the key server, and can immediately broadcast a response message after receiving the message from the other end without waiting. Therefore, compared with the traditional technology of waiting for timeout to send, it can accelerate the protocol convergence time and improve communication efficiency.

[0090] In one embodiment, such as Figure 5 As shown, in step 308, communication relationships with other network devices in the communication link are established based on the first election result message. This may specifically include the following steps:

[0091] Step 502: Distribute the first election result message to other network devices in the communication link.

[0092] Specifically, before the timer expires, when any of the network devices that sent the first message receives the first response message and determines itself to be the key server based on the first response message, it can generate a first election result message including the session key and that it is the key server, and then distribute the first election result message to other network devices in the communication link.

[0093] Step 504: If the first election result message has been distributed before the timer expires, then stop the timer.

[0094] In this embodiment, if any of the aforementioned network devices has completed distributing the first election result message before the timer expires, the timer is stopped. Alternatively, the timer can be stopped simultaneously with the transmission of the last first election result message to establish communication relationships with other network devices in the communication link, enabling each network device in the communication link to communicate based on the session key in the first election result message.

[0095] Step 506: When the timer expires and the first election result message has not been fully distributed, broadcast the first message again and return to the step of starting the timer according to the preset duration.

[0096] Understandably, in one scenario, when the timer expires and the first election result message has not been fully distributed, any of the aforementioned network devices can rebroadcast the first message and return to the step of starting the timer according to the preset duration. That is, when the timer expires and the first election result message has not been fully distributed, the key server is re-elected, and the timer monitoring is restarted to avoid the inability to complete the key server election in case of message loss.

[0097] In one embodiment, such as Figure 6 As shown, after starting the timer according to the preset duration in step 304, the above method may further include:

[0098] Step 602: When a second message for electing a key server is received from another network device based on the established communication link before the timer expires, a third response message for the second message is broadcast.

[0099] The third response message indicates that any network device that sent the first message has received the second message. The second message includes at least the identification information of other network devices, and its format and content conform to the standard MACsec Key Agreement protocol. The third response message may include the identification information of the first network device, as well as the identification information of other network devices carried in the second message received by that first network device.

[0100] In this embodiment, if any network device that sent the first message receives a second message for electing a key server sent by another network device based on an established communication link before the timer expires, then it broadcasts a third response message for the second message to respond to other network devices that it has received the second message.

[0101] Step 604: Establish communication relationships with other network devices in the communication link based on the third response message.

[0102] Specifically, any network device can establish a communication relationship with other network devices in the communication link based on the third response message.

[0103] In this embodiment, when any network device receives a second message for electing a key server from another network device based on an established communication link before the timer expires, it does not need to wait and immediately broadcasts a third response message for the second message, and establishes a communication relationship with other network devices in the communication link based on the third response message, thereby accelerating the protocol convergence time and improving communication efficiency.

[0104] In one embodiment, such as Figure 7 As shown, in step 604, establishing communication relationships with other network devices in the communication link based on the third response message can specifically include:

[0105] Step 702: Before the timer expires, a third election result message is received from other network devices in the communication link in response to the third response message, and the timer is stopped.

[0106] The third election result message includes the election result of the key server and the corresponding session key. It can be understood that when any network device receives a third election result message returned by another network device in the communication link in response to the third response message, it indicates that the network device is not the key server; that is, the other network device that sent the third election result message is the key server.

[0107] In this embodiment, if any of the aforementioned network devices receives a complete message of the third election result message returned by another network device in the communication link in response to the third response message before the timer expires, it indicates that the key server election was successful. Therefore, the timer can be stopped.

[0108] In one scenario, if any of the aforementioned network devices receives only a portion of the third election result message when the timer expires, i.e., does not receive the complete third election result message, then that network device can rebroadcast the first message and return to the step of starting the timer according to the preset duration to re-elect the key server.

[0109] Step 704: Establish communication relationships with other network devices in the communication link based on the third election result message.

[0110] Specifically, any of the aforementioned network devices can communicate with other network devices in the communication link based on the session key in the third election result message, so as to establish a communication relationship with other network devices in the communication link.

[0111] In this embodiment, if any of the aforementioned network devices receives a third election result message returned by other network devices in the communication link in response to the third response message before the timer expires, the timer can be stopped, and a communication relationship with other network devices in the communication link can be established based on the third election result message, thereby improving communication efficiency.

[0112] In one embodiment, such as Figure 8 As shown, in step 604, establishing communication relationships with other network devices in the communication link based on the third response message may further include:

[0113] Step 802: Before the timer expires, a fourth response message is received from other network devices in the communication link in response to the third response message. When the fourth response message determines that it is the key server, a fourth election result message is generated.

[0114] The fourth response message indicates that the other network device that sent the second message received a third response message broadcast by any network device in response to the second message, and indicates that the other network device is not a key server. Specifically, the message format and content of the fourth response message are consistent with the standard MACsec Key Agreement protocol. The fourth response message may include the identification information of the other network device and the identification information of any network device that sent the third response message. The fourth election result message indicates the election result of the key server and the corresponding session key.

[0115] In this embodiment, before the timer expires, when any network device that sent the third response message receives the fourth response message and determines itself to be the key server based on the fourth response message, it can generate a fourth election result message. Specifically, by comparing its own identification information with the identification information of the other network devices carried in the fourth response messages of the other network devices, if the network device determines that it should be elected as the key server, it can generate a fourth election result message including the session key and that it is the key server.

[0116] Step 804: Distribute the fourth election result message to other network devices in the communication link to establish communication relationships with other network devices in the communication link.

[0117] In this embodiment, after any network device determines itself as a key server through the above steps and generates a fourth election result message, it can also establish communication relationships with other network devices in the communication link based on the fourth election result message. Specifically, any network device can broadcast the fourth election result message based on the communication link to distribute the session key, thereby enabling subsequent communication between network devices in the communication link based on the session key, that is, establishing communication relationships with other network devices in the communication link.

[0118] In one embodiment, before starting the timer according to the preset duration in step 304, the method may further include: acquiring the link rate of the communication link and the processor speed of the vehicular Ethernet, and determining the preset duration based on the target requirement parameters, the link rate, and the processor speed. Since the time spent constructing, sending, and analyzing messages after receiving them is affected by both other tasks currently being processed by the processor and the task scheduling algorithm currently used by the processor, the slower the processor, the longer the preset duration should be, and the faster the link rate, the shorter the preset duration should be. Furthermore, considering energy-saving factors, the preset duration can be appropriately adjusted based on specific energy-saving target requirement parameters. For example, a slightly longer preset duration can be set based on the above, thereby increasing the re-election interval and reducing protocol interaction.

[0119] In one embodiment, such as Figure 9 As shown, the communication method of this application will be further described below. In this embodiment, taking a vehicle-mounted Ethernet network including network device A and network device B as an example, the method may specifically include the following steps:

[0120] Step 902, T A0 At this moment, network device A is ready and immediately broadcasts an MKAPDU message (first message) and starts a key server re-election timer (first timer). The message contains A's identification information, and its format and content are consistent with the standard MACsec Key Agreement protocol. At this point, it cannot be assumed that network device B is ready to receive the message, as shown in the diagram. It would be incorrect to assume that the message is discarded by B.

[0121] Step 904, if T A1At a certain point, network device A's key server re-election timer times out (i.e., the first timer times out). Finding that key distribution is still incomplete, it immediately broadcasts an MKAPDU message (i.e., retransmits the first message) and restarts the key server re-election timer (i.e., restarts the first timer). The message contains A's identification information, and its format and content are consistent with the standard MACsec Key Agreement protocol. At this point, it cannot be assumed that network device B is ready to receive the message. As shown in the diagram, if we assume that the message is still discarded by B...

[0122] Step 906, if T B0 At that moment, network device B is ready. It immediately broadcasts an MKAPDU message (second message) and starts a re-election key server timer (second timer). The message contains B's identification information, and the message format and content are consistent with the standard MACsec Key Agreement protocol.

[0123] Step 908, if T A2 At a certain moment, network device A receives an MKAPDU message (i.e., the second message) from network device B, and the restarted first timer has not expired, then it immediately broadcasts a response message (i.e., a response to the second message). The message carries the identification information of network device B, indicating that A has received the aforementioned broadcast message from B.

[0124] Step 910: After receiving the aforementioned response message from network device A, if the second timer has not expired, network device B confirms whether it is a key server based on A's aforementioned response message. If it determines that it should not be elected as a key server, it immediately broadcasts a response message (i.e., a response to the aforementioned response message). The message contains the identification information of network device A, indicating that B confirms that A received B's previous broadcast, thus confirming A's presence.

[0125] Step 912: If network device A receives a response message from network device B before the first timer expires after restarting, A can determine that it should be elected as the key server. Therefore, A generates an election result message including the session key and distributes the election result message.

[0126] In one scenario, when network device A sends the last election result message, the key server re-election timer can be stopped, i.e., the first timer to restart can be stopped. This allows network devices to communicate based on the session key in the election result message.

[0127] In one scenario, network device B can stop the re-election key server timer (i.e., stop the second timer) upon receiving the last election result message from A. This allows network devices to communicate based on the session key in the election result message.

[0128] In one scenario, if the first timer times out at any of the above steps, network device A can immediately broadcast an MKAPDU message (i.e., retransmit the first message) and start a re-election key server timer (i.e., restart the first timer); if the second timer times out, network device B can immediately broadcast an MKAPDU message (i.e., retransmit the second message) and start a re-election key server timer (i.e., restart the second timer), thus ensuring that key server election and session key generation and distribution can still be completed even in the event of message loss.

[0129] In one scenario, if network device A is at T A1 If network device A receives messages broadcast by other network devices before the first timer for restarting expires, network device A can determine whether it is a key server based on the messages broadcast by network device B and other network devices. If it determines that it is a key server, it distributes election result messages to network device B and other network devices. If it determines that it is not a key server, it broadcasts the corresponding response message.

[0130] Based on the above embodiments, through comparison Figure 9 and Figure 1 As can be seen, under normal communication link conditions, the protocol convergence time of the communication method in this application is the shortest time from sending the election message to completing the session key distribution, while the protocol convergence time of traditional communication methods includes at least two additional waiting periods. Therefore, compared with traditional communication methods, the communication method in this application can accelerate the protocol convergence time, thereby meeting the real-time requirements of vehicular networks.

[0131] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0132] Based on the same inventive concept, this application also provides a communication device for implementing the communication method described above. The solution provided by this device is similar to the solution described in the above method; therefore, specific limitations in one or more communication device embodiments provided below can be found in the limitations of the communication method described above, and will not be repeated here.

[0133] In one embodiment, such as Figure 10 As shown, a communication device is provided, including: a broadcast module 1002, a timing module 1004, a result generation module 1006, and a communication establishment module 1008, wherein:

[0134] The broadcast module 1002 is used to broadcast a first message based on an established communication link. The first message is used to elect a key server and includes at least the identification information of any of the network devices.

[0135] The timing module 1004 is used to start a timer according to a preset duration;

[0136] The result generation module 1006 is used to receive a first response message before the timer expires, and generate a first election result message when it determines itself to be a key server based on the first response message. The first response message is a response returned by other network devices in the communication link after receiving the first message.

[0137] The communication establishment module 1008 is used to establish communication relationships with other network devices in the communication link based on the first election result message.

[0138] In one embodiment, the broadcast module is further configured to: receive the first response message before the timer expires, and when determining from the first response message that it is not a key server, send a second response message in response to the first response message, wherein the second response message is configured to instruct other network devices in the communication link to return a second election result message upon receiving the second response message.

[0139] In one embodiment, the communication establishment module is further configured to: stop the timer when the second election result message is received before the timer expires; and establish a communication relationship with other network devices in the communication link based on the second election result message.

[0140] In one embodiment, the broadcast module is further configured to: when the timer times out and no second election result message is received, rebroadcast the first message and return to the step of starting the timer according to a preset duration.

[0141] In one embodiment, the broadcast module is further configured to: when the timer times out and the first response message is not received, rebroadcast the first message and return to the step of starting the timer according to a preset duration.

[0142] In one embodiment, the broadcast module is further configured to: when receiving a second message for electing a key server sent by another network device based on an established communication link before the timer expires, broadcast a third response message for the second message, wherein the second message includes at least the identification information of the other network device, and the third response message is used to indicate that any network device has received the second message; and establish a communication relationship with other network devices in the communication link based on the third response message.

[0143] In one embodiment, the communication establishment module is further configured to: receive a third election result message returned by other network devices in the communication link in response to the third response message before the timer expires, stop the timer; and establish a communication relationship with other network devices in the communication link based on the third election result message.

[0144] In one embodiment, the communication establishment module is further configured to: receive a fourth response message returned by other network devices in the communication link in response to the third response message before the timer expires, and generate a fourth election result message when determining itself as a key server based on the fourth response message; and distribute the fourth election result message to other network devices in the communication link to establish a communication relationship with other network devices in the communication link.

[0145] In one embodiment, the communication establishment module is further configured to: distribute the first election result message to other network devices in the communication link; and stop the timer after the first election result message has been distributed before the timer expires, so as to establish a communication relationship with other network devices in the communication link.

[0146] In one embodiment, the broadcast module is further configured to: when the timer times out and the first election result message has not been fully distributed, broadcast the first message again and return to the step of starting the timer according to a preset duration.

[0147] In one embodiment, the above-mentioned device further includes a preset duration determination module, used to obtain the link rate of the communication link and the processor speed of the vehicle Ethernet; and determine the preset duration based on the target requirement parameters, the link rate and the processor speed.

[0148] Each module in the aforementioned communication device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0149] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 11 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a communication method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0150] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0151] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0152] A first message is broadcast based on the established communication link. The first message is used to elect the key server. The first message includes at least the identification information of any of the network devices.

[0153] Start the timer according to the preset duration;

[0154] Before the timer expires, a first response message is received, and the user determines itself to be the key server based on the first response message. Then, a first election result message is generated. The first response message is a response returned by other network devices in the communication link after receiving the first message.

[0155] Based on the first election result message, establish communication relationships with other network devices in the communication link.

[0156] In one embodiment, when the processor executes the computer program, it further implements the following steps: before the timer expires, it receives the first response message, and when it determines that it is not a key server based on the first response message, it sends a second response message in response to the first response message. The second response message is used to instruct other network devices in the communication link to return a second election result message when they receive the second response message.

[0157] In one embodiment, when the processor executes the computer program, it further performs the following steps: when the second election result message is received before the timer expires, the timer is stopped; and a communication relationship with other network devices in the communication link is established based on the second election result message.

[0158] In one embodiment, when the processor executes the computer program, it further implements the following steps: when the timer times out and no second election result message is received, the first message is broadcast again, and the process returns to the step of starting the timer according to a preset duration.

[0159] In one embodiment, when the processor executes the computer program, it further implements the following steps: when the timer times out and the first response message is not received, the processor rebroadcasts the first message and returns to the step of starting the timer according to a preset duration.

[0160] In one embodiment, when the processor executes the computer program, it further performs the following steps: when a second message for electing a key server is received from another network device based on an established communication link before the timer expires, a third response message is broadcast in response to the second message, wherein the second message includes at least the identification information of the other network device, and the third response message is used to indicate that any network device has received the second message; and a communication relationship is established with the other network device in the communication link based on the third response message.

[0161] In one embodiment, when the processor executes the computer program, it further performs the following steps: before the timer expires, it receives a third election result message returned by other network devices in the communication link in response to the third response message, and stops the timer; and establishes a communication relationship with other network devices in the communication link based on the third election result message.

[0162] In one embodiment, when the processor executes the computer program, it further performs the following steps: before the timer expires, it receives a fourth response message returned by other network devices in the communication link in response to the third response message, and when it determines itself to be a key server based on the fourth response message, it generates a fourth election result message; and distributes the fourth election result message to other network devices in the communication link to establish a communication relationship with other network devices in the communication link.

[0163] In one embodiment, when the processor executes the computer program, it further performs the following steps: distributing the first election result message to other network devices in the communication link; stopping the timer after the first election result message has been distributed before the timer expires, so as to establish a communication relationship with other network devices in the communication link.

[0164] In one embodiment, when the processor executes the computer program, it further implements the following steps: when the timer times out and the first election result message has not been fully distributed, the first message is broadcast again, and the process returns to the step of starting the timer according to a preset duration.

[0165] In one embodiment, when the processor executes the computer program, it further performs the following steps: obtaining the link rate of the communication link and the processor speed of the vehicle Ethernet; and determining the preset duration based on the target requirement parameters, the link rate, and the processor speed.

[0166] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0167] A first message is broadcast based on the established communication link. The first message is used to elect the key server. The first message includes at least the identification information of any of the network devices.

[0168] Start the timer according to the preset duration;

[0169] Before the timer expires, a first response message is received, and the user determines itself to be the key server based on the first response message. Then, a first election result message is generated. The first response message is a response returned by other network devices in the communication link after receiving the first message.

[0170] Based on the first election result message, establish communication relationships with other network devices in the communication link.

[0171] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: when the timer expires, it receives the first response message, and when it determines that it is not a key server based on the first response message, it sends a second response message in response to the first response message, wherein the second response message is used to instruct other network devices in the communication link to return a second election result message when they receive the second response message.

[0172] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: when the second election result message is received before the timer expires, the timer is stopped; and a communication relationship is established with other network devices in the communication link based on the second election result message.

[0173] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: when the timer times out and no second election result message is received, the first message is broadcast again, and the process returns to the step of starting the timer according to a preset duration.

[0174] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: when the timer times out and the first response message is not received, the first message is broadcast again, and the execution of the step of starting the timer according to a preset duration is returned.

[0175] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: when a second message for electing a key server is received from another network device based on an established communication link before the timer expires, a third response message is broadcast in response to the second message, wherein the second message includes at least the identification information of the other network device, and the third response message is used to indicate that any network device has received the second message; and a communication relationship is established with the other network device in the communication link based on the third response message.

[0176] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: before the timer expires, receiving a third election result message returned by other network devices in the communication link in response to the third response message, stopping the timer; and establishing a communication relationship with other network devices in the communication link based on the third election result message.

[0177] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: before the timer expires, it receives a fourth response message returned by other network devices in the communication link in response to the third response message, and when it determines itself to be a key server based on the fourth response message, it generates a fourth election result message; and it distributes the fourth election result message to other network devices in the communication link to establish a communication relationship with other network devices in the communication link.

[0178] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: distributing the first election result message to other network devices in the communication link; stopping the timer after the first election result message has been distributed before the timer expires, so as to establish a communication relationship with other network devices in the communication link.

[0179] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: when the timer times out and the first election result message has not been fully distributed, the first message is broadcast again, and the process returns to the step of starting the timer according to a preset duration.

[0180] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining the link rate of the communication link and the processor speed of the vehicular Ethernet; and determining the preset duration based on the target requirement parameters, the link rate, and the processor speed.

[0181] A first message is broadcast based on the established communication link. The first message is used to elect the key server. The first message includes at least the identification information of any of the network devices.

[0182] Start the timer according to the preset duration;

[0183] Before the timer expires, a first response message is received, and the user determines itself to be the key server based on the first response message. Then, a first election result message is generated. The first response message is a response returned by other network devices in the communication link after receiving the first message.

[0184] Based on the first election result message, establish communication relationships with other network devices in the communication link.

[0185] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: when the timer expires, it receives the first response message, and when it determines that it is not a key server based on the first response message, it sends a second response message in response to the first response message, wherein the second response message is used to instruct other network devices in the communication link to return a second election result message when they receive the second response message.

[0186] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: when the second election result message is received before the timer expires, the timer is stopped; and a communication relationship is established with other network devices in the communication link based on the second election result message.

[0187] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: when the timer times out and no second election result message is received, the first message is broadcast again, and the process returns to the step of starting the timer according to a preset duration.

[0188] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: when the timer times out and the first response message is not received, the first message is broadcast again, and the execution of the step of starting the timer according to a preset duration is returned.

[0189] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: when a second message for electing a key server is received from another network device based on an established communication link before the timer expires, a third response message is broadcast in response to the second message, wherein the second message includes at least the identification information of the other network device, and the third response message is used to indicate that any network device has received the second message; and a communication relationship is established with the other network device in the communication link based on the third response message.

[0190] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: before the timer expires, receiving a third election result message returned by other network devices in the communication link in response to the third response message, stopping the timer; and establishing a communication relationship with other network devices in the communication link based on the third election result message.

[0191] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: before the timer expires, it receives a fourth response message returned by other network devices in the communication link in response to the third response message, and when it determines itself to be a key server based on the fourth response message, it generates a fourth election result message; and it distributes the fourth election result message to other network devices in the communication link to establish a communication relationship with other network devices in the communication link.

[0192] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: distributing the first election result message to other network devices in the communication link; stopping the timer after the first election result message has been distributed before the timer expires, so as to establish a communication relationship with other network devices in the communication link.

[0193] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: when the timer times out and the first election result message has not been fully distributed, the first message is broadcast again, and the process returns to the step of starting the timer according to a preset duration.

[0194] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining the link rate of the communication link and the processor speed of the vehicular Ethernet; and determining the preset duration based on the target requirement parameters, the link rate, and the processor speed.

[0195] The relevant user personal information that may be involved in the various embodiments of this application is processed in strict accordance with the requirements of laws and regulations, following the principles of legality, legitimacy, and necessity, based on the reasonable purpose of the business scenario, and includes personal information that users actively provide or that is generated as a result of using the product / service, as well as personal information obtained with user authorization.

[0196] The personal information of users processed by the applicant will vary depending on the specific product / service scenario and will be based on the specific scenario in which the user uses the product / service. This may involve the user's account information, device information, driving information, vehicle information, or other related information. The applicant will treat the user's personal information and its processing with a high degree of diligence.

[0197] The applicant attaches great importance to the security of users' personal information and has taken reasonable and feasible security protection measures that comply with industry standards to protect users' information and prevent unauthorized access, disclosure, use, modification, damage or loss of personal information.

[0198] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0199] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0200] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A communication method, characterized in that, The method is applied to any network device in an in-vehicle Ethernet system, and the method includes: The link rate of the communication link and the processor speed of the vehicle Ethernet are obtained, and a preset duration is determined based on the target requirement parameters, the link rate, and the processor speed. A first message is broadcast based on the established communication link. The first message is used to elect the key server. The first message includes at least the identification information of any of the network devices. Start the timer according to the preset duration; Before the timer expires, a first response message is received, and the user determines itself to be the key server based on the first response message. Then, a first election result message is generated. The first response message is a response returned by other network devices in the communication link after receiving the first message. Establishing a communication relationship with other network devices in the communication link based on the first election result message includes: distributing the first election result message to other network devices in the communication link; stopping the timer after the first election result message has been distributed before the timer expires, in order to establish a communication relationship with other network devices in the communication link.

2. The method according to claim 1, characterized in that, The method further includes: Before the timer expires, if the first response message is received and it is determined from the first response message that it is not a key server, a second response message is sent in response to the first response message. The second response message is used to instruct other network devices in the communication link to return a second election result message when they receive the second response message.

3. The method according to claim 2, characterized in that, The method further includes: When the second election result message is received before the timer expires, the timer is stopped. Based on the second election result message, establish communication relationships with other network devices in the communication link.

4. The method according to claim 2, characterized in that, The method further includes: When the timer expires and the second election result message is not received, the first message is broadcast again, and the process returns to the step of starting the timer according to the preset duration.

5. The method according to claim 1, characterized in that, The method further includes: When the timer times out and the first response message is not received, the first message is broadcast again, and the process returns to the step of starting the timer according to the preset duration.

6. The method according to claim 1, characterized in that, After starting the timer according to the preset duration, the method further includes: If, before the timer expires, a second message for electing a key server is received from another network device based on an established communication link, a third response message is broadcast in response to the second message. The second message includes at least the identification information of the other network device, and the third response message is used to indicate that any network device has received the second message. The third response message establishes communication relationships with other network devices in the communication link.

7. The method according to claim 6, characterized in that, The step of establishing communication relationships with other network devices in the communication link based on the third response message includes: If a third election result message is received from another network device in the communication link in response to the third response message before the timer expires, the timer is stopped. Based on the third election result message, communication relationships are established with other network devices in the communication link.

8. A communication device, characterized in that, The device is applied to any network device in an in-vehicle Ethernet system, and the device includes: A preset duration determination module is used to obtain the link rate of the communication link and the processor speed of the vehicle Ethernet; and determine the preset duration based on the target requirement parameters, the link rate, and the processor speed. The broadcast module is used to broadcast a first message based on the established communication link. The first message is used to elect the key server and includes at least the identification information of any of the network devices. The timing module is used to start a timer according to the preset duration; The result generation module is used to receive a first response message before the timer expires, and generate a first election result message when it determines itself to be a key server based on the first response message. The first response message is a response returned by other network devices in the communication link after receiving the first message. A communication establishment module is used to establish a communication relationship with other network devices in the communication link based on the first election result message, including: distributing the first election result message to other network devices in the communication link; stopping the timer after the first election result message has been distributed before the timer expires, so as to establish a communication relationship with other network devices in the communication link.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Communication method and device

    CN114760093A