CN111831308A - Firmware updating method and program for quick charging equipment, quick charging equipment and storage medium - Google Patents

Firmware updating method and program for quick charging equipment, quick charging equipment and storage medium Download PDF

Info

Publication number
CN111831308A
CN111831308A CN202010296159.8A CN202010296159A CN111831308A CN 111831308 A CN111831308 A CN 111831308A CN 202010296159 A CN202010296159 A CN 202010296159A CN 111831308 A CN111831308 A CN 111831308A
Authority
CN
China
Prior art keywords
firmware
quick charging
charging equipment
firmware updating
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010296159.8A
Other languages
Chinese (zh)
Inventor
于旸
马卓
黎烨
戴戈
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010296159.8A priority Critical patent/CN111831308A/en
Publication of CN111831308A publication Critical patent/CN111831308A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories

Abstract

The invention provides a firmware updating method of a quick charging device, which comprises the following steps: when the quick charging equipment or the firmware thereof is powered on and operated, executing an initialization process matched with the firmware of the quick charging equipment; detecting a firmware updating signal aiming at the quick charging equipment, and outputting inquiry prompt information whether to update the firmware when the firmware updating signal is detected; responding to a firmware updating instruction, and starting a firmware updating flow aiming at the quick charging equipment; receiving and storing a firmware updating program to be updated; carrying out validity check and check processing on the firmware updating program; and when the firmware updating program passes the validity and validity detection, executing the writing and updating processing of the firmware updating program. The invention also provides a firmware updating program, a quick charging device and a storage medium. The invention can ensure the firmware of the quick charging equipment to be updated in time, prevent the influence of malicious firmware programs on the quick charging equipment and ensure the safe use of the quick charging equipment of users.

Description

