Firmware updating method and program of fast charging device, fast charging device and storage medium

By performing initialization and legitimacy verification when the fast charging device is powered on and running, and using the blockchain network to verify the firmware update program, the security risks of firmware updates in the existing technology are solved, the safe update of fast charging devices is achieved, and the scope of use of their fast charging function is expanded.

CN120653284APending Publication Date: 2025-09-16TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510722822.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2020-04-15
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

Existing firmware update solutions for fast-charging devices pose security risks, which may allow malicious attackers to flash modified firmware programs, causing the charging device to malfunction and cause permanent electrical damage to the charged device.

Method used

When the fast charging device is powered on, the initialization process is executed, the firmware update signal is detected and the legitimacy and validity are checked. The firmware update program is verified through the blockchain network to ensure its legitimacy and validity before the update is performed. The boot loader code is used for security testing and signature authentication to prevent the influence of malicious firmware programs.

Benefits of technology

It achieves secure updates of fast-charging device firmware, prevents malicious firmware from affecting the device, ensures safe use by users, and expands the scope of use of the firmware's fast-charging function.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653284A_ABST
    Figure CN120653284A_ABST
Patent Text Reader

Abstract

The invention provides a firmware updating method for fast charging equipment, which comprises the following steps: when the fast charging equipment or firmware thereof is powered on and runs, executing an initialization process matched with the firmware of the fast charging equipment; in response to the firmware updating instruction, receiving and storing a firmware updating program to be updated; carrying out legality verification and validity detection on the firmware updating program; when the firmware updating program passes validity verification and validity detection, writing and updating processing of the firmware updating program is executed, a chip of the fast charging device comprises a boot loader code used for executing a fast charging function and a fast charging device function code, and the boot loader code and the fast charging device function code are used for executing the fast charging function. The boot loader code and the quick charging device function code are programmed into the chip through the boot loader development board. The invention further provides a firmware updating program, fast charging equipment and a storage medium. According to the method and the device, the firmware of the quick-charging equipment can be updated in time, the influence of malicious firmware programs on the quick-charging equipment is prevented, and the safe use of the quick-charging equipment of a user is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of a patent application with an application date of April 15, 2020, Chinese patent application number 202010296159.8, and invention name “Firmware update method, program, fast charging device and storage medium for fast charging device”. Technical Field

[0002] The present invention relates to fast charging technology, and in particular to a firmware update method and program for a fast charging device, a fast charging device processor, a fast charging device, and a storage medium. Background Art

[0003] With the continuous development of fast charging technology, fast charging functions are increasingly being used in various electronic devices (referred to as fast charging devices). However, in the related art, existing fast charging device firmware updates have design flaws that may lead to security issues with fast charging devices. For example, these existing firmware update solutions cannot guarantee that a malicious attacker can flash their modified firmware program and cause abnormal operation of the charging device through the maliciously modified firmware program, causing permanent electrical damage to the charged device.

[0004] Since these firmware update implementation schemes all have security risks and will pose a security threat to devices using the fast charging protocol, it is necessary to propose a new firmware update method to solve the previous security issues, so that the flashed firmware cannot be counterfeited and modified, and solve the hardware damage defects caused by firmware software security. Summary of the Invention

[0005] In view of this, the embodiments of the present invention provide a firmware update method, program, fast charging device processor, fast charging device and storage medium for a fast charging device, which can realize the legitimacy verification and validity detection of the firmware update program during the firmware processing of the fast charging device, and support the fast charging function of the firmware, expand the safe use scope of the fast charging function of the firmware of the fast charging device, ensure the timely update of the firmware of the fast charging device, prevent malicious firmware programs from affecting the fast charging device, and ensure the safe use of the user's fast charging device.

[0006] The technical solution of the embodiment of the present invention is achieved as follows:

[0007] An embodiment of the present invention provides a method for updating firmware of a fast charging device, comprising:

[0008] When the fast charging device or its firmware is powered on, an initialization process matching the firmware of the fast charging device is executed;

[0009] Detecting a firmware update signal for the fast charging device, and outputting an inquiry prompt message asking whether to perform a firmware update when the firmware update signal is detected;

[0010] In response to the firmware update instruction, starting a firmware update process for the fast charging device;

[0011] receiving and storing a firmware update program to be updated;

[0012] Performing a legality check and validity test on the firmware update program;

[0013] When the firmware update program passes the legality check and validity detection, the writing and updating process of the firmware update program is executed.

[0014] In the above solution, the method further includes:

[0015] The identification of the fast charging device, the boot loader code, the firmware update information, and the fast charging protocol information are sent to the blockchain network so that

[0016] The nodes of the blockchain network fill the identification of the fast charging device, the boot loader code, firmware update information, and fast charging protocol information into a new block, and when consensus is reached on the new block, the new block is appended to the end of the blockchain.

[0017] In the above solution, the method further includes:

[0018] Receiving data synchronization requests from other nodes in the blockchain network;

[0019] In response to the data synchronization request, verifying the authority of the other nodes;

[0020] When the authority of the other nodes is verified, data synchronization is controlled between the current node and the other nodes to enable the other nodes to obtain the identification of the fast charging device, the boot loader code, firmware update information, and fast charging protocol information.

[0021] In the above solution, the method further includes:

[0022] In response to the query request, parsing the query request to obtain a corresponding user identifier;

[0023] Obtaining permission information within a target block in the blockchain network based on the user identifier;

[0024] Verifying the matching between the permission information and the user identification;

[0025] When the permission information matches the user identifier, obtaining the corresponding identifier of the fast charging device, the boot loader code, firmware update information, and fast charging protocol information in the blockchain network;

[0026] In response to the query request, the obtained identification of the corresponding fast charging device, the boot loader code, firmware update information, and fast charging protocol information are pushed to the corresponding client, so that the client can obtain the identification of the corresponding fast charging device, the boot loader code, firmware update information, and fast charging protocol information stored in the blockchain network.

[0027] An embodiment of the present invention further provides a firmware update program for a fast charging device, including:

[0028] A hardware initialization module, configured to execute an initialization process that matches the firmware of the fast charging device when the fast charging device or its firmware is powered on and running;

[0029] A firmware update signal detection module, configured to detect a firmware update signal for the fast charging device and output a query prompt message asking whether to perform a firmware update when the firmware update signal is detected;

[0030] A firmware update triggering module, configured to initiate a firmware update process for the fast charging device in response to a firmware update instruction;

[0031] A firmware update storage module, configured to receive and store a firmware update program to be updated;

[0032] A legitimacy verification and inspection module, configured to perform legitimacy verification and validity inspection on the firmware update program;

[0033] The program writing and updating module is used to execute the writing and updating process of the firmware updating program when the firmware updating program passes the legality check and the validity check.

[0034] In the above solution, the legitimacy verification and inspection module is used to sign and verify the firmware update program using a public-private key data signature algorithm.

[0035] In the above scheme, the program writing and updating module is used to clear the firmware update program or firmware update status when the firmware update program fails to pass the legality check and validity test, and restart the fast charging device to execute the fast charging function of the original firmware of the fast charging device.

[0036] In the above solution, the device further comprises:

[0037] The fast charging function module is used to execute the fast charging function of the fast charging device after completing the detection of the firmware update signal for the fast charging device and when the firmware update signal is not detected.

[0038] In the above scheme,

[0039] The fast charging function module is used to read the fast charging function code from the chip or storage medium of the fast charging device; wherein the chip or storage medium is pre-burned or stored with the boot loader code for executing the fast charging function;

[0040] Performing a credibility verification process on the fast charging function code;

[0041] After the fast charging function code passes the trustworthy verification process, the fast charging function of the fast charging device is executed.

[0042] In the above scheme,

[0043] The fast charging function module is configured to, when the fast charging device is an adapter, send a download request to a corresponding storage device according to the software storage path of the adapter, wherein the download request includes the software identifier of the adapter with the fast charging function;

