Method for synchronizing clocks of at least two devices
By divided into two stages: unlocked synchronization and encrypted certification in the distributed network of vehicle, the safety and efficiency of multiple control equipment clocks are solved, and the fast, simple and safe clock synchronization is achieved.
Patent Information
- Application Number
- CN202111483247.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-12-07
- Filing Date
- 2021-12-07
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2041-12-07
AI Technical Summary
In distributed networks of vehicles, it is difficult for the prior art to synchronize the clocks of multiple control devices simply, quickly, reliably and securely, especially in encryption systems, and individual authentication of messages is difficult to achieve.
It is divided into two stages: the first stage is not encrypted to exchange messages to synchronize clocks, and the second stage is encrypted by message authentication to ensure the security of synchronous results.
The clocks of multiple control devices are quickly, simple and securely synchronized in the distributed network of vehicle, avoiding the risk of network attacks and reducing calculation overhead.
Smart Images

Figure CN114598411B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for synchronizing the clocks of at least two devices, in particular control devices, in a distributed network of a vehicle. The invention also relates to a corresponding computer program product for carrying out the method when implemented on a processor of a control unit of the vehicle. The invention also relates to a corresponding network for a vehicle. The invention also relates to a corresponding vehicle having a corresponding network. Background Art
[0002] Modern vehicles often include multiple devices, such as: for example, control devices, which take over the electronic control of driver assistance systems, safety systems, comfort functions, etc. The control device receives signals from sensors and operating elements of different vehicle devices, evaluates these signals and controls the vehicle devices in order to introduce specific functions. Some functions in the vehicle require the simultaneous control of multiple vehicle devices, such as front area lighting and air conditioning, so that the vehicle is ready for use; such as access control systems and corresponding presence sensors and / or motion sensors; such as engine controllers and sensors for engine pressure, speed or temperature, etc. In these cases, the signals from different sensors need to be interrogated synchronously. For this reason, it is necessary to synchronize the clocks of multiple control devices. Here, it must be ensured that the synchronization is reliable in terms of network security. Methods for synchronizing the clocks of multiple devices usually require the exchange of multiple messages between the control devices. In systems with slow encryption and / or encryption with unpredictable elapsed times, individual authentication of the individual messages cannot and / or cannot be performed quickly enough and / or cannot be performed securely enough. Summary of the invention
[0003] Therefore, the technical problem to be solved by the present invention is to provide an improved method for synchronizing the clocks of at least two devices, in particular control devices, in a distributed network of a vehicle, which method at least partially overcomes the above-mentioned disadvantages. The technical problem to be solved by the present invention is, in particular, to provide an improved method for synchronizing the clocks of at least two devices, in particular control devices, in a distributed network of a vehicle, which method can be performed simply, quickly, reliably and safely and the method requires little computing overhead. In addition, the technical problem to be solved by the present invention is to provide a corresponding computer program product for performing such a method. In addition, the computing problem to be solved by the present invention is to provide a corresponding network for a vehicle. In addition, the technical problem to be solved by the present invention is to provide a corresponding vehicle with a corresponding network.
[0004] The above technical problem according to the invention is solved by: a method according to the invention for synchronizing the clocks of at least two devices, in particular control devices, in a distributed network of a vehicle; a computer program product according to the invention for executing the method; a corresponding network according to the invention for a vehicle and a vehicle according to the invention having a corresponding network. Features described in connection with the various aspects of the invention are of course also applicable in connection with other aspects of the invention, and vice versa, respectively, so that the disclosures about the various aspects of the invention always refer to each other or can refer to each other.
[0005] According to a first aspect, the present invention provides: a method for synchronizing the clocks of at least two devices (which can also be referred to as time sensors, clock generators and / or clock counters) in a distributed network of a vehicle, the at least two devices in particular comprising a first device and a second device, which are preferably in the form of control devices, for example in the form of control devices of a single or multiple sensors and / or devices and / or auxiliary systems of the vehicle, the method comprising the following steps, which can preferably be performed in two stages:
[0006] (Phase 1, unencrypted or unauthenticated, used for clock synchronization):
[0007] - establishing unencrypted communications between at least two devices to determine a time difference between clocks of at least two devices,
[0008] - exchanging messages between at least two devices by unencrypted communication, the messages comprising, for example, at least one request (as a message) from a first device to a second device and at least one response (as a message) from the second device to the first device or a plurality of requests and responses,
[0009] In particular, the message is used to synchronize the clocks of at least two devices, for example according to Cristian's algorithm,
[0010] and / or wherein preferably the message is provided with a timestamp for calculating the cycle time or round trip time (Round-Trip-Time) between sending a request and receiving a corresponding response,
[0011] - in particular determining a cycle time or round trip time of a message pair, preferably a suitable message pair, of the messages, which cycle time preferably corresponds to the desired accuracy for the synchronization,
[0012] - determining a time difference (also referred to as offset) between the clocks of at least two devices by means of messages, in particular by means of a specific cycle time, preferably a cycle time of a suitable message pair, for example on a first of the at least two devices, which is for example activated first (and / or on a second device);
[0013] (Phase 2, encrypted, for subsequent synchronization authentication):
[0014] - establish encrypted communication between at least two devices to authenticate the exchange of messages,
[0015] - authenticating messages which have been used to determine the time difference, in particular messages which have been exchanged before the time difference is determined, preferably by exchanging and comparing hash values for the sent messages and / or received messages at at least two devices,
[0016] In particular, preferably by encrypted communication or also always by unencrypted communication, hash values on at least two devices for the sent messages and / or the received messages are mapped, exchanged and / or compared jointly or individually,
[0017] - If authentication of the exchanged messages has been successfully completed, the determined time difference is used by at least one of the at least two devices or by both devices as a synchronization result.
[0018] It is conceivable within the scope of the present invention that each of the at least two devices can determine the time difference itself. For this purpose, it can also be provided that the determined time difference is exchanged between the at least two devices, preferably by encrypted communication.
[0019] It is also conceivable that only one device, which is activated first, for example, as a central control device (so-called time server), can determine the time difference. For this purpose, it can also be provided that the calculated time difference (dt) is transmitted by the device that has determined the time difference to the other of the at least two devices, preferably by encrypted communication. When the central control device is referred to as the first device, at least one further step can be provided within the scope of the invention:
[0020] The determined time difference is transmitted from a first device to a second device of the at least two devices, preferably by encrypted communication.
[0021] The steps of the method according to the invention, in particular within the individual phases, can be carried out in a predetermined sequence or in a changed sequence. Advantageously, the steps of the method according to the invention can be carried out at least partially simultaneously, staggered or successively. Preferably, the steps of the method according to the invention, which method in particular comprises two phases, can be carried out repeatedly in order to enable a repeated synchronization of the clocks. For example, the method can be carried out periodically and / or at regular time intervals.
[0022] Authentication in the sense of the present invention refers to a message (or verification) that the message comes from an authorized sender and that the message has not been forged. A first device can demonstrate its authenticity to a second device. The second device can then prove or confirm the claimed authenticity to the first device. The methodological process in authentication can be called authentication in the sense of the present invention.
[0023] Possible algorithms for synchronizing clocks used in phase 1, such as the Cristian algorithm, are based on the exchange of messages. Each message contains a timestamp. By comparing the timestamps (and / or arrival time points and / or sending time points) of the messages, the relative time difference between the clocks is calculated. This time difference is the synchronization result. Each message exchange has a certain delay, the so-called round-trip time, so that the destination is reached from the sending device in the form of a request and returned from the destination in the form of a response. The request and response in the sense of the present invention can have the same content or different content. In addition, the round-trip time can have a certain fluctuation (Jitter), which can also be referred to as the time clock fluctuation when transmitting digital signals. This can be advantageously taken into account in the evaluation. In order to compensate for the inconsistent operating speed of the clock (hereinafter also referred to as clock drift), the synchronization established once can be monitored and updated from time to time.
[0024] In synchronization, it is advantageous to send not only one request and one response, but multiple requests and multiple responses. According to the Cristian method, a message pair is waited for and selected from multiple requests and corresponding responses, which message pair has an expected cycle time below a certain threshold. By determining this threshold, the expected accuracy for synchronization is determined. The tolerable waiting time and the acceptable cycle time are a matter of expected accuracy, system knowledge and statistics.
[0025] In order to protect the time synchronization from being tampered, the entire message sequence can be authenticated. According to the present invention, the authentication is then performed in phase 2, after the result or synchronization result is obtained in phase 1.
[0026] The idea of the invention is that the exchange of messages (requests or responses) first takes place without authentication. Each device records which messages it has sent and which messages it has received. Finally, the time offset of the clock is derived from the exchange of messages. The devices then establish authenticated communication. In this way, preferably all previous messages are mutually confirmed according to the record or their integrity is checked and thus authenticated. If the authentication is successful, the generated offset is used for synchronization. If the authentication fails, the result is discarded. In this case, the method can be repeated.
[0027] In other words, the idea of the invention is that the messages used for synchronization are not encrypted during synchronization. Only post-authentication is used to verify the previous communication. Therefore, the synchronization itself is not disturbed by the authentication overhead. Since the number of messages is hardly important for the mapping to the hash value, the subsequent authentication of all messages sent for synchronization can be performed very quickly, simply and with little computational overhead.
[0028] Hash values can advantageously be formed individually or jointly on each device for all sent messages and all received messages. In this way, the entire communication can also be protected from attacks by repeating previously recorded messages ("replay attacks", or "replay protection"). Authentication is used to protect communication from unauthorized middlemen ("man in the middle attack"). On each device, a common hash value is calculated for all sent messages and all received messages, or two separate hash values are calculated for all sent messages and all received messages, respectively. The hash values for all sent messages and / or for all received messages are advantageously sent encrypted or unencrypted from one device to another, where one or more received hash values are compared with one or more corresponding locally calculated hash values for all received messages and / or for all sent messages. If the corresponding hash values are consistent, the authentication can be called successful. If the authentication fails, the method can be repeated.
[0029] The main advantage is that authentication of messages is decoupled from the technical method of synchronization. This is possible because processing fraudulent messages itself does not cause any harm. Simply accepting the result could cause harm. Authentication works as a gatekeeper. It takes additional time, but does not interfere with prior negotiation of synchronization. Small delays in authentication are negligible when using the trusted result afterwards.
[0030] Furthermore, in the method for synchronizing the clocks of at least two devices, it can be advantageous if the calculated time difference is discarded if the authentication fails. In this way, the results of the manipulation can be cleaned up simply and quickly. This ensures network security during clock synchronization.
[0031] Furthermore, in the method for synchronizing the clocks of at least two devices, it may be advantageous if the method is restarted if the authentication fails. Thus, the synchronization of the clocks can be performed despite possible attempted network attacks.
[0032] It can also be advantageous if the method is performed periodically, i.e. at specific time intervals, for example weekly, monthly or yearly, and / or regularly, i.e. in connection with specific events, for example after each engine start, after a specific time and / or mileage, within the scope of a check, after an update of at least one device, etc. Thus, the method can compensate for clock drifts of the clock. Thus, the synchronization can be monitored and updated from time to time.
[0033] Furthermore, it can be advantageous if the method can be started manually at the request of the user of the vehicle. The user can thus ensure that the clocks of the devices are synchronized and build trust in the control system and / or operating system of the vehicle. This can also be advantageous in the case where a new device, such as a user-side mobile device, is coupled to the distributed network of the vehicle.
[0034] It can also be advantageous if the method is automatically started by the first activated and / or activated device of the at least two devices. Time synchronization can thus be automatically performed in the network of the vehicle. It is also conceivable to automatically start the method periodically and / or regularly. It can also be advantageous if the method is automatically started as soon as a new device is coupled to the network of the vehicle.
[0035] Advantageously, the method for synchronizing the clocks of more than two devices can also be carried out.
[0036] In order to synchronize the clocks of more than two devices, a central control device, a so-called time server, can be selected from the more than two devices, which controls the synchronization of all clocks, for example individually or in groups.
[0037] On the one hand, the central control device can perform a time synchronization with each other device individually. This can be advantageous for a peer-to-peer network.
[0038] On the other hand, the central control device can determine the local times of multiple slave devices, if necessary calculate the average time of a distributed system with these slave devices, and as a result of the synchronization send the corresponding time differences relative to its own time or the average time to these slave devices (for example via a broadcast connection or also via point-to-point), provided that the previous correspondence from phase 1 has been successfully authenticated in phase 2.
[0039] Furthermore, other devices as second (slave / client) devices can access the first device as central control device (master / server) in order to synchronize with the first device. The message exchange between the corresponding device pairs can be designed so that the calculation of the offset is performed only on the second device.
[0040] However, in order to synchronize the clocks of more than two devices, it is also conceivable that for a respective pair of more than two devices a central control device (which, as mentioned above, can be both a master control device and a slave control device) can be selected, which can initiate and / or control the synchronization. This can be advantageous for a point-to-point network.
[0041] For different functions in the vehicle, two or more devices may be required in each case, which can be time-synchronized individually or in groups in each specific network according to a suitable principle.
[0042] It is conceivable within the scope of the present disclosure to carry out a method for synchronizing the clocks of devices that are integrated in the vehicle and / or are coupled to a distributed network of the vehicle via a user, such as a mobile device of the user. In this way, the distributed network in the vehicle can be assembled flexibly and the time synchronization can be performed securely.
[0043] Furthermore, it is also conceivable to carry out a method for synchronizing the clocks of devices for a desired vehicle function, which preferably includes sensor functions, assistance systems, safety systems, comfort systems and / or entertainment systems. In this way, a secure time synchronization of the devices required for the desired vehicle function can be ensured. This can significantly increase the reliability in vehicle operation.
[0044] Furthermore, in the method for synchronizing the clocks of at least two devices, it is advantageous if the unencrypted communication is performed wired, in particular via a bus system, and / or wirelessly, in particular via radio. In this way, existing communication possibilities in the system can be utilized.
[0045] The encrypted or cryptographically protected communication can in turn be carried out with the aid of an encryption protocol for secure data transmission, in particular transport layer security. This ensures that the data transmission is secure. For the encryption protocol, a one-time individual key for the vehicle can be used. In addition, this key can also be used to calculate the hash value. In addition, it is also conceivable that for the encrypted communication, a special key can be provided for the subsequent authentication of the time synchronization. It is also possible to agree on a new key for each subsequent authentication of the time synchronization between at least two devices.
[0046] Furthermore, in the method for synchronizing the clocks of at least two devices, it is advantageous if the messages for synchronizing the clocks of at least two devices are stored jointly in a common memory in the at least two devices or separately in two different memories for the sent messages and / or the received messages. The memory can advantageously be cleared after each execution of the method. In this way, the formation of hash values for the sent and / or received messages can be simplified, wherein the contents of the corresponding memory can be executed by a hash generator for the subsequent verification of the time synchronization.
[0047] Furthermore, in the method for synchronizing the clocks of at least two devices, it is advantageous if the messages for synchronizing the clocks of at least two devices are provided with an indicator, for example in the form of a counter. In this way, it can be ensured that the messages are stored in an orderly sequence.
[0048] As already mentioned above, it may be advantageous to compare hash values for the sent and / or received messages at at least two devices in order to authenticate messages that have been used to determine the time difference, in particular messages that have been exchanged before the time difference is calculated. The formation of hash values provides a simple, fast and resource-saving method for checking the integrity of the exchanged messages, thereby ensuring that the messages come from an authorized sender. In other words, a simple, fast and resource-saving authentication of the messages is thereby possible. By exchanging hash values via encrypted communication to perform a comparison of the corresponding hash values, additional security against network attacks can be achieved.
[0049] Advantageously, each of the at least two devices can map all sent messages and all received messages to a common hash value or to two separate hash values. When forming the hash values, a key can be used that is consistent with a key for encrypted communication between the at least two devices or that can be specially selected for mapping the hash values. In this way, the entire communication can be authenticated simply, quickly and with little computational overhead with a suitable cycle time until a suitable message pair is determined.
[0050] If the sent message and the received message are mapped to a common hash value, then in order to perform phase 2 or to authenticate the message used or exchanged, at least one of the following steps may be performed:
[0051] - sending a common hash value for all sent messages and all received messages from at least one device (either the first or primary device or the second or secondary device) to another device of the at least two devices (corresponding to the second or secondary device or the first or primary device), preferably by encrypted communication,
[0052] - comparing the received common hash value at the other device with a calculated common hash value for all received messages and all sent messages, and / or
[0053] - If at the other device, the comparison of the received common hash value and the calculated common hash value is consistent, then it is determined that the authentication has been successfully completed.
[0054] In this way, it is possible to simultaneously check whether the respectively sent message and the corresponding received message are identical in terms of content.
[0055] When the sent message and the received message are mapped to two separate hash values, in order to perform phase 2 or to authenticate the exchanged messages, at least one of the following steps is performed:
[0056] - sending, preferably via encrypted communication, from the first device to the second device a hash value of all sent requests that has been calculated by the first device,
[0057] - receiving the sent hash value at the second device,
[0058] - Comparing at the second device the received hash values for all sent requests with the calculated hash values for all received requests.
[0059] In this way, it is possible to check whether the request sent from the first device to the second device is consistent with the request actually received by the second device.
[0060] In addition, in order to authenticate the exchanged messages, at least one of the following steps may be performed:
[0061] - if at the second device a comparison of the received hash value for all sent requests and the calculated hash value for all received requests is consistent, sending, preferably via encrypted communication, from the second device to the first device the hash value for all sent responses that has been calculated by the second device,
[0062] - receiving the sent hash value at the first device,
[0063] - Comparing at the first device the received hash value for all sent responses with the calculated hash value for all received responses.
[0064] In this way it can be checked whether the response sent from the second device to the first device is consistent with the response received at the first device.
[0065] Finally, you can perform at least one of the following steps:
[0066] - If the comparison of the received hash value for all sent responses and the calculated hash value for all received responses is consistent, then it is determined that the authentication has been successfully completed.
[0067] Time synchronization can thus be concluded after a successful synchronization and the result of the synchronization, ie the time difference between the clocks calculated at the first device, can then be used and, if necessary, transmitted to the second device.
[0068] According to a second aspect, the invention provides a computer program product comprising instructions which, when executed by a processor, in particular a computer program, cause the processor to carry out the method, which can be operated as described above. The computer program product can be provided, for example, on a carrier, such as a disk or other carrier. The computer program product can also be provided to a vehicle in an updated form, with or without a carrier. With the computer program product according to the invention, the same advantages as described above in connection with the method according to the invention can be achieved. Reference is now made to these advantages in their entirety.
[0069] According to a third aspect, the invention provides: a network for a vehicle, comprising at least two devices, wherein at least one of the at least two devices has the following elements: a storage unit and a processor, in which a computer program is stored, the processor being configured such that the processor performs the method when executing the computer program, the method being operable as described above. The same advantages as described above in conjunction with the method according to the invention can advantageously be achieved with the network according to the invention. Reference is now made to these advantages in their entirety.
[0070] According to a fourth aspect, the invention provides a vehicle having a network which can be implemented as described above. With the vehicle according to the invention, the same advantages as described above in connection with the method according to the invention can advantageously be achieved. Reference is now made to these advantages in their entirety. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Furthermore, the invention is illustrated in more detail with reference to the accompanying drawings. It should be noted here that the drawings are of a merely descriptive character and are not intended to limit the invention in any way.
[0072] In the attached figure:
[0073] Figure 1 An exemplary map representation for visualizing the method within the meaning of the invention is shown, and
[0074] Figure 2 An exemplary flow chart of a method within the meaning of the present invention is shown. DETAILED DESCRIPTION
[0075] Figure 1 and Figure 2The method according to the invention for synchronizing the clocks of at least two devices A, B in a distributed network N of a vehicle 100 is described, the at least two devices in particular comprising a first device A and a second device B, preferably in the form of control devices for one or more sensors and / or devices of the vehicle 100. The method can be carried out in two phases 1, 2: phase 1 for synchronizing the clocks and a subsequent phase 2 for post-authentication synchronization.
[0076] Phase 1 is unencrypted and therefore unauthenticated, and is used for synchronization of clocks and consists of the following steps:
[0077] - establishing an unencrypted communication K1 between at least two devices A, B in order to determine a time difference dt between the clocks of the two devices A, B,
[0078] - exchanging messages ai, bi between at least two devices A, B via unencrypted communication K1, the messages comprising, for example: at least one request ai from the first device A to the second device B and at least one response bi from the second device B to the first device A or a plurality of requests ai and responses bi,
[0079] In particular, the messages ai, bi are used to synchronize the clocks of at least two devices A, B, for example by means of the Cristian algorithm.
[0080] and / or wherein preferably, the messages ai, bi are provided with a timestamp for calculating the cycle time Ti or the round trip time between sending a request ai and obtaining a corresponding response bi,
[0081] - if necessary, determining from the messages ai, bi, preferably a suitable message pair an, bn, which has a cycle time Tn, which corresponds, for example, to the desired accuracy of the synchronization,
[0082] - With the help of messages ai, bi, in particular with the help of specific message pairs an, bn, preferably on at least one device of the at least two devices A, B, for example on the first device A of the at least two devices A, B (the first device is, for example, activated first) or on each of the at least two devices A, B, a time difference dt or offset between the clocks of at least two devices A, B is determined, for example calculated.
[0083] Phase 2 is encrypted and used for subsequent synchronization authentication, and includes the following steps:
[0084] - establishing an encrypted communication K2 between at least two devices A, B in order to authenticate the exchange of messages ai, bi,
[0085] - authenticating the messages ai, bi that have been used to determine the time difference dt, in particular the messages ai, bi that have been exchanged until the time difference dt has been determined, preferably by exchanging and comparing hash values HA, HB, Ha, Ha*, Hb, Hb* for the sent messages ai, bi and / or the received messages ai*, bi* at at least two devices A, B,
[0086] In particular, preferably via encrypted communication K2 or also unencrypted, hash values HA, HB, Ha, Ha*, Hb, Hb* are mapped and / or exchanged jointly or individually for the sent messages ai, bi and / or the received messages ai*, bi* on at least two devices A, B,
[0087] If authentication of the exchanged messages ai, bi has been completed successfully, at least one of the at least two devices A, B or both devices A, B use the determined time difference dt as synchronization result.
[0088] It is conceivable within the scope of the invention that each of the at least two devices A, B can determine the time difference dt itself.
[0089] However, it is also conceivable that only one of the at least two devices A, B, for example the first device A, can determine the time difference dt as a central control device (so-called time server). In the latter case, at least one further step can be provided:
[0090] The determined time difference dt is transmitted from a first device A of the at least two devices A, B to a second device B, preferably via encrypted communication K2.
[0091] Figure 1 A possible embodiment of the invention is shown in which one device functions as a first device A (which is activated first, for example) and one device functions as a second device B.
[0092] The first device A sends a request ai to the second device B at a time point t0. The second device B receives the request ai in the form of a received request ai*. The second device B does not yet know whether the received request ai* is authentic and / or whether the request actually comes from the first device A. The second device B sends a response bi to the first device A after a possible processing time s. The first device A receives a response bi in the form of a received response bi*. The first device A does not yet know whether the received response bi* is authentic and / or whether it actually comes from the second device B.
[0093] A possible algorithm for synchronizing the clocks in phase 1 is, for example, the Cristian algorithm. Each message ai, bi, for example by the sending device and / or by the receiving device, is provided with a time stamp. By comparing the time stamps and / or the sending and / or arrival times t0, t1 of the messages ai, bi, the relative time difference dt between the clocks of at least two clocks A, B is calculated. In this case, the so-called cycle time Ti is calculated, such as Figure 1 As shown exemplarily.
[0094] This time difference dt is the synchronization result.
[0095] Request ai and response bi in the sense of the present invention may have the same content or different contents.
[0096] In addition, the round trip time Ti may have a certain jitter, the so-called temporal clock fluctuation. This can advantageously be taken into account in the evaluation. In order to compensate for the clock drift, the synchronization established once can be monitored and updated from time to time.
[0097] like Figure 2 As shown, during synchronization, not only one request ai and one response bi are sent, but multiple requests ai and multiple responses bi are sent. From the multiple requests ai and the corresponding responses bi, a message pair an, bn is waited for and selected, which has an expected cycle time Tn that is lower than a certain threshold C. The threshold C can be set individually according to the vehicle function. Safety-related vehicle functions can be marked with a small threshold C. In contrast, entertainment functions can allow a higher threshold C.
[0098] In order to protect the result of synchronization, ie, the time difference dt, from network attacks, such as man-in-the-middle attacks, the entire message sequence may be authenticated until synchronization is completed.
[0099] Within the scope of the invention, after the synchronization result has already been obtained in phase 1, authentication then takes place in phase 2.
[0100] The invention provides that in phase 1, the exchange of messages ai, bi is carried out without authentication or encryption. Each device A, B records which messages it sends and which messages it receives. For this purpose, a common memory or two separate memories can be provided on each device A, B. Finally, the time offset of the clock is derived from the exchange of messages ai, bi.
[0101] After the end of phase 1, in phase 2, the devices A, B establish authenticated communication K2. In this way, preferably all previous messages ai, bi are mutually confirmed by means of the record and thus authenticated. If the authentication is successful, the generated offset is used for synchronization. If the authentication fails, the result is discarded. In this case, the method can be repeated.
[0102] Advantageously, the messages ai, bi required for synchronization are not encrypted during phase 1. In phase 2, a post-authentication is performed to verify the previous communication K1.
[0103] It is thus possible to ensure that the synchronization in phase 1 is not disrupted by the virtually unforeseeable time delays (also referred to as “overhead” in English) of the cryptographic authentication of the individual messages ai, bi.
[0104] Since the number of messages ai, bi is not important for the mapping to the hash values HA, HB, Ha, Hb, Ha*, Hb*, the subsequent authentication of all messages ai, bi sent in phase 1 can be performed very quickly, simply and with little computational overhead. The hash values HA, HB, Ha, Hb, Ha*, Hb* are formed on each device A, B for all sent messages ai, bi and / or for all received messages ai*, bi*. Therefore, a common hash value HA, HB or two individual hash values Ha, Hb* or Hb, Ha* are calculated on each device A, B.
[0105] exist Figure 2 A possible embodiment is shown in , in which two separate hash values Ha, Hb* or Hb, Ha* are calculated on each device A, B. In phase 2, the hash value Ha for all sent messages ai is sent by the first device A, for example already encrypted or still unencrypted, to the second device B. On the second device B, the received hash value Ha is compared with the hash value Ha* calculated locally for all received messages ai*. If the two hash values Ha, Ha* are consistent, the hash value Hb for all sent messages bi is sent by the second device B, for example already encrypted or still unencrypted, to the first device A. There, the received hash value Hb is compared with the hash value Hb* calculated locally for all received messages bi*. If this comparison is also successful, the authentication can be considered successful. If the authentication fails, the calculated time difference dt can be discarded and / or the method can be repeated.
[0106] However, if Figure 1As shown, it is also conceivable that only one common hash value HA, HB is calculated at each device A, B for all sent messages ai, bi and / or for all received messages ai*, bi*, wherein the sent messages ai, bi and / or the received messages ai*, bi* are stored in a corresponding order (e.g. ai, bi* or ai*, bi*) on the respective device A, B. In this case, in order to authenticate the messages ai, bi for time synchronization, only the common hash values HA, HB can be mutually confirmed. Figure 2 The process of authentication with common hash values HA, HB is not shown for simplicity.
[0107] like Figure 1 As shown, a method for synchronizing the clocks of more than two devices A, B can be performed. For this purpose, a central control device (so-called time server) can be selected from more than two devices A, B, which central control device controls all clocks, for example individually or in groups. On the one hand, the central control device can individually perform time synchronization with another device, which can be advantageous for a point-to-point network.
[0108] On the other hand, the central control device A can determine the local time of multiple slave devices and, as a result of synchronization, send the corresponding time difference dt relative to its own time or average time to these slave devices (e.g. broadcast or point-to-point), provided that the corresponding relationship from phase 1 so far has been successfully authenticated in phase 2.
[0109] Furthermore, other devices as second (slave / client) devices B can access the first device A as central control device (master / server) in order to synchronize with the first device A. The message exchange of devices A, B can be designed in such a way that the calculation of the offset dt is performed only on the second device B. However, it is always necessary to exchange messages, which in the sense of the invention can initially remain cryptographically insecure, but then be authenticated before the synchronization result is used.
[0110] Therefore, in order to synchronize the clocks of more than two devices A, B, it is conceivable that a central control device (so-called local time server) can be selected for each pair of more than two devices A, B in order to start the synchronization. This can be advantageous for a point-to-point network.
[0111] For different functions in vehicle 100 , two or more devices may be required in each case, which devices may be time-synchronized individually or in groups in each specific distributed network N according to a suitable principle.
[0112] Devices A, B may be control devices of individual or combined devices in vehicle 100. Devices A, B may be devices integrated in vehicle 100 and / or which can be coupled to a distributed network N of vehicle 100 by a user, such as a mobile device M of a user.
[0113] Advantageously, a method for synchronizing devices A, B required for a desired vehicle function can be carried out.
[0114] Vehicle functions within the meaning of the present invention include sensor functions, assistance systems, safety systems, comfort systems and / or entertainment systems.
[0115] Unencrypted communication K1 can be performed, for example, by cable connection, for example via a bus system, and / or wirelessly, for example via wires. On this basis, the communication possibilities available in vehicle 100 can be used flexibly.
[0116] The encrypted communication K2 can in turn be carried out using an encryption protocol for secure data transmission, for example Transport Layer Security (TLS).
[0117] As already mentioned above, the messages ai, bi for synchronizing the clocks of at least two devices A, B can be stored in a common memory or separately in two different memories for the sent messages ai, bi and / or the received messages ai*, bi* in at least two devices A, B. The corresponding memories can advantageously be cleared after each run of the method.
[0118] Advantageously, the messages ai, bi can be provided with an indicator, for example in the form of a counter, so that the messages ai, bi can be stored in an ordered sequence.
[0119] like Figure 2 As shown, each of the at least two devices A and B can map all sent messages ai, bi and all received messages ai*, bi* to two corresponding hash values Ha, Ha*, Hb, Hb*. Figure 2A further possibility is not shown here only for reasons of simplicity, in which all sent messages ai, bi and all received messages ai*, bi* are mapped on devices A, B to only one common hash value HA, HB for each device A, B. In this way, so-called Perplay protection can be ensured and man-in-the-middle attacks can be reliably avoided. When forming the hash values Ha, Ha*, Hb, Hb*, the following key can be used, which is consistent with the key used for the encrypted communication K2 between at least two devices A, B, or the key can be specially selected for mapping the hash values. In this way, the entire communication can be authenticated simply, quickly and with little computing overhead until a suitable message pair an, bn with a suitable cycle time Tn is determined.
[0120] like Figure 2 As further shown, in order to perform phase 2 or to authenticate the exchanged messages ai, bi, the following steps are performed:
[0121] - preferably by means of encrypted communication K2, sending from the first device A to the second device B the hash value Ha for all sent requests ai, which has been calculated by the first device A,
[0122] - receiving the sent hash value Ha at the second device B,
[0123] - comparing at the second device B the received hash value Ha for all sent requests ai with the calculated hash value Ha* for all received requests ai*,
[0124] - if at the second device B a comparison of the received hash value Ha for all sent requests ai and the calculated hash value Ha* for all received requests ai* is consistent, the hash value Hb for all sent responses bi which has been calculated by the second device B is sent from the second device B to the first device A, preferably via encrypted communication K2,
[0125] - receiving the sent hash value Hb at the first device A,
[0126] - at the first device A, comparing the received hash value Hb for all sent responses bi with the calculated hash value Hb* for all received responses bi*, and / or
[0127] If a comparison of the received hash value Hb for all sent responses bi and the calculated hash value Hb* for all received responses bi* is consistent, it is determined that the authentication has been successfully completed.
[0128] If the sent messages ai, bi and the received messages ai*, bi* are mapped to the common hash values HA, HB (see Figure 1 ), then in order to perform phase 2 or to authenticate time synchronization, perform at least one of the following steps:
[0129] - preferably via encrypted communication K2, sending from at least one of the at least two devices A, B to the other device a common hash value HA or HB for all sent messages ai, bi and all received messages ai*, bi*,
[0130] - at the other device, comparing the received common hash value HA or HB with the calculated common hash value HB or HA for all received messages ai*, bi* and all sent messages ai, bi, and / or
[0131] - If at the other device, a comparison of the received common hash value HA or HB with the calculated common hash value HB or HA is consistent, it is determined that the authentication has been successfully completed.
[0132] A corresponding computer program product comprising instructions which, when executing the computer program by a processor cu, cause the processor cu to carry out a method which can be performed as described above, is likewise an aspect of the invention.
[0133] In addition, an aspect of the present invention is a corresponding network N for a vehicle 100, comprising at least two devices A, B, wherein at least one of the at least two devices A, B has the following elements: a storage unit mu and a processor cu, in which a computer program is stored, and the processor cu is configured so that the processor cu performs the method when executing the computer program, and the method can be operated as described above.
[0134] The corresponding vehicle 100 with the network N, which can be implemented as described above, is also an aspect of the present invention.
[0135] The above description of the drawings describes the invention only within the scope of examples. Of course, the individual features of the embodiments can be freely combined with one another as long as it is technically reasonable, without departing from the scope of the invention.
[0136] Reference numerals list
[0137] 100 Vehicles
[0138] Phase 1
[0139] Phase 2
[0140] A-Device
[0141] B Device
[0142] M Mobile Devices
[0143] N Network
[0144] ai,bi (sent) message
[0145] ai (sent) request
[0146] bi (sent) response
[0147] ai*,bi* (received) messages
[0148] ai* (received) request
[0149] bi* (received) response
[0150] an,bn Suitable message pair
[0151] an appropriate message pair request
[0152] bn Response to the appropriate message pair
[0153] Ti Cycle Time
[0154] Tn Cycle time with desired accuracy
[0155] C Threshold
[0156] t0 Sending time
[0157] t1 Arrival time
[0158] dt time difference
[0159] K1 Unencrypted communication
[0160] K2 Encrypted Communications
[0161] HA Common Hash Value
[0162] HB common hash value
[0163] Ha is the hash value for all requests sent.
[0164] Ha* Hash value for all received requests
[0165] Hb is the hash value of all responses sent.
[0166] Hb* Hash value for all received responses
[0167] cu processor
[0168] mu memory unit
Claims
1. A method for synchronizing the clocks of at least two devices (A, B) in a distributed network (N) of a vehicle (100), The following steps are involved: - establishing an unencrypted communication (K1) between the at least two devices (A, B) in order to determine a time difference (dt) between the clocks of the two devices (A, B), - exchanging messages (ai, bi) between said at least two devices (A, B) by means of said unencrypted communication (K1), - determining a time difference (dt) between the clocks of the at least two devices (A, B) by means of the message (ai, bi), - establishing encrypted communication (K2) between said at least two devices (A, B) in order to authenticate the exchange of messages (ai, bi), - authenticating said message (ai, bi) used to determine said time difference (dt), - If the authentication of the exchanged messages (ai, bi) has been successfully completed, the at least two devices (A, B) synchronize the clocks using the determined time difference (dt).
2. The method according to claim 1, It is characterized in that If the authentication fails, the calculated time difference (dt) is discarded, and / or restarting the method if the authentication fails.
3. The method according to claim 1, It is characterized in that performing the method periodically and / or regularly, and / or the method can be started manually according to the desire of a user of the vehicle (100), And / or the method is automatically started by the first activated and / or activated device of the at least two devices (A, B).
4. The method according to any one of claims 1 to 3, It is characterized in that performing a method for synchronizing clocks of more than two devices (A, B), wherein a central control device is selected from the more than two devices (A, B), the central control device controlling the synchronization of all clocks, And / or wherein a central control device is selected for each pair of the more than two devices (A, B), the central control device controlling the synchronization.
5. The method according to any one of claims 1 to 3, It is characterized in that A method for synchronizing the clocks of devices (A, B) which are integrated in the vehicle (100) and / or are coupled to a distributed network (N) of the vehicle (100) via a user is performed, And / or a method is performed for synchronizing clocks of devices (A, B) for a desired vehicle function.
6. The method according to any one of claims 1 to 3, It is characterized in that The unencrypted communication (K1) is performed by wire and / or wirelessly, And / or the encrypted communication (K2) is performed by means of an encryption protocol for secure data transmission.
7. The method according to any one of claims 1 to 3, It is characterized in that The messages (ai, bi) are stored in a common memory or in two different memories for the sent messages (ai, bi) and / or the received messages (ai*, bi*) in the at least two devices (A, B), And / or the message (ai, bi) is provided with an indicator.
8. The method according to any one of claims 1 to 3, It is characterized in that In order to authenticate the message (ai, bi) that has been used to determine the time difference (dt), in particular the message (ai, bi) that has been exchanged until the time difference (dt) is calculated, the hash values (Ha, Ha*, Hb, Hb*) for the sent message (ai, bi) and / or the received message (ai*, bi*) are compared at the at least two devices (A, B).
9. The method according to any one of claims 1 to 3, It is characterized in that Each of the at least two devices (A, B) maps all sent messages (ai, bi) and all received messages (ai*, bi*) to a common hash value (HA, HB) or to two separate hash values (Ha, Ha*, Hb, Hb*).
10. The method according to any one of claims 1 to 3, It is characterized in that In order to authenticate the used message (ai, bi), at least one of the following steps is performed: - sending a common hash value (HA) for all sent messages (ai, bi) and all received messages (ai*, bi*) from at least one of the at least two devices (A, B) to the other device, - at said other device, comparing the received common hash value (HA) with a common hash value (HB) calculated for all received messages (ai*, bi*) and all sent messages (ai, bi), and / or - If, at the other device, a comparison of the received common hash value (HA) and the calculated common hash value (HB) is consistent, it is determined that the authentication has been successfully completed.
11. The method according to any one of claims 1 to 3, It is characterized in that In order to authenticate the used message (ai, bi), at least one of the following steps is performed: - sending, from a first device (A) of the at least two devices (A, B) to a second device (B), a hash value (Ha) for all sent requests (ai) that has been calculated by the first device (A), - receiving the sent hash value (Ha) at said second device (B), and / or - At said second device (B), the received hash values (Ha) for all sent requests (ai) are compared with the calculated hash values (Ha*) for all received requests (ai*).
12. The method according to claim 11, It is characterized in that To authenticate the exchanged messages (ai, bi), perform at least one of the following steps: - if at the second device (B) the comparison of the received hash value (Ha) for all sent requests (ai) and the calculated hash value (Ha*) for all received requests (ai*) is consistent, sending from the second device (B) to the first device (A) the hash value (Hb) for all sent responses (bi) that has been calculated by the second device (B), - receiving, at said first device (A), the sent hash value (Hb), - comparing at said first device (A) the received hash value (Hb) for all sent responses (bi) with the calculated hash value (Hb*) for all received responses (bi*), and / or - If the comparison of the received hash value (Hb) for all sent responses (bi) and the calculated hash value (Hb*) for all received responses (bi*) is consistent, then it is determined that the authentication has been successfully completed.
13. A computer program product comprising instructions which, when the computer program is executed by a processor (cu), cause the processor (cu) to perform the method according to any one of claims 1 to 12.
14. A network (N) for a vehicle (100), comprising at least two devices (A, B), At least one of the at least two devices (A, B) has the following elements: a storage unit (mu), in which a computer program is stored, and a processor (cu), the processor (cu) being configured such that the processor (cu) performs the method according to any one of the above claims 1 to 12 when executing the computer program.
15. A vehicle (100) having a network (N) according to claim 14.
Citation Information
Patent Citations
Secure clock synchronization
CN102472998A
Method for lightweight security synchronization in smart sensor network
CN105245305A