UPGRADE METHOD AND APPARATUS, AND ELECTRONIC DEVICE
Embodiments of this application provide an upgrade method and apparatus, and an electronic device, and relate to the field of the Internet-of-vehicles technologies. The method includes: A server obtains a first instruction when a software function of an in-vehicle component is faulty, where the first instruction is used to indicate an upgrade strategy of the in-vehicle component, and the upgrade strategy is associated with a software function status of the in-vehicle component. The server sends task information of an upgrade task in response to the first instruction, where the task information includes information about the upgrade strategy, and the information about the upgrade strategy is used to indicate the in-vehicle component to be upgraded. Correspondingly, after receiving the task information of the upgrade task, a vehicle may upgrade the in-vehicle component based on the upgrade strategy.
1 . An upgrade method, comprising:
obtaining task information of an upgrade task; and
sending the task information of the upgrade task, wherein the task information comprises information about an upgrade strategy associated with a software function status of an in-vehicle component, and wherein the information about the upgrade strategy indicates the in-vehicle component to be upgraded.
2 . The method according to claim 1 , wherein the information about the upgrade strategy comprises a preset condition used by the in-vehicle component to omit a pre-upgrade processing procedure, or is used by the in-vehicle component to directly enter an upgrade state.
3 . The method according to claim 1 , wherein the obtaining task information of the upgrade task comprises:
obtaining a first instruction when a software function of the in-vehicle component is faulty, wherein the first instruction is used to indicate the upgrade strategy of the in-vehicle component; and
obtaining the task information of the upgrade task in response to the first instruction.
4 . The method according to claim 1 , wherein the method further comprises:
sending a second instruction, wherein the second instruction indicates to check a speed and a gear state of a vehicle.
5 . The method according to claim 1 , wherein, before sending task information of the upgrade task, the method further comprises:
displaying risk warning information; and
obtaining a first operation of a user for the risk warning information, wherein the first operation indicates that the user allows a server to deliver the task information of the upgrade task.
6 . The method according to claim 3 , wherein the first instruction is determined based on a user input.
7 . The method according to claim 5 , wherein the method further comprises:
obtaining a third instruction, wherein the third instruction indicates that the user allows the server to deliver an upgrade package corresponding to the upgrade task; and
sending the upgrade package to a vehicle corresponding to the in-vehicle component.
8 . The method according to claim 1 , wherein the method further comprises:
signing the task information of the upgrade task based on a first certificate of a vehicle corresponding to the in-vehicle component; to obtain the signed task information, wherein the signed task information is used to verify security of the task information.
9 . An upgrade method, comprising:
receiving task information of an upgrade task, wherein the task information comprises information about an upgrade strategy associated with a software function status of an in-vehicle component; and
upgrading the in-vehicle component based on the information about the upgrade strategy.
10 . The method according to claim 9 , wherein the information about the upgrade strategy comprises a preset condition used by the in-vehicle component to omit a pre-upgrade processing procedure, or is used by the in-vehicle component to directly enter an upgrade state.
11 . The method according to claim 9 , wherein the method further comprises:
receiving a second instruction that indicates to check a speed and a gear state of a vehicle corresponding to the in-vehicle component.
12 . The method according to claim 9 , wherein upgrading the in-vehicle component based on the information about the upgrade strategy comprises:
receiving an upgrade package corresponding to the upgrade task; and
upgrading the in-vehicle component based on the information about the upgrade strategy and the upgrade package.
13 . The method according to claim 9 , wherein upgrading the in-vehicle component based on the information about the upgrade strategy comprises:
upgrading the in-vehicle component based on the information about the upgrade strategy and a local upgrade package of a vehicle corresponding to the in-vehicle component.
14 . The method according to claim 9 , wherein, before upgrading the in-vehicle component based on the information about the upgrade strategy, the method further comprises:
verifying a signature of the task information based on a first certificate of a vehicle corresponding to the in-vehicle component; and
determining that signature verification of the task information is successful.
15 . An upgrade apparatus, comprising:
a transceiver, configured to receive task information of an upgrade task, wherein the task information comprises information about an upgrade strategy associated with a software function status of an in-vehicle component; and
a processor, configured to upgrade the in-vehicle component based on the information about the upgrade strategy.
16 . The apparatus according to claim 15 , wherein the information about the upgrade strategy comprises a preset condition used by the in-vehicle component to omit a pre-upgrade processing procedure or is used by the in-vehicle component to directly enter an upgrade state.
17 . The apparatus according to claim 15 , wherein the transceiver is configured to receive a second instruction that indicates to check a speed and a gear state of a vehicle.
18 . The apparatus according to claim 15 , wherein
the transceiver is configured to receive an upgrade package corresponding to the upgrade task; and
the processor is configured to upgrade the in-vehicle component based on the information about the upgrade strategy and the upgrade package.
19 . The apparatus according to claim 15 , wherein the processor is configured to upgrade the in-vehicle component based on the information about the upgrade strategy and a local upgrade package of a vehicle corresponding to the in-vehicle component.
20 . The apparatus according to claim 15 , wherein the processor is configured to:
verify a signature of the task information based on a first certificate of a vehicle corresponding to the in-vehicle component; and
determine that signature verification of the task information is successful.