[0044] Receive the fast charging function code compatible with the adapter issued by the storage device according to the software identifier of the adapter.

[0045] In the above scheme,

[0046] The legitimacy verification and inspection module is used to detect the fast charging function code of the fast charging device through the signature authentication algorithm carried by the boot loader code;

[0047] When the fast charging function code fails to pass the trustworthy verification process, the fast charging function of the fast charging device is stopped and an alarm is issued through the fast charging device.

[0048] In the above solution, the device further comprises:

[0049] A software editing module for writing bootloader code with signature verification;

[0050] Writing a fast charging device function code for implementing a fast charging function on the fast charging device;

[0051] Flash the prepared bootloader code with signature verification function and fast charging device function code to the development board to obtain a flashed bootloader development board;

[0052] Testing the signature verification function and the fast charging device function of the boot loader development board after the flashing process;

[0053] Burn the tested and functioning boot loader code with signature verification function into the chip;

[0054] Performing storage area locking processing on the boot loader code with signature verification function;

[0055] Burn the tested and functioning fast charging device function code into the chip.

[0056] In the above scheme,

[0057] The software editing module is used to determine the storage location of the boot loader code with signature verification function in the storage medium of the firmware of the fast charging device;

[0058] Adapting storage medium parameters of the storage location to adjust readability of the storage medium of the storage location;

[0059] The storage area of ​​the storage medium at the storage location is locked by a programmer to achieve read-only status of the storage area.

[0060] In the above scheme,

[0061] The software editing module is configured to adjust the type of signature authentication algorithm carried by the boot loader code according to the version information of the fast charging device function code of the firmware of the fast charging device; or

[0062] According to the usage environment of the fast charging device, the type of signature authentication algorithm carried by the boot loader code is adjusted.

[0063] An embodiment of the present invention also provides a fast charging device processor, which is connected to a memory. The memory stores multiple executable instructions. When the multiple executable instructions are executed, the processor executes the previous fast charging device firmware update method.

[0064] An embodiment of the present invention further provides a fast charging device, comprising:

[0065] A memory for storing executable instructions; wherein the executable instructions include a fast charging device boot loader;

[0066] The processor is used to implement the firmware update method of the fast charging device described above when running the executable instructions stored in the memory.

[0067] An embodiment of the present invention also provides a computer-readable storage medium storing executable instructions, characterized in that when the executable instructions are executed by a processor, a firmware update method for a previous fast charging device, or a firmware update method for a previous fast charging device.

[0068] The embodiments of the present invention have the following beneficial effects:

[0069] The embodiment of the present invention performs an initialization process that matches the firmware of the fast charging device when the fast charging device or its firmware is powered on; outputs a query prompt message on whether to perform a firmware update when the firmware update signal is detected; initiates a firmware update process for the fast charging device in response to a firmware update instruction; receives and stores a firmware update program to be updated; and executes a write and update process of the firmware update program when the firmware update program passes the legality check and validity check. In this way, it is possible to fully utilize the boot loader code in the preparation process of the fast charging device boot loader to support the fast charging function of the electronic device, expand the scope of use of the fast charging function of the firmware of the fast charging device, ensure timely update of the firmware of the fast charging device, prevent malicious firmware programs from affecting the fast charging device, and ensure the safe use of the user's fast charging device. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 A schematic diagram of a usage scenario of the firmware update method for a fast charging device provided by an embodiment of the present invention;

[0071] Figure 2 A schematic diagram of the structure of a fast charging device provided in an embodiment of the present invention;

[0072] Figure 3 An optional flowchart of a method for updating the firmware of a fast charging device provided in an embodiment of the present invention;

[0073] Figure 4 An optional flowchart of a method for updating the firmware of a fast charging device provided in an embodiment of the present invention;

[0074] Figure 5 An optional flowchart of a method for updating the firmware of a fast-charging electric vehicle provided by an embodiment of the present invention;

[0075] Figure 6 This is a schematic diagram of the architecture of a fast charging device preparation process processing device provided by an embodiment of the present invention;

[0076] Figure 7 This is a schematic diagram of the structure of a blockchain in a blockchain network provided by an embodiment of the present invention;

[0077] Figure 8 This is a schematic diagram of the functional architecture of the blockchain network provided by an embodiment of the present invention;

[0078] Figure 9 An optional flowchart of a method for updating the firmware of a fast charging device provided in an embodiment of the present invention;

[0079] Figure 10 An optional flowchart of a firmware update method for a fast charging device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0080] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting the present invention. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0081] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0082] Before further explaining the embodiments of the present invention in detail, the nouns and terms involved in the embodiments of the present invention are explained. The nouns and terms involved in the embodiments of the present invention are subject to the following interpretations.

[0083] 1) Fast Charging Technology: This refers to charging technologies based on USB Type-C, USB Type-C ports, and Lightning connectors, primarily used to quickly charge and / or power devices. This technology is commonly used in lithium-ion battery-powered devices such as laptops and mobile phones. It can quickly charge devices or provide high-power power.

[0084] 2) Fast charging protocol: It is the core of fast charging technology and specifies a set of protocols for negotiating power supply between power supply equipment and powered equipment.

[0085] 3) Firmware: It is the code running inside the chip, which is the binary code used to implement the fast charging protocol.

[0086] 4)USB: Universal Serial Bus, is currently the most commonly used external device interface.

[0087] 5) Type-C: A type of USB interface with more pins and can carry more functions. Fast charging protocols are usually based on this interface for communication.

[0088] 6) PD protocol: short for Power Delivery protocol, is a fast charging protocol designed, developed and announced by the USB organization. It supports DC power supply capacity up to 100W and supports data transmission.

[0089] 7) VDM PD: Messages used to transmit data in the protocol, divided into two types: SVDM and UVDM.

[0090] 8) Public Key Digital Signature Technology: This technology uses public key cryptography to encrypt data. Data encrypted with a private key can be decrypted with a public key. The data can be verified but cannot be tampered with. This signature technology has been mathematically proven to be secure.

[0091] 9) Boot loader code: Also known as boot loader, boot mode, startup loader, etc., refers to a code that runs when the chip starts up. It is usually used to initialize the hardware environment and load the firmware running code. Usually it does not need to be updated.

[0092] 10) In response to: used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed can be in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations executed are executed.

[0093] 11) Transaction: Equivalent to the computer term "transaction," a transaction includes operations that need to be submitted to a blockchain network for execution. It does not refer solely to transactions in a business context. Given the conventional use of the term "transaction" in blockchain technology, the embodiments of the present invention follow this convention.

[0094] For example, the Deploy transaction is used to install a specified smart contract to a node in the blockchain network and prepare it to be called; the Invoke transaction is used to append transaction records to the blockchain by calling a smart contract and perform operations on the blockchain's state database, including update operations (including adding, deleting, and modifying key-value pairs in the state database) and query operations (i.e., querying key-value pairs in the state database).

[0095] 12) Blockchain: It is an encrypted, chained transaction storage structure formed by blocks.

[0096] For example, the header of each block can include the hash value of all transactions in the block, as well as the hash value of all transactions in the previous block, thereby achieving tamper-proof and anti-forgery of transactions in the block based on the hash value; newly generated transactions are filled into the block and, after consensus among nodes in the blockchain network, will be appended to the end of the blockchain to form a chain-like growth.

[0097] 13) Blockchain Network: A collection of nodes that incorporate new blocks into the blockchain through consensus.

[0098] 14) Ledger: A general term for the blockchain (also known as ledger data) and the state database synchronized with the blockchain.

[0099] Among them, the blockchain records transactions in the form of files in the file system; the state database records transactions in the blockchain in the form of different types of key (Key) value (Value) pairs to support fast queries on transactions in the blockchain.