Firmware updating method and program for quick charging equipment, quick charging equipment and storage medium
Technical Field
The present invention relates to a fast charging technology, and in particular, to a firmware updating method and program for a fast charging device, a fast charging device processor, a fast charging device, and a storage medium.
Background
With the continuous development of the fast charging technology, the fast charging function is also increasingly applied to various electronic devices (called fast charging devices for short). However, in the related art, there is a design defect in updating firmware of the existing quick charging device, which may cause a safety problem of the quick charging device. For example, none of these existing firmware update schemes can guarantee that a malicious attacker causes permanent electrical damage to a charged device by swiping in a modified firmware program of the malicious attacker and causing abnormal operation of the charging device through the maliciously modified firmware program.
Because the implementation schemes of firmware update all have potential safety hazards and can cause safety threats to equipment using a fast charging protocol, a new firmware update method needs to be provided to solve the safety problem of the preorders, so that the flushed firmware cannot be counterfeited and modified, and the defect of hardware damage caused by the safety of firmware software is overcome.
Disclosure of Invention
In view of this, embodiments of the present invention provide a firmware updating method and program for a fast charging device, a fast charging device processor, a fast charging device, and a storage medium, which can perform validity check and check processing on a firmware updating program in a firmware processing process of the fast charging device, and support a fast charging function of a firmware, thereby expanding a safe use range of the fast charging function of the firmware of the fast charging device, ensuring timely updating of the firmware of the fast charging device, preventing an influence of a malicious firmware program on the fast charging device, and ensuring safe use of the fast charging device of a user.
The technical scheme of the embodiment of the invention is realized as follows:
the embodiment of the invention provides a firmware updating method of a quick charging device, which comprises the following steps:
when the quick charging equipment or the firmware thereof is powered on and operated, executing an initialization process matched with the firmware of the quick charging equipment;
detecting a firmware updating signal aiming at the quick charging equipment, and outputting inquiry prompt information whether to update the firmware when the firmware updating signal is detected;
responding to a firmware updating instruction, and starting a firmware updating flow aiming at the quick charging equipment;
receiving and storing a firmware updating program to be updated;
carrying out validity check and check processing on the firmware updating program;
and when the firmware updating program passes the validity and validity detection, executing the writing and updating processing of the firmware updating program.
In the above scheme, the method further comprises:
sending the identifier of the quick charging equipment, the boot loader code, the firmware updating information and the quick charging protocol information to a block chain network so as to enable the quick charging equipment to be connected with the block chain network
And the node of the block chain network fills the identifier of the quick charging equipment, the boot loader code, the firmware updating information and the quick charging protocol information into a new block, and when the new block is identified consistently, the new block is added to the tail part of the block chain.
In the above scheme, the method further comprises:
receiving data synchronization requests of other nodes in the blockchain network;
responding to the data synchronization request, and verifying the authority of the other nodes;
and when the authority of the other nodes passes the verification, controlling the current node and the other nodes to carry out data synchronization so as to realize that the other nodes acquire the identification of the quick charging equipment, the boot loader code, the firmware update information and the quick charging protocol information.
In the above scheme, the method further comprises:
responding to a query request, and analyzing the query request to obtain a corresponding user identifier;
acquiring authority information in a target block in a block chain network according to the user identification;
checking the matching of the authority information and the user identification;
when the authority information is matched with the user identification, acquiring the identification of the corresponding quick charging equipment, the boot loader code, the firmware update information and the quick charging protocol information in the block chain network;
and responding to the query request, and pushing the acquired corresponding identifier of the fast charging equipment, the boot loader code, the firmware update information and the fast charging protocol information to a corresponding client so as to realize that the client acquires the identifier of the corresponding fast charging equipment, the boot loader code, the firmware update information and the fast charging protocol information which are stored in the block chain network.
The embodiment of the present invention further provides a firmware update program of a fast charging device, including:
the hardware initialization module is used for executing an initialization process matched with the firmware of the quick charging equipment when the quick charging equipment or the firmware thereof is powered on and runs;
the firmware updating signal detection module is used for detecting a firmware updating signal aiming at the quick charging equipment and outputting inquiry prompt information whether to update the firmware when the firmware updating signal is detected;
the firmware updating triggering module is used for responding to a firmware updating instruction and starting a firmware updating process aiming at the quick charging equipment;
the firmware updating storage module is used for receiving and storing a firmware updating program to be updated;
the validity checking and checking module is used for checking and checking the validity of the firmware updating program;
and the program writing and updating module is used for executing the writing and updating processing of the firmware updating program when the firmware updating program passes the validity and validity detection.
In the above scheme, the validity checking and checking module is configured to sign and check the firmware update program by using a public-private key data signature algorithm
In the above scheme, the program writing and updating module is configured to, when the firmware updating program fails the validity and validity detection, clear the firmware updating program or the firmware updating state, restart the fast charging device, and execute the fast charging function of the original firmware of the fast charging device.
In the above scheme, the apparatus further comprises:
and the quick charging function module is used for executing the quick charging function of the quick charging equipment after the detection of the firmware updating signal aiming at the quick charging equipment is finished and when the firmware updating signal is not detected.
In the above-mentioned scheme, the first step of the method,
the quick charging function module is used for reading a quick charging function code from a chip or a storage medium of the quick charging equipment; wherein, a boot loader code for executing the quick charging function is pre-burned or stored in the chip or the storage medium;
carrying out credible verification processing on the quick charging function code;
and after the quick charging function code passes the trusted verification processing, executing the quick charging function of the quick charging equipment.
In the above-mentioned scheme, the first step of the method,
the quick charging function module is used for sending a downloading request to the corresponding storage equipment according to the software storage path of the adapter when the quick charging equipment is the adapter, wherein the downloading request comprises the software identifier of the adapter with the quick charging function;
and receiving a quick charging function code which is issued by the storage equipment and is matched with the adapter according to the software identifier of the adapter.
In the above-mentioned scheme, the first step of the method,
the validity checking and checking module is used for detecting the quick charging function code of the quick charging equipment through a signature authentication algorithm carried by the boot loader code;
and when the quick charging function code does not pass the credible verification processing, stopping continuously executing the quick charging function of the quick charging equipment, and warning through the quick charging equipment.
In the above scheme, the apparatus further comprises:
the software editing module is used for compiling a boot loader code with a signature verification function;
writing a quick charging equipment function code for implementing a quick charging function on the quick charging equipment;
performing flash processing on the written boot loader code with the signature verification function and the functional code of the rapid charging equipment to obtain a flash-processed boot loader development board;
testing the signature verification function and the quick charging equipment function of the bootstrap loader development board subjected to the flash processing;
programming the tested boot loader code with the signature verification function and normal function into a chip;
performing storage area locking processing on the bootstrap loader code with the signature verification function;
and programming the tested functional code of the quick charging equipment with normal function into a chip.
In the above-mentioned scheme, the first step of the method,
the software editing module is used for determining the storage position of the boot loader code with the signature verification function in a storage medium of the firmware of the fast charging equipment;
adapting storage medium parameters of the storage locations to adjust readability of a storage medium of the storage locations;
and performing storage region locking processing on the storage medium of the storage position through a programmer to realize the read-only property of the storage region.
In the above-mentioned scheme, the first step of the method,
the software editing module is used for adjusting the type of a signature authentication algorithm carried by the boot loader code according to the version information of the quick charging function code of the firmware of the quick charging equipment; alternatively, the first and second electrodes may be,
and adjusting the type of a signature authentication algorithm carried by the boot loader code according to the use environment of the quick charging equipment.
The embodiment of the invention also provides a processor of the quick charging equipment, which is connected with a memory, wherein the memory is stored with a plurality of executable instructions, and when the executable instructions are executed, the processor executes a firmware updating method of the quick charging equipment of a front sequence.
The embodiment of the invention also provides a quick charging device, which comprises:
a memory for storing executable instructions; wherein the executable instructions comprise a fast charging device boot loader;
and the processor is used for realizing the firmware updating method of the preorder quick-charging equipment when the executable instruction stored in the memory is operated.
The embodiment of the present invention further provides a computer-readable storage medium, which stores executable instructions, and is characterized in that when the executable instructions are executed by a processor, the method for updating firmware of a preceding fast charging device is performed, or the method for updating firmware of a preceding fast charging device is performed.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention executes an initialization process matched with the firmware of the quick charging equipment when the quick charging equipment or the firmware thereof is powered on and runs; outputting inquiry prompt information whether to update the firmware when the firmware updating signal is detected; responding to a firmware updating instruction, and starting a firmware updating flow aiming at the quick charging equipment; receiving and storing a firmware updating program to be updated; and when the firmware updating program passes the validity and validity detection, executing the writing and updating processing of the firmware updating program. Therefore, the rapid charging function of the electronic equipment can be supported by fully utilizing the boot loader codes in the preparation process of the boot loader of the rapid charging equipment, the use range of the rapid charging function of the firmware of the rapid charging equipment is expanded, the firmware of the rapid charging equipment can be ensured to be updated in time, the influence of malicious firmware programs on the rapid charging equipment is prevented, and the safe use of the rapid charging equipment of a user is ensured.
Drawings
Fig. 1 is a schematic view of a usage scenario of a firmware updating method of a fast charging device according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a quick charging device according to an embodiment of the present invention;
fig. 3 is an alternative flowchart of a firmware updating method for a fast charging device according to an embodiment of the present invention;
fig. 4 is an alternative flowchart of a firmware updating method for a fast charging device according to an embodiment of the present invention;
fig. 5 is an alternative flowchart of a firmware updating method for a fast charging electric vehicle according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a processing apparatus of a preparation flow of a rapid charging device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a blockchain in a blockchain network according to an embodiment of the present invention;
fig. 8 is a functional architecture diagram of a blockchain network according to an embodiment of the present invention;
fig. 9 is an alternative flowchart of a firmware updating method for a fast charging device according to an embodiment of the present invention;
fig. 10 is an alternative flowchart of a firmware updating method for a fast charging device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail with reference to the accompanying drawings, the described embodiments should not be construed as limiting the present invention, and all other embodiments obtained by persons skilled in the art without inventive work shall fall within the scope of protection of the present invention.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is 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.
Before further detailed description of the embodiments of the present invention, terms and expressions mentioned in the embodiments of the present invention are explained, and the terms and expressions mentioned in the embodiments of the present invention are applied to the following explanations.
1) The quick charging technology comprises the following steps: the short term of the fast charging technology refers to a charging technology based on USB Type-C, an interface, a Lightning interface, and the like, and is mainly used for realizing fast charging and/or power supply to the electric equipment. Such technologies are used in notebooks, mobile phones, and other devices that use lithium batteries for power supply. The charging can be completed in a short time or the power supply with high power can be provided.
2) A fast charging protocol: is the core of fast charging technology, which specifies a set of protocols for negotiating the power supply between a power sourcing device and a powered device.
3) Firmware: is code running inside the chip that is binary code for implementing a fast charging protocol.
4) USB: the universal serial bus is the most common peripheral interface at present.
5) Type-C: a USB interface type has more pins and can carry more functions, and a fast charging protocol is usually based on the interface for communication.
6) PD protocol: the Power Delivery protocol is a fast charging protocol, and is designed, developed and published by the USB organization, and supports a dc Power supply capacity of up to 100W and supports data transmission.
7) VDM PD: the messages used for transmitting data in the protocol are classified into two types, SVDM and UVDM.
8) Public key digital signature technology: the method refers to a technology for encrypting data by using a public key cryptography method, wherein the data encrypted by using a private key can be decrypted by using a public key, and the data can be verified but cannot be tampered. Such signature techniques have been proven mathematically secure.
9) Boot loader code: the code running at the time of chip startup is generally used for initializing a hardware environment, and the code running in a fixed piece is loaded, and generally does not need to be updated.
10) In response to: for indicating conditions or states on which the performed operations depend, one or more of the performed operations may be in real time or may have a set delay when the dependent conditions or states are satisfied; there is no restriction on the order of execution of the operations performed unless otherwise specified.
11) Transaction (Transaction): equivalent to the computer term "transaction," a transaction includes an operation that needs to be committed to a blockchain network for execution and does not refer solely to a transaction in the business context, which embodiments of the present invention follow in view of the convention in blockchain technology that colloquially uses the term "transaction.
For example, a deployment (deployment) transaction is used to install a specified smart contract to a node in a blockchain network and is ready to be invoked; the Invoke (Invoke) transaction is used to append records of the transaction in the blockchain by invoking smart contracts and to perform operations on the state database of the blockchain, 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).
12) Block chain (Block chain): is the storage structure of an encrypted, chained transaction formed by blocks (blocks).
For example, the header of each block may include hash values of all transactions in the block, and also include hash values of all transactions in the previous block, so as to achieve tamper resistance and forgery resistance of the transactions in the block based on the hash values; newly generated transactions, after being filled into the tiles and passing through the consensus of nodes in the blockchain network, are appended to the end of the blockchain to form a chain growth.
13) Block chain Network (Block chain Network): the new block is incorporated into the set of a series of nodes of the block chain in a consensus manner.
14) Ledger (hedger): is a general term for blockchains (also known as ledger data) and state databases that are synchronized with blockchains.
Wherein, the blockchain records the transaction in the form of a file in a file system; the state database records the transactions in the blockchain in the form of different types of Key (Key) Value pairs for supporting fast query of the transactions in the blockchain.
15) Smart Contracts (Smart Contracts): also known as Chain code (Chain code) or application code, a program deployed in a node of a blockchain network, the node executing an intelligent contract invoked in a received transaction to update or query key-value data of an account database.
16) Consensus (Consensus): is a process in a blockchain network for agreeing on transactions in blocks among a plurality of nodes involved, the agreed blocks are to be appended to the end of the blockchain, and the mechanisms for achieving consensus include workload proofs (pow, Proof of Work), equity proofs (PoS, P of stamp), share grant proofs (DPo S, released Proof of-of-stamp), Elapsed Time proofs (Po ET, Proof of Elapsed Time), etc.
Fig. 1 is a schematic view of a usage scenario of a firmware updating method of a fast charging device according to an embodiment of the present invention, referring to fig. 1, different firmware capable of performing a fast charging function is provided on a terminal (including a fast charging device 10-1 and an adapter 10-2 with a fast charging function), where the fast charging device 10-1 may obtain different firmware updating programs from a corresponding server 200 through a network 300, and the adapter 10-2 with a fast charging function may obtain different firmware updating programs by replacing different storage media, where the network 300 is connected to the server 200, the network 300 may be a wide area network or a local area network, or a combination of the two, and data transmission is implemented using a wireless link, and specifically, the terminal 10-1 as a fast charging device and the adapter 10-2 with a fast charging function may include different firmware, the terminal 10-1 can support different versions of quick charging protocols to realize a quick charging function, for example, a target function of firmware of the electronic device in the terminal 10-1 can be quick charging, and then the target function of the firmware determines that the electronic device (such as a mobile phone or a notebook computer) in the terminal 10-1 is an electronic device with a quick charging function, and can support 50W of current charging; similarly, the electronic device in 10-2 may also be an electronic device with a fast charging function (e.g., an electric energy source car performing a fast charging function), and may be capable of supporting 380W current charging. Wherein different electronic device firmware determines that the corresponding boot loader codes are different. Specifically, the firmware updating method of the quick charging device comprises the following steps: when the quick charging equipment or the firmware thereof is powered on and operated, executing an initialization process matched with the firmware of the quick charging equipment; detecting a firmware updating signal aiming at the quick charging equipment, and outputting inquiry prompt information whether to update the firmware when the firmware updating signal is detected; responding to a firmware updating instruction, and starting a firmware updating flow aiming at the quick charging equipment; receiving and storing a firmware updating program to be updated; carrying out validity check and check processing on the firmware updating program; and when the firmware updating program passes the validity and validity detection, executing the writing and updating processing of the firmware updating program.
The structure of the quick charging device according to the embodiment of the present invention is described in detail below, the quick charging device may be implemented in various forms, fig. 2 is a schematic view of a constituent structure of the quick charging device according to the embodiment of the present invention, it can be understood that fig. 2 only shows an exemplary structure of the quick charging device, and not a whole structure, and a part of the structure or a whole structure shown in fig. 2 may be implemented as needed.
The quick charging equipment provided by the embodiment of the invention comprises: at least one processor 201, a memory 202, a user interface 203 and at least one charging interface 204. The various components in the rapid-fill device are coupled together by a bus system 205. It will be appreciated that the bus system 205 is used to enable communications among the components. Bus system 205 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 205 in fig. 2.
The user interface 203 may include, among other things, a display, a keyboard, a mouse, a trackball, a click wheel, a key press, a button, a touch pad, or a touch screen.
It will be appreciated that the memory 202 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. The memory 202 in embodiments of the present invention is capable of storing data to support operation of the terminal (e.g., 10-1). Examples of such data include: any computer program, such as an operating system and application programs, for operating on a terminal (e.g., 10-1). The operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, for implementing various basic services and processing hardware-based tasks. The application program may include various application programs.
In some embodiments, the firmware processing apparatus of the fast charging device provided in the embodiments of the present invention may be implemented by a combination of software and hardware, and as an example, the fast charging device provided in the embodiments of the present invention may be a processor in the form of a hardware decoding processor, which is programmed to execute the firmware updating method of the fast charging device provided in the embodiments of the present invention. For example, a processor in the form of a hardware decoding processor may employ 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.
As an example of the implementation of the fast charging device provided by the embodiment of the present invention by combining software and hardware, the fast charging device provided by the embodiment of the present invention may be directly embodied as a combination of software modules executed by the processor 201, where the software modules may be located in a storage medium, the storage medium is located in the memory 202, and the processor 201 reads executable instructions included in the software modules in the memory 202, and completes the firmware updating method of the fast charging device provided by the embodiment of the present invention in combination with necessary hardware (for example, including the processor 201 and other components connected to the bus 205).
By way of example, the Processor 201 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor or the like.
As an example of the fast charging Device provided by the embodiment of the present invention implemented by hardware, the apparatus provided by the embodiment of the present invention may be implemented by directly using the processor 201 in the form of a hardware decoding processor, for example, the apparatus may be implemented 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 updating method of the fast charging Device provided by the embodiment of the present invention.
The memory 202 in embodiments of the present invention is used to store various types of data to support the operation of the fast-fill device. Examples of such data include: any executable instructions for operating on the fast-charging device, such as executable instructions, may be included in the executable instructions, and the program implementing the firmware update method from the fast-charging device of the embodiments of the present invention may be included in the executable instructions.
In other embodiments, the fast charging device provided by the embodiments of the present invention may be implemented in software, and fig. 2 illustrates the fast charging device stored in the memory 202, which may be software in the form of a program, a plug-in, and the like, and includes a series of modules, as an example of the program stored in the memory 202, a firmware update program of the fast charging device may be included, and the firmware update program of the fast charging device includes the following software modules:
the hardware initialization module 2081 is configured to execute an initialization process matched with the firmware of the fast charging device when the fast charging device or the firmware thereof is powered on and runs;
the firmware update signal detection module 2082 is configured to detect a firmware update signal for the fast charging device, and output inquiry prompt information indicating whether to perform firmware update when the firmware update signal is detected;
the firmware update triggering module 2083 is configured to respond to a firmware update instruction and start a firmware update process for the fast charging device;
a firmware update storage module 2084, configured to receive and store a firmware update program to be updated;
a validity checking and checking module 2085, configured to perform validity checking and checking on the firmware update program;
a program writing and updating module 2086, configured to perform writing and updating of the firmware updating program when the firmware updating program passes the validity and validity detection.
Continuing to describe the firmware updating method of the fast charging device according to the embodiment of the present invention with reference to fig. 2, referring to fig. 3, fig. 3 is an optional flowchart of the firmware updating method of the fast charging device according to the embodiment of the present invention, and it can be understood that the steps shown in fig. 3 may be executed by the fast charging device. The following is a description of the steps shown in fig. 3.
Step 301: when the quick charging equipment or the firmware thereof is powered on and operated, executing an initialization process matched with the firmware of the quick charging equipment.
When a user uses the quick charging equipment, the firmware version may be updated, so that an initialization process matched with the firmware of the quick charging equipment can be executed when the quick charging equipment is powered on and operated; similarly, after the circuit board of the rapid charging device is produced in the factory, the test process in the factory is usually performed by using the corresponding firmware in the first station, and the firmware is mainly used for the purpose of factory test, verification and calibration. And testing and verifying various electrical properties of the circuit board and the assembled electronic equipment complete machine, and calibrating radio frequency parameters and parameters of various sensors, so that when the firmware is powered on and runs, an initialization process matched with the firmware of the quick charging equipment can be executed.
Step 302: and detecting a firmware updating signal aiming at the quick-charging equipment, and outputting inquiry prompt information whether to update the firmware when the firmware updating signal is detected.
Step 303: and responding to a firmware updating instruction, and starting a firmware updating flow aiming at the quick charging equipment.
Step 304: and receiving and storing a firmware updating program to be updated.
Specifically, the firmware update program to be updated is received and stored, and may be adjusted differently according to the usage environment of the fast charging device, for example, the firmware may be obtained and updated by means of Over-the-Air Technology (OTA) using a dedicated wireless network and from a server storing the firmware; in the production process, the firmware of the quick charging equipment can be updated by arranging the hidden contact on the shell of the electronic equipment.
Step 305: and carrying out validity check and checking processing on the firmware updating program.
In some embodiments of the present invention, the validity checking and checking process for the firmware update program may be implemented as follows:
and signing and verifying the firmware updating program by adopting a public and private key data signature algorithm. The signature algorithm may be any one of an asymmetric encryption RSA algorithm (RSA algorithm) and an ECDSA algorithm. For example, an asymmetric encryption RSA algorithm (RSA algorithm) is selected, which may be 1024bit or more preferred according to the usage environment of the fast charging device.
Step 306: and when the firmware updating program passes the validity and validity detection, executing the writing and updating processing of the firmware updating program.
The method comprises the steps that a backup partition is arranged in a memory (memory) of the quick charging device, the size of the partition can be used for packing old version firmware of the quick charging device which leaves a factory into initial firmware according to the size of firmware which is updated in the future (a certain space is reserved, and when a follow-up OTA is prevented, the size of the backup partition is not enough, and new firmware cannot be installed), and the updated firmware is printed in the backup partition of the memory (memory) when writing and updating of a firmware updating program are executed. Furthermore, each version of firmware may be configured with a version number, and when a new version of firmware needs to perform writing and updating processing of the firmware updating program, the version number of the new user firmware needs to be newer than the version number of the current user firmware, so as to ensure the firmware operating efficiency of the fast charging device.
In some embodiments of the invention, the method further comprises:
and when the firmware updating program does not pass the validity and validity detection, clearing the firmware updating program or the firmware updating state, restarting the quick charging equipment, and executing the quick charging function of the original firmware of the quick charging equipment. When the quick charging function of the quick charging equipment is executed, the quick charging equipment can be charged at a first current through a charging interface of the quick charging equipment.
The first current is matched with a fast charging protocol supported by the fast charging device, for example, the versions of the fast charging protocol may respectively support fast charging of 50W and 100W to adapt to fast charging devices with different powers, or the fast charging device is charged with a second current through a charging interface of the fast charging device, where the second current is matched with the type of the fast charging device, for example, firmware of an electric vehicle supports fast charging of the electric vehicle as the fast charging device with a power of 380W.
In some embodiments of the invention, the method further comprises:
when the firmware of the quick charging equipment supports the quick charging function, the boot loader codes are the boot loader codes with the signature authentication algorithm function, so that the safety of the firmware of the quick charging equipment is detected before the quick charging function is triggered. In combination with the usage environment shown in the foregoing fig. 1, the fast charging device may include different firmware, and the fast charging protocols supported by the firmware may also be different, for example, the fast charging function of the firmware of the fast charging device may be a fast charging protocol with a power of 380W, or may only support a fast charging protocol of 50W. Wherein different flash device firmware determines that the corresponding boot loader codes are different. The safety of the firmware of the quick charging equipment is detected by guiding the loading program codes, so that the safe operation of the quick charging equipment can be effectively ensured.
Continuing to describe the firmware updating method of the fast charging device according to the embodiment of the present invention with reference to fig. 2, referring to fig. 4, fig. 4 is an optional flowchart of the firmware updating method of the fast charging device according to the embodiment of the present invention, and it can be understood that the steps shown in fig. 4 may be executed by the fast charging device to implement preparation of the fast charging device according to the present invention. The following is a description of the steps shown in fig. 4.
Step 401: and writing boot loader code with a signature verification function.
Where the boot loader is code, allowing the user application code to be updated. An alternate download channel (e.g., USB memory stick or network port) may be used to obtain the new code. After the boot ROM executes, a boot loader is executed and updates are performed as needed, and then the end-user application is executed.
Specifically, the boot loader is composed of many parts, including a startup screen. To start, the boot loader may flush a new image directly into the corresponding partition or may use recovery to start a re-flush procedure that is consistent with the OTA operation. Some device manufacturers create multi-part bootloaders and then combine them into one bootloader. At the time of the flush, the boot loader will fetch individual boot loaders and flush all of them. At the same time, the boot loader will verify the integrity of the boot and recovery partitions before moving the execution work to the kernel and display the warnings specified in the boot status section.
Step 402: and compiling a quick charging equipment function code for implementing the quick charging function of the quick charging equipment.
The fast charging device function code for executing the fast charging function may implement charging the fast charging device with a first current through a charging interface of the fast charging device, where the first current is matched with a fast charging protocol (e.g., a mobile phone fast charging protocol) supported by the fast charging device; alternatively, the first and second electrodes may be,
and charging the quick charging device at a second current through a charging interface of the quick charging device, wherein the second current is matched with the type of the quick charging device (such as an electric automobile).
Step 403: and performing flash processing on the written boot loader code with the signature verification function and the functional code of the quick charging equipment to obtain a flash-processed boot loader development board.
Step 404: and testing the signature verification function and the quick charging equipment function of the bootloader development board subjected to the flash processing.
Step 405: and burning the tested and normally functioning boot loader code with the signature verification function into a chip.
Step 406: and performing storage area locking processing on the boot loader code with the signature verification function.
In some embodiments of the present invention, performing a storage region locking process on the bootloader code with the signature verification function may be implemented by:
determining the storage position of the boot loader code with the signature verification function in a storage medium of firmware of the quick charging device; adapting storage medium parameters of the storage location to adjust the readability of the storage medium of the storage location; and performing storage area locking processing on the storage medium of the storage position through a programmer to realize the read-only property of the storage area. Wherein, 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 as "non-rewritable", and at the same time, a Protection that the code cannot be Read to the outside is opened (the Protection is different in different chips, such as Read Out Protection of STM 32). This step may determine that the code is not to be updated and covered by someone other than the manufacturer.
Step 407: and programming the tested functional code of the quick charging equipment with normal function into a chip.
In some embodiments of the invention, the method further comprises:
adjusting the type of a signature authentication algorithm carried by the boot loader code according to the version information of the quick charging function code of the firmware of the quick charging equipment; or adjusting the type of the signature authentication algorithm carried by the boot loader code according to the use environment of the quick charging device. Therefore, the diversity of the signature authentication algorithm carried by the boot loader code can be effectively expanded, the signature authentication algorithm is matched with the use environment of the quick charging equipment, and the situation that the normal use of a user is influenced due to the fact that the signature authentication algorithm carried by the boot loader code is not matched with the version information of the quick charging function code of the firmware of the quick charging equipment is avoided.
In some embodiments of the invention, the method further comprises:
according to the software storage path of the quick charging equipment, sending a downloading request to the corresponding storage equipment, wherein the downloading request comprises the software identification of the quick charging equipment; and receiving the software of the quick charging equipment issued by the storage equipment according to the software identifier of the quick charging equipment. Specifically, different transmission channels between the fast charging device and the storage device can be established based on the type of the adapter; and respectively receiving data sent by the storage device according to the software identifier of the quick charging device through a plurality of downlink ports of different transmission channels. When the quick charging equipment with the quick charging function is produced in a large scale in a production line, one transmission channel can be selected and different transmission protocols (such as FTP (file transfer protocol)) are used, firmware and configuration data corresponding to the quick charging equipment, which are issued according to a software identifier of the quick charging equipment, are downloaded from the transmission equipment, and a downloading request with a physical address and a software identifier of the quick charging equipment is sent to the storage equipment through a second transmission channel, so that the software data, the physical address and the software identifier of the quick charging equipment are equally divided into two transmission channels for transmission, and the efficiency can be improved; and/or adopting the network switching equipment, and receiving the software data issued by the storage equipment according to the software identifier of the quick charging equipment by using a plurality of downlink ports of the network switching equipment on the basis of the plurality of established transmission channels.
With reference to fig. 2, a firmware updating method of a fast charging device according to an embodiment of the present invention is described, referring to fig. 5, where fig. 5 is an optional flowchart of a firmware updating method of a fast charging electric vehicle according to an embodiment of the present invention, and it is understood that the steps shown in fig. 5 may be executed by an electric vehicle running a firmware updating program of a fast charging device, and the following description is made with reference to the steps shown in fig. 5.
Step 501: and the firmware of the quick-charging electric automobile is electrified and operated, and an initialization process is executed.
The firmware of the quick-charging electric vehicle is located in a driving computer of the electric vehicle with the quick-charging function so as to monitor the charging and power consumption processes of the electric vehicle, and meanwhile, the firmware version information in the block chain network can be acquired to update the firmware.
Step 502: in response to the initialization process, triggering boot loader code carried by the firmware based on a firmware update signal.
Step 503: and detecting the safety of the firmware of the fast charging electric automobile based on the boot loader codes, judging whether the detection is passed, if so, executing a step 504, and otherwise, executing a step 505.
Step 504: and executing a 380W fast charging function matched with the fast charging electric automobile.
Step 505: the fast charge function is denied execution and an alarm is triggered.
In some embodiments of the present invention, detecting the firmware security of the fast charging device based on the boot loader code includes:
when the firmware of the quick charging equipment needs to be updated, verifying the updating information of the firmware through a signature authentication algorithm carried by the boot loader code; updating the firmware of the quick charging equipment based on the verification result of the updating information of the firmware; or deleting the firmware update information of the quick charging equipment, and restarting the firmware of the quick charging equipment. If the firmware of the quick charging equipment needs to be updated through a non-formal channel, or carries dangerous information, due to the fact that adverse effects can be caused on the quick charging function of the firmware of the quick charging equipment, the update information of the firmware is verified through a signature authentication algorithm carried by the boot loader code, and safe operation of the quick charging equipment can be effectively guaranteed.
In some embodiments of the invention, the method further comprises:
when the boot loader code does not detect the firmware update information of the quick charging equipment, detecting the real-time firmware code of the firmware of the quick charging equipment through a signature authentication algorithm carried by the boot loader code; executing a quick charging function of the firmware of the quick charging equipment according to the checking result of the real-time firmware code of the firmware of the quick charging equipment; or stopping executing the quick charging function of the firmware of the quick charging equipment, and warning through the quick charging equipment.
The embodiment of the present invention may be implemented by combining a cloud technology or a block chain network technology, where the cloud technology (cloud technology) refers to a hosting technology for unifying series resources such as hardware, software, and a network in a wide area network or a local area network to implement calculation, storage, processing, and sharing of data, and may also be understood as a generic term of a network technology, an information technology, an integration technology, a management platform technology, an application technology, and the like applied based on a cloud computing business model. Background services of the technical network system require a large amount of computing and storage resources, such as video websites, photo-like websites and more portal websites, so cloud technology needs to be supported by cloud computing.
It should be noted that cloud computing is a computing mode, and distributes computing tasks on a resource pool formed by a large number of computers, so that various application systems can obtain computing power, storage space and information services as required. The network that provides the resources is referred to as the "cloud". Resources in the "cloud" appear to the user as being infinitely expandable and available at any time, available on demand, expandable at any time, and paid for on-demand. As a basic capability provider of cloud computing, a cloud computing resource pool platform, referred to as a cloud platform for short, generally referred to as Infrastructure as a Service (IaaS), is established, and multiple types of virtual resources are deployed in a resource pool and are used by external clients selectively. The cloud computing resource pool mainly comprises: a computing device (which may be a virtualized machine, including an operating system), a storage device, and a network device.
Referring to fig. 6, fig. 6 is a schematic diagram of an architecture of a device for processing a preparation flow of a fast charging apparatus according to an embodiment of the present invention, which includes a block chain network 200 (exemplarily illustrating a consensus node 210-1 to a consensus node 210-3), an authentication center 300, a service agent 400, and a service agent 500, which are described below.
The type of blockchain network 200 is flexible and may be, for example, any of a public chain, a private chain, or a federation chain. Taking a public link as an example, the fast charging device of any service agent, such as a user terminal and a server, can access the block link network 200 without authorization; taking a federation chain as an example, a fast charging device (e.g., a terminal/server) hosted by a service entity after obtaining authorization may access the blockchain network 200, and at this time, become a client node in the blockchain network 200.
In some embodiments, the client node may act as a mere observer of the blockchain network 200, i.e., provide functionality to support the business entity initiating a transaction (e.g., for uplink storage of data or querying of data on the chain), and may be implemented by default or selectively (e.g., depending on the specific business needs of the business entity) with respect to the functions of the consensus node 210 of the blockchain network 200, such as a ranking function, a consensus service, and an accounting function, etc. Therefore, the data and the service processing logic of the service subject can be migrated to the blockchain network 200 to the maximum extent, and the credibility and traceability of the data and service processing process are realized through the blockchain network 200.
Consensus nodes in blockchain network 200 receive transactions submitted from client nodes (e.g., client node 410 shown in fig. 1 as belonging to business entity 400 and client node 510 shown in fig. 1 as belonging to business entity 500 of the fast-charging device) of different business entities (e.g., business entity 400 and business entity 500 shown in fig. 1), perform the transactions to update the ledger or query the ledger, and various intermediate or final results of performing the transactions may be returned for display in the business entity's client nodes.
For example, the client node 410/510 may subscribe to events of interest in the blockchain network 200, such as transactions occurring in a particular organization/channel in the blockchain network 200, and the consensus node 210 pushes corresponding transaction notifications to the client node 410/510, thereby triggering corresponding traffic logic in the client node 410/510.
An exemplary application of the block chain network is described below by taking an example in which a plurality of service entities access the block chain network to implement the preparation process of the rapid charging device and the management of the production scheme of the rapid charging device.
Referring to fig. 6, a plurality of business entities involved in the management link, for example, the business entity 400 may be a processing apparatus of a rapid charging device preparation process based on artificial intelligence, the business entity 500 may be a display system with a rapid charging device firmware updating function, and registers from the certificate authority 300 to obtain respective digital certificates, where the digital certificates include a public key of the business entity and a digital signature signed by the certificate authority 300 for the public key and identity information of the business entity, and are used to be attached to the transaction together with the digital signature of the business entity for the transaction, and is sent to the blockchain network for the blockchain network to take out the digital certificate and the signature from the transaction, verify the reliability of the message (i.e. whether it has not been tampered with) and the identity information of the service subject sending the message, and the blockchain network can verify according to the identity, for example, whether it has the right to initiate the transaction. A client running on a fast-charging device (e.g., a terminal or a server) hosted by a business entity may request access from blockchain network 200 to become a client node.
The client node 410 of the service agent 400 is configured to execute an initialization process matching with the firmware of the fast charging device when the fast charging device or the firmware thereof is powered on; detecting a firmware updating signal aiming at the quick charging equipment, and outputting inquiry prompt information whether to update the firmware when the firmware updating signal is detected; responding to a firmware updating instruction, and starting a firmware updating flow aiming at the quick charging equipment; receiving and storing a firmware updating program to be updated; carrying out validity check and check processing on the firmware updating program; when the firmware update program passes the validity and validity detection, the writing and updating processing of the firmware update program is executed, and the identifier of the fast charging device, the boot loader code, the firmware update information, and the fast charging protocol information are sent to the block chain network 200.
The identifier of the fast charging device, the boot loader code, the firmware update information, and the fast charging protocol information are sent to the block chain network 200, a service logic may be set in the client node 410 in advance, when a corresponding preparation process of the fast charging device and a production scheme of the fast charging device are formed, the client node 410 automatically sends the identifier of the fast charging device, the boot loader code, the firmware update information, and the fast charging protocol information to the block chain network 200, or a service person of the service agent 400 logs in the client node 410, manually packages the identifier of the fast charging device, the boot loader code, the firmware update information, and the fast charging protocol information, and sends the identifier, the boot loader code, the firmware update information, and the fast charging protocol information to the block chain network 200. Upon transmission, the client node 410 generates a transaction corresponding to the update operation based on the identification of the fast-charging device, the bootloader code, the firmware update information, and the fast-charging protocol information, specifies in the transaction the smart contract that needs to be invoked to implement the update operation, and parameters passed to the smart contract, and the transaction also carries the digital certificate of the client node 410, a signed digital signature (e.g., obtained by encrypting a digest of the transaction using a 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.
When the transaction is received in the consensus node 210 in the blockchain network 200, the digital certificate and the digital signature carried by the transaction are verified, and after the verification is successful, whether the business entity 400 has the transaction right or not is determined according to the identity of the business entity 400 carried in the transaction, and the transaction fails due to any verification judgment of the digital signature and the right verification. After successful verification, node 210 signs its own digital signature (e.g., by encrypting the digest of the transaction using the private key of node 210-1) and continues to broadcast in blockchain network 200.
After receiving the transaction successfully verified, the consensus node 210 in the blockchain network 200 fills the transaction into a new block and broadcasts the new block. When a new block is broadcasted by the consensus node 210 in the block chain network 200, performing a consensus process on the new block, if the consensus is successful, adding the new block to the tail of the block chain stored in the new block, updating the state database according to a transaction result, and executing a transaction in the new block: and for the transaction of submitting and updating the identifier of the quick charging equipment, the boot loader code, the firmware updating information and the quick charging protocol information, adding a key value pair comprising the identifier of the quick charging equipment, the boot loader code, the firmware updating information and the quick charging protocol information into a state database.
A service person of the service agent 500 logs in the client node 510, inputs a preparation process of the fast charging device and a production scheme of the fast charging device or a virtual resource query request, the client node 510 generates a transaction corresponding to the update operation/query operation according to the preparation process of the fast charging device and the production scheme of the fast charging device or the virtual resource query request, specifies an intelligent contract to be called for implementing the update operation/query operation and parameters transferred to the intelligent contract in the transaction, and the transaction also carries a digital certificate of the client node 510 and a signed digital signature (for example, a summary of the transaction is encrypted by using a 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.
After receiving the transaction in the consensus node 210 in the blockchain network 200, verifying the transaction, filling the block and making the consensus consistent, adding the filled new block to the tail of the blockchain stored in the new block, updating the state database according to the transaction result, and executing the transaction in the new block: for the submitted transaction of updating the identification of the quick charging equipment, the boot loader code, the firmware updating information and the quick charging protocol information, updating the preparation flow of the quick charging equipment and the key value pair corresponding to the production scheme of the quick charging equipment in a state database according to the manual identification result; and for the submitted transaction for inquiring the preparation process of a certain quick charging device and the production scheme of the quick charging device, inquiring the preparation process of the quick charging device and the key value pair corresponding to the production scheme of the quick charging device from a state database, and returning a transaction result.
It is noted that fig. 6 illustrates a process of directly linking the identifier of the fast charging apparatus, the bootstrap loader code, the firmware update information, and the fast charging protocol information, but in other embodiments, for the situation that the data volume of the preparation process of the quick charging equipment and the production scheme of the quick charging equipment is large, the client node 410 may link the hash of the preparation process of the fast charging equipment, the hash of the production scheme of the fast charging equipment, the corresponding preparation process of the fast charging equipment, and the hash of the production scheme of the fast charging equipment in pairs, and store the original preparation process of the fast charging equipment, the production scheme of the fast charging equipment, the corresponding preparation process of the fast charging equipment, and the production scheme of the fast charging equipment in a distributed file system or a database. After the client node 510 obtains the preparation process of the fast charging equipment and the production scheme of the fast charging equipment, and the corresponding preparation process of the fast charging equipment and the production scheme of the fast charging equipment from the distributed file system or the database, verification can be performed in combination with the corresponding hash in the block chain network 200, so that the workload of uplink operation is reduced.
As an example of a block chain, referring to fig. 7, fig. 7 is a schematic structural diagram of a block chain in a block chain network 200 according to an embodiment of the present invention, where a header of each block may include hash values of all transactions in the block and also include hash values of all transactions in a previous block, a record of a newly generated transaction is filled in the block and is added to a tail of the block chain after being identified by nodes in the block chain network, so as to form a chain growth, and a chain structure based on hash values between blocks ensures tamper resistance and forgery prevention of transactions in the block.
An exemplary functional architecture of the blockchain network provided by the embodiment of the present invention is described below, referring to fig. 8, fig. 8 is a schematic functional architecture diagram of the blockchain network provided by the embodiment of the present invention, which includes 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.
The resource layer 205 encapsulates the computing, storage, and communication resources that implement each node 210 in the blockchain network 200.
The data layer 204 encapsulates various data structures that implement the ledger, including blockchains implemented as files in a file system, state databases of the key-value type, and presence certificates (e.g., hash trees for transactions in blocks).
The network layer 203 encapsulates the functions of a Point-to-Point (P2P) network protocol, a data propagation mechanism and a data verification mechanism, an access authentication mechanism and service agent identity management.
Wherein the P2P network protocol implements communication between nodes 210 in the blockchain network 200, the data propagation mechanism ensures propagation of transactions in the blockchain network 200, and the data verification mechanism is used for implementing reliability of data transmission between nodes 210 based on cryptography methods (e.g., digital certificates, digital signatures, public/private key pairs); the access authentication mechanism is used for authenticating the identity of the service subject added into the block chain network 200 according to an actual service scene, and endowing the service subject with the authority of accessing the block chain network 200 when the authentication is passed; the business entity identity management is used to store the identity of the business entity that is allowed to access blockchain network 200, as well as the permissions (e.g., the types of transactions that can be initiated).
The consensus layer 202 encapsulates the functions of the mechanism for the nodes 210 in the blockchain network 200 to agree on a block (i.e., a consensus mechanism), transaction management, and ledger management. The consensus mechanism comprises consensus algorithms such as POS, POW and DP OS, and the pluggable consensus algorithm is supported.
The transaction management is used for verifying the digital signature carried in the transaction received by the node 210, verifying the identity information of the service body, and judging and confirming whether the service body has the authority to perform the transaction (reading the relevant information from the service body identity management) according to the identity information; for the service agents authorized to access the blockchain network 200, the service agents all have digital certificates issued by the certificate authority, and the service agents sign the submitted transactions by using private keys in the digital certificates of the service agents, so that the legal identities of the service agents are declared.
The ledger administration is used to maintain blockchains and state databases. For the block with the consensus, adding the block to the tail of the block chain; executing the transaction in the block which obtains the consensus, updating the key-value pairs in the state database when the transaction comprises an updating operation, querying the key-value pairs in the state database when the transaction comprises a querying operation and returning a query result to the client node of the business entity. Supporting query operations for multiple dimensions of a state database, comprising: querying the block based on the block vector number (e.g., hash value of the transaction); inquiring the block according to the block hash value; inquiring a block according to the transaction vector number; inquiring the transaction according to the transaction vector number; inquiring account data of a business main body according to an account (vector number) of the business main body; and inquiring the block chain in the channel according to the channel name.
The application layer 201 encapsulates various services that the blockchain network can implement, including tracing, crediting, and verifying transactions. Therefore, when a manufacturer of the quick charging equipment replaces different production lines, the identification of the quick charging equipment, the boot loader code, the firmware updating information and the quick charging protocol information are obtained from the block chain network, so that the quick charging equipment can be rapidly produced, and the production efficiency of the quick charging equipment is improved.
The following description will be made with reference to fig. 1 by taking an application environment of a fast charging function of an electronic device as an example, where before introducing a processing method of a preparation process of a fast charging device provided by the present invention, a fast charging device in related art is first introduced, where fast charging is a new technology developed recently, and is currently very wide in the field of charging of mobile devices, and corresponds to various complicated fast charging protocols. The fast charging protocol is designed for realizing the communication between the charging terminal and the receiving terminal and completing the power negotiation. By using the quick charging protocol, the charging end can provide a group of voltage-current combined gears selected by the power receiving end, and the power receiving end can select one of the gears to supply power to the power receiving end through the protocol. The flexibility of the design of the charging equipment is greatly improved by the rapid charging protocol, the power receiving end can select the power gear most suitable for the receiving end to charge, and meanwhile, the charging efficiency is also greatly improved.
In design, the fast charging protocol is implemented on a software level, and the charging equipment and the powered equipment can communicate by using the fast charging protocol by compiling corresponding control programs. The part of software is a firmware program running in the two-terminal device charging management chip.
In the related art, the preparation process of the quick charging device can be divided into three parts of work, hardware design, software design and actual production, and specifically comprises the following stages:
1) hardware design stage: carrying out rapid charging hardware design; testing hardware functions; and testing whether the software functions normally.
2) And (3) software design stage: compiling the firmware code; flashing firmware to the development board; and testing whether the software functions normally.
3) The production stage comprises: designing and manufacturing a hardware PCB, and finally programming the firmware into the chip.
Among other things, hardware design includes the design and selection of product appearance and internal circuitry and devices. The software design part mainly develops and supports the charging function of the quick charging equipment, and comprises the realization of a quick charging protocol, the detection of the current charging state, the control of input/output voltage and current, the detection of an access cable and other functions which are realized on a software level.
In the actual production part, after the software and hardware are designed, manufacturers start to perform batch production of products, and in the process, manufacturers can complete operations such as manufacturing of actual product PCBs and shells and filling of firmware. Finally, welding and assembling the devices together to form the final quick charging device. The quick charging equipment produced in the preorder production process can flexibly modify and update a firmware program for realizing a quick charging protocol, and the quick charging protocol can transmit data in design. Most OEMs realize a firmware update function through a data channel of a rapid charging protocol when writing sample codes of firmware. In some other implementations, there are designs that update firmware using a self-defined proprietary protocol.
The updating technology of the quick charging equipment firmware can be realized by the following modes:
1. transmitting firmware through a VDM message of a PD protocol; 2. leading out an SWD pin through a redundant pin in the Type-C interface, and flashing the firmware through an SWD debugging protocol; 3. a private protocol communication is realized through redundant pins in the Type-C interface, and updating and writing of the firmware are realized.
However, no matter which of the foregoing update techniques for the firmware of the flash device is adopted, it cannot be guaranteed that a malicious attacker flushes the modified firmware program. These maliciously modified firmware programs can cause abnormal operation of the charging device and can cause permanent electrical damage to the charged device.
In order to overcome the above defects, when a manufacturer of the fast charging device starts a production process, the manufacturer can quickly enter production by acquiring the identifier of the fast charging device, the boot loader code, the firmware update information, and the fast charging protocol information from the block chain network, wherein the processing method of the preparation process of the fast charging device includes 3 different stages, which are sequentially introduced below.
Referring to fig. 9, fig. 9 is an optional flowchart of a firmware updating method for a fast charging device according to an embodiment of the present invention, which specifically includes the following steps:
1) and (3) software design stage:
step 901: and triggering a function development process of a quick charging part matched with the quick charging equipment.
Step 902: an editing process to write the bootloader code with signature verification is triggered.
Step 903: and determining a function code of a quick charging function of the quick charging equipment.
Step 904: a process is triggered that tests the functionality of the boot loader code.
Step 905: it is checked whether the function of the boot loader code is normal, if so, step 906 is performed, otherwise, step 902 is performed.
Step 906: and detecting whether the quick charging function of the quick charging equipment is normal or not, if so, executing step 911, otherwise, executing step 903.
2) Hardware design stage:
step 907: triggering a hardware design of a quick charging function of the quick charging equipment;
step 908: and testing the hardware function of the quick charging equipment with the quick charging function.
Step 909: and testing whether the software function of the quick charging equipment with the quick charging function is normal, if so, executing the step 910, and otherwise, executing the step 907.
Step 910: and triggering a hardware PCB design and manufacturing process of the quick charging equipment with the quick charging function.
3) Preparation process of code protection stage:
step 911: programming the boot loader code into the chip.
Step 912: the memory area of the boot loader code is locked.
Step 913: and programming the functional code into the chip.
4) The production stage comprises:
step 914: and the production of the equipment factory is finished, and the preparation of the quick-charging equipment is completed.
Wherein, the software design stage is divided into two parts of processes: a bootloader development process and a functional code development process. After separation, the coupling of the code functions can be effectively removed. Independent maintenance and expansion can be performed.
Further, when the production line of the rapid charging device completes the production of the rapid charging device based on the processing method of the preparation flow of the rapid charging device shown in fig. 9, referring to fig. 10, fig. 10 is an optional schematic flow diagram of the method for updating the firmware of the rapid charging device provided in the embodiment of the present invention; the method comprises the following steps:
step 1001: and powering on the chip of the quick charging equipment to run the stored boot loader codes.
Step 1002: and executing a hardware initialization process of the quick charging equipment.
The Bootloader code is a code that runs when the chip is started, and only a few limited functions are provided in design. This ensures a minimum amount of development and a minimum likelihood of bug/hole presence. Bootloader code contains the functions of initializing the hardware environment, loading and running function codes, checking the function codes to be updated, and updating and writing new function codes.
Step 1003: and detecting a firmware updating signal of the quick charging equipment.
Step 1004: and judging whether the firmware is updated, if so, executing step 1005, otherwise, executing step 1006.
Step 1005: waiting for receiving the firmware update of the quick charging device.
Step 1006: and reading the function code from the storage medium of the quick-charging device.
Step 1007: and finishing receiving the firmware of the quick charging equipment.
Initializing a hardware environment when Bootloader is started, after initialization is completed, checking whether a firmware updating signal set on hardware/software exists, and if so, entering a firmware updating process. In the firmware updating process, the bootloader may or may not implement the function of receiving the firmware updating code, and here, the two steps of "waiting to receive the firmware update of the fast charging device" in step 1005 and "reading the function code from the storage medium of the fast charging device" in step 1006 correspond to the above steps, and these two functions are optional. If bootloader does not realize the function, the function of receiving and storing the firmware needs to be realized in the function code. After obtaining the updated firmware, the bootloader needs to check and check the validity of the updated firmware. The proposal adopts public-private key digital signature algorithm to carry out signature and verification. Wherein, the signature algorithm can select any one of RSA algorithm and ECDSA algorithm. If RSA algorithm is selected, 2048 bits and above are preferred.
Step 1008: and checking whether the firmware of the quick charging device is valid, if so, executing the step 1009, otherwise, executing the step 1010.
Step 1009: and writing the updated content into the firmware of the quick charging device.
Step 1010: and clearing the firmware updating signal and restarting the chip of the quick charging device.
Furthermore, if the validity check of the updated firmware is passed, the process of writing the firmware is entered, and the application firmware can be really updated only after the check is passed, so that the equipment can be ensured to only run legal and trusted firmware codes. If the validity check of the updated firmware fails, the bootloader needs to clear the updated state of the firmware, keep the original firmware unchanged, and directly run the original firmware when running next time.
Step 1011: and judging whether the function code is checked to be valid, if so, executing step 1012, otherwise, executing step 1013.
Step 1012: and executing the quick charging function of the quick charging equipment to realize the normal operation of the equipment.
Step 1013: execution of the untrusted code is denied, triggering an alarm.
When the Bootloader does not detect a firmware updating signal, the Bootloader needs to load a firmware code stored in a storage medium by default and check the code, if the code passes the check, the firmware code is directly operated, and at the moment, the function of the fast charging equipment can normally operate. If the verification fails, the firmware code is refused to run. The running efficiency of the firmware code is not guaranteed, and the verification algorithm can adopt a lighter-weight verification algorithm. For example; the check algorithm in the function code start stage may be a lightweight algorithm such as CRC32, CRC16, checksum, or the like.
The following description is continued with reference to the code protection process shown in the preamble embodiment, and an optional flow diagram of the method for processing the preparation flow of the rapid charging device provided in the embodiment of the present invention is provided; the preparation process code protection phase of the code protection phase is divided into three steps:
1) programming a boot loader code; 2) locking the boot loader code; 3) and programming a functional code.
Specifically, the step of programming a boot loader code (bootloader) is to program the programmed firmware into a chip used for mass production of products through a programmer, and the bootloader needs to be programmed into a storage medium built in the chip to prevent the bootloader from being read.
The step of locking the bootloader is to set the storage area where the bootloader is located to be 'not re-writable' by setting the security bit of the chip, and simultaneously open the protection that the code cannot be read to the outside (the protection is different in different chips, such as ReadOutProtection of STM 32). This step may determine that the bootloader code is not to be updated and overwritten by someone other than the vendor.
The step of programming the function code is to program the function code into the chip, specifically, the function code may be programmed into a memory area built in the chip, or may be programmed into an external storage medium, which may be determined according to the specific design of hardware. This step is mainly to write the functional code of the device, which is updateable in design.
The beneficial technical effects are as follows:
the embodiment of the invention executes an initialization process matched with the firmware of the quick charging equipment when the quick charging equipment or the firmware thereof is powered on and runs; outputting inquiry prompt information whether to update the firmware when the firmware updating signal is detected; responding to a firmware updating instruction, and starting a firmware updating flow aiming at the quick charging equipment; receiving and storing a firmware updating program to be updated; and when the firmware updating program passes the validity and validity detection, executing the writing and updating processing of the firmware updating program. Therefore, the method can fully utilize the boot loader codes to support the quick charging function of the electronic equipment in the preparation process of the boot loader of the quick charging equipment, expand the use range of the quick charging function of the firmware of the quick charging equipment, ensure the timely update of the firmware of the quick charging equipment, prevent the influence of malicious firmware programs on the quick charging equipment and ensure the safe use of the quick charging equipment of a user.
The above description is only exemplary of the present invention and should not be taken as limiting the scope of the present invention, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (14)

