Automobile OTA upgrading method, device and equipment based on dual-card bi-pass, and storage medium
By using dual -card dual -pass technology in the vehicle OTA upgrade, the method of using dual -path networks and public key inspection hash checks to solve the problem of low safety and low upgrade efficiency of vehicle OTA, and achieve more efficient and more efficient and more efficient and Reliable OTA upgrade process.
Patent Information
- Application Number
- CN202411960157.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-01-28
AI Technical Summary
In the prior art, remote upgrades of vehicle OTAs are easily affected by external environment and have problems such as low safety and low upgrade efficiency.
Adopting a dual -card -based car OTA upgrade method, the two -path network sends an OTA upgrade package and upgrade verification package through the dual -path network, and uses public key inspection and hash values to ensure the security and integrity of data transmission.
Effectively prevent intermediate people from attacking, improve the efficiency of upgrade, and ensure the safety and reliability of automobile OTA upgrades.
Smart Images

Figure CN119376768A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of online upgrade technology, and in particular to a dual-SIM dual-pass based automobile OTA upgrade method, device, equipment and storage medium. Background Art
[0002] With the development of wireless communication technology, communication technology is evenly applied in all walks of life. Two SIM cards are used for communication in unmanned vehicles. It can switch between different network operators to ensure the stability and reliability of communication. This technology is particularly important in the field of intelligent connected vehicles because it involves multiple aspects such as remote control of vehicles and data transmission.
[0003] Vehicle OTA remote upgrade refers to the remote control upgrade of unmanned vehicle software through over-the-air download technology. This technology allows unmanned vehicles to receive and install new software versions or update packages through wireless communication networks (such as 4G / 5G, Wi-Fi, etc.) without physical contact, thereby improving vehicle performance, adding new functions or fixing security vulnerabilities.
[0004] In the related technologies, vehicle OTA remote upgrades still have problems such as low security and low upgrade efficiency caused by the influence of the external environment. Summary of the invention
[0005] The main purpose of the present invention is to provide a dual-SIM dual-pass based automobile OTA upgrade method, device, equipment and storage medium, aiming to solve the technical problems in the prior art that vehicle OTA remote upgrades are easily affected by the external environment, resulting in low security and low upgrade efficiency.
[0006] To achieve the above objectives, in a first aspect, an embodiment of the present application provides a method for OTA upgrade of a car based on dual-SIM dual-pass, the method comprising: Generate an OTA package according to the latest upgrade software, and calculate a hash value of the OTA package, wherein a random number is generated in the process of generating the OTA package; Sign the OTA package using a private key to obtain a signature file, and pack the signature file and a random number into the OTA package to form an OTA upgrade package, wherein the signature file contains a public key corresponding to the private key; When the upgrade verification package is consistent with the OTA upgrade package through the random number verification, the upgrade verification package is sent to the vehicle terminal through the first network, wherein the upgrade verification package is a verification package formed by encapsulating the random number, the hash value of the OTA package and the public key value during the signature and then encrypting it with a private key; at the same time, the OTA upgrade package is sent to the vehicle terminal through the second network, and the first network and the second network are different network routes; Decrypt the upgrade verification package using a preset public key to obtain a verification decryption package, and extract the public key and hash value in the verification decryption package to obtain a first public key and a first hash value; Extract the public key and hash value in the OTA upgrade package to obtain the second public key and the second hash value respectively; When the first public key is consistent with the second public key and the first hash value is consistent with the second hash value, the OTA package installation is started to complete the OTA upgrade.
[0007] In a possible implementation, the step of starting OTA package installation when the first public key is consistent with the second public key and the first hash value is consistent with the second hash value includes: Before checking the consistency, the difference between the first hash value and the second hash value is calculated, where the difference satisfies the following formula: , and represents the values of the first hash value and the second hash value at the i-th position respectively, and n represents the total number of bits of the hash value; When the difference is less than a preset threshold, it is confirmed that the first hash value is consistent with the second hash value, and the OTA package installation is started.
[0008] In a possible implementation, the second network includes a second main network and a second backup network, the transmission bandwidth of the second main network is greater than the transmission bandwidth of the second backup network, and the step of sending the upgrade verification packet to the vehicle terminal through the first network includes: Acquire the historical data transmission status of the first network; When the historical data transmission status of the first network does not meet the preset requirements, the data transmission of the first network is suspended, and the second network is mapped to a second main network and a second backup network, wherein the second main network is used to send the OTA upgrade package to the vehicle terminal, and the second backup network is used to send the upgrade verification package to the vehicle terminal.
[0009] In a possible implementation manner, mapping the second network into a second primary network and a second backup network includes: When the historical data transmission status of the first network does not meet the preset requirement, the mapping mechanism is automatically triggered; Through the pre-installed network configuration tool, the second network is mapped into the second main network and the second backup network, and in the network configuration, different IP address segments and subnet masks are assigned to the second main network and the second backup network to ensure that the second main network and the second backup network are in an isolated state at the network layer.
[0010] In a possible implementation, after mapping the second network to the second primary network and the second standby network through a pre-installed network configuration tool, the following steps are further included: Send the OTA upgrade package to the in-vehicle terminal through the second primary network, and send the upgrade verification package to the in-vehicle terminal through the second standby network; In the case where the first public key is inconsistent with the second public key, or the first hash value is inconsistent with the second hash value, do not start the installation of the OTA package.
[0011] In a possible implementation, the obtaining of the historical data transmission status of the first network includes: Obtain the data read / write rate value and the read / write accuracy value during the historical data transmission process of the first network; Perform efficiency conversion on the read / write rate value and the read / write accuracy value to obtain a data transmission efficiency value; Determine that the data transmission efficiency value is less than or equal to the efficiency value threshold, and determine that the historical data transmission status of the first network does not meet the preset requirements.
[0012] In a possible implementation, the performing of efficiency conversion on the read / write rate value and the read / write accuracy value to obtain a data transmission efficiency value includes: Input the read / write rate value and the read / write accuracy value into a pre-trained data transmission efficiency value prediction model to obtain a data transmission efficiency value, where the data read / write efficiency value prediction model satisfies the following expression: ; In the formula, X is the data transmission efficiency value, R1 is the average value of the historical data read / write rate value, R2 is the most recent data read / write rate value, R0 is the data reference read / write rate value, A1 is the average value of the historical data read / write accuracy value, A2 is the most recent data read / write accuracy value, A0 is the data reference read / write accuracy value, F is the performance load of the network card device, 0 < F ≤ 1, and the performance load represents the original performance size of the network card device, Cz is the performance penalty factor, Cz ≥ 1, and the performance penalty factor is positively correlated with the workload of the network card device; W1 and W2 are respectively the influence weights of the data read / write rate value and the data read / write rate value on the data read / write efficiency value.
[0013] In a second aspect, an in-vehicle OTA upgrade device is further provided in an embodiment of the present application. The device includes: A data packet generation unit, configured to generate an OTA package according to the latest upgrade software, and generate a random number during the process of generating the OTA package; A data signature unit, configured to sign the OTA package with a private key; A data sending unit, used to send the upgrade verification package to the vehicle terminal through the first network, and send the OTA upgrade package to the vehicle terminal through the second network; A data decryption unit, decrypting the upgrade verification package using a preset public key to obtain a verification decryption package; A data extraction unit, used to extract the public key and hash value in the verification decryption package to obtain a first public key and a first hash value; and to extract the public key and hash value in the OTA upgrade package to obtain a second public key and a second hash value; A data verification unit, used to verify the consistency of the first public key and the second public key, and the consistency of the first Hash value and the second Hash value; An installation startup unit is used to start the OTA package installation to complete the OTA upgrade when the first public key is consistent with the second public key and the first hash value is consistent with the second hash value.
[0014] In a third aspect, an embodiment of the present application further provides an OTA upgrade device, comprising a memory and a processor, wherein the memory is used to store program code, and the processor is used to call the program code to execute the method described in the first aspect.
[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0016] Different from the prior art, the embodiment of the present application provides a dual-card dual-pass automobile OTA upgrade method. The method adopts dual-card dual-pass technology. When the upgrade verification package is consistent with the OTA upgrade package through random number verification, the OTA upgrade package and the upgrade verification package are first sent to the vehicle terminal through the dual-path network. After the two packages are sent to the vehicle terminal through the two-way network, the upgrade package is signed by the public key in the verification package. If the public key in the upgrade verification package is consistent with the public key in the OTA upgrade package, it indicates that there is no man-in-the-middle attack in the data transmission. Then, the integrity of the upgrade package is judged by the hash value in the verification package; finally, when the public key and hash value are consistent, the OTA package installation is started to complete the OTA upgrade. In this way, man-in-the-middle attacks can be effectively prevented and the upgrade efficiency can be improved, thereby providing a reliable security strategy for the car. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0018] Figure 1 This is a flowchart of a method for OTA upgrade of a car based on dual-SIM dual-pass in some embodiments of the present application; Figure 2 This is a flow chart of step S600 of the automobile OTA upgrade method based on dual-SIM dual-channel in some embodiments of the present application; Figure 3 This is a schematic diagram of the module structure of the automobile OTA upgrade device in some embodiments of the present application; Figure 4 This is a schematic diagram of the hardware structure of the OTA upgrade device in some embodiments of the present application.
[0019] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0022] In addition, the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, "and / or" in the full text includes three solutions. Taking A and / or B as an example, it includes technical solution A, technical solution B, and technical solution that satisfies both A and B. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in this field to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0023] With the development of wireless communication technology, communication technology is evenly applied in all walks of life. Two SIM cards are used for communication in unmanned vehicles. It can switch between different network operators to ensure the stability and reliability of communication. This technology is particularly important in the field of intelligent connected vehicles because it involves multiple aspects such as remote control of vehicles and data transmission.
[0024] Vehicle OTA remote upgrade refers to the remote control upgrade of unmanned vehicle software through over-the-air download technology. This technology allows unmanned vehicles to receive and install new software versions or update packages through wireless communication networks (such as 4G / 5G, Wi-Fi, etc.) without physical contact, thereby improving vehicle performance, adding new functions or fixing security vulnerabilities.
[0025] In the related technologies, vehicle OTA remote upgrades still have problems such as low security and low upgrade efficiency caused by the influence of the external environment.
[0026] In view of the above problems, this application proposes a dual-SIM dual-channel automobile OTA upgrade method, which can be applied to OTA upgrade devices, such as Figure 1-Figure 2 As shown, the following takes the OTA upgrade device executing the dual-SIM dual-channel automobile OTA upgrade method as an example for explanation. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described can be performed in a different order from here. Figure 1 The method includes the following steps S100 to S600: S100, generating an OTA package according to the latest upgrade software, and calculating a hash value of the OTA package, wherein a random number is generated in the process of generating the OTA package; Specifically, in the embodiment of the present application, the latest version of the upgrade software is first obtained from the cloud and compared with the local software. If the local software version is lower, the OTA package is generated using the packaging tool based on the latest upgrade software. During the generation process, the hash value of the OTA package content is calculated for subsequent integrity verification. At the same time, a random number is generated to verify the consistency of the OTA upgrade package and the upgrade verification package.
[0027] S200, using a private key to sign the OTA package, and packing the signature file and the random number into the OTA package to form an OTA upgrade package, wherein the signature file contains a public key corresponding to the private key; Specifically, in an embodiment of the present application, a private key is used to digitally sign the OTA package. The signing process encrypts the content, hash value and other information of the OTA package to generate a signature file. The signature file and the random number are packaged together into the OTA package to form an OTA upgrade package. The signature file contains the public key corresponding to the private key, which is used for subsequent signature verification. Ensure the authenticity and integrity of the OTA upgrade package to prevent tampering during transmission.
[0028] S300, when the upgrade verification package is consistent with the OTA upgrade package through the random number verification, the upgrade verification package is sent to the vehicle terminal through the first network, wherein the upgrade verification package is a verification package formed by encapsulating the random number, the hash value of the OTA package and the public key value during the signature and then encrypting it with a private key; at the same time, the OTA upgrade package is sent to the vehicle terminal through the second network, and the first network and the second network are different network routes; In an embodiment of the present application, after forming an OTA upgrade package, the above-mentioned random number, hash value of the OTA package, and public key value at the time of signing are first encapsulated and encrypted with a private key to form an upgrade verification package, thereby obtaining an OTA upgrade package and an upgrade verification package. Then, the above-mentioned random number is used to verify whether the upgrade verification package is consistent with the OTA upgrade package, thereby preventing errors at the source of the upgrade verification package and the OTA upgrade package. Finally, the dual-card dual-pass technology is used to send the upgrade verification package (including the random number, hash value of the OTA package, public key value at the time of signing, and encrypted with a private key) to the vehicle terminal through the first network; at the same time, the OTA upgrade package is sent to the vehicle terminal through the second network (different from the first network). In this way, the use of two networks to send and transmit upgrade data greatly reduces the probability of network attacks and improves the reliability and security of data transmission.
[0029] It is understandable that since the data volume of the upgrade verification package is relatively small, while the data volume of the OTA upgrade package is relatively large, in order to improve the overall hardware and software costs of the OTA upgrade system, generally speaking, the configuration of the first network is relatively low, and the speed and efficiency of data transmission are also relatively low; while the configuration of the second network is relatively high, and the speed and efficiency of data transmission are also relatively high. Therefore, the efficiency of data transmission is affected by the performance of the hardware itself and the external environment. For example, data transmission is blocked due to hardware failure, network congestion, signal interference, etc.
[0030] Therefore, in one embodiment, the second network includes a second main network and a second backup network, the transmission bandwidth of the second main network is greater than the transmission bandwidth of the second backup network, and the step of sending the upgrade verification packet to the vehicle terminal through the first network includes: Acquire the historical data transmission status of the first network; When the historical data transmission status of the first network does not meet the preset requirements, the data transmission of the first network is suspended, and the second network is mapped to a second main network and a second backup network, wherein the second main network is used to send the OTA upgrade package to the vehicle terminal, and the second backup network is used to send the upgrade verification package to the vehicle terminal.
[0031] Specifically, the embodiment of the present application sets a second main network and a second backup network in the second network, and dynamically adjusts the data transmission strategy according to the historical data transmission status of the first network. For example, by monitoring and recording the data transmission of the first network in the past period of time, including indicators such as transmission speed, packet loss rate, and delay, its historical data transmission status is evaluated. The preset requirements can be set according to the actual application scenario and requirements, such as the transmission speed needs to reach a certain threshold, the packet loss rate needs to be lower than a certain level, etc. If the historical data transmission status of the first network does not meet these preset requirements, it is considered that its data transmission efficiency is affected and corresponding measures need to be taken. After determining that the data transmission efficiency of the first network is affected, its data transmission task is suspended to avoid the loss or transmission delay of the upgrade verification package. Then the second network is divided into a second main network and a second backup network, and the second main network is configured with a higher transmission bandwidth and priority for transmitting OTA upgrade packages with large data volumes. Although the transmission bandwidth of the second backup network is low, it is sufficient to meet the transmission requirements of the upgrade verification package and serve as a supplement and backup for the second main network. After the second network mapping is completed, the OTA upgrade package is sent to the vehicle terminal through the second main network. At the same time, the upgrade verification package is sent to the vehicle terminal through the second backup network. In this way, the efficient transmission of the OTA upgrade package can be guaranteed while the reliable transmission of the upgrade verification package can be ensured.
[0032] The embodiment of the present application improves the data transmission efficiency by dynamically adjusting the data transmission strategy to transmit the OTA upgrade package with large data volume through the second main network with higher configuration. A second backup network is set up in the second network and enabled when the data transmission efficiency of the first network is affected, ensuring the reliable transmission of the upgrade verification package. Although the second network is configured with a higher transmission bandwidth and priority, by dividing it into two sub-networks and making rational use of resources, the system cost can be reduced to a certain extent.
[0033] In one embodiment, obtaining the historical data transmission status of the first network includes: Obtain the data reading and writing rate value and the reading and writing accuracy value during the historical data transmission process of the first network; Performing efficiency conversion on the read / write rate value and the read / write accuracy value to obtain a data transmission efficiency value; Determine that the data transmission efficiency value is less than or equal to the efficiency value threshold, and determine that the historical data transmission status of the first network does not meet the preset requirements.
[0034] Specifically, in the embodiment of the present application, first, obtain the data read-write rate value and the read-write accuracy rate value during the historical data transmission process of the first network, then input the read-write rate value and the read-write accuracy rate value into a pre-trained data transmission efficiency value prediction model to obtain the data transmission efficiency value, and finally, when it is determined that the data transmission efficiency value is less than or equal to the efficiency value threshold, determine that the historical data transmission status of the first network does not meet the preset requirements.
[0035] In the embodiment of the present application, the training of the data transmission efficiency value prediction model is pre-performed, and the obtained data read-write efficiency value prediction model satisfies the following expression: , where X is the data transmission efficiency value, R1 is the average value of the historical data read-write rate values, R2 is the most recent data read-write rate value, R0 is the data reference read-write rate value, A1 is the average value of the historical data read-write accuracy rate values, A2 is the most recent data read-write accuracy rate value, A0 is the data reference read-write accuracy rate value, F is the performance load of the network card device, 0 < F ≤ 1, and the performance load represents the original performance size of the network card device, Cz is the performance penalty factor, Cz ≥ 1, and the performance penalty factor is positively correlated with the working load of the network card device; W1 and W2 are the influence weights of the data read-write rate value and the data read-write rate value on the data read-write efficiency value, respectively.
[0036] It should be noted that in the embodiment of the present application, through experimental data related to the historical data read-write rate value, the historical data read-write accuracy rate value, etc., the regression algorithm is used for the training and parameter calibration of the data read-write efficiency value prediction model to obtain the above model expression. In the formula, 0.8 means that the average value of the historical data read-write rate values accounts for 80% of the influence on the data read-write efficiency represented by the data read-write rate value, 0.2 means that the most recent data read-write rate value accounts for 20% of the influence on the data read-write efficiency represented by the data read-write rate value, 0.7 means that the average value of the historical data read-write accuracy rate values accounts for 70% of the influence on the data read-write efficiency represented by the data read-write accuracy rate value, and 0.3 means that the most recent data read-write accuracy rate value accounts for 30% of the influence on the data read-write efficiency represented by the data read-write accuracy rate value. And to simplify the training of the model, the data read-write rate value and the influence weight of the data read-write rate value on the data read-write efficiency value can be given the same weight.
[0037] When the network card device corresponding to the first network is a new device, the original performance size F of the network card device can be defined as 1 or 0.9, which means that the initial performance of the network card device is relatively strong. As the network card device is used for a long time, its use load such as heating and hardware aging increases. The embodiment of the present application performs a performance penalty on the performance of the network card device to more accurately obtain the real data transmission status of the first network, thereby more accurately obtaining the data reading and writing efficiency value. This provides accurate data basis for subsequent dynamic network adjustments.
[0038] In one embodiment, mapping the second network to a second main network and a second backup network includes: automatically triggering a mapping mechanism when the historical data transmission status of the first network does not meet the preset requirements; mapping the second network to a second main network and a second backup network through a pre-installed network configuration tool, and in the network configuration, assigning different IP address segments and subnet masks to the second main network and the second backup network to ensure that the second main network and the second backup network are in an isolated state at the network layer.
[0039] Specifically, when the historical data transmission status of the first network does not meet the preset requirements (for example, the transmission speed is lower than the threshold, the packet loss rate is too high, the delay is too large, etc.), the system will automatically trigger the mapping mechanism. A network configuration tool is pre-installed in the system, which is responsible for performing network mapping and configuration tasks. Once the mapping mechanism is triggered, the tool will automatically divide the second network into the second main network and the second backup network. During the network configuration process, different IP address segments are assigned to the second main network and the second backup network to ensure that they are isolated at the network layer. In this way, unnecessary interference or confusion of network traffic between the two subnets can be prevented, and it also helps to improve the security and manageability of the network. In addition to assigning different IP address segments, the isolation between the second main network and the second backup network can also be further ensured by configuring routing rules, firewall policies, etc. This isolation measure can prevent potential security risks such as data leakage and network attacks.
[0040] In the embodiment of the present application, by automatically triggering the mapping mechanism and using the network configuration tool, the system can quickly switch to the second network when a problem occurs in the first network, thereby ensuring the continuity and stability of data transmission. And the second network is divided into a second main network and a second backup network, and different network resources (such as bandwidth, IP address, etc.) are allocated according to actual needs, which can more effectively utilize network resources and improve overall network performance. The mapping mechanism and network configuration scheme provide greater flexibility and scalability for the system. In the future, if more network paths need to be added or the network configuration needs to be optimized, it can be expanded and adjusted based on the existing framework. By automatically triggering the mapping mechanism, using the network configuration tool for mapping, and allocating different IP address segments and subnet masks, this embodiment ensures that when the network conditions are poor, the system can automatically and effectively switch to the backup network solution, thereby maintaining the stability and reliability of data transmission.
[0041] In one embodiment, after mapping the second network into the second primary network and the second backup network through the pre-installed network configuration tool, the method further includes: Sending the OTA upgrade package to the vehicle terminal through the second primary network, and sending the upgrade verification package to the vehicle terminal through the second backup network; When the first public key is inconsistent with the second public key, or the first hash value is inconsistent with the second hash value, the OTA package installation is not started.
[0042] After mapping the second network to the second main network and the second backup network through the pre-installed network configuration tool, the system will start using these two networks for data transmission. The second main network is responsible for sending the OTA upgrade package to the vehicle terminal. This is because the OTA upgrade package usually contains a large amount of data and requires a higher transmission speed and bandwidth. The second backup network is responsible for sending the upgrade verification package to the vehicle terminal. After the vehicle terminal receives the data, if it is determined that the first public key is inconsistent with the second public key, or the first hash value is inconsistent with the second hash value, the OTA package installation will not be started; if it is determined that the first public key is consistent with the second public key and the first hash value is consistent with the second hash value, the OTA package installation will be started.
[0043] S400, decrypting the upgrade verification package by using a preset public key to obtain a verification decryption package, and extracting the public key and hash value in the verification decryption package to obtain a first public key and a first hash value; In the embodiment of the present application, the vehicle terminal uses a preset public key to decrypt the upgrade verification package to obtain a verification decryption package, and extracts a public key (first public key) and a hash value (first hash value) from the verification decryption package.
[0044] S500, extracting the public key and hash value in the OTA upgrade package respectively to obtain a second public key and a second hash value; S600: When the first public key is consistent with the second public key and the first hash value is consistent with the second hash value, start the OTA package installation to complete the OTA upgrade.
[0045] In an embodiment of the present application, a public key (second public key) and a hash value (second hash value) are extracted from the OTA upgrade package to prepare for subsequent public key comparison and hash value verification.
[0046] Finally, the first public key is compared with the second public key, and the first hash value is compared with the second hash value. Ensure that the OTA upgrade package has not been tampered with during transmission and has not been attacked by a man-in-the-middle. Only when the public key and hash value are consistent, the OTA package installation is started. When the public key and hash value are consistent, the vehicle terminal starts the OTA package installation program and starts the upgrade process.
[0047] In one embodiment, step S600: when the first public key is consistent with the second public key and the first hash value is consistent with the second hash value, the step of starting the OTA package installation includes: S610: Before checking consistency, calculate the difference between the first hash value and the second hash value, where the difference satisfies the following formula: , and represents the values of the first hash value and the second hash value at the i-th position respectively, and n represents the total number of bits of the hash value; S620: When the difference is less than a preset threshold, confirm that the first hash value is consistent with the second hash value, and start OTA package installation.
[0048] Specifically, the embodiment of the present application compares each bit of the two hash values bit by bit, and adds up the differences (i.e., the difference between the two hash values at the same bit) to obtain the difference. This calculation method can accurately reflect the degree of similarity between the two hash values. By calculating the difference of the hash values, it is possible to more accurately determine whether the two hash values are consistent. Compared with simple binary comparison, the difference calculation can more sensitively reflect the slight differences between the hash values, thereby avoiding misjudgment. In this way, by calculating the difference of the hash values and confirming that the hash values are consistent when the difference is less than a preset threshold, the security of the OTA upgrade can be greatly improved. It helps prevent malicious attackers from tampering with the upgrade package or sending forged upgrade packages, thereby protecting the software system and data security of the car.
[0049] Based on this, the automobile OTA upgrade method based on dual-card dual-pass of the present application adopts dual-card dual-pass technology. When the upgrade verification package is consistent with the OTA upgrade package through random number verification, the OTA upgrade package and the upgrade verification package are first sent to the vehicle terminal through the dual-path network respectively. After the two packages are sent to the vehicle terminal by the two-way network, the upgrade package is signed by the public key in the verification package. If the public key in the upgrade verification package is consistent with the public key in the OTA upgrade package, it indicates that there is no man-in-the-middle attack in the data transmission. Then, the integrity of the upgrade package is judged by the hash value in the verification package; finally, when the public key and hash value are consistent, the OTA package installation is started to complete the OTA upgrade. In this way, man-in-the-middle attacks can be effectively prevented and the upgrade efficiency can be improved, thereby providing a reliable security strategy for the car.
[0050] Please see attached Figure 3 , Figure 3 1. The present invention is a schematic diagram of the module structure of the automobile OTA upgrade device in some embodiments of the present application; the automobile OTA upgrade device of the present application, the device includes: a data packet generation unit 100, used to generate an OTA package according to the latest upgrade software, and generate a random number in the process of generating the OTA package; a data signature unit 200, used to sign the OTA package using a private key; a data sending unit 300, used to send the upgrade verification package to the vehicle terminal through the first network, and send the OTA upgrade package to the vehicle terminal through the second network; a data decryption unit 400, decrypting the upgrade verification package by presetting the public key to obtain a verification decryption package; a data extraction unit 500, used to extract the public key and hash value in the verification decryption package to obtain the first public key and the first hash value; and extract the public key and hash value in the OTA upgrade package to obtain the second public key and the second hash value; a data verification unit 600, used to verify the consistency of the first public key and the second public key, and the consistency of the first hash value and the second hash value; an installation startup unit 700, used to start the OTA package installation to complete the OTA upgrade when the first public key is consistent with the second public key and the first hash value is consistent with the second hash value.
[0051] Please see attached Figure 4 , Figure 4 A schematic diagram of the hardware structure of an OTA upgrade device provided for some embodiments of the present application; the OTA upgrade device provided in the embodiments of the present application includes a memory 1100 and a processor 1200, wherein the memory 1100 is used to store program code, and the processor 1200 is used to call the program code to execute the method described above.
[0052] Among them, the processor 1200 is used to provide computing and control capabilities to control the OTA upgrade device to perform corresponding tasks, for example, to control the OTA upgrade device to perform the dual-card dual-pass based automobile OTA upgrade method in any of the above method embodiments, the method comprising: generating an OTA package according to the latest upgrade software, and calculating the hash value of the OTA package, wherein a random number is generated in the process of generating the OTA package; signing the OTA package with a private key, and packaging the signature file and the random number into the OTA package to form an OTA upgrade package, wherein the signature file contains a public key corresponding to the private key; when the upgrade verification package is verified to be consistent with the OTA upgrade package through the random number, the upgrade verification package is transmitted through the first network The upgrade verification package is sent to the vehicle terminal through a second network, wherein the upgrade verification package is a verification package formed by encapsulating the random number, the hash value of the OTA package and the public key value during the signature and encrypting it with a private key; at the same time, the OTA upgrade package is sent to the vehicle terminal through a second network, and the first network and the second network are different network routes; the upgrade verification package is decrypted by using a preset public key to obtain a verification decryption package, and the public key and hash value in the verification decryption package are respectively extracted to obtain a first public key and a first hash value; the public key and hash value in the OTA upgrade package are respectively extracted to obtain a second public key and a second hash value; when the first public key is consistent with the second public key, and the first hash value is consistent with the second hash value, the OTA package installation is started to complete the OTA upgrade.
[0053] The processor 1200 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a hardware chip, or any combination thereof; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a programmable logic device (PLD), or any combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0054] The memory 1100, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the dual-SIM dual-pass based automobile OTA upgrade method in the embodiment of the present application. The processor 1200 can implement the dual-SIM dual-pass based automobile OTA upgrade method in any of the above method embodiments by running the non-transitory software programs, instructions and modules stored in the memory 1100.
[0055] Specifically, the memory 1100 may include a volatile memory (VM), such as a random access memory (RAM); the memory 1100 may also include a non-volatile memory (NVM), such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD) or other non-transitory solid-state storage device; the memory 1100 may also include a combination of the above types of memory.
[0056] To sum up, the OTA upgrade device of the present application adopts the technical solution of any one of the above-mentioned embodiments of the automobile OTA upgrade method based on dual-SIM dual-pass, and therefore, it has at least the beneficial effects brought by the technical solutions of the above-mentioned embodiments, which will not be elaborated one by one here.
[0057] The embodiment of the present application also provides a computer-readable storage medium, such as a memory including a program code, and the program code can be executed by a processor to complete the automobile OTA upgrade method based on dual-SIM dual-pass in the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CDROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0058] The embodiment of the present application also provides a computer program product, which includes one or more program codes, and the program code is stored in a computer-readable storage medium. The processor of the OTA upgrade device reads the program code from the computer-readable storage medium, and the processor executes the program code to complete the steps of the dual-SIM dual-channel automobile OTA upgrade method provided in the above embodiment.
[0059] A person skilled in the art will appreciate that all or part of the steps for implementing the above embodiments may be accomplished by hardware or by hardware associated with a program code, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0060] It should be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0061] Through the description of the above embodiments, it can be clearly understood by those skilled in the art that each embodiment can be implemented by means of software plus a general hardware platform, or by hardware. It can be understood by those skilled in the art that all or part of the processes in the above embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0062] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the inventive concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.
Claims
1. A dual-SIM dual-pass based automobile OTA upgrade method, characterized in that: The method comprises: Generate an OTA package according to the latest upgrade software, and calculate a hash value of the OTA package, wherein a random number is generated in the process of generating the OTA package; Sign the OTA package using a private key to obtain a signature file, and pack the signature file and a random number into the OTA package to form an OTA upgrade package, wherein the signature file contains a public key corresponding to the private key; When the upgrade verification package is consistent with the OTA upgrade package through the random number verification, the upgrade verification package is sent to the vehicle terminal through the first network, wherein the upgrade verification package is a verification package formed by encapsulating the random number, the hash value of the OTA package and the public key value during the signature and then encrypting it with a private key; at the same time, the OTA upgrade package is sent to the vehicle terminal through the second network, and the first network and the second network are different network routes; Decrypt the upgrade verification package using a preset public key to obtain a verification decryption package, and extract the public key and hash value in the verification decryption package to obtain a first public key and a first hash value; Extract the public key and hash value in the OTA upgrade package to obtain the second public key and the second hash value respectively; When the first public key is consistent with the second public key and the first hash value is consistent with the second hash value, the OTA package installation is started to complete the OTA upgrade.
2. The automobile OTA upgrade method based on dual-SIM dual-channel as claimed in claim 1, characterized in that: The step of starting OTA package installation when the first public key is consistent with the second public key and the first hash value is consistent with the second hash value includes: Before checking the consistency, the difference between the first hash value and the second hash value is calculated, where the difference satisfies the following formula: , and represents the values of the first hash value and the second hash value at the i-th position respectively, and n represents the total number of bits of the hash value; When the difference is less than a preset threshold, it is confirmed that the first hash value is consistent with the second hash value, and the OTA package installation is started.
3. The automobile OTA upgrade method based on dual-SIM dual-channel as claimed in claim 1, characterized in that: The second network includes a second main network and a second backup network, the transmission bandwidth of the second main network is greater than the transmission bandwidth of the second backup network, and the step of sending the upgrade verification packet to the vehicle terminal through the first network includes: Acquire the historical data transmission status of the first network; When the historical data transmission status of the first network does not meet the preset requirements, the data transmission of the first network is suspended, and the second network is mapped to a second main network and a second backup network, wherein the second main network is used to send the OTA upgrade package to the vehicle terminal, and the second backup network is used to send the upgrade verification package to the vehicle terminal.
4. The automobile OTA upgrade method based on dual-SIM dual-channel as claimed in claim 3, characterized in that: The mapping of the second network into a second primary network and a second backup network includes: When the historical data transmission status of the first network does not meet the preset requirement, the mapping mechanism is automatically triggered; Through the pre-installed network configuration tool, the second network is mapped into the second main network and the second backup network, and in the network configuration, different IP address segments and subnet masks are assigned to the second main network and the second backup network to ensure that the second main network and the second backup network are in an isolated state at the network layer.
5. The automobile OTA upgrade method based on dual-SIM dual-channel as claimed in claim 4, characterized in that: After mapping the second network into the second main network and the second backup network through the pre-installed network configuration tool, the method further includes: Sending the OTA upgrade package to the vehicle terminal through the second primary network, and sending the upgrade verification package to the vehicle terminal through the second backup network; When the first public key is inconsistent with the second public key, or the first hash value is inconsistent with the second hash value, the OTA package installation is not started.
6. The automobile OTA upgrade method based on dual-SIM dual-channel as claimed in claim 3, characterized in that: The acquiring of the historical data transmission status of the first network includes: Obtain the data reading and writing rate value and the reading and writing accuracy value during the historical data transmission process of the first network; Performing efficiency conversion on the read / write rate value and the read / write accuracy value to obtain a data transmission efficiency value; Determining that the data transmission efficiency value is less than or equal to an efficiency value threshold value, determining that the historical data transmission status of the first network does not meet a preset requirement.
7. The automobile OTA upgrade method based on dual-SIM dual-channel as claimed in claim 6, characterized in that: The performing efficiency conversion on the read / write rate value and the read / write accuracy value to obtain a data transmission efficiency value includes: The read / write rate value and the read / write accuracy value are input into a pre-trained data transmission efficiency value estimation model to obtain a data transmission efficiency value, wherein the data read / write efficiency value estimation model satisfies the following expression: ; Wherein, X is the data transmission efficiency value, R1 is the average value of the historical data read / write rate values, R2 is the most recent data read / write rate value, R0 is the data reference read / write rate value, A1 is the average value of the historical data read / write accuracy rate values, A2 is the most recent data read / write accuracy rate value, A0 is the data reference read / write accuracy rate value, F is the performance load of the network card device, 0 < F ≤ 1, and the performance load represents the original performance size of the network card device, C z is the performance penalty factor, C z ≥ 1, and the performance penalty factor is positively correlated with the workload of the network card device; W1 and W2 are the influence weights of the data read / write rate value and the data read / write rate value on the data read / write efficiency value respectively.
8. An automobile OTA upgrade device, characterized in that: The device comprises: A data packet generating unit, configured to generate an OTA package according to the latest upgrade software, and to generate a random number in the process of generating the OTA package; A data signature unit, used to sign the OTA package using a private key; A data sending unit, used to send the upgrade verification package to the vehicle terminal through the first network, and send the OTA upgrade package to the vehicle terminal through the second network; A data decryption unit, decrypting the upgrade verification package using a preset public key to obtain a verification decryption package; A data extraction unit, used to extract the public key and hash value in the verification decryption package to obtain a first public key and a first hash value; and to extract the public key and hash value in the OTA upgrade package to obtain a second public key and a second hash value; A data verification unit, used to verify the consistency of the first public key and the second public key, and the consistency of the first Hash value and the second Hash value; An installation startup unit is used to start the OTA package installation to complete the OTA upgrade when the first public key is consistent with the second public key and the first hash value is consistent with the second hash value.
9. An OTA upgrade device, characterized in that: The method comprises a memory and a processor, wherein the memory is used to store program codes, and the processor is used to call the program codes to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Networking control method, networking control device, electronic equipment and storage medium
CN112469099A
OTA upgrade package acquisition method, electronic equipment and storage medium
CN112929871A
Information collection method, communication device, server, system and storage medium
CN113660385A
OTA data upgrading method, system and device and storage medium
CN116419217A
Vehicle system upgrading method, OTA upgrading file cloud processing method and electronic equipment
CN117041048A