Firmware upgrade method, device, system and storage medium
By using the background method to obtain and store upgrade data in the APP running area of the charging device, the problem of manual disassembly of the charging pile firmware upgrade is solved, remote firmware upgrade is realized, manpower and time costs are reduced, and the continuity of communication between the charging pile and the robot is ensured.
Patent Information
- Application Number
- CN202211008511.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-22
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-08-22
AI Technical Summary
In the prior art, the robot's charging pile needs to be manually disassembled during firmware upgrades, causing the charging pile to go offline, affecting normal operation, increasing manpower and time costs, and preventing timely upgrades.
The upgrade data is obtained in the background in the APP running area of the charging device and stored in the backup area. After the complete data is detected, it is switched to the BootLoader area for upgrade without affecting normal operation.
It enables remote firmware upgrades without affecting the normal operation of the charging pile, reducing manpower and time costs and ensuring the continuity of communication between the charging pile and the robot.
Smart Images

Figure CN115473807B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a firmware upgrade method, device, system, and storage medium. Background Art
[0002] In existing technology, upgrading the board firmware of a robot's charging station typically requires on-site personnel to manually disassemble the unit to perform the firmware upgrade. In this case, the charging station is often offline during the upgrade process, impacting the normal operation of the charging station and the robot. Furthermore, the manual upgrade of the charging station requires on-site personnel, increasing labor and time costs, and preventing timely upgrades of the control board. Summary of the Invention
[0003] The embodiments of the present application provide a firmware upgrade method, device, system and storage medium, which are used to remotely upgrade the firmware of a charging pile control board without affecting the normal operation of the charging pile.
[0004] In a first aspect, an embodiment of the present application provides a firmware upgrade method, the method comprising: during the operation of the APP running area of the charging device, when the charging device determines that the firmware of the charging device needs to be upgraded, the charging device obtains the upgrade data of the firmware of the charging device from the mobile device in a background manner. The charging device stores the firmware upgrade data in the APP backup area of the charging device. When it is determined that the charging device enters the BootLoader area from the APP running area through a first operation, and when it is detected that the APP backup area has upgrade data, the charging device moves the upgrade data to the APP running area. The charging device uses the upgrade data to upgrade the firmware of the charging device in the APP running area.
[0005] An embodiment of the present application provides a firmware upgrade method, in which, when it is determined that the firmware of a charging device needs to be upgraded, the upgrade data of the firmware of the charging device is obtained from the mobile device in the background while the APP running area of the charging device is running. Receiving the upgrade data in the background can prevent the charging device from jumping from the APP running area to the BootLoader area, without affecting the normal operation of the charging device through the APP running area. The upgrade data is then stored in the APP backup area of the charging device, rather than directly in the APP running area. This can prevent the newly received upgrade data from erasing the old version upgrade data already in the APP running area. In the present application, when the charging device enters the BootLoader area from the APP running area through a first operation and detects that the APP backup area has upgrade data, the upgrade data is moved to the APP running area and the firmware is upgraded using the upgrade data. Therefore, this solution can achieve remote upgrade of the charging device without affecting the normal operation of the charging device.
[0006] In a possible implementation of the present application, in the process of moving the upgrade data to the APP running area, the old version upgrade data originally stored in the APP running area is first deleted, and then the upgrade data is moved to the APP running area.
[0007] In one possible implementation of the present application, in the process of moving the upgrade data to the APP running area, the upgrade data can be moved to the APP running area first, and then the old version upgrade data originally stored in the APP running area can be deleted, or the old version upgrade data originally stored in the APP running area can be set to an unavailable state.
[0008] In one possible implementation of the present application, before storing the upgrade data in the APP backup area of the charging device, the method provided in the embodiment of the present application further includes: the charging device verifies in the BootLoader area whether the chip model carried in the upgrade data matches the chip model of the charging device, and / or whether the upgrade data is complete. In this method, the BootLoader area of the charging device needs to confirm that the received upgrade data is complete and applicable to the charging device. The purpose of doing so is to detect changes in the data during transmission, prevent transmission errors or incomplete transmission data, and ensure the reliability of the transmitted data.
[0009] In one possible implementation of the present application, during operation of the APP running area of the charging device, before determining to upgrade the firmware of the charging device, the method provided in an embodiment of the present application further includes: the charging device running the BootLoader area and determining whether the APP running area has an application. If there is no application in the APP running area, the charging device continues to run the BootLoader area to wait for upgrade data from the mobile device, where the application represents a program that performs work on the charging device. If there is an application in the APP running area, the charging device enters the APP running area from the BootLoader area.
[0010] In one possible implementation of the present application, when the charging device enters the BootLoader area, the method provided in the embodiment of the present application further includes: the charging device detecting whether the charging device enters the BootLoader area in the first operation or the second operation. When the charging device enters the BootLoader area in the second operation, the charging device re-detects whether the APP running area in the BootLoader area has an application.
[0011] In a possible implementation of the present application, the method provided in the embodiment of the present application further includes: the charging device receives an upgrade instruction, and the upgrade instruction is used to indicate that the firmware is to be upgraded. According to the upgrade instruction, the charging device updates the first flag bit in the APP running area to a first indicator, and the first indicator is used to indicate that the firmware is to be upgraded. In the case where there is an application in the APP running area, the second flag bit in the BootLoader area of the charging device is updated to a second indicator, and the second indicator indicates that there is an application in the APP running area. In the case where the upgrade data is stored in the APP backup area, the charging device updates the third flag bit in the BootLoader area to a third indicator, and the third indicator indicates that the upgrade data is stored in the APP backup area.
[0012] In one possible implementation of the present application, the method provided in an embodiment of the present application further includes: storing a fourth flag in the BootLoader area of the charging device, the fourth flag being used to indicate whether the charging device entered the BootLoader area as the first operation or the second operation. Determining that the charging device entered the BootLoader area from the APP running area through the first operation and detected that the APP backup area contained upgrade data includes: the charging device entered the BootLoader area from the APP running area, and obtaining the fourth flag and the third flag from the BootLoader area. If the fourth flag is the fourth indicator and the third flag is the third indicator, the charging device determines that the charging device entered the BootLoader area from the APP running area through the first operation and detected that the APP backup area contained upgrade data, and the fourth indicator is used to indicate whether the charging device entered the BootLoader area through the first operation. The flag stored in the charging device facilitates requiring a dedicated indicator to change the flag of the charging device, or using different indicators to represent the current status of different areas. The flag is updated to the corresponding indicator. This ensures that the charging device only upgrades its firmware using a preset indicator, avoiding program confusion.
[0013] In one possible implementation of the present application, the charging device obtains firmware upgrade data for the charging device in a background manner. The method provided in an embodiment of the present application further includes: the charging device obtains the firmware upgrade data from the mobile device via a Bluetooth communication connection between the charging device and the mobile device. Alternatively, the charging device obtains the firmware upgrade data from the mobile device via a serial port communication connection between the charging device and the mobile device.
[0014] In a second aspect, an embodiment of the present application provides a device for firmware upgrade, which is applied to a charging device. The control module of the charging device has an APP portion area, an APP running area, and a BootLoader area. The device for firmware upgrade can implement the method in the first aspect or any possible implementation of the first aspect, and thus can also achieve the beneficial effects of the first aspect or any possible implementation of the first aspect. The device for firmware upgrade can be a charging device, or it can be a device that supports the charging device to implement the method in the first aspect or any possible implementation of the first aspect, such as a chip or control circuit applied to the charging device. The device for firmware upgrade can implement the above method through software, hardware, or by executing corresponding software through hardware.
[0015] As an example, an embodiment of the present application provides a device for firmware upgrade, which is a charging device or a chip used in a charging device. The device for firmware upgrade includes: an acquisition unit, a first processing unit, a second processing unit, and an upgrade unit, wherein the acquisition unit is used to obtain firmware upgrade data from a mobile device in a background manner when determining that the firmware of the charging device is upgraded during the operation of the APP operation area of the charging device. The first processing unit is used to store the upgrade data in the APP backup area of the charging device. The second processing unit is used to move the upgrade data to the APP operation area when determining that the charging device enters the BootLoader area from the APP operation area through the first operation and detecting that the APP backup area has upgrade data. The upgrade unit is used to upgrade the firmware in the APP operation area using the upgrade data.
[0016] In a possible implementation of the present application, before storing the upgrade data in the APP backup area of the charging device, the first processing unit is further configured to verify the upgrade data in the BootLoader area of the charging device.
[0017] In a possible implementation of the present application, the acquiring unit is further configured to, when there is no application program in the APP running area, continue running the BootLoader area to wait for upgrade data from the mobile device.
[0018] In a possible implementation of the present application, the upgrading unit is further configured to, when the charging device performs the second operation, enable the charging device to enter the BootLoader area and re-detect whether the firmware of the charging device needs to be upgraded.
[0019] In a third aspect, an embodiment of the present application provides a charging device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the charging device implements a firmware upgrade method as described in any possible implementation of the first aspect to the first aspect.
[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is run on a computer, the computer executes a firmware upgrade method as described in any possible implementation method of the first aspect to the first aspect.
[0021] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute a firmware upgrade method described in the first aspect or various possible implementations of the first aspect.
[0022] In a sixth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is configured to execute a computer program or instruction to implement the firmware upgrade method described in the first aspect or various possible implementations of the first aspect. The communication interface is configured to communicate with other modules outside the chip. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A schematic diagram of a firmware upgrade system provided in an embodiment of the present application;
[0024] Figure 2 A schematic structural diagram of a charging device 100 provided in an embodiment of the present application;
[0025] Figure 3 A flowchart of a firmware upgrade method provided in an embodiment of the present application;
[0026] Figure 4 A schematic diagram of the structure of a device for firmware upgrade provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] like Figure 1 As shown, Figure 1 A schematic diagram of a firmware upgrade system provided in an embodiment of the present application is shown, the system comprising: a charging device 100 and a mobile device 200.
[0028] Optionally, the system may further include: a server 300 , configured to provide firmware upgrade data for the charging device 100 .
[0029] As an example, the charging device 100 in the embodiments of the present application can provide charging services for the mobile device 200. For example, the charging device 100 can be a charging station or charging base, and the mobile device 200 can be a robot, such as a cleaning robot or a delivery robot, without specific limitation. The server 300 typically establishes a communication connection with the mobile device 200. In practice, the server 300 stores firmware upgrades and updates, and can transmit the upgrade data to the mobile device 200.
[0030] The communication module 110 in the charging device 100 can establish a communication connection with the communication module 210 in the mobile device 200, such as a Bluetooth connection or a serial communication connection, which is not limited in this embodiment of the present application.
[0031] The communication module 210 in the mobile device 200 can establish a wireless communication connection with the server 300, such as a 4G connection or a WIFI connection, which is not limited in this embodiment of the present application.
[0032] Optional, such as Figure 2As shown, the charging device 100 includes: a communication module 110 and a control module 120. The communication module 110 and the control module 120 are connected. The communication module 110 can be a wireless communication module, such as a Bluetooth communication module, or a wired communication module, such as a serial communication module. The communication module 110 of the charging device 100 can establish a communication connection with the communication module of another device (such as the communication module 210 of the mobile device 200). The communication connection can be a wired communication connection or a wireless communication connection.
[0033] As an example, in the embodiment of the present application, the control module 120 may be executed in a memory chip in a microcontroller unit (MCU) in the charging device 100. Optionally, the memory chip may be a flash memory or a static random-access memory (SRAM), which is not limited in the embodiment of the present application.
[0034] As an example, the control module 120 can be divided into three areas, such as Figure 1 As shown, it includes: BootLoader (boot loader) area 121, APP running area 122 and APP backup area 123. It should be explained that the area mentioned in the embodiment of the present application can be one and / or multiple programs, or it can be an area containing one and / or multiple programs.
[0035] In this embodiment, in order to enable the control module 120 to respond to remote upgrades, a BootLoader area 121 is preset in the control module 120 .
[0036] As an example, the BootLoader area 121 stores a bootloader. This bootloader can run after the first or second operation of the charging device 100, before the application program in the APP running area 122, to detect whether there are any programs in the APP running area 122 and the APP backup area 123. The bootloader can also be used to receive upgrade data from the mobile device and store it in the APP backup area 123. The bootloader can also be used to verify the integrity of the upgrade data. The bootloader can also be used to check the operating mode of the charging device 100.
[0037] For example, the first operation in the embodiments of the present application may be a soft reset operation, and the second operation may be a power-on reset operation. A soft reset typically uses a series of instructions to mimic a hardware reset function. Optionally, the soft reset operation may define a function pointer that points to the absolute address 0. The power-on reset operation sends a reset signal to the reset terminal when the chip is powered on, instructing the processor not to operate during the power-on process to avoid data errors during runtime.
[0038] As an example, the APP running area 122 stores an application program and an upgrade program. The application program is used to perform normal operation of the charging device 100. It should be noted that the application program is the existing firmware program in the charging device 100. When the charging device receives firmware upgrade data, the application program is responsible for the normal operation of the charging device. The upgrade program is used to detect whether the firmware of the charging device 100 needs to be upgraded. The upgrade program can also receive upgrade instructions issued by the mobile device. The upgrade program can also use the upgrade data copied from the APP backup area 123 to upgrade the firmware of the charging device 100.
[0039] As an example, the APP backup area 123 may be used to store firmware upgrade data received by the BootLoader area 121 . It is understandable that the firmware upgrade data includes data for upgrading the firmware.
[0040] Optionally, the mobile device 200 includes a communication module and a processing module. The communication module can support the mobile device 200 to establish a communication connection with other devices (such as the charging device 100 and the server 300). The processing module is used to support the mobile device 200 to perform relevant processing steps.
[0041] The communication module 110 of the charging device 100 can be used to support the connection and communication between the charging device 100 and the mobile device 200 through wireless or wired communication technology, for example, in combination with Figure 1 As shown, the charging device 100 and the mobile device 200 can exchange data through their respective communication modules.
[0042] As an example, the communication module of the charging device 100 can be a Bluetooth chip or a serial bus physical interface. The communication module of the mobile device 200 can be a Bluetooth chip or a serial bus physical interface. Of course, the communication module of the mobile device 200 can also include a 4G chip or a WIFI chip to support data exchange between the mobile device 200 and the server 300. This embodiment of the application is not limited to this.
[0043] The charging device 100 can pair with the Bluetooth chip of the charging device 100 through the Bluetooth chip and establish a wireless communication connection, so as to realize wireless communication, service processing and data transmission between the charging device 100 and the mobile device 200 through the wireless connection. Generally, the Bluetooth chip can support Basic Rate (BR) / Enhanced Data Rate (EDR) Bluetooth and Bluetooth Low Energy (BLE).
[0044] Of course, in addition to being a Bluetooth chip, the communication module may also be a Near Field Communication (NFC) chip or a WiFi chip, which is not limited in the embodiment of the present application.
[0045] In addition to pairing the charging device 100 with the Bluetooth chip of the charging device 100 and establishing a wireless communication connection through the Bluetooth chip, the charging device 100 and the mobile device 200 can also achieve a wired communication connection through the serial bus physical interface they each have. Specifically, for example, if the charging device 100 is a charging pile and the mobile device 200 is a robot, the charging pile and the robot have a serial bus physical interface at their interface. Once the robot and the charging pile are connected, they can achieve a serial communication connection through the serial bus physical interface.
[0046] It is understandable that the serial communication connection between the charging pile and the robot through the serial bus physical interface is a wired communication method. As an example, the serial communication connection can be achieved through the serial bus physical interface between the central processing unit (CPU) in the charging device and the charging device 100, according to the set serial communication protocol, to perform wired communication connection, thereby performing data transmission. Optionally, according to the different level standards used in the physical layer, the serial communication protocol can be the RS-232 standard or the TTL standard, which is not limited in the embodiments of the present application.
[0047] In the related art, when the board firmware of the robot's charging pile is upgraded, the firmware program in the MCU's flash memory (Flash) chip is usually upgraded, and the BootLoader program in the flash memory chip guides the upgrade of the firmware. Since there is only one APP area, it is necessary to use the new firmware program to overwrite the original firmware program in the flash memory chip to complete the firmware upgrade. Therefore, during the firmware upgrade process, the current working state of the charging pile is interrupted, and the communication connection with the robot is not restored until the firmware upgrade is completed. And such an upgrade operation may cause the original firmware program to be overwritten due to data errors in the firmware upgrade, resulting in the charging pile being unable to work. Based on the problems in the related art, the present application proposes a solution that can realize the remote upgrade of the firmware of the charging pile control board without affecting the normal operation of the charging pile.
[0048] In the embodiment of the present application, the specific structure of the execution subject of a method for firmware upgrade is not particularly limited in the embodiment of the present application, as long as it can communicate according to a method for firmware upgrade in accordance with an embodiment of the present application by running a program that records the code of the method for firmware upgrade in the embodiment of the present application. For example, the execution subject of a method for firmware upgrade provided in the embodiment of the present application may be a functional module in the charging device 100 that can call and execute a program, or a device for firmware upgrade in the charging device 100, such as a chip. The execution subject of a method for firmware upgrade provided in the embodiment of the present application may be a functional module in the charging device 100 that can call and execute a program, or a device for firmware upgrade in the charging device 100, such as a chip. This application does not limit this. The following embodiment is described by taking the execution subject of a method for firmware upgrade as the charging device 100 and the mobile device 200 as an example.
[0049] like Figure 3 As shown, Figure 3 A flowchart of a firmware upgrade method provided in an embodiment of the present application is shown. The method is applied to a charging device and includes:
[0050] Step 401: The charging device and the mobile device establish a communication connection.
[0051] As an example, the communication connection established between the charging device 100 and the charging device 100 can be a wireless communication connection or a wired communication connection. For example, the wireless communication connection can be a Bluetooth connection. For example, the wired communication connection can be a serial communication connection implemented through a physical interface having a serial bus.
[0052] As an example, the wireless communication connection established between the charging device 100 and the server 300 may be a WIFI connection, which is not limited in the embodiment of the present application.
[0053] For example, the embodiment of this application Figure 2 The charging device 100 involved can be Figure 1 The charging device 100 shown in FIG. 1 may be a charging device 100 of FIG. Figure 1 The mobile device 200 and the server 300 shown in FIG. Figure 1 The server 300 shown is not limited in this embodiment of the present application.
[0054] Step 402: During the operation of the APP operation area of the charging device, if the charging device determines that the firmware of the charging device needs to be upgraded, the charging device obtains the upgrade data of the firmware of the charging device from the charging device in a background manner.
[0055] In the background mode of the present application, that is, during the operation of the APP running area 122, the BootLoader area 121 receives new firmware (i.e., firmware upgrade data) from the background without affecting the normal operation of the charging device 100, and the charging device 100 does not need to jump to the BootLoader area 121. For example, the charging device 100 can obtain the upgrade data of the charging device 100 firmware from the charging device 100 in the background mode.
[0056] As an example, the charging device 100 may obtain firmware upgrade data from the server 300 via a wireless communication connection established with the server 300. The firmware upgrade data is applied to the charging device 100 and may be any data that can provide optimization or new functions for the charging device 100.
[0057] As an example, the firmware upgrade data can resolve compatibility issues in the charging device 100, thereby optimizing the operating functions of the charging device 100. As an example, the firmware upgrade data can optimize the interactive functions established between the charging device 100 and the charging device 100. Optionally, the interactive functions can include data communication between the charging device 100 and the charging device 100, real-time monitoring of the robot's status, etc.
[0058] Step 403: The charging device stores the firmware upgrade data in the APP backup area of the charging device.
[0059] Optionally, after the charging device 100 receives the firmware upgrade data, it stores the firmware upgrade data in the APP backup area 123 of the charging device 100. This prevents the received upgrade data from erasing the old version of the upgrade data originally stored in the APP running area 122 during the upgrade data reception process. Therefore, this ensures that the received firmware upgrade data does not affect the normal operation of the applications in the APP running area 122.
[0060] Step 404: When it is determined that the charging device enters the BootLoader area from the APP running area through the first operation and it is detected that the APP backup area has upgrade data, the charging device moves the upgrade data to the APP running area.
[0061] It is understandable that the first operation refers to the charging device 100 (such as MCU) sending a reset instruction to the BootLoader area 121 through a software program, thereby causing the charging device 100 to enter the BootLoader area 121.
[0062] It is understood that the charging device 100 needs to move the upgrade data from the BootLoader area 121 to the APP running area 122 when both the first operation is performed to enter the BootLoader area 121 from the APP running area 122 and the upgrade data is detected in the APP backup area 123. If either of the above two situations is not achieved, the bootloader in the BootLoader area 121 will not move the upgrade data to the APP running area 122.
[0063] As a possible implementation, the charging device 100 in the BootLoader area 121 erases the application (ie, the original firmware program) in the APP running area 122 and moves the upgrade data in the APP backup area 123 to the APP running area 122 .
[0064] As a possible implementation, the charging device 100 in the BootLoader area 121 changes the application in the APP running area 122 into an inoperable state. Optionally, the inoperable state may be achieved by annotating the data or other methods that can make the application inoperable.
[0065] Step 405: The charging device upgrades the firmware of the charging device using the upgrade data in the APP running area.
[0066] As an example, an upgrade program is stored in the APP running area 122 , and the upgrade program can also upgrade the firmware of the charging device 100 using the upgrade data moved from the APP backup area 123 to the APP running area 122 .
[0067] It should be explained that the upgrade data cannot be directly applied to the APP running area 122, and a new application (such as new firmware) must be created in the APP running area 122 in order to work normally.
[0068] In an embodiment of the present invention, the method includes: the charging device and the charging device 100 establish a communication connection. During the operation of the APP running area 122 of the charging device, when the charging device determines to upgrade the firmware of the charging device, the charging device obtains the upgrade data of the firmware of the charging device from the charging device 100 in the background. The charging device stores the firmware upgrade data in the APP backup area 123 of the charging device. When it is determined that the charging device enters the BootLoader area 121 from the APP running area 122 through the first operation, and detects that the APP backup area 123 has upgrade data, the charging device moves the upgrade data to the APP running area 122. The charging device uses the upgrade data to upgrade the firmware of the charging device in the APP running area 122. The solution of this application is used to realize remote upgrade of the firmware of the charging pile control board without affecting the normal operation of the charging pile.
[0069] Typically, the charging device 100 starts running in the BootLoader area 121. When the charging device 100 is in the BootLoader area 121, the charging device 100 can determine that no application is stored in the APP running area 122 of the charging device 100. The subsequent steps performed by the charging device 100 are generally different when no application is stored in the APP running area 122 of the charging device 100 and when the APP running area 122 of the charging device 100 stores an application. The following will describe each of these steps:
[0070] In one possible embodiment of the present application, before the charging device 100 executes step 402, if the BootLoader region 121 in the charging device 100 determines that no application is stored in the APP running region 122, the charging device 100 continues to run the BootLoader region 121 to wait for upgrade data from the charging device 100. It is understandable that because there are no applications in the APP running region 122 of the charging device 100, the charging device 100 itself cannot operate normally. Therefore, at this time, the charging device 100 is in the BootLoader region 121 and does not need to jump to the APP running region 122. Until the charging device 100 detects the presence of upgrade data, it is determined and the boot program in the BootLoader region 121 is responsible for receiving the upgrade data sent by the charging device 100.
[0071] For example, after receiving the upgrade data from the charging device 100, the BootLoader area 121 may store the firmware upgrade data in the APP backup area 123. Upon determining that the charging device 100 has entered the BootLoader area 121 and detecting that the APP backup area 123 contains the upgrade data, the charging device 100 moves the upgrade data to the APP execution area 122. The charging device 100 then uses the upgrade data in the APP execution area 122 to upgrade the firmware.
[0072] In a possible embodiment of the present application, when the charging device 100 executes step 402, if the upgrade program in the APP running area 122 of the charging device 100 determines that the firmware of the charging device 100 does not need to be upgraded, the charging device 100 continues to operate normally through the application in the APP running area 122.
[0073] In one possible embodiment of the present application, the charging device 100 may determine whether the firmware of the charging device 100 needs to be upgraded by: the charging device 100 determines whether the firmware needs to be upgraded based on the first flag bit stored in the APP running area 122. As an example, if the first flag bit is a first indicator, the charging device 100 determines that the firmware of the charging device 100 needs to be upgraded.
[0074] As another example, if the first flag bit is not the first indicator, such as the fifth indicator, the charging device 100 determines that a firmware upgrade of the charging device 100 is not required. For example, the first indicator can be a sequence of at least one bit, such as 0, 00, or 01. If the first flag bit is not the first indicator, the first flag bit can also be a sequence of at least one bit, such as 1, 10, or 11.
[0075] It should be noted that in the following specific embodiments, the relationship between the flag bit and the indicator, and the fact that the indicator can be a sequence consisting of at least one bit, are all in accordance with the above statement and will not be repeated hereafter.
[0076] In one possible implementation of the present application, the charging device 100 may determine whether to upgrade the firmware of the charging device 100 by: the charging device 100 obtains an upgrade instruction, and the charging device 100 determines whether to upgrade the firmware of the charging device 100 according to the upgrade instruction. Alternatively, the upgrade instruction may be provided to the charging device 100 by the charging device 100, or input by a user into the charging device 100. For example, the charging device 100 may have an upgrade button. If the user determines that the firmware of the charging device 100 needs to be upgraded, the user may trigger the upgrade button, causing the charging device 100 to determine whether to upgrade the firmware of the charging device 100. Alternatively, if the charging device 100 can communicate with the server 300, and the server 300 detects that a newer version of the firmware of the charging device 100 exists, the server 300 may send an upgrade instruction to the charging device 100, thereby triggering the charging device 100 to determine whether to upgrade the firmware of the charging device 100. Optionally, when the charging device 100 receives an upgrade instruction from the server 300, the charging device 100 may further issue a prompt message to prompt the user whether to upgrade the firmware of the charging device 100. When the user inputs an instruction to agree to the upgrade, the charging device 100 determines to upgrade the firmware of the charging device 100. When the user inputs an instruction to disagree with the upgrade, the charging device 100 determines not to upgrade the firmware of the charging device 100.
[0077] As an example, the charging device 100 may send the prompt information by displaying the prompt information on its display interface, or by sending the prompt information in the form of voice playback, or by sending the prompt information to the charging device 100 that is communicatively connected to the charging device 100 .
[0078] In one possible embodiment of the present application, after the charging device 100 receives the upgrade instruction, the method provided in the embodiment of the present application may further include: the charging device 100 updates the first flag bit stored in the APP running area 122 to the first indicator. Of course, it is understandable that if the charging device 100 does not receive the upgrade instruction, the first flag bit in the APP running area 122 is the fifth indicator, that is, it is used to indicate that the upgrade is not required.
[0079] In one possible implementation of the present application, before the charging device 100 obtains the firmware upgrade data of the charging device 100 from the charging device 100 in a background manner, the charging device 100 can obtain the firmware upgrade data from the server 300 if it determines that the firmware of the charging device 100 needs to be upgraded.
[0080] In a possible implementation of the present application, the above step 402 may be implemented in the following manner: the charging device 100 obtains the firmware upgrade data from the charging device 100 while maintaining a communication connection with the charging device 100 .
[0081] It is understandable that when the charging device 100 maintains communication with the charging device 100, the charging device 100 may be connected to the charging device 100 through Bluetooth communication.
[0082] Optionally, the charging device 100 can obtain firmware upgrade data from the charging device 100 while maintaining a serial communication connection with the charging device 100. For example, the charging device 100 can be connected to the charging device 100 via a serial communication connection, performing wired communication according to a set communication standard, and obtain firmware upgrade data from the charging device 100 while the charging device 100 is operating normally with the charging device 100 established via a Bluetooth communication connection. This can ensure stable data transmission.
[0083] In one possible embodiment of the present application, to prevent upgrade failures caused by mismatching, incompleteness, or erroneous content in the upgrade data received by the charging device 100, the method provided in this embodiment of the present application may further include, before the charging device 100 stores the upgrade data in the APP backup area 123 of the charging device 100, the charging device 100 verifying the upgrade data in the BootLoader area 121. Therefore, in this case, the upgrade data stored in the APP backup area 123 is generally verified upgrade data.
[0084] As one possible implementation, the charging device 100 verifies the upgrade data in the BootLoader area 121. Specifically, the charging device 100 verifies in the BootLoader area 121 whether the chip model carried in the upgrade data matches the chip model of the charging device 100 and / or whether the upgrade data is complete. This ensures that the BootLoader area 121 of the charging device 100 needs to confirm that the received upgrade data is complete and applicable to the charging device 100. This is done to detect changes in data during transmission, prevent transmission errors or incomplete data, and ensure the reliability of the transmitted data.
[0085] Exemplarily, verifying whether the chip model carried in the upgrade data matches the chip model of the charging device 100 may include: obtaining version information of the upgrade data, the version information may include the version number of the upgrade data, the chip model required by the upgrade data, etc., obtaining the chip model of the charging device 100, and determining whether the model required by the upgrade data matches the chip model of the charging device 100, which may include that the chip models of the two are compatible, and the current model of the charging device 100 can meet the requirements for the upgrade data to run in the charging device 100.
[0086] For example, the charging device 100 may verify whether the upgrade data is complete in the following cases:
[0087] Case 1: Verify and confirm the integrity of each upgrade data packet in the received upgrade data.
[0088] Case 2: Verify and confirm the integrity of the entire upgrade data.
[0089] Optionally, the integrity of each upgrade data packet is verified and determined. In practice, if it is verified that the upgrade data packet A is not received, the charging device 100 sends an indication message of the loss of the upgrade data packet A to the charging device 100, and the charging device 100 resends the upgrade data packet A to the charging device 100. Optionally, the number of resendings can be one or three times.
[0090] Optionally, the integrity of the entire upgrade data is verified and confirmed, thereby ensuring that the upgrade data received by the charging device 100 is unmodified, thereby ensuring the secure transmission of the firmware upgrade data.
[0091] It should be noted that the process of the BootLoader area 121 storing the upgrade data in the APP backup area 123 of the charging device 100 is running in the background. When the charging device 100 is operating normally, the firmware upgrade data is stored in the APP backup area 123 without affecting the application programs stored in the APP running area 122.
[0092] In one possible embodiment of the present application, after the charging device 100 stores the firmware upgrade data in the APP backup area 123 of the charging device 100, the method provided in this embodiment of the present application may further include: the charging device 100 may update the third flag stored in the BootLoader area 121 to a third indicator. The third indicator is used to indicate that the firmware upgrade data is stored in the APP backup area 123. Of course, if the BootLoader area 121 does not have the third flag, the charging device 100 may create the third flag in the BootLoader area 121 and then assign the third flag to the third indicator. Of course, if the charging device 100 does not store the firmware upgrade data in the APP backup area 123 of the charging device 100, the third flag is generally used to indicate that the APP backup area 123 does not store the firmware upgrade data. This facilitates the subsequent identification of whether the firmware upgrade data is stored in the APP backup area 123 based on the third flag after the charging device 100 jumps from the APP running area 122 to the BootLoader area 121.
[0093] In one possible embodiment of the present application, after determining that the charging device 100 enters the BootLoader area 121 from the APP running area 122 through the first operation, the method provided in the embodiment of the present application may further include: the charging device 100 enters the BootLoader area 121 from the APP running area 122, and the charging device 100 determines whether the reset mode of the charging device 100 is the first operation or the second operation based on the fourth flag bit stored in the BootLoader area 121. As an example, when the fourth flag bit is updated to the fourth indicator, the charging device 100 determines that the charging device 100 enters the BootLoader area 121 from the APP running area 122 through the first operation.
[0094] It is understood that under normal circumstances, the charging device 100 is in the APP running area 122 during normal operation. The second operation is that the charging device 100 performs a reset immediately after powering on, thereby entering the BootLoader area 121. The first operation is that the charging device 100 sends a reset command to the BootLoader area 121 through a software program, thereby causing the charging device 100 to enter the BootLoader area 121.
[0095] When the charging device 100 performs the second operation, it rechecks whether the charging device 100's firmware needs to be upgraded when it enters the BootLoader area 121. It is understood that if the reset operation is determined to be the second operation, step 402 is repeated. This prevents the second operation from occurring during the upgrade data transmission process, which could result in incomplete data transmission.
[0096] It is understandable that when it is determined that the charging device 100 enters the BootLoader area 121 from the APP running area 122 through the first operation, and detects that the APP backup area 123 has upgrade data, the charging device 100 enters the BootLoader area 121 and the application in the APP running area 122 stops running.
[0097] In one possible embodiment of the present application, when it is determined that the charging device 100 enters the BootLoader area 121 from the APP running area 122 through a first operation and detects that the APP backup area 123 has upgrade data, the method provided in the embodiment of the present application may further include: the charging device 100 enters the BootLoader area 121, and obtains the fourth flag bit and the third flag bit from the BootLoader area 121. If the fourth flag bit is the fourth indicator and the third flag bit is the third indicator, the charging device 100 moves the upgrade data to the APP running area 122.
[0098] It should be explained that in the above specific embodiment, the flag bit needs to be obtained, so that the flag bit of the charging device 100 can be changed through a special indicator, or different indicators are used to represent the current status of different areas.
[0099] It should be explained that in the above specific embodiment, the flag bit needs to be updated to a corresponding indicator. This makes it necessary for the charging device 100 to upgrade the firmware only when the corresponding indicator is used, thereby avoiding program confusion.
[0100] It is understandable that, in order to implement the above functions, each device, such as the charging device 100, includes a structure and / or software module corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in hardware or in a computer software-driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0101] In the embodiment of the present application, the charging device 100 can be divided into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical functional division. In actual implementation, there may be other division methods.
[0102] Combined with the above Figures 1 to 3 , the method of the embodiment of the present application is described, and the device for performing the above method provided by the embodiment of the present application is described below. Those skilled in the art will understand that the method and the device can be combined and referenced with each other. The firmware upgrade device provided in the embodiment of the present application can perform the steps respectively performed by the charging device 100 and the charging device 100 in the above firmware upgrade method.
[0103] In the case of integrated units, Figure 4 The device for upgrading the firmware involved in the above embodiment is shown. The device for upgrading the firmware can be the charging device 100 or a device applied to the charging device 100, such as a chip or a processing circuit. The device for upgrading the firmware can include: an acquisition unit 501, a first processing unit 502, a second processing unit 503 and an upgrading unit 504.
[0104] In an optional implementation, the firmware upgrade device may further include a storage unit for storing program code and data of the firmware upgrade device.
[0105] In one example, the device for firmware upgrading is the charging device 100, or a chip used in the charging device 100. The acquisition unit 501 is used to obtain firmware upgrade data from the charging device 100 in a background manner when it is determined that the firmware of the charging device 100 is upgraded during the operation of the APP running area 122 of the charging device 100. The first processing unit 502 is used to store the upgrade data in the APP backup area 123 of the charging device 100. The second processing unit 503 is used to move the upgrade data to the APP running area 122 when it is determined that the charging device 100 enters the BootLoader area 121 from the APP running area 122 through the first operation and detects that the APP backup area 123 has upgrade data. The upgrading unit 504 is used to upgrade the firmware in the APP running area 122 using the upgrade data.
[0106] In a possible implementation, before storing the upgrade data in the APP backup area 123 of the charging device 100 , the first processing unit 502 is further configured to verify the upgrade data in the BootLoader area 121 of the charging device 100 .
[0107] In a possible implementation, the acquiring unit 502 is further configured to, when there is no application program in the APP running area 122 , continue running the BootLoader area 121 to wait for upgrade data from the charging device 100 .
[0108] In a possible implementation, the upgrading unit 504 is further configured to, when the charging device 100 performs the second operation, enable the charging device 100 to enter the BootLoader area 121 and re-detect whether the firmware of the charging device 100 needs to be upgraded.
[0109] The first processing unit 503 and the second processing unit 504 may be processors or controllers, such as a central processing unit (CPU), a general-purpose processor (GPPC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic device (PLD), a transistor logic device (TLD), a hardware component, or any combination thereof. They may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. A processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like. The communication module may be a transceiver, a transceiver circuit, or a communication interface. The storage module may be a memory.
[0110] Optional, such as Figure 2The structure of the charging device 100 shown may further include a memory, which may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may be independent and connected to the processor via a communication line. The memory may also be integrated with the processor.
[0111] The memory is used to store computer-executable instructions for executing the solution of the present application, and the processor controls the execution. The processor is used to execute the computer-executable instructions stored in the memory, thereby implementing a firmware upgrade method provided in the following embodiment of the present application.
[0112] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, which is not specifically limited in the embodiments of the present application.
[0113] On the one hand, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed, the following are implemented: Figure 3 Functions performed by the charging device 100 in FIG.
[0114] In one aspect, a computer program product is provided, wherein the computer program product includes instructions that, when executed, implement the following Figure 3 Functions performed by the charging device 100 in FIG.
[0115] On the one hand, an embodiment of the present application provides a chip, which is applied to a charging device 100, and the chip includes at least one processor and a communication interface, the communication interface is coupled to the at least one processor, and the processor is used to run instructions to implement the following Figure 3 Functions performed by the charging device 100 in FIG.
[0116] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer program or instruction can be transmitted from one website, computer, server 300 or data center to another website, computer, server 300 or data center by wired or wireless means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server 300 or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; an optical medium, such as a digital video disc (DVD); or a semiconductor medium, such as a solid state drive (SSD).
[0117] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other variations of the disclosed embodiments by reviewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0118] Although the present application has been described with reference to specific features and embodiments thereof, it is apparent that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely illustrative of the present application as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, the present application is intended to include such modifications and variations as fall within the scope of the claims of the present application and their equivalents.
Claims
1. A firmware upgrade method, characterized in that: Applied to a charging device, the control module of the charging device has an APP backup area, an APP running area, and a BootLoader area, and the method includes: During the operation of the APP operation area of the charging device, if it is determined that the firmware of the charging device needs to be upgraded, obtaining the upgrade data of the firmware in a background manner; Verifying in the BootLoader area whether the chip model carried in the upgrade data matches the chip model of the charging device, and / or whether the upgrade data is complete; Storing the firmware upgrade data that has passed verification in the APP backup area of the charging device, and updating the third flag bit stored in the BootLoader area to a third indicator; the third indicator indicates that the APP backup area has the upgrade data; Detecting that the charging device enters the BootLoader area from the APP running area; When the fourth flag bit stored in the BootLoader area indicates that the charging device enters the BootLoader area from the APP running area through a first operation, and the third flag bit is the third indicator, the upgrade data is moved to the APP running area; the first operation is a soft reset operation; the soft reset operation refers to the charging device sending a reset instruction to the BootLoader area through a software program to enter the BootLoader area; Upgrading the firmware using the upgrade data in the APP running area; The fourth flag bit stored in the BootLoader area indicates that the charging device enters the BootLoader area in the second operation mode, and the charging device re-detects in the BootLoader area whether the APP running area has an application program.
2. The method according to claim 1, characterized in that During the operation of the APP operation area of the charging device, before determining to upgrade the firmware of the charging device, the method further includes: Running the BootLoader area and determining whether the APP running area has an application; if there is no application in the APP running area, continuing to run the BootLoader area to wait for upgrade data from the mobile device, wherein the application represents a program that performs work for the charging device; In a case where the application program exists in the APP running area, the APP running area is entered from the BootLoader area.
3. The method according to claim 1 or 2, characterized in that The method further comprises: receiving an upgrade instruction, wherein the upgrade instruction is used to instruct to upgrade the firmware; According to the upgrade instruction, updating the first flag in the APP running area to a first indicator, where the first indicator is used to indicate that the firmware is to be upgraded; and / or, In the case where there is an application in the APP running area, updating the second flag bit in the BootLoader area to a second indicator, where the second indicator indicates that there is an application in the APP running area; and / or, In the case where the upgrade data is stored in the APP backup area, the third flag bit in the BootLoader area is updated to a third indicator, and the third indicator indicates that the upgrade data is stored in the APP backup area.
4. The method according to claim 3, characterized in that The method further comprises: The BootLoader area further stores a fourth flag bit, and the fourth flag bit is used to indicate whether the charging device enters the BootLoader area in the first operation or the second operation; The determining that the charging device enters the BootLoader area from the APP running area through the first operation and detecting that the APP backup area has the upgrade data includes: The charging device enters the BootLoader area from the APP running area, and obtains the fourth flag bit and the third flag bit from the BootLoader area; When the fourth flag bit is the fourth indicator and the third flag bit is the third indicator, it is determined that the charging device enters the BootLoader area from the APP running area through the first operation, and it is detected that the APP backup area has the upgrade data. The fourth indicator is used to indicate that the charging device enters the BootLoader area by the first operation.
5. The method according to any one of claims 1 to 4, characterized in that The obtaining of the upgrade data of the firmware of the charging device in a background manner includes any one or more of the following: The charging device obtains the firmware upgrade data from the mobile device via a Bluetooth communication connection between the charging device and the mobile device; or The charging device obtains the firmware upgrade data from the mobile device via a serial communication connection between the charging device and the mobile device.
6. A device for upgrading firmware, characterized in that: Applied to a charging device, the control module of the charging device has an APP backup area, an APP running area, and a BootLoader area, and the device includes: An acquiring unit is configured to acquire, during operation of the APP operation area of the charging device, firmware upgrade data of the charging device from a mobile device in a background manner when it is determined that the charging device needs to be upgraded; a first processing unit, configured to verify in the BootLoader area whether the chip model carried in the upgrade data matches the chip model of the charging device, and / or whether the upgrade data is complete; Storing the firmware upgrade data after verification in the APP backup area of the charging device, and using the third flag bit stored in the BootLoader area for updating as a third indicator; the third indicator indicates that the APP backup area has the upgrade data; a second processing unit, configured to detect that the charging device enters the BootLoader area from the APP running area; and to move the upgrade data to the APP running area when it is determined that the fourth flag bit stored in the BootLoader area indicates that the charging device enters the BootLoader area from the APP running area through a first operation and the third flag bit is the third indicator; the first operation is a soft reset operation; the soft reset operation refers to the charging device sending a reset instruction to the BootLoader area through a software program to enter the BootLoader area; An upgrading unit, configured to upgrade the firmware using the upgrading data in the APP running area; The second processing unit is further configured to store a fourth flag bit in the BootLoader area to indicate that the charging device enters the BootLoader area in the second operation mode, and then the charging device re-detects in the BootLoader area whether the APP running area has an application program.
7. A charging device, characterized in that: include: At least one processor is connected to a communication interface, the communication interface is used to receive or send information, and the at least one processor is used to run instructions stored in a memory to execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that The readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Vehicle-mounted T-BOX terminal and firmware upgrading method
CN109783123A
Firmware upgrading method and charging base
CN111459516A