1. A firmware updating method of a quick charging device is characterized by comprising the following steps:
when the quick charging equipment or the firmware thereof is powered on and operated, executing an initialization process matched with the firmware of the quick charging equipment;
detecting a firmware updating signal aiming at the quick charging equipment, and outputting inquiry prompt information whether to update the firmware when the firmware updating signal is detected;
responding to a firmware updating instruction, and starting a firmware updating flow aiming at the quick charging equipment;
receiving and storing a firmware updating program to be updated;
carrying out validity check and check processing on the firmware updating program;
and when the firmware updating program passes the validity and validity detection, executing the writing and updating processing of the firmware updating program.
2. The method of claim 1, wherein performing a validity check and check process on the firmware update program comprises:
and signing and verifying the firmware updating program by adopting a public and private key data signature algorithm.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
and when the firmware updating program does not pass the validity and validity detection, clearing the firmware updating program or the firmware updating state, restarting the quick charging equipment, and executing the quick charging function of the original firmware of the quick charging equipment.
4. The method according to claim 1 or 2, characterized in that the method further comprises:
and after the detection of the firmware updating signal aiming at the quick charging equipment is completed and the firmware updating signal is not detected, executing a quick charging function of the quick charging equipment.
5. The method of claim 3 or 4, wherein the performing the fast charging function of the fast charging device comprises:
reading a quick charging function code from a chip or a storage medium of the quick charging equipment; wherein, a boot loader code for executing the quick charging function is pre-recorded or stored in the chip or the storage medium;
carrying out credible verification processing on the quick charging function code;
and after the quick charging function code passes the trusted verification processing, executing the quick charging function of the quick charging equipment.
6. The method according to claim 5, wherein the reading the fast charging function code from the chip or the storage medium of the fast charging device comprises:
when the quick charging equipment is an adapter, sending a downloading request to corresponding storage equipment according to a software storage path of the adapter, wherein the downloading request comprises a software identifier of the adapter with the quick charging function;
and receiving a quick charging function code which is issued by the storage equipment and is matched with the adapter according to the software identifier of the adapter.
7. The method according to claim 5, wherein the performing a trust verification process on the fast charging function code comprises:
detecting a quick charging function code of the quick charging equipment through a signature authentication algorithm carried by the boot loader code;
and when the quick charging function code does not pass the credible verification processing, stopping continuously executing the quick charging function of the quick charging equipment, and warning through the quick charging equipment.
8. The method of claim 5, wherein the boot loader code is implemented by:
writing a boot loader code with a signature verification function;
writing a quick charging equipment function code for implementing a quick charging function on the quick charging equipment;
performing flash processing on the written boot loader code with the signature verification function and the functional code of the rapid charging equipment to obtain a flash-processed boot loader development board;
testing the signature verification function and the quick charging equipment function of the bootstrap loader development board subjected to the flash processing;
programming the tested boot loader code with the signature verification function and normal function into a chip;
performing storage area locking processing on the bootstrap loader code with the signature verification function;
and programming the tested functional code of the quick charging equipment with normal function into a chip.
9. The method according to claim 8, wherein performing a storage region locking process on the bootloader code with signature verification function comprises:
determining the storage position of the boot loader code with the signature verification function in a storage medium of firmware of the quick charging device;
adapting storage medium parameters of the storage location to adjust readability of the storage medium of the storage location;
and performing storage region locking processing on the storage medium of the storage position through a programmer to realize the read-only property of the storage region.
10. The method of claim 8, further comprising:
according to the version information of the quick charging function code of the firmware of the quick charging equipment, the type of a signature authentication algorithm carried by the boot loader code is adjusted; alternatively, the first and second electrodes may be,
and adjusting the type of a signature authentication algorithm carried by the boot loader code according to the use environment of the quick charging equipment.
11. A firmware update program of a fast charging device, the firmware update program comprising:
the hardware initialization module is used for executing an initialization process matched with the firmware of the quick charging equipment when the quick charging equipment or the firmware thereof is powered on and runs;
the firmware updating signal detection module is used for detecting a firmware updating signal aiming at the quick charging equipment and outputting inquiry prompt information whether to update the firmware when the firmware updating signal is detected;
the firmware updating triggering module is used for responding to a firmware updating instruction and starting a firmware updating process aiming at the quick charging equipment;
the firmware updating storage module is used for receiving and storing a firmware updating program to be updated;
the validity checking and checking module is used for checking and checking the validity of the firmware updating program;
and the program writing and updating module is used for executing the writing and updating processing of the firmware updating program when the firmware updating program passes the validity and validity detection.
12. A processor of a fast charging device, wherein the processor of the fast charging device is connected to a memory, the memory stores a plurality of executable instructions, and when the executable instructions are executed, the processor is enabled to execute the firmware updating method of the fast charging device according to any one of claims 1 to 10.
13. A fast charging device, characterized in that, the fast charging device includes:
a memory for storing executable instructions; wherein the executable instructions comprise a fast charging device boot loader;
a processor, configured to execute the executable instructions stored in the memory, and implement the firmware updating method of the fast-charging device according to any one of claims 1 to 10.
14. A computer-readable storage medium storing executable instructions, wherein the executable instructions, when executed by a processor, implement a firmware update method of a fast-charging device according to any one of claims 1 to 10.
CN202010296159.8A 2020-04-15 2020-04-15 Firmware updating method and program for quick charging equipment, quick charging equipment and storage medium Pending CN111831308A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010296159.8A CN111831308A (en) 2020-04-15 2020-04-15 Firmware updating method and program for quick charging equipment, quick charging equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010296159.8A CN111831308A (en) 2020-04-15 2020-04-15 Firmware updating method and program for quick charging equipment, quick charging equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111831308A true CN111831308A (en) 2020-10-27

