METHOD AND DEVICE FOR PROCESSING UPGRADE PACKAGES FOR VEHICLES
Patent Information
- Application Number
- DE602020059130
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-11-14
- Filing Date
- 2020-06-23
- Publication Date
- 2025-09-17
- Estimated Expiration
- 2040-06-23
AI Technical Summary
The existing over-the-air (OTA) server is burdened with heavy loads due to the need to provide upgrade packages for each vehicle, leading to inefficiencies in software updating processes.
The upgrade package is divided into multiple data blocks, which are distributed to terminals in a peer-to-peer manner, allowing terminals to obtain the complete package without directly accessing the OTA server, and ensuring encryption and integrity through integer multiple packet lengths and signatures.
This approach reduces the load on the OTA server, enhances decryption efficiency, improves security, and ensures confidentiality and integrity of the upgrade package transmission.
Description
TECHNICAL FIELD
[0001] This application relates to communications technologies, and in particular, to a method and an apparatus for processing an upgrade package of a vehicle.BACKGROUND
[0002] With the development of Internet of vehicles technologies, an increasing quantity of vehicles are provided with software-related operating systems. During software updating, a vehicle may download an upgrade package of a vehicle from an over the air (over the air, OTA) server based on an OTA technology, and implement software updating by using the upgrade package of the vehicle.
[0003] Usually, whenever a vehicle sends an upgrade request, the OTA server needs to respond to the upgrade request of the vehicle and deliver an upgrade package of the vehicle to the vehicle.
[0004] However, because the OTA server needs to provide an upgrade package of the vehicle for each vehicle, load of the OTA server is relatively heavy.
[0005] KR 2015 0072809 A discloses an apparatus and a method for updating the software program of a vehicle based on collaborative communication of V2V and V2I. An apparatus for updating the software program of a vehicle based on collaborative communication of V2V and V2I according to an embodiment of the present invention includes a network interface part in a car which performs internal communication with electronic control devices in the car; a network interface part except a first care which supports the connection of the first network based on V2I communication protocol with a road-side base station; a network interface part except a second car which supports the connection of a second network based on V2V communication protocol with adjacent cars; and a client control part which controls the switching of the second network connection and the first network connection when data for updating the software of the electronic control device is received.
[0006] WO 2019 / 149599 A1 discloses a method for distributing a software to a plurality of motor vehicle, as well as a corresponding system, motor vehicle, and data storage medium. The software is divided into multiple parts, which are delivered from a data server to a set of first generation motor vehicles. For each part, the respective motor vehicle sends an acknowledgement of receipt to a coordination server, which then sends out a notification of availability for the part to a second generation motor vehicle. This second generation motor vehicle downloads the part from the motor vehicle that previously sent the acknowledgement of receipt. This process iteratively continues until all of the plurality of motor vehicles have received all parts of the software.
[0007] US 2010 / 179720 A1 discloses a system and method for providing autonomous and remote vehicle maintenance and repair. The system employs an on-board diagnosis and prognosis module that monitors one or more vehicle buses to identify trouble codes and other information indicating a vehicle problem. The on-board module causes a telematic device on the vehicle to broadcast a message including a problem code that identifies the problem the vehicle is having. A remote repair center may receive the message and may identify a software upgrade patch associated with the problem that can be transmitted to the vehicle to upgrade its software to correct the problem. Also, the message may be received by another vehicle that is part of a broadcast network that has previously received the software upgrade patch to fix a problem on that vehicle, where the receiving vehicle may transmit the software upgrade patch to the vehicle having the problem.
[0008] US 2006 / 294514 A1 discloses a system, method and computer program for updating computer programs embedded in a vehicle. Wireless communication means are used to detect and contact one of a plurality of neighbor vehicles. Information is exchanged with the contacted neighbor vehicle related to a plurality of computer programs embedded in the vehicle and the neighbor vehicle. One of a plurality of computer programs is requested and retrieved from the contacted neighbor vehicle. Another of the plurality of computer programs is delivered to the neighbor vehicle. The retrieved computer program is validated and installed.
[0009] US 2019 / 265965 A1 discloses a system and method for updating software in a vehicle. Software in a vehicle may, at times, be subject to update. In this regard, a server may send the update software to one or more electronic devices in the vehicle. The server may receive the capabilities of the electronic devices in the vehicle, such as the memory, computational, security capabilities, or the like, and tailor the sending of the software update based on the capabilities of the electronic devices. For example, the division of the software update, the sections of memory from which to determine the delta, the compression schemes, and / or where certain functions (such as where decryption occurs) may be dependent on the capabilities of the electronic devices in the vehicle.SUMMARY
[0010] Embodiments of this application provide a method and an apparatus for processing an upgrade package of the vehicle, to reduce load of an OTA server. The invention is set out by the appended claims.
[0011] According to a first aspect, an embodiment of this application provides a method for processing an upgrade package of the vehicle. The method includes: A first terminal receives one or more first data blocks from a server, where the first data block is used for vehicle upgrading; the first terminal obtains one or more second data blocks from a second terminal, where the second data block is used for upgrading an in-vehicle system, and the second data block is sent by the server to the second terminal; and the first terminal obtains the upgrade package of the vehicle based on the first data block and the second data block. To be specific, the server may divide the upgrade package of the vehicle into a plurality of data blocks, and then deliver the plurality of data blocks to a plurality of terminals. Then, each terminal may obtain an upgrade package of the vehicle in a peer-to-peer (peer to peer, P2P) manner based on a data block that has been received by the terminal and a data block obtained by the terminal from another terminal. In this process, none of the terminals need to obtain the complete upgrade package of the vehicle from an OTA server. Therefore, load of the OTA server can be reduced.
[0012] According to the first aspect, both the first data block and the second data block are encrypted data blocks, and a data block length of the first data block and a data block length of the at least one second data block each are an integer multiple of a packet length of an encryption algorithm. By dividing the vehicle upgrade packet into data blocks whose lengths are integer multiples of the packet length, it can be ensured that a decapsulator does not additionally consume a time for packet integration in decryption during processing of encrypted packets. This effectively resists a timing attack, thereby ensuring confidentiality protection and integrity protection of the encrypted packets.
[0013] In a possible design, that the first terminal obtains an upgrade package of the vehicle based on the first data block and the at least one second data block includes: The first terminal starts to decrypt the first data block at a first time, and the first terminal receives the second data block at a second time, where the first time is earlier than the second time; or the first terminal starts to decrypt the second data block at a third time, and the first terminal receives the first data block at a fourth time, where the third time is earlier than the fourth time. In this embodiment of this application, the first terminal decrypts a data block while receiving the data block. Therefore, compared with a method in which the first terminal decrypts all the data blocks together after receiving all the data blocks, the method in this embodiment of this application can improve decryption efficiency and reduce an upgrade package downloading time.
[0014] In a possible design, the first data block and the second data block each include a signature of a server that generates an upgrade package for upgrading a vehicle system; and that the first terminal starts to decrypt the first data block at a first time includes: The first terminal starts to decrypt the first data block at the first time when the first terminal confirms that a signature in the first data block is the signature of the server that generates the upgrade package for upgrading the vehicle system; and that the first terminal starts to decrypt the second data block at a third time includes: The first terminal starts to decrypt the second data block at the third time when the first terminal confirms that a signature in the second data block is the signature of the server that generates the upgrade package for upgrading the vehicle system. In this case, if the signatures carried in the first data block and the second data block are not a signature of an OTA server, the first data block and the second data block may be discarded, and a first data block and a second data block that include the signature of the OTA server may be re-obtained. In this way, the first terminal is prevented from receiving an insecure data block sent by another device, thereby improving security of data block transmission. In a possible design, the server stores an association relationship between a data block obtained through division of the upgrade package of the vehicle and a terminal that receives the data block. That the first terminal obtains one or more second data blocks from a second terminal includes: The first terminal sends a data block obtaining request to the second terminal based on the association relationship; and the first terminal receives the one or more second data blocks returned by the second terminal in response to the data block obtaining request. In this way, the first terminal can accurately obtain the second data block from the corresponding second terminal based on the association relationship provided by the server.
[0015] In a possible design, the server is a proxy server, the upgrade package of the vehicle is obtained by the proxy server from an over the air OTA server, and the first terminal is a vehicle. In this case, the proxy server can assist the vehicle in upgrading, thereby reducing load of the OTA server.
[0016] In a possible design, the first terminal is a charging pile.
[0017] In a possible design, the method further includes: The charging pile receives an upgrade package obtaining request sent by a vehicle; and when the vehicle succeeds in safety verification of the charging pile, the charging pile returns the upgrade package of the vehicle to the vehicle based on the upgrade package obtaining request. In this way, the vehicle can download the upgrade package of the vehicle while being charged. It can be understood that, during charging of the vehicle, there may usually be a relatively good network environment because the vehicle is usually in a stationary state; and a phenomenon such as download interruption of the upgrade package of the vehicle caused due to insufficient power of the vehicle can be avoided because the vehicle is connected to a charging auxiliary device. Therefore, user experience of vehicle upgrading can be effectively improved.
[0018] In a possible design, that a first terminal receives a first data block from a server includes: The first terminal receives the first data block from the server when the first terminal succeeds in security authentication with the server. The first terminal receives the first data block after performing security authentication with the server, so that security of the first data block received by the first terminal can be improved.
[0019] According to a second aspect, an embodiment of this application provides a method for processing an upgrade package of the vehicle. The method includes: A server divides the upgrade package of the vehicle into a plurality of data blocks; and the server distributes the plurality of data blocks to at least one terminal, where each terminal is configured to obtain the upgrade package of the vehicle based on a data block received by the terminal and a data block from another terminal in the at least one terminal.
[0020] According to the second aspect, that a server divides an upgrade package of the vehicle into a plurality of data blocks includes: The server encrypts the upgrade package of the vehicle according to an encryption algorithm, and divides the encrypted upgrade package of the vehicle into the plurality of data blocks whose lengths are integer multiples of packet lengths of the encryption algorithm.
[0021] In a possible design, the server is a proxy server; and before the server divides the upgrade package of the vehicle into the blocks, the method further includes: The proxy server obtains the upgrade package of the vehicle from an over the air OTA server.
[0022] In a possible design, that the proxy server obtains the upgrade package of the vehicle from an over the air OTA server includes: The proxy server sends an upgrade package of the vehicle obtaining request to the over the air OTA server, where the upgrade package of the vehicle obtaining request includes an operating system type and a version of a vehicle; and when the proxy server succeeds in security verification with the OTA server, the proxy server receives the upgrade package of the vehicle sent by the OTA server, where the upgrade package of the vehicle is generated by the OTA server based on the operating system type and the version of the vehicle.
[0023] In a possible design, after the server distributes the plurality of data blocks to the at least one terminal, the method further includes: The server records an association relationship between a data block obtained through division of the upgrade package of the vehicle and a terminal that receives the data block.
[0024] According to a third aspect, an embodiment of this application provides a first terminal, including: a receiving module, configured to receive one or more first data blocks from a server, where the first data block is used for vehicle upgrading; and a processing module, configured to: obtain, by the first terminal, one or more second data blocks from a second terminal, where the second data block is used for upgrading an in-vehicle system, and the second data block is sent by the server to the second terminal; and obtain an upgrade package of the vehicle based on the first data block and the second data block.
[0025] According to the third aspect, both the first data block and the second data block are encrypted data blocks, and a data block length of the first data block and a data block length of the at least one second data block each are an integer multiple of a packet length of an encryption algorithm.
[0026] In a possible design, the processing module is specifically configured to: start to decrypt the first data block at a first time and receive the second data block at a second time, where the first time is earlier than the second time; or start to decrypt the second data block at a third time and receive the first data block at a fourth time, where the third time is earlier than the fourth time.
[0027] In a possible design, the first data block and the second data block each include a signature of a server that generates an upgrade package for upgrading a vehicle system; and the processing module is specifically further configured to: start to decrypt the first data block at the first time when confirming that a signature in the first data block is the signature of the server that generates the upgrade package for upgrading the vehicle system; and start to decrypt the second data block at the third time when confirming that a signature in the second data block is the signature of the server that generates the upgrade package for upgrading the vehicle system.
[0028] In a possible design, the server stores an association relationship between a data block obtained through division of the upgrade package of the vehicle and a terminal that receives the data block; and the processing module is specifically further configured to: send a data block obtaining request to the second terminal based on the association relationship; and receive the one or more second data blocks returned by the second terminal in response to the data block obtaining request.
[0029] In a possible design, the server is a proxy server, the upgrade package of the vehicle is obtained by the proxy server from an over the air OTA server, and the first terminal is a vehicle.
[0030] In a possible design, the first terminal is a charging pile.
[0031] In a possible design, the receiving module is further configured to receive an upgrade package obtaining request sent by a vehicle; and the processing module is further configured to: when the vehicle succeeds in safety verification of the charging pile, return the upgrade package of the vehicle to the vehicle based on the upgrade package obtaining request.
[0032] In a possible design, the receiving module is specifically configured to receive, by the first terminal, the first data block from the server when the first terminal succeeds in security authentication with the server.
[0033] According to a fourth aspect, an embodiment of this application provides a server, including: a processing module, configured to divide an upgrade package of the vehicle into a plurality of data blocks; and a sending module, configured to distribute the plurality of data blocks to at least one terminal, where each terminal is configured to obtain the upgrade package of the vehicle based on a data block received by the terminal and a data block from another terminal in the at least one terminal.
[0034] According to the fourth aspect, the processing module is specifically configured to: encrypt the upgrade package of the vehicle according to an encryption algorithm, and divide the encrypted upgrade package of the vehicle into the plurality of data blocks whose lengths are integer multiples of packet lengths of the encryption algorithm.
[0035] In a possible design, the server is a proxy server; and the processing module is further configured to obtain the upgrade package of the vehicle from an over the air OTA server.
[0036] In a possible design, the processing module is specifically configured to: send an upgrade package of the vehicle obtaining request to the over the air OTA server, where the upgrade package of the vehicle obtaining request includes an operating system type and a version of a vehicle; and when the proxy server succeeds in security verification with the OTA server, receive the upgrade package of the vehicle sent by the OTA server, where the upgrade package of the vehicle is generated by the OTA server based on the operating system type and the version of the vehicle.
[0037] In a possible design, the processing module is further configured to record an association relationship between a data block obtained through division of the upgrade package of the vehicle and a terminal that receives the data block.
[0038] According to a fifth aspect, an embodiment of this application provides an apparatus for processing an upgrade package of the vehicle. The apparatus for processing an upgrade package of the vehicle may be a chip or a system on a chip in a first terminal, and includes a processor and an interface circuit. The interface circuit is configured to receive code instructions and transmit the code instructions to the processor. The processor is configured to run the code instructions to perform the method according to any one of the first aspect or the possible designs of the first aspect. According to a sixth aspect, an embodiment of this application provides an apparatus for processing an upgrade package of the vehicle. The apparatus for processing an upgrade package of the vehicle may be a chip or a system on a chip in a server, and includes a processor and an interface circuit. The interface circuit is configured to receive code instructions and transmit the code instructions to the processor. The processor is configured to run the code instructions to perform the method according to any one of the second aspect or the possible designs of the second aspect.
[0039] According to a seventh aspect, an embodiment of this application provides an apparatus for processing an upgrade package of the vehicle, including a memory and a processor. The processor executes program instructions in the memory to implement the method according to any one of the first aspect or the possible designs of the first aspect.
[0040] According to an eighth aspect, an embodiment of this application provides an apparatus for processing an upgrade package of the vehicle, including a memory and a processor. The processor executes program instructions in the memory to implement the method according to any one of the second aspect or the possible designs of the second aspect.
[0041] According to a ninth aspect, an embodiment of this application provides a readable computer storage medium. The readable computer storage medium is configured to store a computer program, and the computer program is used to implement the method according to any one of the first aspect or the possible designs of the first aspect.
[0042] According to a tenth aspect, an embodiment of this application provides a readable computer storage medium. The readable computer storage medium is configured to store a computer program, and the computer program is used to implement the method according to any one of the second aspect or the possible designs of the second aspect.
[0043] According to an eleventh aspect, an embodiment of this application provides a system for processing an upgrade package of the vehicle. The system includes the communications apparatus in the third aspect and the corresponding feasible implementations and the communications apparatus in the fourth aspect and the corresponding feasible implementations.
[0044] It should be understood that, the technical solutions of the second aspect to the eleventh aspect of this application correspond to the technical solution of the first aspect of this application, and beneficial effects obtained by each aspect and corresponding feasible implementations are similar and are not described in detail again.BRIEF DESCRIPTION OF DRAWINGS
[0045] FIG. 1 is a schematic diagram of a network system to which a method for processing an upgrade package of the vehicle is applied according to an embodiment of this application; FIG. 2 is a schematic flowchart of a method for processing an upgrade package of the vehicle according to an embodiment of this application; FIG. 3 is a schematic diagram of another network system to which a method for processing an upgrade package of the vehicle is applied according to an embodiment of this application; FIG. 4 is a schematic diagram of a logical framework of a vehicle-mounted device in a vehicle according to an embodiment of this application; FIG. 5 is a schematic flowchart of a specific method for processing an upgrade package of the vehicle according to an embodiment of this application; FIG. 6 is a schematic diagram of still another network system to which a method for processing an upgrade package of the vehicle is applied according to an embodiment of this application; FIG. 7 is a schematic flowchart of another specific method for processing an upgrade package of the vehicle according to an embodiment of this application; FIG. 8 is a schematic diagram of a structure of a first terminal according to an embodiment of this application; FIG. 9 is a schematic diagram of a structure of a server according to an embodiment of this application; and FIG. 10 is a schematic diagram of a hardware structure of an apparatus for processing an upgrade package of the vehicle according to an embodiment of this application. DESCRIPTION OF EMBODIMENTS
[0046] The following describes implementations of embodiments in detail with reference to accompanying drawings.
[0047] A method for processing an upgrade package of the vehicle provided in embodiments of this application may be applied to a network system in FIG. 1. The system may include a server 11, a first terminal 121, and a second terminal 122. There may be one or more second terminals 122.
[0048] The server 11 may be an OTA server configured to deliver an upgrade package of the vehicle, or may be a vehicle fleet server that has obtained an upgrade package of the vehicle from an OTA server, or any other possible server. This is not specifically limited in embodiments of this application. The first terminal 121 may be a vehicle in any form, the first terminal 121 may be a vehicle auxiliary device (for example, a vehicle charging pile) in any form, or the first terminal 121 may be a mobile terminal (for example, a mobile phone, a tablet computer, or a wearable device). This is not specifically limited in embodiments of this application. The second terminal 122 may be a vehicle in any form, the second terminal 122 may be a vehicle auxiliary device (for example, a vehicle charging pile) in any form, or the second terminal 122 may be a mobile terminal (for example, a mobile phone, a tablet computer, or a wearable device). This is not specifically limited in embodiments of this application. The first terminal 121 and the second terminal 122 may be devices of a same type. For example, both the first terminal 121 and the second terminal 122 are vehicles, vehicle auxiliary devices, mobile terminals, or the like. Alternatively, the first terminal 121 and the second terminal 122 may be devices of different types. For example, the first terminal 121 is a vehicle, and the second terminal 122 is a vehicle auxiliary device, a mobile terminal, or the like. This is not specifically limited in embodiments of this application. Manners of processing an upgrade package of the vehicle when the server 11, the first terminal 121, and the second terminal 122 are various specific devices are described in detail in subsequent embodiments. Details are not described herein.
[0049] The first terminal 121 and the second terminal 122 each establish a communication connection to the server 11. For example, the first terminal 121 and the second terminal 122 each may establish a communication connection to the server 11 by using a protocol such as the hypertext transfer protocol (hypertext transfer protocol, HTTP) or the hypertext transfer protocol over secure socket layer (hypertext transfer protocol over secure socket layer, HTTPS). This is not limited in embodiments of this application.
[0050] P2P communication may be implemented between the first terminal 121 and the second terminal 122 through a communication connection in any form. For example, P2P communication may be implemented between the first terminal 121 and the second terminal 122 through wireless transmission, for example, Bluetooth (Bluetooth) transmission, carrierless communication (ultra wide band, UWB), or infrared transmission.
[0051] Alternatively, P2P communication may be implemented between the first terminal 121 and the second terminal 122 through wired transmission. This is not specifically limited in embodiments of this application.
[0052] Alternatively, P2P communication may be implemented between the first terminal 121 and the second terminal 122 based on an index server. The index server may be the server 11 or may be any other server. For example, the index server may store a resource list. The resource list includes an association relationship between the first terminal 121 and a resource identifier in the first terminal 121, and an association relationship between the second terminal 122 and a resource identifier in the second terminal 122. When the first terminal 121 expects to obtain a resource, the first terminal 121 obtains a resource list of each terminal from the index server, and determines, from the resource lists, that a terminal including an identifier of the resource is the second terminal 122. In this case, the first terminal 121 may further obtain the resource from the second terminal 122 through wired communication or wireless communication.
[0053] FIG. 2 is a schematic flowchart of a method for processing an upgrade package of the vehicle according to an embodiment of this application. As shown in FIG. 2, the method includes the following steps.
[0054] Step S101: A first terminal receives one or more first data blocks from a server, where the first data block is used for vehicle upgrading.
[0055] In this embodiment of this application, the server may be an OTA server or may be a server other than an OTA server. When the server is an OTA server, the server may generate an upgrade package for vehicle upgrading. When the server is a server other than an OTA server, the server may first obtain an upgrade package for vehicle upgrading from an OTA server.
[0056] The server may divide a complete upgrade package for vehicle upgrading into a plurality of data blocks. It can be understood that, based on a device specifically corresponding to an upgrade package, each upgrade package may correspond to a device number and an upgrade package sequence number. During block division, the server may identify the data blocks based on locations of the data blocks in the upgrade package, or the like, so that the data blocks may be subsequently integrated based on identifiers of the plurality of data blocks to obtain the complete upgrade package again. A specific identification manner and identification content of the data blocks are not specifically limited in this embodiment of this application. In an embodiment, a data block may be a complete data packet.
[0057] For example, in a specific implementation, a header of each data block obtained through block division may include one or more of a version number, an upgrade package sequence number i, a device number j, and a sequence number k of the data block in an upgrade package i. For example, currently, there are approximately 25 to 100 types of automobile electronic control units (electronic control unit, ECU) for passenger vehicles. Therefore, there are usually no more than 256 types of upgrade packages. Correspondingly, a total quantity of upgrade package sequence numbers i does not exceed 256. It may be specified that the upgrade package sequence number i occupies one byte in the data block. Correspondingly, there are also usually no more than 256 types of vehicles. Therefore, the device number (for example, an ECU number of a vehicle) j may also occupy one byte. The sequence number k of the data block in the upgrade package i is related to a size of the upgrade package and an upgrading manner. For example, a larger upgrade package indicates a larger sequence number k; or k is smaller when a differential upgrading manner is used or k is larger when a complete package upgrading manner is used. For example, k may occupy 1 to 3 bytes. This is not specifically limited in this embodiment of this application.
[0058] After obtaining the plurality of data blocks, the server may distribute the plurality of data blocks to a plurality of terminals. In this embodiment of this application, a description is provided by using an example in which the first terminal in the plurality of terminals is used as an execution body and a terminal in the plurality of terminals other than the first terminal is a second terminal. The first terminal and the second terminal may alternatively be terminals other than the plurality of terminals. A data block received by the first terminal is a first data block, and there may be one or more first data blocks. A data block received by the second terminal is a second data block, and there may be one or more second data blocks. All first data blocks and all second data blocks may form the complete upgrade package. Certainly, there may be a case, for example, redundant information-related encapsulation is performed; and the complete upgrade package may be formed when some data packets are parsed. Alternatively, the first data block herein may be one type of data block, and the second data block is another type of data block. Transmission paths of different types of data blocks may be different. For example, different types of data blocks reach a destination end after passing through different devices.
[0059] Optionally, in a specific implementation, the first terminal may send an upgrade request to the server. The upgrade request may include basic information of the first terminal, and the basic information may include software information and / or hardware information or a vehicle model (for example, a unique identifier (vehicle identification number, VIN) of a vehicle). In response to the upgrade request, the server may send, to the first terminal, one or more first data blocks that match the basic information in the upgrade request. Before sending the upgrade request, the first terminal may further receive an upgrade notification. There may be various conditions for triggering sending of the upgrade request. For example, sending of the upgrade request is triggered based on a timing moment specified in the first terminal; sending of the upgrade request is triggered when a user taps an upgrade control on a screen of an in-vehicle infotainment (in-vehicle Infotainment, IVI) system in the first terminal; sending of the upgrade request is triggered by using an application in a mobile device such as a mobile phone that communicates with the first terminal; or the upgrade request is automatically sent when a network environment of the first terminal satisfies an upgrade requirement (which is also referred to as silent upgrading).
[0060] Optionally, before step S101 is performed, bidirectional authentication may be performed between the first terminal and the server to establish secure communication. For example, bidirectional authentication may be performed between the first terminal and the server by using public key infrastructure (public key infrastructure, PKI). For example, the first terminal may check a digital certificate of the server in the PKI to implement authentication on the server by the first terminal; and the server may check a digital certificate of the first terminal in the PKI to implement authentication on the first terminal by the server. It can be understood that, bidirectional authentication may alternatively be performed between the first terminal and the server in another manner based on an actual application scenario. This is not specifically limited in this embodiment of this application.
[0061] Step S102: The first terminal obtains one or more second data blocks from the second terminal, where the second data block is used for vehicle upgrading, and the second data block is sent by the server to the second terminal.
[0062] In this embodiment of this application, the first terminal may obtain the one or more second data blocks from the second terminal in any P2P manner described above. There may be one or more second terminals. A quantity of second terminals is not limited in this embodiment of this application. For example, when there is one second terminal, the first terminal obtains one or more second data blocks from one second terminal. When there are a plurality of second terminals, the first terminal obtains one or more second data blocks from one or more second terminals.
[0063] It should be noted that, in this embodiment of this application, a sequence between step S 102 and step S101 may be reversed. To be specific, the first terminal may first obtain the one or more first data blocks, and then obtain the one or more second data blocks; or the first terminal may first obtain the one or more second data blocks, and then obtain the one or more first data blocks. This is not specifically limited in this embodiment of this application.
[0064] Optionally, when the server distributes the data blocks to the plurality of terminals, the server stores an association relationship between each data block and a terminal that receives the data block. A specific implementation of step S102 may be as follows: The first terminal sends a data block obtaining request to the second terminal based on the association relationship, and the first terminal receives at least one second data block returned by the second terminal in response to the data block obtaining request.
[0065] In this embodiment of this application, each data block may uniquely correspond to one data block identifier, and the data block identifier may be an identifier such as a number or a name. Each terminal may uniquely correspond to one terminal identifier, and the terminal identifier may be an identifier such as a device serial number of a terminal or a communication address of a terminal. Certainly, for different terminals, specific forms of terminal identifiers used by the terminals may be different. For different data blocks, data block identifiers used by the data blocks may be different. For each data block, the server may store an association relationship between an identifier of the data block and an identifier of a terminal that receives the data block. In this case, the first terminal may determine, based on the association relationship, a data block (for example, one or more first data blocks) that has been received by the first terminal, a data block (for example, one or more second data blocks) that is still missing for the first terminal, and an identifier of a second terminal associated with the data block that is missing for the first terminal. Further, the first terminal may send a data obtaining request to the second terminal based on the identifier of the second terminal, and receive one or more second data blocks returned by the second terminal. For example, when there are a plurality of second terminals, the first terminal may send a data block obtaining request to each second terminal based on the association relationship, and receive one or more second data blocks returned by the second terminal. The server may alternatively use a simple technical verification manner or another verification manner to ensure that no data block is missing or ensure that the data blocks can satisfy a normal upgrading condition.
[0066] Optionally, before step S102 is performed, bidirectional authentication may be performed between the first terminal and the second terminal to establish secure communication. For example, bidirectional authentication may be performed between the first terminal and the second terminal by using PKI. For example, the first terminal may check a digital certificate of the second terminal in the PKI to implement authentication on the second terminal by the first terminal, and the second terminal may check a digital certificate of the first terminal in the PKI to implement authentication on the first terminal by the second terminal. It can be understood that, bidirectional authentication may alternatively be performed between the first terminal and the second terminal in another manner based on an actual application scenario. This is not specifically limited in this embodiment of this application.
[0067] Step S103: The first terminal obtains an upgrade package of the vehicle based on the first data block and the second data block.
[0068] In this embodiment of this application, after obtaining all the second data blocks, the first terminal may integrate the first data block and the second data block according to a data block arrangement sequence or the like based on an identifier of the second data block and an identifier of the first data block, to obtain the upgrade package of the vehicle. In this embodiment of this application, the upgrade package of the vehicle may be an upgrade package for upgrading a system (or software) of a single component in a vehicle, or may be an upgrade package for upgrading a system (or software) of a plurality of components or all components in a vehicle. This is not specifically limited in this embodiment of this application.
[0069] In conclusion, in this embodiment of this application, the server may divide the vehicle upgrade packet into the plurality of data blocks, and then deliver the plurality of data blocks to the plurality of terminals. Then, a terminal may obtain a data block from another terminal in a P2P manner, and obtain the upgrade package of the vehicle based on the data block that has been received by the terminal and a data block obtained by the terminal from another terminal. In this process, none of the terminals need to obtain the complete upgrade package of the vehicle from an OTA server. Therefore, load of the OTA server can be reduced.
[0070] Optionally, both the first data block and the second data block may be encrypted data blocks.
[0071] In this embodiment of this application, when dividing the upgrade package of the vehicle into blocks, the server may first encrypt the upgrade package of the vehicle, and then divide the encrypted upgrade package of the vehicle into an encrypted first data block and an encrypted second data block. Alternatively, when dividing the upgrade package of the vehicle into blocks, the server may first divide the upgrade package of the vehicle into one or more first data blocks and one or more second data blocks, and then encrypt each first data block and each second data block. A specific implementation of encryption is not specifically limited in this embodiment of this application. To ensure data block integrity, the first data block and the second data block may be respectively stored in terminals, or may be centrally stored in a terminal, for example, the first terminal and / or the second terminal. Alternatively, information included in the first data block and the second data block may be respectively stored in terminals, or may be centrally stored in a terminal, for example, the first terminal and / or the second terminal.
[0072] In this embodiment of this application, an encryption algorithm used by the server to obtain an encrypted data block may be a symmetric encryption algorithm, or may be an asymmetric encryption algorithm or any other encryption algorithm. The encryption algorithm is not specifically limited in this embodiment of this application. It can be understood that, for data blocks obtained through encryption by using different encryption methods, identifiers of the encryption algorithms may be carried in the data blocks. During decryption, a corresponding decryption algorithm may be used based on an identifier of the encryption algorithm. This is not specifically limited in this embodiment of this application.
[0073] In this embodiment of this application, by encrypting the first data block and the second data block, an unauthorized user can be prevented from obtaining the upgrade packet, and confidentiality of a transmission process of data blocks obtained through division can be ensured. This can further ensure transmission security of an OTA data packet while ensuring fast transmission of the OTAn upgrade packet.
[0074] In an optional implementation of this embodiment of this application, a data block length of the first data block and a data block length of the at least one second data block each are an integer multiple of a packet length of a symmetric encryption algorithm.
[0075] In this embodiment of this application, a length of the vehicle upgrade packet input to the symmetric encryption algorithm may be an integer multiple of the packet length of the encryption algorithm. For example, the packet length may be 8 bytes, 16 bytes, or 128 bytes. However, the length of the upgrade package of the vehicle is usually random, and may not be an integer multiple of the packet length. Therefore, a padding part may be added to the upgrade package of the vehicle to make a total length of the upgrade package of the vehicle become an integer multiple of the packet length. Further, the upgrade package of the vehicle is divided into a plurality of data blocks whose lengths are integer multiples of the packet length of the encryption algorithm. For example, when the packet length is 128 bytes, lengths of both the first data block and the second data block may be 128*n, where n is a natural number.
[0076] In this embodiment of this application, by dividing the vehicle upgrade packet into data blocks whose lengths are integer multiples of the packet length, it can be ensured that a decapsulator does not additionally consume a time for packet integration in decryption during processing of encrypted packets. This effectively resists a timing attack, thereby ensuring confidentiality protection and integrity protection of the encrypted packets.
[0077] In an optional implementation, when the first terminal is connected to an OTA server, the first terminal may obtain, from the OTA server, packet lengths of the first data block and the second data block, a key for encrypting a data block, and a valid time of the key. In this case, the first terminal may decrypt the first data block and the second data block within the valid time of the key based on the key.
[0078] Optionally, when a data block length of the first data block and a data block length of the at least one second data block each are an integer multiple of a packet length of an encryption algorithm, a manner of decrypting the first data block and the second data block by the first terminal may be as follows: Each time the first terminal receives a data block (including the first data block or the second data block), the first terminal immediately decrypts the received data block. In this case, when the first terminal receives the last data block, the first terminal may have completed decryption of a previously received data block. Therefore, the first terminal only needs to wait for a time for decrypting the last data block to complete decryption of all data blocks. In other words, in this embodiment of this application, the first terminal decrypts a data block while receiving the data block. Therefore, compared with a method in which the first terminal decrypts all the data blocks together after receiving all the data blocks, the method in this embodiment of this application can improve decryption efficiency and reduce an upgrade package downloading time.
[0079] It can be understood that, the first terminal may alternatively decrypt all the data blocks (including the first data block or the second data block) together after receiving all the data blocks. This is not specifically limited in this embodiment of this application.
[0080] Optionally, the first data block and the second data block each include a signature of a server that generates an upgrade package for upgrading a vehicle system. For example, before performing block division on the complete upgrade package for upgrading a vehicle system, the OTA server may sign the upgrade package, or digitally sign content of the upgrade package based on public key cryptography. A signature may be an identifier corresponding to the OTA server. For example, the signature may be a device identifier of the OTA server or an identifier of an operator operating the OTA server. Alternatively, the signature may include an identifier of a vehicle provider or the like. In addition, during block division, signatures are added to the first data block and the second data block. In this way, when obtaining the first data block and the second data block, the first terminal can determine, based on the signatures carried in the first data block and the second data block, whether the first data block and the second data block are sent by an OTA server allowed by the first terminal. It can be understood that, if the signatures carried in the first data block and the second data block are not the signature of the OTA server, the first data block and the second data block may be discarded, and a first data block and a second data block that include the signature of the OTA server may be re-obtained. In this way, the first terminal is prevented from receiving an insecure data block sent by another device, thereby improving security of data block transmission.
[0081] Correspondingly, the first data block and the second data block each include a signature of a server that generates an upgrade package for vehicle upgrading. The first terminal starts to decrypt the first data block at a first time when the first terminal confirms that a signature in the first data block is a signature of a server for downloading an upgrade package of the vehicle, and receives the second data block at a second time, where the first time is earlier than the second time; or the first terminal starts to decrypt the second data block at a third time when the first terminal confirms that a signature in the second data block is a signature of a server for downloading an upgrade package of the vehicle, and receives the first data block at a fourth time, where the third time is earlier than the fourth time.
[0082] For example, FIG. 3 shows a specific upgrading system to which a method for processing an upgrade package of the vehicle may be applied according to an embodiment of this application. As shown in FIG. 3, the upgrading system includes a server 30, a first terminal 31, and a second terminal 32. There are three second terminals 32, which are respectively numbered as a second terminal 320, a second terminal 321, and a second terminal 322.
[0083] In this embodiment of this application, the server 30 may be an OTA server. The server 30 may alternatively be a proxy server. For example, the proxy server may be a server that serves a vehicle fleet. When the server 30 is a proxy server, the proxy server may first establish secure communication with an OTA server through bidirectional authentication, and then the proxy server sends hardware and software information of a vehicle to the OTA server. After generating an upgrade package of the vehicle, the OTA server may deliver the upgrade package of the vehicle to the proxy server. It can be understood that, the OTA server may alternatively divide the upgrade package of the vehicle into blocks and deliver the blocks to a plurality of proxy servers; and the plurality of proxy servers obtain the upgrade package of the vehicle in the foregoing P2P manner. This is not specifically limited in this embodiment of this application.
[0084] In this embodiment of this application, both the first terminal and the second terminal may be vehicles. FIG. 4 is a schematic diagram of a logical framework of a vehicle-mounted device in a vehicle. It can be understood that, the vehicle-mounted device in FIG. 4 may be all or some of vehicle-mounted devices included in the vehicle. These vehicle-mounted devices may be grouped into several domains, each domain includes one or more vehicle-mounted devices, each domain includes a domain administrator, and the domain administrator may also be referred to as a domain controller. For example, a mobile data center (mobile data center, MDC), one or more sensors (sensors), and a global positioning system (global positioning system, GPS) belong to a domain, and the MDC is a domain controller in the domain. A vehicle control unit (vehicle control unit, VCU), one or more electronic control units (electronic control unit, ECU), a wireless power transmission (wireless power transmission, WPT) device, and the like belong to a domain, and the VCU is a domain controller in the domain. A human machine interface (human machine interface, HMI) and one or more ECUs belong to a domain, and the HMI is a domain controller in the domain. A body control module (body control module, BCM), one or more ECUs, a passive entry passive start (passive entry passive start, PEPS), and the like belong to a domain, and the BCM is a domain controller in the domain. The domain controller is connected to a gateway (gateway, GW), and the gateway is connected to an on-board diagnostics (on-board diagnostics, OBD) system, a vehicle communications terminal (telematics box, T-Box) in the Internet of vehicles, and another device. For example, the domain controller may communicate with a device such as the T-Box through the gateway, and an intra-domain device may communicate with a device such as the gateway through the domain controller.
[0085] In an optional implementation, the vehicle downloads an upgrade package of the vehicle by using a T-Box, and determines a source of the upgrade package of the vehicle; and after determining that the upgrade package of the vehicle is delivered by an OTA server, the vehicle may forward the upgrade package of the vehicle to a corresponding vehicle-mounted device in the vehicle based on a device number corresponding to the upgrade package. A vehicle-mounted device (for example, an MDC or an HMI) with relatively strong computing and storage capabilities can perform packaging itself, so that consumption of a storage resource of the T-Box can be reduced. After performing packaging, a vehicle-mounted component in the vehicle may further perform signature verification on the upgrade package, and perform an operation such as upgrade installation after determining that the upgrade package of the vehicle is delivered by the OTA server. This can improve reliability of the upgrade package.
[0086] In this embodiment of this application, an example in which the first terminal is a first vehicle and the second terminal is a second vehicle is used. As shown in FIG. 5, optional specific implementation steps of the method for processing an upgrade package of the vehicle may be as follows: Step S301: The first vehicle obtains one or more first data blocks from the server, and the second vehicle obtains one or more second data blocks from the server. Step S302: The first vehicle obtains the one or more second data blocks from the second vehicle. Step S303: The first vehicle obtains an upgrade package of the vehicle based on the obtained first data block and the obtained second data block.
[0087] In this embodiment of this application, for a method for dividing the upgrade package of the vehicle into blocks by the server and a method for obtaining the first data block and the second data block by the first vehicle, refer to the description in the embodiment corresponding to FIG. 2. Details are not described herein again.
[0088] In an optional application scenario in this embodiment of this application, as shown in FIG. 3, the server 30 is a vehicle fleet server, and the vehicle fleet server obtains, in advance from an OTA server, an upgrade package of the vehicle used by a vehicle fleet (for example, including a first vehicle 31, a second vehicle 320, a second vehicle 321, and a second vehicle 322) served by the vehicle fleet server. Further, during routine maintenance of the vehicle fleet, in a case of wireless fidelity (Wireless-Fidelity, Wi-Fi) network connection or the like, the first vehicle 31, the second vehicle 320, the second vehicle 321, and the second vehicle 322 are connected to the vehicle fleet server. When receiving an upgrade package downloading notification, the vehicle fleet server performs bidirectional authentication (for example, a PKI-based authentication manner) with the first vehicle 31, the second vehicle 320, the second vehicle 321, and the second vehicle 322; and after succeeding in the authentication, encrypts an encryption key k of the upgrade package (encrypts the encryption key k of the upgrade package by using public keys of the vehicles), and then delivers encrypted encryption keys to the first vehicle 31, the second vehicle 320, the second vehicle 321, and the second vehicle 322. For example, if the first vehicle 31 downloads a first part of the upgrade package of the vehicle, the second vehicle 320 downloads a second part of the upgrade package of the vehicle, and the second vehicle 321 downloads a third part of the upgrade package of the vehicle, the first vehicle 31 may download the second part of the upgrade package of the vehicle from the second vehicle 320, download the third part of the upgrade package of the vehicle from the second vehicle 321, and further obtain the complete upgrade package of the vehicle through decryption by using the key k.
[0089] It can be understood that, the second vehicle 320 may also obtain the complete upgrade package of the vehicle from the first vehicle 31 and the second vehicle 321, and the second vehicle 321 may also obtain the complete upgrade package of the vehicle from the first vehicle 31 and the second vehicle 320.
[0090] In this case, after the first vehicle 31, the second vehicle 320, or the second vehicle 321 obtains the complete upgrade package of the vehicle, the second vehicle 322 can obtain the upgrade package of the vehicle from the first vehicle 31, the second vehicle 320, or the second vehicle 321. A specific process in which each vehicle downloads the upgrade package of the vehicle is not limited in this embodiment of this application.
[0091] In this embodiment of this application, the vehicle fleet server is used as a proxy server, so that the vehicle can implement convenient vehicle upgrading during maintenance or another process.
[0092] Optionally, to further improve stability of the upgrade package of the vehicle and prevent an incorrect upgrade package of the vehicle from being delivered to a plurality of vehicles, before step S301 is performed, performance test may be performed on an upgrade package of the vehicle. For example, an upgrade package of the vehicle may be first obtained from the server 30 by using a vehicle A, and then the vehicle A performs updating based on the upgrade package of the vehicle. If the updating succeeds, the vehicle A sends an update success message to the server 30; and then step S301 and subsequent steps are further performed. This can increase a probability of successful vehicle upgrading.
[0093] For example, FIG. 6 shows a specific upgrading system to which a method for processing an upgrade package of the vehicle may be applied according to an embodiment of this application. As shown in FIG. 6, the upgrading system includes a server 60, a first terminal 61, and a second terminal 62. There are three second terminals 62, which are respectively numbered as a second terminal 620, a second terminal 621, and a second terminal 622.
[0094] In this embodiment of this application, the server 60 may be an OTA server. The server 60 may alternatively be a proxy server. When the server 60 is a proxy server, the proxy server may first establish secure communication with an OTA server through bidirectional authentication, and then the proxy server sends, to the OTA server, hardware and software information of a vehicle served by a vehicle auxiliary device. After generating an upgrade package of the vehicle, the OTA server may deliver the upgrade package of the vehicle to the proxy server. It can be understood that, the OTA server may alternatively divide the upgrade package of the vehicle into blocks and deliver the blocks to a plurality of proxy servers; and the plurality of proxy servers obtain the upgrade package of the vehicle in the foregoing P2P manner. This is not specifically limited in this embodiment of this application.
[0095] In this embodiment of this application, an example in which the first terminal is a first vehicle auxiliary device and the second terminal is a second vehicle auxiliary device is used. The second vehicle auxiliary device may be a device for vehicle charging (for example, a charging pile), a mobile terminal, or the like. As shown in FIG. 7, optional specific implementation steps of the method for processing an upgrade package of the vehicle may be as follows: Step S701: The first vehicle auxiliary device obtains one or more first data blocks from the server, and the second vehicle auxiliary device obtains one or more second data blocks from the server. Step S702: The first vehicle auxiliary device obtains the one or more second data blocks from the second vehicle auxiliary device. Step S703: The first vehicle auxiliary device obtains an upgrade package of the vehicle based on the obtained first data block and the obtained second data block.
[0096] In this embodiment of this application, for a method for dividing the upgrade package of the vehicle into blocks by the server and a method for obtaining the first data block and the second data block by the first vehicle auxiliary device, refer to the description in the embodiment corresponding to FIG. 2. Details are not described herein again.
[0097] In an optional application scenario in this embodiment of this application, as shown in FIG. 6, the server 60 is an OTA server. The OTA server generates an upgrade package of the vehicle, and further notifies a first vehicle auxiliary device 61, a second vehicle auxiliary device 620, a second vehicle auxiliary device 621, and a second vehicle auxiliary device 622 that an upgrade package of the vehicle needs to be downloaded. The OTA server performs bidirectional authentication (for example, a PKI-based authentication manner) with the first vehicle auxiliary device 61, the second vehicle auxiliary device 620, the second vehicle auxiliary device 621, and the second vehicle auxiliary device 622; and after succeeding in the authentication, delivers, to the first vehicle auxiliary device 61, the second vehicle auxiliary device 620, the second vehicle auxiliary device 621, and the second vehicle auxiliary device 622, data blocks encrypted by using a key k. For example, if the first vehicle auxiliary device 61 downloads a first part of the upgrade package of the vehicle, the second vehicle auxiliary device 620 downloads a second part of the upgrade package of the vehicle, and the second vehicle auxiliary device 621 downloads a third part of the upgrade package of the vehicle, the first vehicle auxiliary device 61 may download the second part of the upgrade package of the vehicle from the second vehicle auxiliary device 620, download the third part of the upgrade package of the vehicle from the second vehicle auxiliary device 621, and further obtain the complete upgrade package of the vehicle through decryption by using the key k.
[0098] It can be understood that, the second vehicle auxiliary device 620 may also obtain the complete upgrade package of the vehicle from the first vehicle auxiliary device 61 and the second vehicle auxiliary device 621, and the second vehicle auxiliary device 621 may also obtain the complete upgrade package of the vehicle from the first vehicle auxiliary device 61 and the second vehicle auxiliary device 620.
[0099] In this case, after the first vehicle auxiliary device 61, the second vehicle auxiliary device 620, or the second vehicle auxiliary device 621 obtains the complete upgrade package of the vehicle, the second vehicle auxiliary device 622 can obtain the upgrade package of the vehicle from the first vehicle auxiliary device 61, the second vehicle auxiliary device 620, or the second vehicle auxiliary device 621. A specific process in which each vehicle auxiliary device downloads the upgrade package of the vehicle is not limited in this embodiment of this application.
[0100] In this embodiment of this application, for example, after receiving an upgrade notification, a vehicle 63 may establish a connection to the OTA server to obtain the encryption key k of the upgrade package of the vehicle. When the vehicle 63 is being charged by using the first vehicle auxiliary device 61, the second vehicle auxiliary device 620, the second vehicle auxiliary device 621, or the second vehicle auxiliary device 622, the first vehicle auxiliary device 61, the second vehicle auxiliary device 620, the second vehicle auxiliary device 621, or the second vehicle auxiliary device 622 may receive an upgrade package obtaining request sent by the vehicle, and perform bidirectional authentication with the vehicle. Then, the first vehicle auxiliary device 61, the second vehicle auxiliary device 620, the second vehicle auxiliary device 621, or the second vehicle auxiliary device 622 may send the encrypted upgrade package of the vehicle to the vehicle. The vehicle 63 decrypts the encrypted upgrade package of the vehicle by using the key k to obtain the upgrade package of the vehicle. In this way, the vehicle 63 can download the upgrade package of the vehicle while being charged. It can be understood that, during charging of the vehicle, there may usually be a relatively good network environment because the vehicle is usually in a stationary state; and a phenomenon such as download interruption of the upgrade package of the vehicle caused due to insufficient power of the vehicle can be avoided because the vehicle is connected to a charging auxiliary device. Therefore, user experience of vehicle upgrading can be effectively improved.
[0101] Optionally, to further improve stability of the upgrade package of the vehicle and prevent an incorrect upgrade package of the vehicle from being delivered to a plurality of vehicles, before step S701 is performed, correctness test may be performed on an upgrade package of the vehicle. For example, an upgrade package of the vehicle may be first obtained from the first vehicle auxiliary device 61, the second vehicle auxiliary device 620, the second vehicle auxiliary device 621, or the second vehicle auxiliary device 622 by using a vehicle A, and then the vehicle A performs updating based on the upgrade package of the vehicle. If the updating succeeds, the vehicle A sends an update success message to the first vehicle auxiliary device 61, the second vehicle auxiliary device 620, the second vehicle auxiliary device 621, or the second vehicle auxiliary device 622, and then step S701 and subsequent steps are further performed. This can increase a probability of successfully upgrading an in-vehicle system.
[0102] FIG. 8 is a schematic diagram of a structure of a first terminal according to an embodiment of this application. The first terminal includes a receiving module 801 and a processing module 802. The receiving module is configured to receive one or more first data blocks from a server, where the first data block is used for vehicle upgrading. The processing module is configured to: obtain, by the first terminal, one or more second data blocks from a second terminal, where the second data block is used for upgrading an in-vehicle system, and the second data block is sent by the server to the second terminal; and obtain an upgrade package of the vehicle based on the first data block and the second data block.
[0103] According to this application, both the first data block and the second data block are encrypted data blocks, and a data block length of the first data block and a data block length of the at least one second data block each are an integer multiple of a packet length of an encryption algorithm.
[0104] In a possible design, the processing module is specifically configured to: start to decrypt the first data block at a first time and receive the second data block at a second time, where the first time is earlier than the second time; or start to decrypt the second data block at a third time and receive the first data block at a fourth time, where the third time is earlier than the fourth time.
[0105] In a possible design, the first data block and the second data block each include a signature of a server that generates an upgrade package for upgrading a vehicle system; and the processing module is specifically further configured to: start to decrypt the first data block at the first time when confirming that a signature in the first data block is the signature of the server that generates an upgrade package for upgrading a vehicle system; and start to decrypt the second data block at the third time when confirming that a signature in the second data block is the signature of the server that generates an upgrade package for upgrading a vehicle system.
[0106] In a possible design, the server stores an association relationship between a data block obtained through division of the upgrade package of the vehicle and a terminal that receives the data block; and the processing module is specifically further configured to: send a data block obtaining request to the second terminal based on the association relationship; and receive one or more second data blocks returned by the second terminal in response to the data block obtaining request.
[0107] In a possible design, the server is a proxy server, the upgrade package of the vehicle is obtained by the proxy server from an over the air OTA server, and the first terminal is a vehicle.
[0108] In a possible design, the first terminal is a charging pile.
[0109] In a possible design, the receiving module is further configured to receive an upgrade package obtaining request sent by a vehicle; and the processing module is further configured to: when the vehicle succeeds in safety verification of the charging pile, return the upgrade package of the vehicle to the vehicle based on the upgrade package obtaining request.
[0110] In a possible design, the receiving module is specifically configured to receive, by the first terminal, the first data block from the server when the first terminal succeeds in security authentication with the server.
[0111] The apparatus in this embodiment may be correspondingly configured to perform the steps performed by the first terminal in the foregoing method embodiment. An implementation principle and technical effects of the apparatus are similar to those of the foregoing method, and details are not described herein again.
[0112] FIG. 9 is a schematic diagram of a structure of a first terminal according to an embodiment of this application. The first terminal includes a processing module 901 and a sending module 902. The processing module is configured to divide an upgrade package of the vehicle into a plurality of data blocks. The sending module is configured to distribute the plurality of data blocks to at least one terminal, where each terminal is configured to obtain the upgrade package of the vehicle based on a data block received by the terminal and a data block from another terminal in the at least one terminal.
[0113] In a possible design, the processing module is specifically configured to: encrypt the upgrade package of the vehicle according to an encryption algorithm, and divide the encrypted upgrade package of the vehicle into the plurality of data blocks.
[0114] In a possible design, the server is a proxy server; and the processing module is further configured to obtain the upgrade package of the vehicle from an over the air OTA server.
[0115] In a possible design, the processing module is specifically configured to: send an upgrade package of the vehicle obtaining request to the over the air OTA server, where the upgrade package of the vehicle obtaining request includes an operating system type and a version of a vehicle; and when the proxy server succeeds in security verification with the OTA server, receive the upgrade package of the vehicle sent by the OTA server, where the upgrade package of the vehicle is generated by the OTA server based on the operating system type and the version of the vehicle.
[0116] In a possible design, the processing module is further configured to record an association relationship between a data block obtained through division of the upgrade package of the vehicle and a terminal that receives the data block.
[0117] The apparatus in this embodiment may be correspondingly configured to perform the steps performed by the server in the foregoing method embodiment. An implementation principle and technical effects of the apparatus are similar to those of the foregoing method, and details are not described herein again.
[0118] FIG. 10 is a schematic diagram of a hardware structure of an apparatus for processing an upgrade package of the vehicle according to this application. Refer to FIG. 10. The apparatus for processing an upgrade package of the vehicle includes a memory 1001, a processor 1002, and a communications interface 1003. The memory 1001, the processor 1002, and the communications interface 1003 may communicate with each other. For example, the memory 1001, the processor 1002, and the communications interface 1003 may communicate with each other by using a communications bus 1004. The memory 1001 is configured to store a computer program. The processor 1002 executes the computer program to implement the methods described in the foregoing method embodiments.
[0119] Optionally, the communications interface 1003 may further include a transmitter and / or a receiver.
[0120] Optionally, the processor may be a central processing unit (central processing unit, CPU), or may be another general-purpose processor, a digital signal processor (digital signal processor, DSP), an application-specific integrated circuit (application-specific integrated circuit, ASIC), or the like. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor or the like. The steps of the methods disclosed with reference to this application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and a software module in a processor.
[0121] This application provides a computer-readable storage medium. The computer-readable storage medium is configured to store a computer program, and the computer program is used to implement the methods described in the foregoing method embodiments.
[0122] This application further provides a communications system, including the first terminal shown in FIG. 8 and the server shown in FIG. 9.
[0123] This application provides a system chip. The system chip is configured to support a communications apparatus in implementing functions described in embodiments of this application (for example, a first terminal receives one or more first data blocks from a server, where the first data block is used for vehicle upgrading; the first terminal obtains one or more second data blocks from a second terminal, where the second data block is used for upgrading an in-vehicle system, and the second data block is sent by the server to the second terminal; and the first terminal obtains an upgrade package of the vehicle based on the first data block and the second data block). The chip is specifically used in a chip system, and the chip system may include a chip, or may include a chip and another discrete device. When the foregoing method is implemented by using a chip in a first device, the chip includes a processing unit. Further, the chip may further include a communications unit. The processing unit may be, for example, a processor. When the chip includes the communications unit, the communications unit may be, for example, an input / output interface, a pin, or a circuit. The processing unit performs all or some operations performed by each processing module in embodiments of this application, and the communications unit may perform a corresponding receiving or sending operation. In another specific embodiment, a processing module of a receiving device in this application may be the processing unit of the chip, and a receiving module or a sending module of a control device is the communications unit of the chip.
[0124] Embodiments of this application are described with reference to the flowcharts and / or block diagrams of the method, the device (system), and the computer program product according to embodiments of this application. It should be understood that computer program instructions may be used to implement each procedure and / or each block in the flowcharts and / or the block diagrams and a combination of a procedure and / or a block in the flowcharts and / or the block diagrams. These computer program instructions may be provided for a general-purpose computer, a dedicated computer, an embedded processor, or a processing unit of any other programmable data processing device to generate a machine, so that instructions executed by the computer or the processing unit of any other programmable data processing device generate an apparatus for implementing a specific function in one or more processes in the flowcharts and / or in one or more blocks in the block diagrams.
[0125] These computer program instructions may also be stored in a computer-readable memory that can indicate the computer or the another programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate an artifact that includes an instruction apparatus. The instruction apparatus implements a specific function in one or more procedures in the flowcharts and / or in one or more blocks in the block diagrams.
[0126] These computer program instructions may be loaded onto the computer or the another programmable data processing device, so that a series of operations and steps are performed on the computer or the another programmable device, thereby generating computer-implemented processing. Therefore, the instructions executed on the computer or the another programmable device provide steps for implementing a specific function in one or more procedures in the flowcharts and / or in one or more blocks in the block diagrams.
[0127] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the described apparatus embodiment is merely an example. For example, the unit division is merely logical function division and may be other division during actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electronic, mechanical, or other forms.
[0128] The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units may be selected based on actual requirements to achieve the objectives of the solutions of embodiments. In addition, function units in embodiments of this application may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in a form of hardware, or may be implemented in a form of hardware plus a software function unit.
[0129] When the foregoing integrated unit is implemented in a form of a software function unit, the integrated unit may be stored in a computer-readable storage medium. The software function unit is stored in a storage medium and includes several instructions for instructing a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to perform a part of the steps of the methods described in embodiments of this application. The foregoing storage medium includes: any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (read-only memory, ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disc.
Claims
1. A method for processing an upgrade package of a vehicle, comprising: receiving (S101), by a first terminal (121, 31, 61), a first data block from a server (11, 30, 60), wherein the first data block is used for upgrading the vehicle; obtaining (S102), by the first terminal (121, 31, 61), a second data block from a second terminal (122, 32, 62), wherein the second data block is used for upgrading the vehicle, and the second data block is sent by the server (11, 30, 60) to the second terminal (122, 32, 62); and obtaining (S103), by the first terminal (121, 31, 61), the upgrade package of the vehicle based on the first data block and the second data block, wherein both the first data block and the second data block are encrypted data blocks, and each of a length of the first data block and a length of the second data block is an integer multiple of a packet length of an encryption algorithm.
2. The method according to claim 1, wherein the obtaining (S103), by the first terminal (121, 31, 61), the upgrade package of the vehicle based on the first data block and the second data block comprises: starting, by the first terminal (121, 31, 61), to decrypt the first data block at a first time, and receiving, by the first terminal (121, 31, 61), the second data block at a second time, wherein the first time is earlier than the second time; or starting, by the first terminal (121, 31, 61), to decrypt the second data block at a third time, and receiving, by the first terminal (121, 31, 61), the first data block at a fourth time, wherein the third time is earlier than the fourth time.
3. The method according to claim 2, wherein the first data block and the second data block each comprise a signature of a server (11, 30, 60) that generates the upgrade package of the vehicle; and the starting, by the first terminal (121, 31, 61), to decrypt the first data block at a first time comprises: starting, by the first terminal (121, 31, 61), to decrypt the first data block at the first time when the first terminal (121, 31, 61) confirms that a signature in the first data block is the signature of the server (11, 30, 60) that generates the upgrade package of the vehicle; and the starting, by the first terminal (121, 31, 61), to decrypt the second data block at a third time comprises: starting, by the first terminal (121, 31, 61), to decrypt the second data block at the third time when the first terminal (121, 31, 61) confirms that a signature in the second data block is the signature of the server (11, 30, 60) that generates the upgrade package of the vehicle.
4. The method according to claim 1, wherein the obtaining (S102), by the first terminal (121, 31, 61), a second data block from a second terminal (122, 32, 62) comprises: sending, by the first terminal (121, 31, 61), a data block obtaining request to the second terminal (122, 32, 62) based on an association relationship, stored by the server (11, 30, 60), between a data block obtained through division of the upgrade package of the vehicle and a terminal that receives the data block; and receiving, by the first terminal (121, 31, 61), the second data block returned by the second terminal (122, 32, 62) in response to the data block obtaining request.
5. The method according to any one of claims 1 to 4, wherein the server (11, 30, 60) is a proxy server, the upgrade package of the vehicle is obtained by the proxy server from an over the air, OTA server, and the first terminal (121, 31, 61) is a vehicle.
6. The method according to any one of claims 1 to 4, wherein the first terminal (121, 31, 61) is a charging pile.
7. The method according to claim 6, wherein the method further comprises: receiving, by the charging pile, an upgrade package obtaining request sent by a vehicle; and when the vehicle succeeds in safety verification of the charging pile, returning, by the charging pile, the upgrade package of the vehicle to the vehicle based on the upgrade package obtaining request.
8. The method according to any one of claims 1 to 4, wherein the receiving (S101), by a first terminal (121, 31, 61), a first data block from a server (11, 30, 60) comprises: receiving, by the first terminal (121, 31, 61), the first data block from the server (11, 30, 60) when the first terminal (121, 31, 61) succeeds in security authentication with the server (11, 30, 60).
9. A method for processing an upgrade package of a vehicle , comprising: dividing, by a server (11, 30, 60), the upgrade package of the vehicle into a plurality of data blocks, wherein the dividing, by a server (11, 30, 60), the upgrade package of the vehicle into a plurality of data blocks comprises: encrypting, by the server (11, 30, 60), the upgrade package of the vehicle according to an encryption algorithm, and dividing the encrypted upgrade package of the vehicle into the plurality of data blocks whose lengths are integer multiples of packet lengths of the encryption algorithm; and distributing, by the server (11, 30, 60), the plurality of data blocks to a plurality of terminals, wherein the plurality of data blocks are configured to be combined into the upgrade package of the vehicle by a first terminal (121, 31, 61), and the first terminal (121, 31, 61) is one of the plurality of terminals that receives multiple data blocks of the plurality of data blocks from terminals other than the first terminal (121, 31, 61) among the plurality of terminals.
10. The method according to claim 9, wherein the server (11, 30, 60) is a proxy server; and before the dividing, by a server (11, 30, 60), the upgrade package of the vehicle into blocks, the method further comprises: obtaining, by the proxy server, the upgrade package of the vehicle from an over the air, OTA server.
11. The method according to claim 9 or 10, wherein after the distributing, by the server (11, 30, 60), the plurality of data blocks to at least one terminal, the method further comprises: recording, by the server (11, 30, 60), an association relationship between the plurality of data blocks obtained through division of the upgrade package of the vehicle and the plurality of terminals that receive the plurality of data blocks.
12. An apparatus, comprising units configured to perform the steps in the method according to any one of claims 1 to 11.
13. A computer-readable storage medium, wherein the computer-readable storage medium is configured to store a program instruction, and when the program instruction is run, the method according to any one of claims 1 to 11 is implemented.