Fresh value synchronization method and device, electronic control unit, vehicle and storage medium
By using the master fresh value manager located at the BSW layer of the basic software in the car to generate fresh value, and directly send fresh value synchronization messages to the slave ECU through the first on-board secure communication component, the problem of low communication efficiency across the master and slave ECU is solved and the communication efficiency of fresh value synchronization is improved.
Patent Information
- Application Number
- CN202311466173.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-06
- Publication Date
- 2025-05-06
AI Technical Summary
In cars, fresh value management and on-board security communication components in the main ECU need to conduct cross-layer communication, resulting in inefficient communication when the main and slave ECUs in the vehicle perform fresh value synchronization.
The main fresh value manager located in the BSW layer of the basic software is generated by generating fresh value synchronization packets through the first on-board secure communication component located in the BSW layer, which is directly sent to the slave ECU to avoid cross-layer communication.
It reduces the time to obtain fresh value synchronization packets from the ECU, and improves the communication efficiency of the master and slave ECU in the vehicle when the fresh value synchronization is performed.
Smart Images

Figure CN119945867A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of automobile technology, and in particular to a fresh value synchronization method, device, electronic control unit, vehicle and storage medium. Background Art
[0002] At present, there are usually multiple electronic control units (ECUs) in a car, and multiple ECUs can be managed as master and slave. Among them, each ECU in the car is an ECU based on the AUTOmotive Open System Architecture (AUTOSAR) framework.
[0003] In the AUTOSAR standard, the SecOC (Security Onboard Communication) framework is proposed to ensure the internal safety communication of the car. The on-board safety communication component in the on-board safety communication framework is very important for on-board safety communication. In the process of internal safety communication in the car, the on-board safety communication component usually communicates with the freshness value manager (FVM). For example, the on-board safety communication component in the master ECU needs to obtain the fresh value from the freshness value manager and synchronize the fresh value to the slave ECU to achieve the synchronization of fresh values between the master and slave ECUs. However, the freshness value management in the master ECU and the on-board safety communication component in the related art need to communicate across layers, which leads to the communication efficiency when the master and slave ECUs in the vehicle synchronize fresh values. Summary of the invention
[0004] To this end, the present disclosure proposes a fresh value synchronization method, device, electronic control unit, vehicle and storage medium to solve the technical problem of fresh value management in the main ECU and the need for cross-layer communication of the on-board safety communication components in the related technology, which leads to communication efficiency problems when the master and slave ECUs in the vehicle synchronize fresh values.
[0005] In one aspect, an embodiment of the present disclosure proposes a fresh value synchronization method, which includes: using a main fresh value manager located in a basic software BSW layer to generate a fresh value; using a first vehicle-mounted safety communication component located in the BSW layer to generate a fresh value synchronization message according to the fresh value; and using the first vehicle-mounted safety communication component to send the fresh value synchronization message to synchronize the fresh value.
[0006] According to an embodiment of the present disclosure, a fresh value synchronization method is proposed, which includes: using a second vehicle-mounted safety communication component located in the BSW layer to receive a fresh value synchronization message; using the second vehicle-mounted safety communication component to parse and process the fresh value synchronization message to obtain the fresh value carried in the fresh value synchronization message; using the second vehicle-mounted safety communication component to send the fresh value to a slave fresh value manager located in the BSW layer to update the current fresh value in the slave fresh value manager.
[0007] According to one aspect of the present disclosure, an embodiment of the present disclosure proposes a fresh value synchronization device, which includes: a first generation module, which is used to generate a fresh value by using a main fresh value manager located in a basic software BSW layer; a second generation module, which is used to generate a fresh value synchronization message according to the fresh value by using a first vehicle-mounted safety communication component located in the BSW layer; and a sending module, which is used to send the fresh value synchronization message by using the first vehicle-mounted safety communication component to perform fresh value synchronization.
[0008] According to one aspect of the present disclosure, an embodiment provides a fresh value synchronization device, comprising: a receiving module, used to receive a fresh value synchronization message using a second vehicle-mounted safety communication component located in a BSW layer; a parsing and processing module, used to parse and process the fresh value synchronization message using the second vehicle-mounted safety communication component to obtain a fresh value carried in the fresh value synchronization message; and a sending module, used to send the fresh value to a slave fresh value manager located in the BSW layer using the second vehicle-mounted safety communication component to update the current fresh value in the slave fresh value manager.
[0009] An embodiment of one aspect of the present disclosure proposes an electronic control unit, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the fresh value synchronization method disclosed in the embodiment of the present disclosure.
[0010] An embodiment of one aspect of the present disclosure provides a vehicle, which includes: a freshness value synchronization device disclosed in an embodiment of the present disclosure, or an electronic control unit disclosed in an embodiment of the present disclosure.
[0011] According to one aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. When the computer instructions are executed by a processor, the fresh value synchronization method disclosed in the embodiment of the present disclosure is executed.
[0012] The technical solution provided by the embodiments of the present disclosure has the following beneficial effects:
[0013] A master fresh value manager located in the basic software BSW layer is used to generate fresh values; a first vehicle safety communication component located in the BSW layer is used to generate a fresh value synchronization message based on the fresh values; and the first vehicle safety communication component is used to send the fresh value synchronization message to synchronize the fresh values. Among them, the master ECU sends the fresh value synchronization message, and the slave ECU receives the fresh value synchronization message. Therefore, during the process of synchronizing the fresh values between the master ECU and the slave ECU, the master fresh value manager and the first vehicle safety communication component of the master ECU are located in the same layer, and there is no need to communicate across layers during communication, which can reduce the time for the slave ECU to obtain the fresh value synchronization message, thereby improving the communication efficiency when the master and slave ECUs in the vehicle synchronize the fresh values.
[0014] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0016] Figure 1 A flowchart of a fresh value synchronization method provided by an embodiment of the present disclosure;
[0017] Figure 2 A flowchart of another fresh value synchronization method provided by an embodiment of the present disclosure;
[0018] Figure 3 A flowchart of another fresh value synchronization method provided by an embodiment of the present disclosure;
[0019] Figure 4 A flowchart of another freshness value management method provided by an embodiment of the present disclosure;
[0020] Figure 5 A flowchart of another freshness value management method provided by an embodiment of the present disclosure;
[0021] Figure 6 A flowchart of another freshness value management method provided by an embodiment of the present disclosure;
[0022] Figure 7 A structural diagram of a freshness value management device provided by an embodiment of the present disclosure;
[0023] Figure 8 A structural diagram of a freshness value management device provided by an embodiment of the present disclosure;
[0024] Fig. 9A schematic diagram of the structure of a vehicle-mounted safety communication system provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0026] In order to clearly understand the present disclosure, the freshness value synchronization method, device, electronic control unit, vehicle and storage medium according to the embodiments of the present disclosure are described below with reference to the accompanying drawings.
[0027] Figure 1 A flowchart of a fresh value synchronization method provided in an embodiment of the present disclosure.
[0028] It should be noted that the fresh value synchronization method can be executed by a fresh value synchronization device, which can be implemented by hardware and / or software, and the fresh value synchronization device can be a main electronic control unit ECU in a vehicle, or can be configured in a main ECU in a vehicle. It should be noted that in this embodiment, the fresh value synchronization device is taken as an example of a main ECU in a vehicle.
[0029] like Figure 1 As shown, the fresh value synchronization method may include:
[0030] Step 101 : generating fresh values using a main fresh value manager located in the basic software BSW layer.
[0031] In this embodiment, when the main ECU confirms the need to synchronize fresh values with the slave ECU, the main ECU uses the main fresh value manager located in the basic software BSW layer to generate fresh values, and then the main ECU controls the main fresh value manager to send the fresh values to the first vehicle-mounted safety communication component.
[0032] Step 102: Use the first vehicle safety communication component located in the BSW layer to generate a fresh value synchronization message according to the fresh value.
[0033] In one embodiment of the present disclosure, in order to further improve the security of the fresh value in the fresh value synchronization message, a possible implementation method of using the first vehicle-mounted safety communication component located in the BSW layer to generate a fresh value synchronization message based on the fresh value is: using the first vehicle-mounted safety communication component located in the BSW layer to truncate the fresh value according to a preset truncation rule to obtain the truncated fresh value; using the first vehicle-mounted safety communication component to generate a fresh value synchronization message based on the truncated fresh value. As a result, the fresh value synchronization message does not contain a complete fresh value, and even if the fresh value message is intercepted, the intercepting party cannot obtain the complete fresh value, thereby improving the security of fresh value transmission.
[0034] Among them, the truncation rule refers to the rule for truncating the fresh value, and the truncation rule can be set according to actual needs. For example, the truncation rule can be to truncate the high N bits of the fresh value, where N is a pre-set positive integer. For example, N can be 4, 6 or 8, etc. This embodiment does not specifically limit the value of N.
[0035] Step 103: Use the first vehicle-mounted safety communication component to send a fresh value synchronization message to synchronize the fresh value.
[0036] In order to synchronize the fresh values of the master and slave ECUs, after obtaining the fresh value synchronization message, the first on-board safety communication component of the master ECU uses the first on-board safety communication component to send the fresh value synchronization message to the slave ECU.
[0037] The fresh value synchronization method provided by the embodiment of the present disclosure uses a main fresh value manager located in the basic software BSW layer to generate fresh values; uses a first vehicle-mounted safety communication component located in the BSW layer to generate a fresh value synchronization message based on the fresh value; and uses the first vehicle-mounted safety communication component to send the fresh value synchronization message to synchronize the fresh values. Among them, the master ECU sends the fresh value synchronization message, and the slave ECU receives the fresh value synchronization message. As a result, during the process of synchronizing the fresh values between the master ECU and the slave ECU, the master fresh value manager and the first vehicle-mounted safety communication component of the master ECU do not need to communicate across layers, which can reduce the time for the slave ECU to obtain the fresh value synchronization message, thereby improving the communication efficiency when the master and slave ECUs in the vehicle synchronize fresh values.
[0038] Figure 2 A flow chart of another fresh value synchronization method provided by an embodiment of the present disclosure. The fresh value synchronization method is applied in a main ECU in a vehicle. It should be noted that this embodiment further refines the above embodiment.
[0039] like Figure 2 As shown, the fresh value synchronization method may include:
[0040] Step 201 : generating fresh values using a main fresh value manager located in the basic software BSW layer.
[0041] Step 202: Use the first vehicle safety communication component located in the BSW layer to generate a fresh value synchronization message according to the fresh value.
[0042] It should be noted that, for the specific implementation of step 201 to step 202, reference may be made to the relevant description of the embodiment of the present disclosure, which will not be repeated here.
[0043] Step 203: The first encryption service manager located in the BSW layer encrypts the fresh value synchronization message based on a preset encryption algorithm and a preset key, and sends the encrypted fresh value synchronization message to the first vehicle-mounted safety communication component.
[0044] Step 204: Use the first vehicle-mounted safety communication component to send the encrypted fresh value synchronization message to synchronize the fresh value.
[0045] In this embodiment, the first encryption service manager located in the BSW layer encrypts the fresh value synchronization message based on a preset encryption algorithm and a preset key, and sends the encrypted fresh value synchronization message to the first vehicle safety communication component, and the first vehicle safety communication component is used to send the encrypted fresh value synchronization message, specifically, the fresh value synchronization message is sent to the slave ECU in the vehicle to synchronize the fresh value. In this way, the security of communication during the fresh value synchronization process between the master and slave ECUs can be further improved.
[0046] It can be understood that not only can the master ECU actively send fresh value synchronization messages to the slave ECU, but in some scenarios, after the slave ECU abnormally restarts or recovers from BussOff, it can also actively send fresh value synchronization request messages to the master ECU. In this example, the first on-board safety communication component can also perform corresponding processing in conjunction with the fresh value synchronization request message. In order to clearly understand the process, the following is combined with Figure 3 The freshness value management method of this embodiment is further described by way of example.
[0047] Figure 3 A flowchart of another freshness value management method provided in an embodiment of the present disclosure.
[0048] like Figure 3 As shown, the fresh value management method may also include:
[0049] Step 301: During the process of sending a fresh value synchronization message, if the first vehicle safety communication component receives a fresh value synchronization request message, the first vehicle safety communication component ignores the fresh value synchronization request message.
[0050] In one embodiment of the present disclosure, in order to enable the slave ECU to obtain the response result of the fresh value synchronization request message, after the first vehicle-mounted safety communication component ignores the fresh value synchronization request message, the first vehicle-mounted safety communication component may also send an ignore message to the slave ECU, wherein the ignore message is used to prompt the master ECU that it is in the process of sending a fresh value synchronization message to the slave ECU, and the fresh value synchronization request message is ignored.
[0051] Among them, the fresh value synchronization request message received by the main ECU is sent by the slave ECU.
[0052] Step 302, after the fresh value synchronization message is sent, if the first vehicle-mounted safety communication component receives a fresh value synchronization request message from the ECU, the first vehicle-mounted safety communication component is used to generate a new fresh value synchronization message based on the latest fresh value currently generated in the main fresh value manager, and the new fresh value synchronization message is sent.
[0053] For example, after generating a fresh value synchronization message at 9:50, if the master ECU needs to resend the fresh value synchronization message three times, the time length required for the three resendings can be determined, and based on the time length, the period for sending the fresh value synchronization message can be determined. For example, the time length is 2 minutes, and the corresponding period for sending the fresh value synchronization message is between 9:50 and 9:52. If a fresh value synchronization request message is received between 9:50 and 9:52, the fresh value synchronization request message is ignored. If a fresh value synchronization request message is received after 9:52, the first vehicle-mounted safety communication component generates a new fresh value synchronization message based on the latest fresh value currently generated in the master fresh value manager, and sends the new fresh value synchronization message. Specifically, the new fresh value synchronization message is sent to the slave ECU.
[0054] Figure 4 A flow chart of another freshness value management method provided in an embodiment of the present disclosure. It should be noted that the freshness value management method can be executed by a freshness value synchronization device, which can be implemented by hardware and / or software, and the freshness value synchronization device can be a slave electronic control unit ECU applied in a vehicle, or can be configured in a slave ECU. It should be noted that this embodiment is described by taking the freshness value synchronization device as a slave ECU in a vehicle as an example.
[0055] like Figure 4 As shown, the method may include:
[0056] Step 401: Use the second vehicle-mounted safety communication component located in the BSW layer to receive a fresh value synchronization message.
[0057] The fresh value synchronization message is sent from the master ECU to the slave ECU.
[0058] Step 402: parse and process the fresh value synchronization message using the second vehicle-mounted safety communication component to obtain the fresh value carried in the fresh value synchronization message.
[0059] In one embodiment of the present disclosure, for the transmission security of the fresh value synchronization message, the main ECU may encrypt the fresh value synchronization message. In order to obtain the fresh value carried in the fresh value synchronization message, the above-mentioned use of the second vehicle-mounted safety communication component to parse the fresh value synchronization message to obtain the fresh value carried in the fresh value synchronization message. A possible implementation method can be: using the second vehicle-mounted safety communication component based on a preset decryption algorithm, using a preset key, to decrypt the fresh value synchronization message to obtain the decrypted fresh value synchronization message; using the second vehicle-mounted safety communication component based on a preset message parsing rule, to parse the decrypted fresh value synchronization message to obtain the fresh value.
[0060] Among them, the preset decryption algorithm based on the second vehicle safety communication component in this example corresponds to the preset encryption algorithm based on the first vehicle safety communication component in the main ECU.
[0061] In one embodiment of the present disclosure, when the main ECU does not encrypt the fresh value synchronization message, the slave ECU uses the second on-board safety communication component to parse the fresh value synchronization message based on a preset message parsing rule to obtain the fresh value in the fresh value synchronization message.
[0062] Step 403: Use the second vehicle-mounted safety communication component to send the fresh value to the slave fresh value manager located in the BSW layer to update the current fresh value in the slave fresh value manager.
[0063] The fresh value synchronization method provided by the embodiment of the present disclosure is that the slave ECU uses the second vehicle-mounted safety communication component located in the BSW layer to receive the fresh value synchronization message sent by the main ECU in the vehicle, and uses the second vehicle-mounted safety communication component to parse and process the fresh value synchronization message to obtain the fresh value carried in the fresh value synchronization message, and uses the second vehicle-mounted safety communication component to send the fresh value to the slave fresh value manager located in the BSW layer to update the current fresh value in the slave fresh value manager. Therefore, since the second vehicle-mounted safety communication component in the slave ECU and the slave fresh value manager are in the same layer, the second vehicle-mounted safety communication component in the slave ECU and the slave fresh value manager do not need to communicate across layers, so the efficiency of obtaining fresh values from the slave fresh value manager can be improved.
[0064] Figure 5 A flow chart of another freshness value management method provided by an embodiment of the present disclosure is provided. It should be noted that the freshness value management method is applied in a slave electronic control unit ECU of a vehicle.
[0065] like Figure 5 As shown, the method may include:
[0066] Step 501: Use the second vehicle-mounted safety communication component located in the BSW layer to receive a fresh value synchronization message.
[0067] Step 502: Use the second vehicle-mounted safety communication component to parse and process the fresh value synchronization message to obtain the fresh value carried in the fresh value synchronization message.
[0068] It should be noted that, for the specific implementation of step 501 and step 502, reference may be made to the relevant description of the embodiment of the present disclosure, which will not be repeated here.
[0069] Step 503: Reconstruct the fresh value using the second vehicle-mounted safety communication component according to a preset fresh value reconstruction principle.
[0070] The fresh value reconstruction principle in this embodiment corresponds to the above-mentioned preset truncation rule.
[0071] In this example, the second vehicle-mounted safety communication component is used to reconstruct the fresh value according to a preset fresh value reconstruction principle to obtain a complete fresh value.
[0072] Step 504 : Use the second vehicle-mounted safety communication component to send the reconstructed fresh value to the slave fresh value manager to update the current fresh value in the slave fresh value manager.
[0073] Step 505 : Use the second vehicle-mounted safety communication component to send the fresh value to the slave fresh value manager located in the BSW layer to update the current fresh value in the slave fresh value manager.
[0074] In this embodiment, the second vehicle safety communication component is used to reconstruct the fresh value according to the preset fresh value reconstruction principle, and the second vehicle safety communication component is used to send the reconstructed fresh value to the slave fresh value manager to update the current fresh value in the slave fresh value manager. As a result, the slave fresh value manager can complete the fresh value synchronization based on the reconstructed fresh value, realizing the accurate synchronization of the fresh values of the master and slave ECUs.
[0075] Figure 6 A flowchart of another freshness value management method provided by an embodiment of the present disclosure. This embodiment is a further exemplary description of the previous embodiment.
[0076] like Figure 6 As shown, the fresh value management method may include:
[0077] Step 601: after the diagnosis event manager in the BSW layer determines that an abnormal restart or a bus off recovery occurs, a second vehicle safety communication component is used to send a fresh value synchronization request message.
[0078] Specifically, after the diagnostic event manager determines that an abnormal restart or a bus off recovery occurs in the slave ECU, the second vehicle safety communication component may be used to send a fresh value synchronization request message to the master ECU.
[0079] Step 602: Use the second vehicle-mounted safety communication component to receive the returned ignore message, wherein the ignore message is sent by the master ECU and is used to indicate that the master ECU is in the process of sending a fresh value synchronization message to the slave ECU, and the fresh value synchronization request message is ignored.
[0080] Step 603, using the second on-board safety communication component to receive a new fresh value synchronization message, wherein the new fresh value synchronization message is received by the main ECU after determining that the fresh value synchronization request message is received after the fresh value synchronization message is sent, and is generated according to the latest fresh value currently generated in the main fresh value manager in the main ECU.
[0081] Step 604: Use the second vehicle-mounted safety communication component to receive the updated fresh value in the new fresh value synchronization message, and update the fresh value in the fresh value manager.
[0082] In this example, after an abnormal restart or a BussOff recovery occurs, the master and slave ECUs communicate with each other so that the slave fresh value manager of the slave ECU can obtain the updated fresh value in time.
[0083] Figure 7 A schematic diagram of the structure of a freshness value management device provided in an embodiment of the present disclosure.
[0084] like Figure 7 As shown, the fresh value management device 700 may include:
[0085] A first generating module 701 is used to generate a fresh value using a main fresh value manager located in the basic software BSW layer;
[0086] The second generating module 702 is used to generate a fresh value synchronization message according to the fresh value by using the first vehicle safety communication component located in the BSW layer;
[0087] The sending module 703 is used to use the first vehicle-mounted safety communication component to send a fresh value synchronization message to perform fresh value synchronization.
[0088] In one embodiment of the present disclosure, the second generating module 702 is specifically configured to:
[0089] The first vehicle safety communication component located in the BSW layer is used to truncate the fresh value according to a preset truncation rule to obtain a truncated fresh value;
[0090] The first vehicle-mounted safety communication component is used to generate a fresh value synchronization message according to the fresh value after truncation.
[0091] In one embodiment of the present disclosure, the device may further include:
[0092] The ignoring module is used to, during the process of sending the fresh value synchronization message, if the first vehicle-mounted safety communication component receives the fresh value synchronization request message, the first vehicle-mounted safety communication component ignores the fresh value synchronization request message.
[0093] In one embodiment of the present disclosure, the device may further include:
[0094] A processing module is used to generate a new fresh value synchronization message based on the latest fresh value currently generated in the main fresh value manager by the first vehicle safety communication component after the fresh value synchronization message is sent, if the first vehicle safety communication component receives a fresh value synchronization request message, and send the new fresh value synchronization message.
[0095] In one embodiment of the present disclosure, the device may further include:
[0096] The encryption module is used to adopt the first encryption service manager located in the BSW layer to encrypt the fresh value synchronization message based on the preset encryption algorithm and the preset key, and send the encrypted fresh value synchronization message to the first vehicle-mounted safety communication component.
[0097] It should be noted that the above explanation of the fresh value synchronization method embodiment is also applicable to the fresh value synchronization device of this embodiment.
[0098] The fresh value synchronization device provided by the embodiment of the present disclosure adopts a main fresh value manager located in the basic software BSW layer to generate fresh values; adopts a first vehicle-mounted safety communication component located in the BSW layer to generate a fresh value synchronization message according to the fresh value; and adopts the first vehicle-mounted safety communication component to send the fresh value synchronization message to synchronize the fresh values. Among them, the one that sends the fresh value synchronization message is the master ECU, and the one that receives the fresh value synchronization message is the slave ECU. As a result, during the process of synchronizing the fresh values between the master ECU and the slave ECU, the master fresh value manager and the first vehicle-mounted safety communication component of the master ECU do not need to communicate across layers, which can reduce the time for the slave ECU to obtain the fresh value synchronization message, thereby improving the communication efficiency when the master and slave ECUs in the vehicle synchronize the fresh values.
[0099] Figure 8 A schematic diagram of the structure of a freshness value management device provided in an embodiment of the present disclosure.
[0100] like Figure 8 As shown, the fresh value management device 800 may include:
[0101] A receiving module 801 is used to receive a fresh value synchronization message using a second vehicle safety communication component located in the BSW layer;
[0102] The parsing and processing module 802 is used to parse the fresh value synchronization message using the second vehicle-mounted safety communication component to obtain the fresh value carried in the fresh value synchronization message;
[0103] The sending module 803 is used to use the second vehicle-mounted safety communication component to send the fresh value to the slave fresh value manager located in the BSW layer to update the current fresh value in the slave fresh value manager.
[0104] In one embodiment of the present disclosure, the sending module 803 is further used to use the second vehicle safety communication component to send a fresh value synchronization request message after using the diagnostic event manager located in the BSW layer to determine that an abnormal restart or a bus off BussOff recovery occurs;
[0105] The second vehicle-mounted safety communication component is used to receive the updated fresh value synchronization message sent.
[0106] In one embodiment of the present disclosure, the device may further include:
[0107] A reconstruction module, used to reconstruct the fresh value according to a preset fresh value reconstruction principle using the second vehicle-mounted safety communication component;
[0108] The sending module 803 is specifically used to: use the second vehicle-mounted safety communication component to send the reconstructed fresh value to the slave fresh value manager to update the current fresh value in the slave fresh value manager.
[0109] It should be noted that the above explanation of the fresh value synchronization method embodiment is also applicable to the fresh value synchronization device of this embodiment.
[0110] The fresh value synchronization device provided by the embodiment of the present disclosure,
[0111] The second vehicle safety communication component located in the BSW layer is used to receive the fresh value synchronization message, and the second vehicle safety communication component is used to parse and process the fresh value synchronization message to obtain the fresh value carried in the fresh value synchronization message, and the second vehicle safety communication component is used to send the fresh value to the slave fresh value manager located in the BSW layer to update the current fresh value in the slave fresh value manager. Therefore, since the second vehicle safety communication component in the slave ECU and the slave fresh value manager are in the same layer, the second vehicle safety communication component in the slave ECU and the slave fresh value manager do not need to communicate across layers, so the efficiency of obtaining fresh values from the slave fresh value manager can be improved.
[0112] In order to clearly understand the present disclosure, Fig. 9 An in-vehicle safety communication system including an automotive open system architecture AUTOSAR of a master ECU and an automotive open system architecture AUTOSAR of a slave ECU is exemplarily described.
[0113] Fig. 9 A schematic diagram of the structure of a vehicle-mounted safety communication system provided in an embodiment of the present disclosure.
[0114] like Fig. 9 As shown, the in-vehicle safety communication system architecture may include a master electronic control unit ECU and a slave electronic control unit ECU, wherein:
[0115] The first automotive open system architecture AUTOSAR of the main ECU includes a main fresh value manager, which is deployed in the basic software BSW layer in the first AUTOSAR and communicates with the first vehicle safety communication component in the BSW layer of the first AUTOSAR.
[0116] The second AUTOSAR of the slave ECU includes a slave fresh value manager, which is deployed in the BSW layer of the second AUTOSAR and communicates with the second on-vehicle safety communication component in the BSW layer of the second AUTOSAR.
[0117] In this example, the FVM in the master and slave ECUs and the on-board safety communication components are placed in the same layer, so that the FVM in the master and slave ECUs and the on-board safety communication components do not need to communicate across layers, which can increase the speed of transmitting fresh values between the on-board safety communication components and the FVM, and then improve the communication efficiency when the master and slave ECUs synchronize fresh values.
[0118] In one embodiment of the present disclosure, in order to further improve the security of communication, Figure 1 As shown, the BSW layer of the first AUTOSAR further includes a first cryptographic service manager (CSM), and the main fresh value manager communicates with the first vehicle-mounted safety communication component through the first cryptographic service manager.
[0119] In some exemplary embodiments, when it is necessary to transmit a fresh value to the first vehicle safety communication component in the main ECU, the first encryption service manager can obtain the latest generated fresh value from the main fresh value manager, and then encrypt the fresh value based on the key, and send the encrypted fresh value to the first vehicle safety communication component. Correspondingly, the first vehicle safety communication component can also decrypt the encrypted fresh value based on the encryption information agreed between it and the first encryption service manager to obtain the decrypted fresh value. In this way, the transmission security of the fresh value in the main ECU during the transmission of the fresh value can be improved.
[0120] In one embodiment of the present disclosure, after the first vehicle-mounted safety communication component generates a fresh value synchronization message based on the received fresh value, the first vehicle-mounted safety communication component may send the fresh value synchronization message to the first encryption service manager. Correspondingly, the first encryption service manager encrypts the fresh value synchronization message based on a preset encryption algorithm using a preset key, and sends the encrypted fresh value synchronization message to the first vehicle-mounted safety communication component.
[0121] In some exemplary embodiments, in order to further improve the security of the key stored in the hardware security module of the master ECU, the first cryptographic service manager is further connected to the hardware security module (HSM) of the master ECU, wherein:
[0122] A first encryption service manager is used to obtain an encryption algorithm from a hardware security module of the main ECU, and encrypt a key used in vehicle communication based on the encryption algorithm, wherein the key is used to encrypt a fresh value exchanged during vehicle communication;
[0123] The hardware security module of the main ECU is also used to store the encrypted key.
[0124] Among them, the first vehicle-mounted safety communication component is also used to obtain the encrypted key from the hardware security module of the main ECU and send the encrypted key to the second vehicle-mounted safety communication component.
[0125] In some exemplary embodiments, the first encryption service manager calls the encryption algorithm interface Crypto Interface (CryptoIf) downward, and CryptoIf calls the corresponding encryption algorithm from the hardware security module of the master ECU. Correspondingly, the first encryption service manager calls the encryption driver, so that the encryption driver encrypts the key in the HSM of the master ECU based on the encryption algorithm, which can further improve the security of the keys transmitted when the master and slave ECUs are synchronized, and further improve the communication security.
[0126] The encryption algorithm of the hardware security module of the main ECU may be any type of encryption algorithm, for example, the encryption algorithm may be Advanced Encryption Standard (AES128).
[0127] The encryption driver Crypto Driver in this example provides a common interface for synchronous and asynchronous encryption primitives, and supports key storage, key configuration and key management of key services. In addition, the bottom layer of Crypto Driver can have one or more encryption driver objects, and has an independent workspace. Each encryption driver object can provide any number of encryption primitives. An encryption primitive is an instance of a configured encryption algorithm. An encryption driver object can only support one encryption primitive at the same time.
[0128] Among them, it can be understood that the HSM of the main ECU is mainly used to store sensitive data, keys and other information. In some exemplary embodiments, in order to facilitate the subsequent rapid reading of the required data from the HSM of the main ECU, a storage area for storing data can be provided in the HSM of the main ECU, and the storage area can be divided into blocks to obtain multiple storage area sub-blocks, and the corresponding data can be stored in different storage area sub-blocks in combination with the data type corresponding to the data. For example, for the data to be stored, the data type of the data to be stored can be determined, and the target storage area sub-block corresponding to the data type can be obtained from the multiple storage area sub-blocks corresponding to the storage area, and the data to be stored can be stored in the target storage area sub-block. In this way, classified storage of data is achieved to improve the efficiency of subsequent data reading.
[0129] In one embodiment of the present disclosure, in order to further improve the security of communication, Figure 1As shown, the BSW layer of the second AUTOSAR further includes a second encryption service manager, and the fresh value manager communicates with the second onboard safety communication component through the second encryption service manager.
[0130] In some exemplary embodiments, the first vehicle-mounted safety communication component of the master ECU obtains the latest fresh value generated in the master fresh value manager; generates a fresh value synchronization message based on the fresh value; and sends the fresh value synchronization message to the slave ECU. Correspondingly, after the second vehicle-mounted safety communication component in the slave ECU receives the fresh value synchronization message sent by the master ECU, it processes the fresh value synchronization message to obtain the fresh value sent by the master ECU, and sends the fresh value to the second encryption service manager. Correspondingly, the second encryption service manager encrypts the fresh value and sends the encrypted fresh value to the slave fresh value manager. Correspondingly, the slave fresh value manager decrypts the received encrypted fresh value and updates the current fresh value in the slave fresh value manager based on the decrypted fresh value.
[0131] In this example, a fresh value synchronization message is received from the second vehicle-mounted safety communication component in the ECU. The second vehicle-mounted safety communication component decrypts the fresh value synchronization message based on a preset decryption algorithm and using a preset key to obtain a decrypted fresh value synchronization message, and can parse the decrypted fresh value synchronization message based on preset message parsing rules to obtain the fresh value sent by the main ECU.
[0132] In some exemplary embodiments, in order to enable the hardware security module of the slave ECU to store the received key, in some examples, the second cryptographic service manager is further connected to the hardware security module of the slave ECU, wherein:
[0133] A second encryption manager, used to obtain an encryption algorithm from a hardware security module of the ECU, and decrypt the encrypted key sent by the first vehicle-mounted safety communication component based on the encryption algorithm;
[0134] The hardware security module of the slave ECU is also used to store the decrypted key.
[0135] In some exemplary embodiments, the second encryption manager calls the encryption algorithm interface CryptoInterface (CryptoIf) downward, and CryptoIf calls the corresponding encryption algorithm in the hardware security module of the slave ECU. Correspondingly, the encryption driver decrypts the key sent by the first vehicle-mounted safety communication component based on the encryption algorithm to obtain the decrypted key, and stores the decrypted key in the hardware security module of the slave ECU.
[0136] Among them, it can be understood that the HSM of the slave ECU is mainly used to store sensitive data, keys and other information. In some exemplary embodiments, in order to facilitate the subsequent rapid reading of the required data from the HSM of the slave ECU, a storage area for storing data can be provided in the HSM of the slave ECU, and the storage area can be divided into blocks to obtain multiple storage area sub-blocks, and the corresponding data can be stored in different storage area sub-blocks in combination with the data type corresponding to the data. For example, for the data to be stored, the data type of the data to be stored can be determined, and the target storage area sub-block corresponding to the data type can be obtained from the multiple storage area sub-blocks corresponding to the storage area, and the data to be stored can be stored in the target storage area sub-block. In this way, classified storage of data is achieved to improve the efficiency of subsequent data reading.
[0137] In some exemplary embodiments, in order to further improve the security of messages during in-vehicle communications, in some examples, for the sender, the sender can use a key to generate a message authentication code, and then attach the message authentication code to the message to be sent, and during the communication process, the message to be sent and the corresponding message authentication code are sent to the receiver together.
[0138] In some examples, the sender may be a master ECU, and correspondingly, the receiver may be a slave ECU. In other examples, the sender may be a slave ECU, and correspondingly, the receiver may be a master ECU.
[0139] Among them, a cipher-based message authentication code algorithm can be used to generate a cipher-based message authentication code (Cipher-Based Message Authentication Code, CMAC) using a key.
[0140] In some examples, in order to further improve the security of communications, the message may be encrypted based on an encryption algorithm. For example, the encryption algorithm may be AES128.
[0141] In some examples, in order to further improve the security of communications, encryption may be implemented by combining the CMAC and AES128 encryption algorithms.
[0142] It can be understood that the BSW layer in the master ECU and the slave ECU can also include an AUTOSAR serial communication interface (Cluster communication port, COM) and a protocol data unit router (Protocol Data Units Router, PDUR), and a diagnostic event manager (Diagnosis Event Manager). Correspondingly, the example diagram, such as Figure 2 As shown, through Figure 2 It can be seen that the AUTOSAR serial communication interface in the master ECU is connected to the PDUR in the master ECU, and the PDUR in the master ECU includes a routing table. Correspondingly, the first on-board safety communication component in the master ECU is connected to the PDUR, and the diagnostic event manager in the master ECU is connected to the first on-board safety communication component. In addition, for the slave ECU, the AUTOSAR serial communication interface in the slave ECU is connected to the PDUR in the slave ECU, and the PDUR in the slave ECU includes a routing table. Correspondingly, the second on-board safety communication component in the slave ECU is connected to the PDUR, and the diagnostic event manager in the slave ECU is connected to the second on-board safety communication component.
[0143] The present disclosure also provides an electronic control unit, including:
[0144] at least one processor; and
[0145] a memory communicatively connected to at least one processor; wherein,
[0146] The memory stores instructions that can be executed by at least one processor. The instructions are executed by the at least one processor so that the at least one processor can execute the fresh value synchronization method of the embodiment of the present disclosure.
[0147] In order to implement the above embodiment, the embodiment of the present disclosure proposes a vehicle, comprising the aforementioned freshness value synchronization device.
[0148] In order to implement the above-mentioned embodiment, the embodiment of the present disclosure proposes a vehicle including a master ECU or a slave ECU.
[0149] In order to implement the above embodiment, the embodiment of the present disclosure proposes a vehicle, including the aforementioned master ECU and slave ECU.
[0150] In order to implement the above embodiments, the embodiments of the present disclosure provide a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to enable a computer to execute the method of the above method embodiments.
[0151] In order to implement the above embodiments, the embodiments of the present disclosure provide a computer program product, including computer instructions, which implement the methods of the above method embodiments when executed by a processor.
[0152] In order to implement the above embodiments, the present disclosure further proposes a non-temporary computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method of the above method embodiment is implemented.
[0153] In order to implement the above embodiments, the present disclosure further proposes a computer program product, on which a computer program is stored. When the computer program is executed by a processor, the method of the above method embodiment is implemented.
[0154] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0155] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0156] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present disclosure includes additional implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present disclosure belong.
[0157] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.
[0158] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0159] A person skilled in the art may understand that all or part of the steps in the above-mentioned embodiment method may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0160] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0161] The storage medium mentioned above may be a read-only memory, a disk or an optical disk, etc. Although the embodiments of the present disclosure have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations of the present disclosure. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present disclosure.
Claims
1. A fresh value synchronization method, characterized in that: The method comprises: The fresh values are generated using the main fresh value manager located in the basic software BSW layer; generating a fresh value synchronization message according to the fresh value using a first vehicle safety communication component located in the BSW layer; The first vehicle-mounted safety communication component is used to send the fresh value synchronization message to synchronize the fresh value.
2. The method according to claim 1, characterized in that The step of using the first vehicle-mounted safety communication component located in the BSW layer to generate a fresh value synchronization message according to the fresh value includes: Using the first vehicle safety communication component located in the BSW layer to truncate the fresh value according to a preset truncation rule to obtain a truncated fresh value; The first vehicle-mounted safety communication component is used to generate the fresh value synchronization message according to the truncated fresh value.
3. The method according to claim 1, characterized in that The method further comprises: In the process of sending the fresh value synchronization message, if the first vehicle safety communication component receives a fresh value synchronization request message, the first vehicle safety communication component ignores the fresh value synchronization request message.
4. The method according to claim 1, characterized in that The method further comprises: After the fresh value synchronization message is sent, if the first vehicle-mounted safety communication component receives a fresh value synchronization request message, the first vehicle-mounted safety communication component is used to generate a new fresh value synchronization message based on the latest fresh value currently generated in the main fresh value manager, and the new fresh value synchronization message is sent.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: The first encryption service manager located in the BSW layer uses a preset encryption algorithm and a preset key to encrypt the fresh value synchronization message, and sends the encrypted fresh value synchronization message to the first vehicle-mounted safety communication component.
6. A fresh value synchronization method, characterized in that: The method comprises: A second vehicle safety communication component located in the BSW layer is used to receive a fresh value synchronization message; The fresh value synchronization message is parsed by the second vehicle-mounted safety communication component to obtain the fresh value carried in the fresh value synchronization message; The second vehicle-mounted safety communication component is used to send the fresh value to a slave fresh value manager located in the BSW layer, so as to update the current fresh value in the slave fresh value manager.
7. The method according to claim 6, characterized in that The method further comprises: After determining that an abnormal restart or a bus off BussOff recovery occurs by using the diagnostic event manager located in the BSW layer, using the second vehicle safety communication component to send a fresh value synchronization request message; The second vehicle-mounted safety communication component is used to receive an updated fresh value synchronization message.
8. The method according to claim 6, characterized in that Before using the second vehicle safety communication component to send the fresh value to a slave fresh value manager located in the BSW layer to update the current fresh value in the slave fresh value manager, the method further includes: Reconstructing the fresh value using the second vehicle-mounted safety communication component according to a preset fresh value reconstruction principle; The step of using the second vehicle-mounted safety communication component to send the fresh value to a slave fresh value manager located in the BSW layer to update the current fresh value in the slave fresh value manager includes: The second vehicle-mounted safety communication component is used to send the reconstructed fresh value to the slave fresh value manager to update the current fresh value in the slave fresh value manager.
9. A fresh value synchronization device, characterized in that: The device comprises: A first generation module, for generating fresh values using a main fresh value manager located in the basic software BSW layer; A second generating module, configured to generate a fresh value synchronization message according to the fresh value by using a first vehicle safety communication component located in the BSW layer; A sending module is used to use the first vehicle-mounted safety communication component to send the fresh value synchronization message to synchronize the fresh value.
10. A freshness value synchronization device, characterized in that: The device comprises: A receiving module, used to receive a fresh value synchronization message using a second vehicle safety communication component located in the BSW layer; A parsing and processing module, configured to parse the fresh value synchronization message using the second vehicle-mounted safety communication component to obtain a fresh value carried in the fresh value synchronization message; A sending module is used to use the second vehicle-mounted safety communication component to send the fresh value to the slave fresh value manager located in the BSW layer to update the current fresh value in the slave fresh value manager.
11. An electronic control unit, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of any one of claims 1-5, or the method of any one of claims 6-8.
12. A vehicle, characterized in that: Comprising the device as claimed in claim 9, the device as claimed in claim 11, or the electronic control unit as claimed in claim 11.
13. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by a processor, the method according to any one of claims 1 to 5 or the method according to any one of claims 6 to 8 is executed.