Family

ID=72913392

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010296159.8A Pending CN111831308A (en) 2020-04-15 2020-04-15 Firmware updating method and program for quick charging equipment, quick charging equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111831308A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732308A (en) * 2020-12-31 2021-04-30 广州万协通信息技术有限公司 Firmware upgrading method, equipment and storage medium for module fine-grained
CN113220330A (en) * 2021-05-25 2021-08-06 杭州海康威视数字技术股份有限公司 Management method and device of electronic equipment
CN114168176A (en) * 2021-12-15 2022-03-11 四川启睿克科技有限公司 Block chain-based cross-manufacturer equipment upgrading system and method
CN114584322A (en) * 2022-03-31 2022-06-03 浙江地芯引力科技有限公司 Method and device for switching key authentication mode of connection device, connection device and medium
WO2023216845A1 (en) * 2022-05-09 2023-11-16 乐鑫信息科技(上海)股份有限公司 Firmware update method for embedded device, embedded device, and development end device
TWI823311B (en) * 2022-03-29 2023-11-21 新唐科技股份有限公司 Method and data structure product for updating a firmware

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120060039A1 (en) * 2010-03-05 2012-03-08 Maxlinear, Inc. Code Download and Firewall for Embedded Secure Application
CN104166565A (en) * 2014-08-11 2014-11-26 成都瑞博慧窗信息技术有限公司 Intelligent display terminal firmware updating method
CN105870982A (en) * 2015-11-20 2016-08-17 乐视致新电子科技(天津)有限公司 Intelligent charging method and system and intelligent charging pile
CN106097587A (en) * 2016-08-04 2016-11-09 刘世和 Based on cloud platform, the distributed electric vehicle charging management system of many tenants and method
US20180173182A1 (en) * 2016-12-16 2018-06-21 General Electric Company Uninterruptable verification and control upgrade for real-time control system
WO2018138789A1 (en) * 2017-01-25 2018-08-02 三菱電機株式会社 Built-in device and firmware update method
CN109918105A (en) * 2019-02-21 2019-06-21 福建星云电子股份有限公司 A kind of charging pile software automatic on-line upgrade method and system
CN110196727A (en) * 2019-06-06 2019-09-03 北京牛电信息技术有限责任公司 Electric vehicle Oftware updating method, device, handheld device and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120060039A1 (en) * 2010-03-05 2012-03-08 Maxlinear, Inc. Code Download and Firewall for Embedded Secure Application
CN104166565A (en) * 2014-08-11 2014-11-26 成都瑞博慧窗信息技术有限公司 Intelligent display terminal firmware updating method
CN105870982A (en) * 2015-11-20 2016-08-17 乐视致新电子科技(天津)有限公司 Intelligent charging method and system and intelligent charging pile
CN106097587A (en) * 2016-08-04 2016-11-09 刘世和 Based on cloud platform, the distributed electric vehicle charging management system of many tenants and method
US20180173182A1 (en) * 2016-12-16 2018-06-21 General Electric Company Uninterruptable verification and control upgrade for real-time control system
WO2018138789A1 (en) * 2017-01-25 2018-08-02 三菱電機株式会社 Built-in device and firmware update method
CN109918105A (en) * 2019-02-21 2019-06-21 福建星云电子股份有限公司 A kind of charging pile software automatic on-line upgrade method and system
CN110196727A (en) * 2019-06-06 2019-09-03 北京牛电信息技术有限责任公司 Electric vehicle Oftware updating method, device, handheld device and storage medium

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
DONUT: "Overcome MD5-RSA Signature verification", 《HTTPS://CRYPTO.STACKEXCHANGE.COM/QUESTIONS/68727/OVERCOME-MD5-RSA-SIGNATURE-VERIFICATION》 *
ITSENSING: "如何用MD5值检查软件的合法性", 《HTTPS://BBS.CSDN.NET/TOPICS/30477165?LIST=82748》 *
WUYEYOULANJIAN: "文件系统——程序包管理概述及rpm包合法性验证", 《HTTPS://BLOG.51CTO.COM/WUYELAN/1545895》 *
小北瓜: "对设备升级时,如何通过核对MD5哈希值来校验软件的合法性", 《HTTPS://FORUM.HUAWEI.COM/ENTERPRISE/ZH/THREAD-319445.HTML》 *
小安: "Google OpenTitan,硬件安全的泰坦之箭", 《HTTPS://ZHUANLAN.ZHIHU.COM/P/97569701》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732308A (en) * 2020-12-31 2021-04-30 广州万协通信息技术有限公司 Firmware upgrading method, equipment and storage medium for module fine-grained
CN113220330A (en) * 2021-05-25 2021-08-06 杭州海康威视数字技术股份有限公司 Management method and device of electronic equipment
CN114168176A (en) * 2021-12-15 2022-03-11 四川启睿克科技有限公司 Block chain-based cross-manufacturer equipment upgrading system and method
TWI823311B (en) * 2022-03-29 2023-11-21 新唐科技股份有限公司 Method and data structure product for updating a firmware
CN114584322A (en) * 2022-03-31 2022-06-03 浙江地芯引力科技有限公司 Method and device for switching key authentication mode of connection device, connection device and medium
CN114584322B (en) * 2022-03-31 2023-08-22 浙江地芯引力科技有限公司 Method and device for switching secret key authentication modes of connecting device, connecting device and medium
WO2023216845A1 (en) * 2022-05-09 2023-11-16 乐鑫信息科技(上海)股份有限公司 Firmware update method for embedded device, embedded device, and development end device