[0100] 15) Smart Contracts: Also known as chain code or application code, they are programs deployed on nodes in a blockchain network. Nodes execute smart contracts invoked in received transactions to update or query key-value pairs in the ledger database.

[0101] 16) Consensus: It is a process in a blockchain network used to reach agreement on transactions in a block among multiple nodes involved. The agreed blocks will be appended to the end of the blockchain. Mechanisms for achieving consensus include Proof of Work (PoW), Proof of Stake (PoS), Delegated Proof-of-Stake (DPoS), Proof of Elapsed Time (PoET), etc.

[0102] Figure 1 Schematic diagram of the use scenario of the method for updating the firmware of a fast charging device provided by an embodiment of the present invention, see Figure 1, the terminal (including the fast charging device 10-1 and the adapter 10-2 with a fast charging function) is provided with different firmware capable of executing the fast charging function, wherein the fast charging device 10-1 can obtain different firmware update programs from the corresponding server 200 through the network 300, and the adapter 10-2 with a fast charging function can obtain different firmware update programs by replacing different storage media, wherein the network 300 is connected to the server 200, and the network 300 can be a wide area network or a local area network, or a combination of the two, using a wireless link to realize data transmission. Specifically, the terminal 10-1 as a fast charging device and the adapter 10-2 with a fast charging function can include different firmware and can support different versions of the fast charging protocol to realize the fast charging function. For example, the target function of the firmware of the electronic device in the terminal 10-1 can be fast charging, then the target function of the firmware also determines that the electronic device in 10-1 (such as a mobile phone or a laptop computer) is an electronic device with a fast charging function and can support 50W current charging; similarly, the electronic device in 10-2 can also be an electronic device with a fast charging function (such as an electric energy vehicle with a fast charging function) and can support 380W current charging. Different electronic device firmware also determines that the corresponding boot loading code is different. Specifically, the firmware update method of the fast charging device includes: when the fast charging device or its firmware is powered on, executing the initialization process that matches the firmware of the fast charging device; detecting the firmware update signal for the fast charging device, and outputting the inquiry prompt information whether to perform the firmware update when the firmware update signal is detected; in response to the firmware update instruction, starting the firmware update process for the fast charging device; receiving and storing the firmware update program to be updated; performing the legitimacy check and validity check on the firmware update program; when the firmware update program passes the legitimacy check and validity check, executing the writing and update processing of the firmware update program.

[0103] The structure of the fast charging device according to the embodiment of the present invention is described in detail below. The fast charging device can be implemented in various forms. Figure 2 The schematic diagram of the structure of the fast charging device provided in the embodiment of the present invention can be understood as follows: Figure 2 Only the exemplary structure of the fast charging device is shown, not all structures, and can be implemented as needed. Figure 2 Partial or complete structure shown.

[0104] The fast charging device provided in the embodiment of the present invention includes: at least one processor 201, a memory 202, a user interface 203 and at least one charging interface 204. The various components in the fast charging device are coupled together through a bus system 205. It can be understood that the bus system 205 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 205 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 2 Various buses are labeled as bus system 205.

[0105] The user interface 203 may include a display, a keyboard, a mouse, a trackball, a click wheel, keys, buttons, a touch pad or a touch screen.

[0106] It is understood that the memory 202 can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. The memory 202 in the embodiment of the present invention can store data to support the operation of the terminal (such as 10-1). Examples of such data include: any computer program used to operate on the terminal (such as 10-1), such as an operating system and an application program. Among them, the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application program can include various application programs.

[0107] In some embodiments, the firmware processing device of the fast charging device provided by the embodiment of the present invention can be implemented in a combination of software and hardware. As an example, the fast charging device provided by the embodiment of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the firmware update method of the fast charging device provided by the embodiment of the present invention. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), or other electronic components.

[0108] As an example of a fast charging device provided by an embodiment of the present invention being implemented by a combination of software and hardware, the fast charging device provided by an embodiment of the present invention can be directly embodied as a combination of software modules executed by a processor 201. The software module can be located in a storage medium, and the storage medium is located in the memory 202. The processor 201 reads the executable instructions included in the software module in the memory 202, and combines with the necessary hardware (for example, including the processor 201 and other components connected to the bus 205) to complete the firmware update method for the fast charging device provided by an embodiment of the present invention.

[0109] As an example, the processor 201 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0110] As an example of hardware implementation of the fast charging device provided in an embodiment of the present invention, the device provided in an embodiment of the present invention can be directly executed by a processor 201 in the form of a hardware decoding processor. For example, it can be executed by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components to implement the firmware update method of the fast charging device provided in an embodiment of the present invention.

[0111] The memory 202 in the embodiment of the present invention is used to store various types of data to support the operation of the fast charging device. Examples of such data include any executable instructions for operating on the fast charging device, such as executable instructions. The program implementing the firmware update method from the fast charging device in the embodiment of the present invention may be included in the executable instructions.

[0112] In other embodiments, the fast charging device provided by the embodiments of the present invention can be implemented in software. Figure 2 The fast charging device stored in the memory 202 is shown. The fast charging device may be software in the form of a program and a plug-in, and may include a series of modules. As an example of a program stored in the memory 202, a firmware update program for the fast charging device may be included. The firmware update program for the fast charging device includes the following software modules:

[0113] The hardware initialization module 2081 is used to execute an initialization process that matches the firmware of the fast charging device when the fast charging device or its firmware is powered on and running;

[0114] A firmware update signal detection module 2082 is configured to detect a firmware update signal for the fast charging device and output a query prompt message asking whether to perform a firmware update when the firmware update signal is detected;

[0115] A firmware update triggering module 2083 is configured to initiate a firmware update process for the fast charging device in response to a firmware update instruction;

[0116] The firmware update storage module 2084 is used to receive and store the firmware update program to be updated;

[0117] The validity verification and inspection module 2085 is used to perform validity verification and effectiveness inspection on the firmware update program;

[0118] The program writing and updating module 2086 is used to execute the writing and updating process of the firmware updating program when the firmware updating program passes the legality check and validity detection.

[0119] Combine Figure 2 Continuing to explain the firmware update method of the fast charging device provided by the embodiment of the present invention, see Figure 3 , Figure 3 An optional flow chart of the firmware update method for a fast charging device provided by an embodiment of the present invention is provided. It can be understood that: Figure 3 The steps shown can be performed by a fast charging device. Figure 3 The steps shown are explained.

[0120] Step 301: When the fast charging device or its firmware is powered on, an initialization process matching the firmware of the fast charging device is executed.

[0121] Among them, when the user uses the fast charging device, since the firmware version may have been updated, when the fast charging device is powered on, an initialization process that matches the firmware of the fast charging device can be executed; similarly, in the factory, after the circuit board of the fast charging device is produced, it enters the factory testing process, and usually the corresponding firmware is installed at the first workstation. The main purpose of this firmware is for factory testing, verification and calibration. Test and verify the various electrical performances of the circuit board and the assembled electronic device, calibrate the radio frequency parameters and the parameters of various sensors, so when the firmware is powered on, an initialization process that matches the firmware of the fast charging device can also be executed.

[0122] Step 302: Detect a firmware update signal for the fast charging device, and output an inquiry prompt message asking whether to perform a firmware update when the firmware update signal is detected.

[0123] Step 303: In response to the firmware update instruction, start a firmware update process for the fast charging device.

[0124] Step 304: Receive and store the firmware update program to be updated.

[0125] Specifically, the firmware update program to be updated is received and stored, and can be adjusted differently according to the different usage environments of the fast charging device. For example, the firmware can be obtained and updated from a dedicated wireless network and a server where the firmware is stored through the over-the-air technology OTA (Over-the-Air Technology); or the firmware of the fast charging device can be updated during the production process by setting hidden contacts on the casing of the electronic device.

[0126] Step 305: Performing a legality check and validity check on the firmware update program.

[0127] In some embodiments of the present invention, the validity check and effectiveness detection of the firmware update program can be implemented in the following ways:

[0128] The firmware update program is signed and verified using a public-private key data signature algorithm. The signature algorithm can be either the asymmetric RSA algorithm or the ECDSA algorithm. If the asymmetric RSA algorithm is selected, asymmetric encryption algorithms of 1024 bits or higher can be prioritized based on the usage environment of the fast charging device.

[0129] Step 306: When the firmware update program passes the legality check and validity detection, the firmware update program is written and updated.

[0130] Among them, a backup partition is set in the memory of the fast charging device. The size of the partition can be based on the size of the firmware to be updated in the future (a certain amount of space is reserved to prevent the backup partition from being too small to accommodate the new firmware during subsequent OTA). The old version of the firmware of the fast charging device is packaged into the initial firmware. When the write and update process of the firmware update program is executed, the updated firmware is flashed to the backup partition of the memory. Furthermore, each version of the firmware can be configured with a version number. When a new version of the firmware needs to execute the write and update process of the firmware update program later, the version number of the new user firmware needs to be newer than the version number of the current user firmware to ensure the firmware working efficiency of the fast charging device.

[0131] In some embodiments of the present invention, the method further comprises:

[0132] When the firmware update program fails the legality check and validity check, the firmware update program or the firmware update status is cleared, and the fast charging device is restarted to execute the fast charging function of the original firmware of the fast charging device. When the fast charging function of the fast charging device is executed, the fast charging device can be charged with a first current through the charging interface of the fast charging device.

[0133] In which, the first current matches the fast charging protocol supported by the fast charging device. For example, the fast charging protocol version can support 50W and 100W fast charging respectively to adapt to fast charging devices with different power, or the fast charging device is charged with a second current through the charging interface of the fast charging device, wherein the second current matches the type of the fast charging device. For example, the firmware of the electric vehicle supports fast charging of the electric vehicle as a fast charging device at a power of 380W.

[0134] In some embodiments of the present invention, the method further comprises:

[0135] When the firmware of the fast charging device supports the fast charging function, the boot loader code is a boot loader code that carries a signature authentication algorithm function to detect the security of the firmware of the fast charging device before the fast charging function is triggered. Figure 1 In the usage environment shown, as a fast charging device, it can include different firmware, and the fast charging protocols supported by the firmware can also be different. For example, the fast charging function of the firmware of a fast charging device can be a fast charging protocol with a power of 380W, or it can only support a fast charging protocol of 50W. Different fast charging device firmwares also determine that the corresponding boot loader codes are different. By testing the firmware security of the fast charging device through the boot loader code, the safe operation of the fast charging device can be effectively guaranteed.

[0136] Combine Figure 2 Continuing to explain the firmware update method of the fast charging device provided by the embodiment of the present invention, see Figure 4 , Figure 4 An optional flow chart of the firmware update method for a fast charging device provided by an embodiment of the present invention is provided. It can be understood that: Figure 4 The steps shown can be performed by a fast charging device to achieve the preparation of the fast charging device provided by the present invention. Figure 4 The steps shown are explained.

[0137] Step 401: Write a boot loader code with a signature verification function.

[0138] The bootloader is the code that allows the user application code to be updated. The new code can be obtained using an alternative download channel, such as a USB memory stick or a network port. After the boot ROM executes, the bootloader executes and performs updates if necessary, followed by the end-user application.

[0139] Specifically, the bootloader consists of many parts, including the splash screen. To start booting, the bootloader may flash a new image directly to the appropriate partitions, or it may use recovery to start a re-flashing process, which is consistent with the OTA operation process. Some device manufacturers create multi-part bootloaders and then combine them into a single bootloader.img file. During flashing, the bootloader extracts the individual bootloaders and flashes all of them. At the same time, the bootloader verifies the integrity of the boot and recovery partitions before moving execution to the kernel and displays the warnings specified in the Boot Status section.

[0140] Step 402: Write a fast charging device function code for implementing a fast charging function for the fast charging device.

[0141] The fast charging device function code for executing the fast charging function can realize charging the fast charging device with a first current through the charging interface of the fast charging device, wherein the first current matches the fast charging protocol supported by the fast charging device (such as the mobile phone fast charging protocol); or

[0142] The fast charging device is charged with a second current through the charging interface of the fast charging device, wherein the second current matches the type of the fast charging device (such as an electric vehicle).

[0143] Step 403: The compiled boot loader code with signature verification function and the fast charging device function code are flashed on the development board to obtain a flashed boot loader development board.

[0144] Step 404: Testing the signature verification function and the fast charging device function of the boot loader development board after the flashing process.

[0145] Step 405: Burn the tested and functioning boot loader program code with signature verification function into the chip.

[0146] Step 406: Lock the storage area of ​​the boot loader program code with signature verification function.

[0147] In some embodiments of the present invention, the storage area locking process of the boot loader code with signature verification function can be implemented in the following manner:

[0148] Determine the storage location of the boot loader code with signature verification function in the storage medium of the firmware of the fast charging device; adapt the storage medium parameters of the storage location to adjust the readability of the storage medium of the storage location; lock the storage area of ​​the storage medium of the storage location through the programmer to achieve read-only nature of the storage area. Among them, by adapting the storage medium parameters of the storage location and adjusting the readability of the storage medium of the storage location, it can be ensured that the storage area where the boot loader code is located is set to "not writable again" and at the same time turn on the protection that the code cannot be read to the outside (the protection form of this protection is different in different chips, such as STM32's Read Out Protection). This step can ensure that the code will not be updated and overwritten by people other than the manufacturer.

[0149] Step 407: Burn the tested and normally functioning fast charging device function code into the chip.

[0150] In some embodiments of the present invention, the method further comprises:

[0151] The type of signature authentication algorithm carried by the bootloader code is adjusted based on the version information of the fast charging device function code in the firmware of the fast charging device; or the type of signature authentication algorithm carried by the bootloader code is adjusted based on the usage environment of the fast charging device. In this way, the diversity of signature authentication algorithms carried by the bootloader code can be effectively expanded and adapted to the usage environment of the fast charging device, avoiding the mismatch between the signature authentication algorithm carried by the bootloader code and the version information of the fast charging device function code in the firmware of the fast charging device, which may affect the normal use of the user.

[0152] In some embodiments of the present invention, the method further comprises:

[0153] According to the software storage path of the fast charging device, a download request is sent to the corresponding storage device, and the download request includes the software identification of the fast charging device; and the software of the fast charging device issued by the storage device according to the software identification of the fast charging device is received. Specifically, different transmission channels can be established between the fast charging device and the storage device based on the type of the adapter; and the data issued by the storage device according to the software identification of the fast charging device is received respectively through multiple downstream ports of the different transmission channels. Among them, when the fast charging device with fast charging function is mass-produced in the production line, a transmission channel can be selected and different transmission protocols (such as FTP protocol) can be used to download the firmware and configuration data of the corresponding fast charging device issued according to the software identification of the fast charging device from the transmission device, and a download request with the physical address and software identification of the fast charging device is sent to the storage device through the second transmission channel. In this way, the software data and physical address, software identification, etc. of the fast charging device are divided into two transmission channels for transmission, thereby improving efficiency; and / or, a network switching device is used to collect the software data issued by the storage device according to the software identification of the fast charging device based on the multiple transmission channels established.

[0154] Continue to combine Figure 2 , describes the firmware update method of the fast charging device provided by the embodiment of the present invention, see Figure 5 , Figure 5 An optional flow chart of the method for updating the firmware of a fast-charging electric vehicle provided by an embodiment of the present invention is provided. It can be understood that: Figure 5 The steps shown can be performed by an electric vehicle running the firmware updater for the fast charging device. Figure 5 The steps shown are explained.

[0155] Step 501: The firmware of the fast-charging electric vehicle is powered on and runs to perform an initialization process.

[0156] Among them, the firmware of the fast-charging electric vehicle is located in the on-board computer of the electric vehicle with fast-charging function to detect the charging and power consumption process of the electric vehicle. At the same time, it can also obtain the firmware version information in the blockchain network for firmware updates.

[0157] Step 502: In response to the initialization process, trigger the boot loader code carried by the firmware based on the firmware update signal.

[0158] Step 503: Based on the boot loader code, the firmware security of the fast-charging electric vehicle is tested to determine whether it passes the test. If so, step 504 is executed; otherwise, step 505 is executed.

[0159] Step 504: Execute a fast charging function with a power of 380W that matches the fast charging electric vehicle.

[0160] Step 505: Refuse to execute the fast charging function and trigger an alarm.

[0161] In some embodiments of the present invention, the firmware security of the fast charging device is detected based on the boot loader code, including:

[0162] When the firmware of the fast charging device needs to be updated, the update information of the firmware is verified by the signature authentication algorithm carried by the boot loader code; based on the verification result of the firmware update information, the firmware of the fast charging device is updated; or, the firmware update information of the fast charging device is deleted, and the firmware of the fast charging device is restarted. Among them, if the content that needs to be updated in the firmware of the fast charging device is obtained through informal channels, or carries dangerous information, since it will have an adverse effect on the fast charging function of the firmware of the fast charging device, verifying the update information of the firmware by the signature authentication algorithm carried by the boot loader code can effectively ensure the safe operation of the fast charging device.

[0163] In some embodiments of the present invention, the method further comprises:

[0164] When the boot loader code fails to detect the firmware update information of the fast charging device, the real-time firmware code of the firmware of the fast charging device is detected through the signature authentication algorithm carried by the boot loader code; based on the inspection result of the real-time firmware code of the firmware of the fast charging device, the fast charging function of the firmware of the fast charging device is executed; or, the execution of the fast charging function of the firmware of the fast charging device is stopped, and an alarm is issued through the fast charging device.

[0165] The embodiments of the present invention may be implemented in conjunction with cloud technology or blockchain network technology. Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network or local area network to achieve data computing, storage, processing, and sharing. It can also be understood as a general term for network technology, information technology, integration technology, management platform technology, and application technology based on cloud computing business models. The backend services of technical network systems require a large amount of computing and storage resources, such as video websites, image websites, and more portal websites. Therefore, cloud technology needs to be supported by cloud computing.

[0166] It should be noted that cloud computing is a computing model that distributes computing tasks across a resource pool consisting of a large number of computers, enabling various application systems to obtain computing power, storage space, and information services as needed. The network that provides these resources is called the "cloud." To users, the resources in the "cloud" appear to be infinitely scalable and can be accessed at any time, used on demand, and expanded at any time, with a pay-per-use fee. As a provider of cloud computing's basic capabilities, a cloud computing resource pool platform, often referred to as Infrastructure as a Service (IaaS), is established. Various types of virtual resources are deployed within the resource pool for external customers to choose from. The cloud computing resource pool primarily includes computing devices (which can be virtualized machines, including operating systems), storage devices, and network devices.

[0167] See also Figure 6 , Figure 6 It is a schematic diagram of the architecture of the fast charging device preparation process processing device provided by an embodiment of the present invention, including a blockchain network 200 (consensus nodes 210-1 to consensus nodes 210-3 are exemplarily shown), an authentication center 300, a business entity 400 and a business entity 500, which are described below respectively.

[0168] The types of blockchain network 200 are flexible and diverse, and can be, for example, any of a public chain, a private chain, or a consortium chain. Taking a public chain as an example, any business entity's fast-charging devices, such as user terminals and servers, can access blockchain network 200 without authorization. Taking a consortium chain as an example, a business entity can access blockchain network 200 after obtaining authorization, and its subordinate fast-charging devices (such as terminals / servers) can then become client nodes in blockchain network 200.

[0169] In some embodiments, client nodes may only serve as observers of blockchain network 200, providing support for business entities to initiate transactions (e.g., storing data on-chain or querying on-chain data). Client nodes may implement the functions of consensus node 210 of blockchain network 200, such as sorting, consensus services, and ledger functions, by default or selectively (e.g., depending on the specific business needs of the business entity). This allows the business entity's data and business processing logic to be migrated to blockchain network 200 to the greatest extent possible, ensuring the trustworthiness and traceability of data and business processing processes through blockchain network 200.

[0170] The consensus nodes in the blockchain network 200 receive data from different business entities (e.g. Figure 1 4 and 500) of the client nodes (eg, Figure 1The client node 410 belonging to the business entity 400 and the client node 510 belonging to the business entity 500 of the fast charging device) submit transactions, execute transactions to update the ledger or query the ledger, and various intermediate results or final results of the transaction can be returned to the client node of the business entity for display.

[0171] For example, the client node 410 / 510 can subscribe to events of interest in the blockchain network 200, such as transactions occurring in a specific organization / channel in the blockchain network 200, and the consensus node 210 pushes the corresponding transaction notification to the client node 410 / 510, thereby triggering the corresponding business logic in the client node 410 / 510.

[0172] The following uses an example of multiple business entities accessing a blockchain network to implement the preparation process of the fast charging device and the management of the production plan of the fast charging device to illustrate an exemplary application of the blockchain network.

[0173] See also Figure 6 , multiple business entities involved in the management link, such as business entity 400, which can be an artificial intelligence-based fast charging device preparation process processing device, and business entity 500, which can be a display system with a fast charging device firmware update function. They register with the authentication center 300 to obtain their respective digital certificates. The digital certificate includes the public key of the business entity and the digital signature signed by the authentication center 300 on the public key and identity information of the business entity. It is used to attach to the transaction together with the digital signature of the business entity for the transaction and is sent to the blockchain network so that the blockchain network can extract the digital certificate and signature from the transaction, verify the reliability of the message (that is, whether it has not been tampered with) and the identity information of the business entity that sent the message. The blockchain network will verify based on the identity, such as whether it has the authority to initiate a transaction. The clients running on the fast charging devices (such as terminals or servers) under the jurisdiction of the business entity can request access to the blockchain network 200 and become client nodes.

[0174] The client node 410 of the business entity 400 is used to execute an initialization process that matches the firmware of the fast charging device when the fast charging device or its firmware is powered on; detect a firmware update signal for the fast charging device, and output an inquiry prompt message on whether to perform a firmware update when the firmware update signal is detected; start the firmware update process for the fast charging device in response to a firmware update instruction; receive and store the firmware update program to be updated; perform a legitimacy check and validity check on the firmware update program; when the firmware update program passes the legitimacy check and validity check, execute the writing and update processing of the firmware update program, and send the identification of the fast charging device, the boot loader code, the firmware update information, and the fast charging protocol information to the blockchain network 200.

[0175] Among them, the identification of the fast charging device, the boot loader code, the firmware update information, and the fast charging protocol information are sent to the blockchain network 200. The business logic can be set in advance in the client node 410. When the corresponding preparation process of the fast charging device and the production plan of the fast charging device are formed, the client node 410 automatically sends the identification of the fast charging device, the boot loader code, the firmware update information, and the fast charging protocol information to the blockchain network 200. The business personnel of the business entity 400 can also log in to the client node 410, manually package the identification of the fast charging device, the boot loader code, the firmware update information, and the fast charging protocol information, and send them to the blockchain network 200. When sending, the client node 410 generates a transaction corresponding to the update operation based on the identification of the fast charging device, the boot loader code, the firmware update information, and the fast charging protocol information. The transaction specifies the smart contract that needs to be called to implement the update operation and the parameters passed to the smart contract. The transaction also carries the digital certificate of the client node 410 and the signed digital signature (for example, the transaction summary is encrypted using the private key in the digital certificate of the client node 410), and broadcasts the transaction to the consensus node 210 in the blockchain network 200.

[0176] When consensus node 210 in blockchain network 200 receives a transaction, it verifies the digital certificate and digital signature carried in the transaction. If verification is successful, it then determines whether business entity 400 has transaction authority based on the identity of the business entity 400 carried in the transaction. Either of these verifications will result in transaction failure. After successful verification, node 210 signs its own digital signature (e.g., by encrypting the transaction digest using the private key of node 210-1) and continues to broadcast the transaction within blockchain network 200.

[0177] After receiving the successfully verified transaction, the consensus node 210 in the blockchain network 200 fills the transaction into a new block and broadcasts it. When the consensus node 210 in the blockchain network 200 broadcasts a new block, it will perform a consensus process on the new block. If the consensus is successful, the new block will be appended to the end of the blockchain stored by itself, and the state database will be updated according to the result of the transaction, and the transaction in the new block will be executed: for transactions that submit updates to the fast charging device identification, the boot loader code, the firmware update information, and the fast charging protocol information, a key-value pair including the fast charging device identification, the boot loader code, the firmware update information, and the fast charging protocol information will be added to the state database.

[0178] The business personnel of the business entity 500 logs in to the client node 510 and inputs the preparation process of the fast charging device and the production plan of the fast charging device or the virtual resource query request. The client node 510 generates a transaction corresponding to the update operation / query operation based on the preparation process of the fast charging device and the production plan of the fast charging device or the virtual resource query request. The transaction specifies the smart contract that needs to be called to implement the update operation / query operation and the parameters passed to the smart contract. The transaction also carries the digital certificate of the client node 510 and the signed digital signature (for example, the transaction summary is encrypted using the private key in the digital certificate of the client node 510), and broadcasts the transaction to the consensus node 210 in the blockchain network 200.

[0179] The consensus node 210 in the blockchain network 200 receives the transaction, verifies the transaction, fills the block and reaches consensus, then appends the filled new block to the end of the blockchain stored in itself, updates the status database according to the transaction result, and executes the transaction in the new block: for the transaction submitted to update the identification of a certain fast charging device, the boot loader code, firmware update information, and fast charging protocol information, the key-value pairs corresponding to the preparation process of the fast charging device and the production plan of the fast charging device in the status database are updated according to the manual identification results; for the transaction submitted to query the preparation process of a certain fast charging device and the production plan of the fast charging device, the key-value pairs corresponding to the preparation process of the fast charging device and the production plan of the fast charging device are queried from the status database, and the transaction results are returned.

[0180] It is worth noting that in Figure 6 The process of directly uploading the identification of the fast charging device, the boot loader code, the firmware update information, and the fast charging protocol information to the chain is exemplified in the figure. However, in other embodiments, for the case where the amount of data of the preparation process of the fast charging device and the production plan of the fast charging device is large, the client node 410 may upload the hash of the preparation process of the fast charging device and the production plan of the fast charging device and the corresponding hash of the preparation process of the fast charging device and the production plan of the fast charging device to the chain in pairs, and store the original preparation process of the fast charging device and the production plan of the fast charging device and the corresponding preparation process of the fast charging device and the production plan of the fast charging device in a distributed file system or database. After the client node 510 obtains the preparation process of the fast charging device and the production plan of the fast charging device and the corresponding preparation process of the fast charging device and the production plan of the fast charging device from the distributed file system or database, it can be verified in combination with the corresponding hash in the blockchain network 200, thereby reducing the workload of the uploading operation.

[0181] As an example of blockchain, see Figure 7 , Figure 7 This is a schematic diagram of the structure of the blockchain in the blockchain network 200 provided by an embodiment of the present invention. The header of each block can include the hash values ​​of all transactions in the block as well as the hash values ​​of all transactions in the previous block. The records of newly generated transactions are filled into the block and, after consensus among the nodes in the blockchain network, are appended to the end of the blockchain to form a chain growth. The chain structure between blocks based on hash values ​​ensures that transactions in the block are tamper-proof and anti-forgery.

[0182] The following describes an exemplary functional architecture of the blockchain network provided by an embodiment of the present invention. Figure 8 , Figure 8 2 is a functional architecture diagram of a blockchain network provided by an embodiment of the present invention, including an application layer 201, a consensus layer 202, a network layer 203, a data layer 204, and a resource layer 205, which are described below respectively.

[0183] The resource layer 205 encapsulates the computing resources, storage resources, and communication resources of each node 210 in the blockchain network 200.

[0184] The data layer 204 encapsulates various data structures that implement the ledger, including the blockchain implemented as files in the file system, the key-value state database, and the existence proof (such as the hash tree of transactions in the block).

[0185] The network layer 203 encapsulates the functions of point-to-point (P2P) network protocol, data transmission mechanism and data verification mechanism, access authentication mechanism and business subject identity management.

[0186] Among them, the P2P network protocol realizes the communication between the nodes 210 in the blockchain network 200, the data propagation mechanism ensures the propagation of transactions in the blockchain network 200, and the data verification mechanism is used to realize the reliability of data transmission between nodes 210 based on cryptographic methods (such as digital certificates, digital signatures, public / private key pairs); the access authentication mechanism is used to authenticate the identity of the business subject joining the blockchain network 200 according to the actual business scenario, and grant the business subject the right to access the blockchain network 200 when the authentication is passed; the business subject identity management is used to store the identity of the business subject allowed to access the blockchain network 200, and the authority (such as the type of transaction that can be initiated).

[0187] The consensus layer 202 encapsulates the mechanism by which nodes 210 in the blockchain network 200 reach consensus on blocks (i.e., the consensus mechanism), as well as transaction management and ledger management functions. Consensus mechanisms include consensus algorithms such as POS, POW, and DPOS, and support pluggable consensus algorithms.

[0188] Transaction management is used to verify the digital signature carried in the transaction received by the verification node 210, verify the identity information of the business subject, and determine whether it has the authority to conduct the transaction based on the identity information (read relevant information from the business subject identity management); for business subjects that have obtained authorization to access the blockchain network 200, they all have digital certificates issued by the certification center. The business subject uses the private key in its own digital certificate to sign the submitted transaction, thereby declaring its legal identity.

[0189] Ledger management is used to maintain the blockchain and state database. Consensus-reached blocks are appended to the end of the blockchain. Transactions in the consensus-reached blocks are executed. When the transaction includes an update operation, the key-value pairs in the state database are updated. When the transaction includes a query operation, the key-value pairs in the state database are queried and the query results are returned to the client node of the business entity. Multiple query operations on the state database are supported, including: querying blocks based on block vector numbers (e.g., transaction hash values); querying blocks based on block hash values; querying blocks based on transaction vector numbers; querying transactions based on transaction vector numbers; querying business entity account data based on their account numbers (vector numbers); and querying the blockchain in a channel based on the channel name.

[0190] The application layer 201 encapsulates various services that can be implemented by the blockchain network, including transaction traceability, evidence storage, and verification. Therefore, when a fast-charging device manufacturer switches to a different production line, by obtaining the fast-charging device's identifier, the boot loader code, firmware update information, and fast-charging protocol information from the blockchain network, it can quickly enter production and improve the production efficiency of fast-charging devices.

[0191] Next, continue to combine Figure 1 Taking the application environment of the fast charging function of electronic equipment as an example, the firmware update method of the fast charging device provided by the present invention is explained. Before introducing the fast charging device preparation process processing method provided by the present invention, the fast charging device in the related technology is first introduced. Fast charging is a new technology developed recently. It is currently very widespread in the field of mobile device charging. Corresponding to it are various complex fast charging protocols. The fast charging protocol is designed to enable communication between the charging end and the receiving end, and to complete power negotiation. By using the fast charging protocol, the charging end can provide a set of voltage-current combination gears for the receiving end to select, and the receiving end can select one of the gears through the protocol to power itself. The introduction of the fast charging protocol greatly improves the flexibility of the charging equipment design. The receiving end can choose the power gear that best suits it for charging, and it also greatly improves the charging efficiency.

[0192] The fast charging protocol is implemented at the software level. By writing the corresponding control program, both the charging device and the powered device can communicate using the fast charging protocol. This software is the firmware program running in the charging management chip of the devices at both ends.

[0193] Among the related technologies, the preparation process of fast charging equipment can be divided into three parts: hardware design, software design, and actual production, which specifically include the following stages:

[0194] 1) Hardware design phase: Design fast charging hardware; test hardware functions; test whether software functions are normal.

[0195] 2) Software design phase: compile the firmware code; flash the firmware to the development board; test whether the software functions normally.

[0196] 3) Production stage: hardware PCB design and production, and finally burning the firmware into the chip.

[0197] Hardware design includes the design and selection of the product's exterior, internal circuits, and components. Software design primarily involves the development and support of fast-charging device functionality. This includes implementing the fast-charging protocol, detecting the current charging status, controlling input / output voltage and current, and detecting connected cables. These functions are all implemented at the software level.

[0198] Among them, the actual production part is that after completing the design of software and hardware, the manufacturer begins to carry out mass production of the product. During this process, the manufacturer will complete the actual product PCB board, the production of the shell, the filling of the firmware and other operations. Finally, the various components are welded and assembled together to form the final fast charging device. In order to achieve the flexibility of modifying and updating the firmware program that implements the fast charging protocol, the fast charging device produced through the previous production process has been modified. The fast charging protocol is designed to transmit data. When most OEM manufacturers write firmware sample code, they will implement a firmware update function through the data channel of the fast charging protocol. In some other implementations, there is also a design that uses a custom private protocol to update the firmware.

[0199] Among them, the update technology of fast charging device firmware can be implemented in the following ways:

[0200] 1. Transmit firmware through VDM messages of the PD protocol; 2. Use the redundant pins in the Type-C interface to bring out the SWD pins and flash the firmware through the SWD debugging protocol; 3. Implement a private protocol communication through the redundant pins in the Type-C interface to achieve firmware updates and flashing.

[0201] However, no matter which of the aforementioned fast charging device firmware update technologies is used, there is no guarantee that a malicious attacker can flash their own modified firmware. These maliciously modified firmware programs can cause the charging device to malfunction and cause permanent electrical damage to the device being charged.

[0202] In order to overcome the above-mentioned defects, when the manufacturer of the fast-charging device starts the production process, it can quickly enter production by obtaining the fast-charging device identification, the boot loader code, firmware update information, and fast-charging protocol information from the blockchain network. Among them, the fast-charging device preparation process processing method includes 3 different stages, which are introduced below in turn.

[0203] Among them, reference Figure 9 , Figure 9 An optional flowchart of a method for updating the firmware of a fast charging device provided in an embodiment of the present invention specifically includes the following steps:

[0204] 1) Software design phase:

[0205] Step 901: triggering a process for developing a fast charging function that matches a fast charging device.

[0206] Step 902: Trigger the editing process of writing the bootloader code with signature verification.

[0207] Step 903: Determine the function code of the fast charging function of the fast charging device.

[0208] Step 904: Trigger a process of testing the functionality of the bootloader code.

[0209] Step 905: Check whether the bootloader code functions normally. If so, execute step 906; otherwise, execute step 902.

[0210] Step 906: Check whether the fast charging function of the fast charging device is normal. If so, execute step 911; otherwise, execute step 903.

[0211] 2) Hardware design stage:

[0212] Step 907: triggering hardware design of the fast charging function of the fast charging device;

[0213] Step 908: Test the hardware function of the fast charging device with fast charging function.

[0214] Step 909: Test whether the software function of the fast charging device with fast charging function is normal. If it is, execute step 910; otherwise, execute step 907.

[0215] Step 910: Hardware PCB design and manufacturing process of a fast charging device that triggers the fast charging function.

[0216] 3) Preparation process of code protection stage:

[0217] Step 911: Burn the boot loader code into the chip.

[0218] Step 912: Lock the storage area of ​​the boot loader code.

[0219] Step 913: Burn the function code into the chip.

[0220] 4) Production stage:

[0221] Step 914: The equipment factory is completed and the fast charging equipment is prepared.

[0222] The software design phase is divided into two processes: bootloader development and functional code development. This separation effectively decouples code functionality, allowing for independent maintenance and expansion.

[0223] Furthermore, when the fast charging equipment production line is based on Figure 9 When the production of fast charging equipment is completed, refer to the fast charging equipment preparation process shown in the Figure 10 , Figure 10 An optional flowchart of a method for updating the firmware of a fast charging device provided in an embodiment of the present invention includes the following steps:

[0224] Step 1001: The chip of the fast charging device is powered on to run the stored boot loader code.

[0225] Step 1002: Execute the hardware initialization process of the fast charging device.

[0226] The bootloader code runs when the chip starts up and is designed to provide only a limited number of functions. This minimizes development effort and the potential for bugs and vulnerabilities. The bootloader code includes functions such as initializing the hardware environment, loading and running functional code, verifying functional code to be updated, and updating and writing new functional code.

[0227] Step 1003: Detect the firmware update signal of the fast charging device.

[0228] Step 1004: Determine whether to perform a firmware update. If yes, execute step 1005; otherwise, execute step 1006.

[0229] Step 1005: Waiting to receive the firmware update of the fast charging device.

[0230] Step 1006: Read the function code from the storage medium of the fast charging device.

[0231] Step 1007: Complete receiving the firmware of the fast charging device.

[0232] When the bootloader starts, it initializes the hardware environment. After initialization, it checks for firmware update signals set in the hardware / software. If so, it begins the firmware update process. During the firmware update process, the bootloader may or may not receive the firmware update code. This corresponds to the "Waiting for Firmware Update" and "Firmware Acceptance Completed" steps in the figure above. These two functions are optional. If the bootloader does not implement this function, it must implement the function code to receive and store the firmware. After receiving the updated firmware, the bootloader must verify its legitimacy. It is recommended to use a public-private key digital signature algorithm for signing and verification. The signature algorithm can be either RSA or ECDSA. If RSA is selected, 2048-bit or higher is preferred.

[0233] Step 1008: Check whether the firmware of the fast charging device is valid. If so, execute step 1009; otherwise, execute step 1010.

[0234] Step 1009: Write the updated content into the firmware of the fast charging device.

[0235] Step 1010: Clear the firmware update signal and restart the chip of the fast charging device.

[0236] Furthermore, if the updated firmware passes the validity check, the "Write Firmware" process begins. Only after the verification is passed can the firmware be updated, ensuring that the device only runs legal and trusted firmware code. If the updated firmware fails the validity check, the bootloader clears the firmware update status and keeps the original firmware unchanged, and directly runs the original firmware the next time it is run.

[0237] Step 1011: Determine whether the function code verification is valid, if so, execute step 1012, otherwise, execute step 1013.

[0238] Step 1012: Execute the fast charging function of the fast charging device to achieve normal operation of the device.

[0239] Step 1013: Refuse to execute the untrusted code and trigger an alarm.

[0240] When the bootloader doesn't detect a firmware update signal, it defaults to loading the firmware code from the storage medium and verifying the code. If the verification passes, the firmware code is executed directly, and the fast charging device functions normally. If the verification fails, the firmware code is rejected. The efficiency of the firmware code is not guaranteed, so it is recommended that a lightweight verification algorithm be used. For example, a lightweight algorithm such as CRC32, CRC16, or a checksum algorithm can be considered for the verification algorithm during the function code startup phase.

[0241] The following continues to introduce the code protection process shown in the previous embodiment, and provides an optional flow chart of the fast charging device preparation process processing method provided by the embodiment of the present invention; wherein the preparation process of the code protection stage is divided into three steps:

[0242] 1) Burn the bootloader code; 2) Lock the bootloader code; 3) Burn the functional code.

[0243] Specifically, the step of burning the boot loader code (bootloader) is to burn the written firmware into the chip used in mass production through a programmer. This step requires burning the bootloader into the chip's built-in storage medium to prevent it from being read out.

[0244] Locking the bootloader involves setting the chip's security bit, making the bootloader's storage area "non-writable," and enabling protection against external code readout (this protection varies across different chips, such as the STM32's ReadOutProtection). This ensures that the bootloader code cannot be updated or overwritten by anyone other than the manufacturer.

[0245] Burning the function code is the process of burning the function code into the chip. Specifically, this can be done into the chip's built-in storage area or into an external storage medium, depending on the specific hardware design. This step is primarily for burning the device's function code, which is designed to be updateable.

[0246] Beneficial technical effects:

[0247] The embodiment of the present invention performs an initialization process that matches the firmware of the fast charging device when the fast charging device or its firmware is powered on; outputs a query prompt message on whether to perform a firmware update when the firmware update signal is detected; initiates a firmware update process for the fast charging device in response to a firmware update instruction; receives and stores a firmware update program to be updated; and executes a write and update process of the firmware update program when the firmware update program passes the legality check and validity check. In this way, it is possible to fully utilize the boot loader code in the preparation process of the fast charging device boot loader to support the fast charging function of the electronic device, expand the scope of use of the fast charging function of the firmware of the fast charging device, ensure timely updates of the firmware of the fast charging device, prevent malicious firmware programs from affecting the fast charging device, and ensure the safe use of the user's fast charging device.

[0248] The above description is merely an embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for updating the firmware of a fast charging device, characterized in that: The chip of the fast charging device includes a boot loader code and a fast charging device function code for executing the fast charging function; the boot loader code and the fast charging device function code are burned into the chip through a boot loader development board, and the boot loader development board is flashed with the boot loader code and the fast charging device function code with a signature verification function; The method comprises: When the fast charging device or its firmware is powered on, an initialization process matching the firmware of the fast charging device is executed; receiving and storing a firmware update program to be updated in response to a firmware update instruction; Performing a legality check and validity test on the firmware update program; When the firmware update program passes the legality check and the validity detection, the writing and updating process of the firmware update program is executed.

2. The method according to claim 1, characterized in that The bootloader code is burned into the chip by: Obtaining the boot loader code with the signature verification function; Flashing the boot loader program code with the signature verification function to a development board to obtain a flashed boot loader program development board; Performing a test on the signature verification function of the boot loader development board after the flashing process; The boot loader code with the signature verification function that has been tested and functions normally is burned into the chip.

3. The method according to claim 2, characterized in that The method further comprises: A storage area locking process is performed on the boot loader code with the signature verification function.

4. The method according to claim 3, characterized in that The performing storage area locking processing on the boot loader program code with the signature verification function includes: Determining a storage location of the bootloader code with the signature verification function in a storage medium of the firmware of the fast charging device; Adapting storage medium parameters of the storage location to adjust readability of the storage medium of the storage location; The storage area of ​​the storage medium at the storage location is locked by a programmer to achieve read-only status of the storage area.

5. The method according to claim 1, characterized in that The fast charging device function code is burned into the chip in the following way: Obtaining a function code of the fast charging device for implementing the fast charging function on the fast charging device; Flashing the development board with the fast charging device function code to obtain a boot loader development board after the flashing process; Testing the fast charging function of the boot loader development board after the flashing process; Burn the tested and normally functioning fast charging device function code into the chip.

6. The method according to claim 1, characterized in that The method further comprises: Adjusting the type of signature authentication algorithm carried by the bootloader code according to the version information of the fast charging device function code of the firmware of the fast charging device; or, According to the usage environment of the fast charging device, the type of the signature authentication algorithm carried by the boot loader code is adjusted.

7. The method according to claim 1, characterized in that The method further comprises: The identification of the fast charging device, the boot loader code, the firmware update information, and the fast charging protocol information are sent to the blockchain network so that The nodes of the blockchain network fill the identification of the fast charging device, the boot loader code, firmware update information, and fast charging protocol information into a new block, and when consensus is reached on the new block, the new block is appended to the end of the blockchain.

8. The method according to claim 1, characterized in that The method further comprises: Receiving data synchronization requests from other nodes in the blockchain network; In response to the data synchronization request, verifying the authority of the other nodes; When the authority of the other nodes is verified, data synchronization is controlled between the current node and the other nodes to enable the other nodes to obtain the identification of the fast charging device, the boot loader code, firmware update information, and fast charging protocol information.

9. The method according to claim 1, characterized in that Performing a validity check and validation on the firmware update program, including: The firmware update program is signed and verified using a public-private key data signature algorithm.

10. The method according to claim 1, characterized in that The method further comprises: When the firmware update program fails to pass the legality check and the validity check, the firmware update program or the firmware update status is cleared, and the fast charging device is restarted to execute the fast charging function of the original firmware of the fast charging device.

11. The method according to claim 1, characterized in that Before receiving and storing the firmware update program to be updated in response to the firmware update instruction, the method further includes: When a firmware update signal for the fast charging device is detected, an inquiry prompt message is outputted asking whether to perform a firmware update.

12. The method according to claim 11, characterized in that The method further comprises: When the firmware update signal for the fast charging device is completed and the firmware update signal is not detected, the fast charging function of the fast charging device is executed.

13. The method according to claim 1, wherein The executing of the fast charging function of the fast charging device includes: Reading the fast charging function code from the chip or storage medium of the fast charging device; wherein the boot loader code for executing the fast charging function is pre-burned or stored in the chip or storage medium; Performing a credibility verification process on the fast charging function code; After the fast charging function code passes the trustworthy verification process, the fast charging function of the fast charging device is executed.

14. The method according to claim 13, characterized in that The reading the fast charging function code from the chip or storage medium of the fast charging device includes: When the fast charging device is an adapter, sending a download request to a corresponding storage device according to the software storage path of the adapter, the download request including the software identifier of the adapter with the fast charging function; The fast charging function code compatible with the adapter is received and sent by the storage device according to the software identifier of the adapter.

15. The method according to claim 13, characterized in that The performing a trustworthy verification process on the fast charging function code includes: Detecting the fast charging function code of the fast charging device through the signature authentication algorithm carried by the boot loader code; When the fast charging function code fails to pass the trustworthy verification process, the fast charging function of the fast charging device is stopped from being executed, and an alarm is issued through the fast charging device.

16. A firmware update program running on a fast charging device, characterized in that: The chip of the fast charging device includes a boot loader code and a fast charging device function code for executing the fast charging function; the boot loader code and the fast charging device function code are burned into the chip through a boot loader development board, and the boot loader development board is flashed with the boot loader code and the fast charging device function code with a signature verification function; The firmware update procedure includes: A hardware initialization module, configured to execute an initialization process that matches the firmware of the fast charging device when the fast charging device or its firmware is powered on and running; a firmware update trigger module, configured to receive and store a firmware update program to be updated in response to a firmware update instruction; A legitimacy verification and inspection module, configured to perform legitimacy verification and validity inspection on the firmware update program; The program writing and updating module is used to execute the writing and updating processing of the firmware updating program when the firmware updating program passes the legality check and the validity check.

17. A fast charging device processor, characterized in that: The fast charging device processor is connected to a memory, which stores multiple executable instructions. When the multiple executable instructions are executed, the processor executes the firmware update method for the fast charging device according to any one of claims 1 to 15.

18. A fast charging device, characterized in that: The fast charging device includes: A memory for storing executable instructions; wherein the executable instructions include a fast charging device boot loader; The processor is configured to implement the firmware update method for the fast charging device according to any one of claims 1 to 15 when running the executable instructions stored in the memory.

19. A computer-readable storage medium storing executable instructions, characterized in that: When the executable instructions are executed by the processor, the firmware update method of the fast charging device according to any one of claims 1 to 15 is implemented.