Similar Documents

Publication Publication Date Title
CN111831308A (en) Firmware updating method and program for quick charging equipment, quick charging equipment and storage medium
CN109542518B (en) Chip and method for starting chip
US10395039B2 (en) Customer-owned trust of device firmware
KR101066727B1 (en) Secure booting a computing device
CN109446815B (en) Management method and device for basic input/output system firmware and server
US10078748B2 (en) Unlock and recovery for encrypted devices
US9378372B2 (en) Secure download and security function execution method and apparatus
US8560823B1 (en) Trusted modular firmware update using digital certificate
US7953225B2 (en) Mobile wireless communications device with software installation and verification features and related methods
KR102618665B1 (en) Version history management using blockchain
CN111264044B (en) Chip, method for generating private key and method for trustable certification
US20090327741A1 (en) System and method to secure boot uefi firmware and uefi-aware operating systems on a mobile internet device (mid)
US20110258426A1 (en) Booting and configuring a subsystem securely from non-local storage
EP3458999A1 (en) Self-contained cryptographic boot policy validation
US11206141B2 (en) Merging multiple compute nodes with trusted platform modules utilizing provisioned node certificates
EP3676743B1 (en) Application certificate
CN109492352B (en) Method and device for realizing equipment identification combination engine
CN111052117B (en) Safely defining operating system composition without multiple authoring
CN112714158A (en) Transaction processing method, relay network, cross-link gateway, system, medium, and device
US20220224546A1 (en) Software integrity protection method and apparatus, and software integrity verification method and apparatus
WO2023124420A1 (en) Application signature methods and system, transaction terminal and service platform
CN115329321A (en) Firmware starting method, chip and computing device
JP2023525576A (en) Scope of control of authentication keys for software updates
US20090172376A1 (en) Methods, apparatuses, and computer program products for providing a secure predefined boot sequence
WO2018233638A1 (en) Method and apparatus for determining security state of ai software system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination