WO2022143295A1 - Method for upgrading firmware, and related device - Google Patents

Method for upgrading firmware, and related device Download PDF

Info

Publication number
WO2022143295A1
WO2022143295A1 PCT/CN2021/140018 CN2021140018W WO2022143295A1 WO 2022143295 A1 WO2022143295 A1 WO 2022143295A1 CN 2021140018 W CN2021140018 W CN 2021140018W WO 2022143295 A1 WO2022143295 A1 WO 2022143295A1
Authority
WO
WIPO (PCT)
Prior art keywords
firmware
time
bluetooth
storage space
space
Prior art date
Application number
PCT/CN2021/140018
Other languages
French (fr)
Chinese (zh)
Inventor
赵伟亮
陈龙
肖羽
刘治文
周灵
Original Assignee
展讯通信(上海)有限公司
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 展讯通信(上海)有限公司 filed Critical 展讯通信(上海)有限公司
Publication of WO2022143295A1 publication Critical patent/WO2022143295A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present application relates to the field of Bluetooth technology, and in particular, to a firmware upgrade method and related equipment.
  • Bluetooth OTA (Over-the-Air Technology) is a technology that uses Bluetooth to upgrade the firmware in the device.
  • the process of upgrading the firmware in the device based on Bluetooth mainly includes: starting the OTA code from the Bluetooth slave device, and obtaining the data package of the new version of the firmware from the Bluetooth master device.
  • the OTA code in the Bluetooth slave device is usually integrated in RAM (Random Access Memory, random access memory), which will occupy more RAM resources in the system.
  • the Bluetooth slave device receives the firmware data packet sent by the Bluetooth master device, the firmware data is written into the storage space for storing the firmware data packet in the manner of erasing and writing. This method not only takes a long time, but also often needs to turn off the interruption of Bluetooth transmission and reception, which easily causes Bluetooth disconnection and affects the stability of the connection between the Bluetooth master device and the Bluetooth slave device.
  • the embodiment of the present invention provides a firmware upgrade method and related equipment, the firmware upgrade code in the first firmware can be stored in a preset memory to save system RAM resources; this solution is used for storing firmware data in advance.
  • the storage space of the package is erased, and the write operation can be performed directly after the firmware data packet is obtained, saving the transmission time of the firmware data packet; further, the above erase operation and write operation are performed during the idle time of Bluetooth transmission, which not only can Reduce Bluetooth power consumption, and do not need to close the Bluetooth transceiver interrupt, improve the stability of the Bluetooth connection between devices.
  • an embodiment of the present invention provides a firmware upgrade method, including: determining a first storage space according to description information of a first firmware, wherein part or all of the code of the first firmware is stored in a preset memory, The first storage space is located in the preset memory; in the first idle time of Bluetooth transmission, an erase operation is performed on the first storage space; in the second idle time of Bluetooth transmission, the update package of the first firmware is written into The first storage space, wherein the update package is from a first Bluetooth device.
  • the preset memory may be a flash memory (Flash) memory.
  • the preset memory may be a NOR Flash memory.
  • the first idle time may include a plurality of sub-idle times, and an erase operation is performed in each of the sub-idle times.
  • the second idle time may include multiple sub-idle times, and one write operation is performed in each of the sub-idle times.
  • the above-mentioned sub-idle time may all refer to the idle time between two adjacent nodes where the transmission and reception are interrupted.
  • the description information of the first firmware is sent to the second Bluetooth device when the first Bluetooth device determines to upgrade the first firmware in the second Bluetooth device.
  • the description information of the first firmware includes: the size of the first firmware, the starting address of the first storage space, and the running address of the code.
  • the description information of the first firmware includes the size of the first firmware.
  • the second Bluetooth device may autonomously determine the first storage space according to the size of the first firmware.
  • the description information of the first firmware may include a size of the first firmware and an address of the first storage space, and the address may be a start address of the first storage space.
  • the second Bluetooth device may dynamically determine the first storage space according to the size of the first firmware and the address of the first storage space.
  • the first storage space may also be a fixed space in the preset memory.
  • the running address of the code is used to determine the running address of the updated first firmware.
  • performing an erasing operation on the first storage space during the first idle time of Bluetooth transmission includes: performing M erasing operations on the first storage space according to the size of the first storage space. , each erasing operation is performed in the idle time of Bluetooth transmission, and the space erased by each erasing operation is an integer multiple of the unit space, M ⁇ 1; If the remaining space to be erased is smaller than the size of one unit space, the space to be erased is supplemented as one unit space and the Mth erasing operation is performed.
  • the method of supplementing the space to be erased into a unit space may be extended and supplemented according to the physical characteristics of the corresponding memory.
  • performing the Qth erasing operation in the M times on the first storage space includes: determining an erasing time required for the Qth erasing operation; determining from the current time to the next transmission and reception interrupt node the first time; if the difference between the first time and the erasing time is within the first value range, the Qth erasing operation is performed at the first time; otherwise, the adjustment of the Bluetooth connection parameters is triggered.
  • the method further includes: after the Bluetooth connection parameter is adjusted, when it is determined that the difference between the second time from the current time to the next sending and receiving interrupted node and the erasing time is within the first value range, when the The Qth erasing operation is performed at the second time.
  • the update package of the first firmware is divided into multiple sub-update packages, and the first sub-update package is any sub-update package of the first firmware; wherein, the first sub-update package is written into the first sub-update package.
  • a storage space including: determining the writing time required for writing the first sub-update package into the first storage space; determining a third time from the current time to the next node for sending and receiving interrupts; if the third time If the difference from the writing time is within the second value range, the first sub-update package is written into the first storage space at the third time; otherwise, the adjustment of the Bluetooth connection parameters is triggered.
  • the method further includes: after the Bluetooth connection parameter is adjusted, when it is determined that the difference between the fourth time from the current time to the next sending and receiving interrupt node and the writing time is within the second value range, in the second value range.
  • the first sub-update package is written into the first storage space at the fourth time.
  • triggering the adjustment of the Bluetooth connection parameters includes: if the difference between the third time and the writing time is less than the minimum boundary value of the second value range, determining that the subsequent N transmission and reception interrupt nodes correspond to Whether the difference between the idle time and the write time is less than the minimum boundary value; if so, triggering an adjustment to increase the Bluetooth connection parameters.
  • the method further includes: when the first firmware is restarted, copying the update package code of the first firmware to the run address of the code and run it.
  • an embodiment of the present invention provides a firmware upgrade device, including: a preset storage module for storing part or all of the code of the first firmware, and providing a first storage space; wherein, the first firmware contains
  • the corresponding firmware upgrade code includes the following functional modules: a determination module, used for determining the first storage space according to the description information of the first firmware; an erasing module, used for the first idle time of Bluetooth transmission, for the first storage space. The space performs an erasing operation; and is used for writing the update package of the first firmware into the first storage space during the second idle time of Bluetooth transmission; the Bluetooth transceiver module is used for receiving the update package from the first Bluetooth device.
  • an embodiment of the present invention provides a Bluetooth chip, including: a processor configured to execute computer program instructions stored in a memory, wherein, when the computer program instructions are executed by the processor, trigger the The Bluetooth chip executes the method of the first aspect or any one of the embodiments of the first aspect.
  • an embodiment of the present invention provides an electronic device, including: at least one processor; and at least one memory communicatively connected to the processor, wherein: the memory stores a memory executable that can be executed by the processor Program instructions, where the processor invokes the program instructions to execute the first aspect or any of the embodiments of the first aspect.
  • an embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium includes a stored program, wherein when the program runs, a device on which the computer-readable storage medium is located is controlled to execute the above-mentioned The first aspect or the manner of any embodiment of the first aspect.
  • part or all of the OTA code of the first firmware may be stored in a preset memory, and the preset memory does not need to be a RAM memory, thereby saving system RAM resources;
  • the write operation can be performed directly, which saves the transmission time of the firmware data packet;
  • the above-mentioned erase operation and write operation are performed in the idle time of Bluetooth transmission, which can not only reduce the Bluetooth power consumption, and there is no need to turn off the Bluetooth transceiver interrupt, data transmission and reception between devices can be performed normally, and the stability of the Bluetooth connection between devices is improved.
  • FIG. 1 is a schematic structural diagram of a Bluetooth system provided by an embodiment of the present invention.
  • FIG. 2 is a schematic diagram of a time node of Bluetooth transmission provided by an embodiment of the present invention.
  • FIG. 3 is a flowchart of a firmware upgrade method provided by an embodiment of the present invention.
  • 4-a is a flowchart of another firmware upgrade method provided by an embodiment of the present invention.
  • Fig. 4-b is a kind of flow chart of performing erase operation based on Fig. 4-a provided;
  • Fig. 4-c is a kind of flow chart of performing write operation provided based on Fig. 4-a;
  • FIG. 5 is a schematic structural diagram of a firmware upgrade apparatus provided by an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
  • FIG. 1 is a schematic structural diagram of a Bluetooth system according to an embodiment of the present invention.
  • the system includes: a first Bluetooth device and a second Bluetooth device.
  • the first Bluetooth device can be used as a Bluetooth master device
  • the second Bluetooth device can be used as a Bluetooth slave device.
  • the first Bluetooth device establishes a Bluetooth connection with the second Bluetooth device.
  • the first Bluetooth device may acquire a new version of the first firmware.
  • the second Bluetooth device is provided with an older version of the first firmware.
  • the first Bluetooth device determines that the first firmware of the second Bluetooth device needs to be upgraded, the first Bluetooth device sends a data packet related to the first firmware to the second Bluetooth device.
  • the Bluetooth device determines the transmission and reception interruption node (corresponding to the interruption node in Figure 2) based on the Bluetooth connection parameters, and the time of two adjacent transmission and reception interruption nodes can be divided into working time and free time. Among them, the working time can be further divided into the time used for hardware startup, code calling, etc., and the data sending and receiving time. Optionally, for this embodiment of the present invention, the data sending and receiving time during working hours is focused on. During the data sending and receiving time, the first Bluetooth device and the second Bluetooth device can perform data interaction.
  • the first bluetooth device and the second bluetooth device can send and receive valid data during the data sending and receiving time; if there is no valid data between the first bluetooth device and the second bluetooth device, they can send and receive heartbeat data.
  • the first Bluetooth device and the second Bluetooth device enter a sleep state.
  • the time lengths occupied by the working time between two adjacent sending and receiving interrupt nodes are different, and the time lengths occupied by the corresponding idle time are also different.
  • Both the first Bluetooth device and the second Bluetooth device may be mobile phones, tablet computers, cameras, wearable devices, vehicle-mounted devices, building devices, smart home devices, augmented reality (AR)/virtual reality (VR) ) devices and other electronic devices, the embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
  • AR augmented reality
  • VR virtual reality
  • FIG. 3 is a flowchart of a firmware upgrade method provided by an embodiment of the present invention.
  • the executing subject of the method shown in FIG. 3 may be the above-mentioned second Bluetooth device.
  • the firmware upgrade method can be applied to a low-power Bluetooth transmission scheme or a traditional Bluetooth transmission scheme.
  • part or all of the code of the first firmware in this embodiment of the present invention may be stored in a preset memory.
  • part or all of the firmware upgrade code included in the first firmware is stored in the preset memory.
  • the firmware upgrade code includes code for writing the update package of the first firmware into the first storage space, and this part of the code may be stored in RAM or ROM memory, and other firmware upgrade codes are stored in a preset memory.
  • the preset memory may be a Flash memory.
  • the preset memory may be a NOR Flash memory.
  • the processing steps of the method include:
  • the first firmware is firmware that needs to be upgraded and updated in the second Bluetooth device.
  • the first firmware may be any firmware in the second Bluetooth device.
  • the manner in which the second Bluetooth device acquires the description information of the first firmware may be acquisition from a firmware server, acquisition according to user input, or acquisition from the first Bluetooth device.
  • the manner in which the second bluetooth device obtains the description information of the first firmware from the first bluetooth device may include: after the second bluetooth device establishes a connection with the first bluetooth device, the first bluetooth device may read the information in the second bluetooth device. Information such as the version of the existing first firmware and/or the version of the firmware bin file.
  • the first Bluetooth device determines that the existing first firmware in the second Bluetooth device needs to be upgraded according to the read information such as the version of the first firmware and/or the version of the firmware bin file. At this time, the first Bluetooth device may send the description information of the first firmware to the second Bluetooth device.
  • the description information of the first firmware in step 101 is the description information of the new version of the first firmware.
  • the description information of the first firmware may include: the size of the first firmware, the starting address of the first storage space, and the running address of the code.
  • the description information of the first firmware includes the size of the first firmware.
  • the second Bluetooth device may autonomously determine the first storage space according to the size of the first firmware.
  • the description information of the first firmware may include a size of the first firmware and an address of the first storage space, and the address may be a start address of the first storage space.
  • the second Bluetooth device may dynamically determine the first storage space according to the size of the first firmware and the address of the first storage space.
  • the first storage space may also be a fixed space in the preset memory.
  • the running address of the code is used to determine the running address of the updated first firmware.
  • the first storage space may be determined according to the description information of the first firmware.
  • the second Bluetooth device may determine the first storage space in a preset memory, such as the above-mentioned Flash memory.
  • the first storage space is used to store the updated package of the upgraded first firmware.
  • performing an erasing operation on the first storage space during the first idle time of the Bluetooth transmission may include: according to the size of the first storage space, performing M erasing operations on the first storage space, each erasing operation All are executed in the idle time of Bluetooth transmission, and the space erased by each erase operation is an integer multiple of the unit space, M ⁇ 1.
  • the space to be erased is supplemented as one unit space and the Mth erasing operation is performed.
  • the method of supplementing the space to be erased into a unit space may be extended and supplemented according to the physical characteristics of the corresponding memory.
  • M is equal to 1 if the first storage space is less than or equal to one unit space. That is, an erasing operation is performed on the first storage space. Wherein, if the first storage space is less than one unit space, the first storage space needs to be supplemented into one unit space before performing the erasing operation.
  • the erasing time of each erasing operation corresponds to a unit time, and the unit time is the time required to erase a unit space.
  • the unit time is determined based on the physical characteristics of the preset memory. For example, when the preset memory is a Flash memory, the unit time is determined based on the physical characteristics of the Flash memory.
  • the first storage space is larger than one unit space
  • M is larger than 1, that is, at least two erase operations are performed on the first storage space.
  • the erasing space of each erasing operation is an integer multiple of the unit space.
  • the erasing time of each erasing operation is determined according to the number of unit spaces to be erased. For example, the Qth erasing operation corresponds to one unit space, and the Qth erasing operation corresponds to one unit time. If the Qth erasing operation corresponds to two unit spaces, the Qth erasing operation corresponds to two unit times. Wherein, for the last erasing operation, if there is less than one unit space, the first storage space needs to be supplemented into one unit space before performing the erasing operation.
  • the above-mentioned unit space may include a plurality of unit spaces of different sizes.
  • the Qth erasing operation is the last erasing operation.
  • the unit time corresponding to each unit space with different sizes may be the same or different. In the embodiment of the present invention, the unit time corresponding to each unit space with different sizes is the same. Therefore, when erasing the first storage space, first erase based on the larger unit space, and if the larger unit space is insufficient, then erase according to the smaller unit space, thereby improving the erasing efficiency and saving the erasing efficiency. except time.
  • the last erase operation if the remaining space to be erased corresponding to the last erase operation is less than one unit space, it will be supplemented as one unit space. Optionally, it can be supplemented based on the smallest unit space.
  • the second bluetooth device after the second bluetooth device has finished erasing the first storage space, it can notify the first bluetooth device to send an update package of the first firmware at a later data sending and receiving time.
  • the first Bluetooth device sends an update package of the first firmware to the second Bluetooth device according to the notification information.
  • the update package of the first firmware may be divided into multiple sub-update packages. Each sub-update package may be sent to the second Bluetooth device respectively.
  • the first Bluetooth device sends a sub-update packet to the second Bluetooth device each time. After the second Bluetooth device writes the one sub-update package into the first storage space, it receives and writes the next sub-update package.
  • the number of sending and receiving sub-update packets and the writing time can also be adjusted according to actual needs.
  • any one of the sub-update packages of the first firmware is referred to as the first sub-update package.
  • the second Bluetooth device After receiving the first sub-update package, the second Bluetooth device writes the first sub-update package into the first storage space during an idle time of Bluetooth transmission.
  • the idle time may be the idle time before the next transceiving interrupt node after the second Bluetooth device receives the first sub-update packet. For example, if the current time is t 3 and the arrival time of the next node that interrupts transmission and reception is t 4 , the second Bluetooth device can write the first sub-update packet into the first storage space during the idle time from t 4 to t 3 .
  • the OTA code can be partially or completely stored in a preset memory, and the preset memory does not need to be a RAM memory, thereby saving system RAM resources;
  • the space performs the erasing operation, and the writing operation can be directly performed after the firmware data packet is obtained, saving the transmission time of the firmware data packet; further, the above-mentioned erasing operation and writing operation are performed in the idle time of Bluetooth transmission, which can not only reduce the Bluetooth function.
  • FIG. 4-a is a flowchart of another firmware upgrade method provided by an embodiment of the present invention. As shown in Figure 4-a, the processing steps of the method include:
  • the first Bluetooth device determines that the first firmware in the second Bluetooth device needs to be upgraded, it sends description information of the first firmware to the second Bluetooth device.
  • the description information of the first firmware includes the size of the first firmware, the start address of the first storage space, and the running address of the code.
  • the size of the first firmware is the size of the new version of the first firmware.
  • the second Bluetooth device determines the first storage space according to the size of the first firmware and the start address of the first storage space.
  • the second Bluetooth device may determine the first storage space in NOR FLASH.
  • the second Bluetooth device performs M times of erasing operations on the first storage space according to the size of the first storage space, each erasing operation is performed during the idle time of Bluetooth transmission, and the space erased by each erasing operation is is an integer multiple of the unit space, M ⁇ 1.
  • the remaining space to be erased after the M-1 th erasing operation is performed is smaller than the size of one unit space, the to-be-erased space is supplemented into one unit space and the Mth erasing operation is performed.
  • the Qth erasing operation in M times is performed on the first storage space, as shown in FIG. 4-b, which may specifically include:
  • the erasing time is an integer multiple of the unit time, and the unit time is determined according to the physical characteristics of the preset storage space.
  • the first storage space supports erase operations in units of the first unit space and the second unit space. The first unit space is larger than the second unit space. If the remaining space to be erased corresponding to the Qth erasing operation is greater than or equal to one first unit space, then the Qth erasing a first unit space, and the erasing time corresponds to the unit time required for one first unit space.
  • the erasing time corresponds to a second unit Unit time required for space. If the remaining space to be erased corresponding to the Qth erasing operation is less than a second unit space, then the Qth erasing operation is the last erasing operation, then the remaining space to be erased is supplemented into a second unit space and The erasing operation is performed, and the erasing time corresponds to the unit time required for a second unit space.
  • the unit time required by the first unit space and the second unit space may be the same or different, which may be determined according to the physical characteristics of the Flash.
  • erase operations are supported in units of 64K and 4K. It is assumed that the size of the first storage space is 70k, which includes one 64k space, one 4k space and one 2k space remaining.
  • the unit erasing time corresponding to a 64k space is a
  • the unit erasing time corresponding to a 4k space is b
  • the remaining 2k space is supplemented as a 4k space.
  • the actual erasing space is 64k+4k+4k
  • the erasing time is a+2b.
  • the values of a and b can be determined according to the physical properties of the Flash.
  • a and b can have the same value. Based on the above manner, the erasing time required for the first storage space can be reduced as much as possible.
  • the 2032 Determine the first time from the current time to the next node that interrupts transmission and reception.
  • the first time corresponds to an idle time of Bluetooth transmission.
  • the difference between the first time and the erasing time not in the first value range includes: the difference between the first time minus the erasing time is less than the minimum boundary value of the first value range, or, the first time minus the erasing time The difference divided by time is greater than the maximum boundary value of the first value range.
  • the value range defined by the minimum boundary value and the maximum boundary value is the first value range.
  • triggering the adjustment of the Bluetooth connection parameters may be adjusting the Bluetooth connection parameters through the underlying hardware.
  • the first firmware in the second Bluetooth device sends first information for adjusting Bluetooth connection parameters to the underlying hardware.
  • the first firmware here may be an upgrade program of the first firmware.
  • the underlying hardware in the second Bluetooth device adjusts the Bluetooth connection parameters according to the first information, and after confirmation by the underlying hardware of the first Bluetooth device, the underlying hardware of the second Bluetooth device sends the adjusted Bluetooth connection parameters to the first Bluetooth device. 2.
  • the first firmware of the upper layer of the Bluetooth device is adjusting the Bluetooth connection parameters through the underlying hardware.
  • the first firmware in the second Bluetooth device sends first information for adjusting Bluetooth connection parameters to the underlying hardware.
  • the first firmware here may be an upgrade program of the first firmware.
  • the underlying hardware in the second Bluetooth device adjusts the Bluetooth connection parameters according to the first information, and after confirmation by the underlying hardware of the first Bluetooth device, the underlying hardware of the second Bluetooth device sends the adjusted Bluetooth connection parameters to the first Bluetooth device. 2.
  • the Bluetooth connection parameter is increased. If the difference between the first time and the erasing time is greater than the maximum boundary value of the first value range, the Bluetooth connection parameter is reduced.
  • the second Bluetooth device may notify the first Bluetooth device to send an update package of the first firmware.
  • the second Bluetooth device may adjust the Bluetooth connection parameters again before notifying the first Bluetooth device to send the update package of the first firmware, and this adjustment may be to reduce the Bluetooth connection parameters to reduce two adjacent nodes that are interrupted in sending and receiving. interval, so that the corresponding idle time for subsequent writes more closely matches the size of the update package.
  • the second Bluetooth device may also notify the first Bluetooth device to send an update package of the first firmware without adjusting the Bluetooth connection parameters after erasing the first storage space.
  • the second Bluetooth device respectively receives each sub-update package of the first firmware, and respectively writes each sub-update package into the first storage space during the idle time of Bluetooth transmission.
  • the first sub-update package is any one of each sub-update package, as shown in Figure 4-c, including:
  • the second Bluetooth device determines the writing time required for writing the first sub-update package into the first storage space.
  • the second Bluetooth device determines a third time (corresponding to T3 in the figure) from the current time to the next node that interrupts transmission and reception.
  • the second Bluetooth device determines whether the difference between the third time and the writing time is within the second value range, and if so, executes step 2044 ; if not, executes step 2045 .
  • the difference between the third time and the writing time not in the second value range includes: the difference between the third time minus the writing time is less than the minimum boundary value of the second value range, or, the third time minus the writing time The difference of the incoming time is greater than the maximum boundary value of the second value range.
  • the value range defined by the minimum boundary value and the maximum boundary value here is the second value range.
  • the third time is t 4 -t 3 .
  • the difference between t 4 -t 3 -writing time is within the second value range, it means that the writing operation to the first sub-update packet can be performed efficiently within the third time.
  • the difference between t 4 -t 3 - writing time is greater than the maximum boundary value of the second value range, it means that the idle time between the current time and the next sending and receiving interrupt node is much longer than the writing time, which will cause unnecessary Therefore, the idle time can be reduced by adjusting the Bluetooth connection parameters to improve the transmission efficiency of the first firmware.
  • the second Bluetooth device writes the first sub-update package into the first storage space at the third time.
  • the second Bluetooth device triggers the adjustment of the Bluetooth connection parameters.
  • the second Bluetooth device determines that the idle time corresponding to the subsequent N transceiving interrupt nodes is the same as the writing time. Whether the difference between the incoming times is smaller than the minimum boundary value of the second value range, and if so, triggering an adjustment to increase the Bluetooth connection parameter.
  • the difference between the third time and the writing time is smaller than the minimum boundary value of the second value range, it may be caused by the code running and data sending and receiving time taking up a lot. In this way, it can continue to determine whether the idle time corresponding to the subsequent N transceiver interrupt nodes can meet the above difference requirements. If the difference is within the second value range, the first sub-update package is written into the first storage space during the idle time.
  • N can be set according to actual needs, for example, can be set to 3, 4, 5 or other possible numbers.
  • x is a value in N.
  • the corresponding idle time can meet the write requirement by adjusting the Bluetooth connection parameters. In this way, the adjustment of the Bluetooth connection parameters can be reduced, and the stability of the Bluetooth connection can be ensured.
  • the above-mentioned first sub-update package is any sub-update package of the new version firmware.
  • the manner in which each sub-update package is written into the first storage space is the same, and details are not repeated here.
  • the method further includes: when the first firmware is restarted, updating the first firmware The package code is copied to the running address of the code and run.
  • an erasing operation can be performed on the storage space in advance, thereby reducing the erasing time during the firmware upgrade process, and increasing the stability of the system and the Bluetooth connection.
  • the firmware upgrade code of the embodiment of the present invention can be directly stored in NOR FLASH to run, saving system RAM resources. Further, this solution performs the erasing operation of the storage space and the writing operation of the firmware upgrade data in the idle time of the Bluetooth transmission, which can improve the utilization rate of the processor and speed up the firmware upgrade speed.
  • the solution can dynamically adjust the Bluetooth connection parameters according to the time required to perform the erase operation and the time required to perform the write operation, which can improve the efficiency and stability of the transmission of the first firmware update packet.
  • the estimated upgrade process does not need to turn off the interruption of Bluetooth transmission, and can normally send and receive Bluetooth data to ensure the stability of the Bluetooth connection between devices.
  • the flash suspend/resume mechanism can also be supported during the firmware upgrade phase, and can also be interrupted by other interrupts.
  • an embodiment of the present invention further provides a firmware upgrade apparatus.
  • these firmware upgrade apparatuses can be configured by using commercially available hardware components through the steps taught in this solution.
  • the firmware upgrade device includes: a preset storage module, the preset storage module is used to store part or all of the codes of the first firmware and provide a first storage space; as shown in FIG. 5 , the first firmware
  • the corresponding firmware upgrade code includes the following functional modules:
  • the determining module 301 is used to determine the first storage space according to the description information of the first firmware; the erasing and writing module 302 is used to perform an erasing operation on the first storage space during the first idle time of Bluetooth transmission; and In the second idle time of the Bluetooth transmission, the update package of the first firmware is written into the first storage space; the Bluetooth transceiver module 303 is configured to receive the update package of the first firmware from the first Bluetooth device.
  • the firmware upgrade apparatus in this embodiment of the present invention may execute the methods of the embodiments shown in FIG. 3 to FIG. 4 .
  • the firmware upgrade apparatus in this embodiment of the present invention may execute the methods of the embodiments shown in FIG. 3 to FIG. 4 .
  • each module of the firmware upgrade apparatus shown in FIG. 5 is only a division of logical functions, and may be fully or partially integrated into a physical entity in actual implementation, or may be physically separated.
  • these modules can all be implemented in the form of software calling through processing elements; they can also all be implemented in hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in hardware.
  • the erasing and writing module may be a separately established processing element, or may be integrated into a certain chip of an electronic device.
  • the implementation of other modules is similar.
  • all or part of these modules can be integrated together, and can also be implemented independently.
  • each step of the above-mentioned method or each of the above-mentioned modules can be completed by an integrated logic circuit of hardware in the processor element or an instruction in the form of software.
  • the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more specific integrated circuits (Application Specific Integrated Circuit; hereinafter referred to as: ASIC), or, one or more microprocessors Digital Singnal Processor (hereinafter referred to as: DSP), or, one or more Field Programmable Gate Array (Field Programmable Gate Array; hereinafter referred to as: FPGA), etc.
  • ASIC Application Specific Integrated Circuit
  • DSP Digital Singnal Processor
  • FPGA Field Programmable Gate Array
  • these modules can be integrated together and implemented in the form of a system-on-a-chip (System-On-a-Chip; hereinafter referred to as: SOC).
  • An embodiment of the present invention further provides a Bluetooth chip, including: a processor configured to execute computer program instructions stored in a memory, wherein when the computer program instructions are executed by the processor, the Bluetooth chip is triggered to execute The above firmware upgrade method.
  • the memory may include a Flash memory, where the Flash memory is used to store part or all of the codes of the first firmware.
  • the Flash memory may be NOR Flash memory.
  • FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
  • the electronic device shown in FIG. 6 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present specification.
  • the electronic device takes the form of a general-purpose computing device.
  • Components of an electronic device may include, but are not limited to, one or more processors 410 , a communication interface 420 , a memory 430 , a communication bus 440 connecting various system components including memory 430 , communication interface 420 and processor 410 .
  • the above-mentioned communication interface 420 can be connected with other electronic devices or other components, for example, the communication interface 420 can communicate with other Bluetooth devices.
  • the processor of the electronic device may be an on-chip device SOC, and the processor may include a central processing unit (Central Processing Unit, CPU), and may further include other types of processors.
  • CPU Central Processing Unit
  • the involved processor may include, for example, a CPU, a DSP, a microcontroller, or a digital signal processor, and may also include a GPU, an embedded Neural-network Process Units (NPU, NPU) ) and an image signal processor (Image Signal Processing, ISP), the processor may also include necessary hardware accelerators or logic processing hardware circuits, such as ASICs, or one or more integrated circuits for controlling the execution of programs in the technical solution of the present application Wait. Furthermore, the processor may have the function of operating one or more software programs, which may be stored in a storage medium.
  • Communication bus 440 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures.
  • these architectures include, but are not limited to, Industry Standard Architecture (hereinafter referred to as: ISA) bus, Micro Channel Architecture (hereinafter referred to as: MAC) bus, enhanced ISA bus, video electronics Standards Association (Video Electronics Standards Association; hereinafter referred to as: VESA) local bus and Peripheral Component Interconnection (Peripheral Component Interconnection; hereinafter referred to as: PCI) bus.
  • ISA Industry Standard Architecture
  • MAC Micro Channel Architecture
  • VESA Video Electronics Standards Association
  • PCI Peripheral Component Interconnection
  • Electronic devices typically include various computer system readable media. These media can be any available media that can be accessed by the electronic device, including both volatile and nonvolatile media, removable and non-removable media.
  • the memory 430 may include a computer system readable medium in the form of volatile memory, such as random access memory (Random Access Memory; hereinafter referred to as: RAM) and/or cache memory.
  • RAM random access memory
  • the electronic device may further include other removable/non-removable, volatile/non-volatile computer system storage media.
  • the memory 430 may include a Flash memory, where the Flash memory is used to store part or all of the codes of the firmware. Wherein, part or all of the firmware upgrade code in the firmware code is stored in the flash memory.
  • the firmware upgrade code is called by the processor 410, the firmware upgrade method of each embodiment of this specification is executed.
  • the memory 430 may include a RAM memory, and the RAM memory may be used to cooperate with the Flash memory to execute the firmware upgrade method of the embodiment of the present invention. For example, when a data packet of the first firmware sent by the first Bluetooth device is received through the communication interface 420, the data packet may be buffered in the RAM, and then written into the Flash memory from the RAM.
  • An embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the methods provided by the embodiments shown in FIGS. 3 to 4 of this specification.
  • the aforementioned computer-readable storage media may employ any combination of one or more computer-readable media.
  • the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium.
  • the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above.
  • a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a propagated data signal in baseband or as part of a carrier wave, with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
  • first and second are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implying the number of indicated technical features. Thus, a feature delimited with “first”, “second” may expressly or implicitly include at least one of that feature.
  • plurality means at least two, such as two, three, etc., unless otherwise expressly and specifically defined.
  • the word “if” as used herein can be interpreted as “at” or “when” or “in response to determining” or “in response to detecting.”
  • the phrases “if determined” or “if detected (the stated condition or event)” can be interpreted as “when determined” or “in response to determining” or “when detected (the stated condition or event),” depending on the context )” or “in response to detection (a stated condition or event)”.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined. Either it can be integrated into another system, or some features can be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • each functional unit in each embodiment of this specification may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software functional units.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The present application relates to the field of Bluetooth technology, and, in particular, relates to a method for upgrading firmware, and a related device. The method comprises: determining a first storage space according to description information about first firmware; performing an erase operation on the first storage space in a first idle time period during Bluetooth transmission; and writing an update packet of the first firmware into the first storage space in a second idle time period during Bluetooth transmission, the update packet of the first firmware coming from a first Bluetooth device. According to the solution in the embodiments of the present invention, a firmware upgrade code can be stored in a preset memory so as to conserve system RAM resources; performing an erase operation on a storage space in advance can shorten the transmission time for a firmware data packet; furthermore, an erase operation and write operation are performed in idle time periods during Bluetooth transmission, which can reduce Bluetooth power consumption, while also improving the stability of a Bluetooth connection between devices.

Description

固件升级方法和相关设备Firmware upgrade method and related equipment
本申请要求于2021年01月04日提交中国专利局、申请号为202110004296.4、申请名称为“固件升级方法和相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110004296.4 and the application name "firmware upgrade method and related equipment", which was submitted to the Chinese Patent Office on January 4, 2021, the entire contents of which are incorporated into this application by reference.
技术领域technical field
本申请涉及蓝牙技术领域,尤其涉及一种固件升级方法和相关设备。The present application relates to the field of Bluetooth technology, and in particular, to a firmware upgrade method and related equipment.
背景技术Background technique
蓝牙OTA(Over-the-Air Technology,空中下载技术),即采用蓝牙方式对设备中的固件进行升级的技术。目前基于蓝牙对设备中的固件升级的过程主要包括:蓝牙从设备启动OTA代码,并从蓝牙主设备获取新版本固件的数据包。其中,蓝牙从设备中的OTA代码通常集成在RAM(Random Access Memory,随机存储器),这会占用系统较多的RAM资源。而且蓝牙从设备接收到蓝牙主设备发送的固件数据包之后采用边擦除边写入的方式将固件数据写入用于存储固件数据包的存储空间。此方式,不仅占用的时间比较长,而且常常需要关闭蓝牙收发中断,容易引起蓝牙断连,影响蓝牙主设备和蓝牙从设备连接的稳定性。Bluetooth OTA (Over-the-Air Technology) is a technology that uses Bluetooth to upgrade the firmware in the device. At present, the process of upgrading the firmware in the device based on Bluetooth mainly includes: starting the OTA code from the Bluetooth slave device, and obtaining the data package of the new version of the firmware from the Bluetooth master device. Among them, the OTA code in the Bluetooth slave device is usually integrated in RAM (Random Access Memory, random access memory), which will occupy more RAM resources in the system. Moreover, after the Bluetooth slave device receives the firmware data packet sent by the Bluetooth master device, the firmware data is written into the storage space for storing the firmware data packet in the manner of erasing and writing. This method not only takes a long time, but also often needs to turn off the interruption of Bluetooth transmission and reception, which easily causes Bluetooth disconnection and affects the stability of the connection between the Bluetooth master device and the Bluetooth slave device.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本发明实施例提供了一种固件升级方法和相关设备,第一固件中的固件升级代码可以存放在预设存储器由此以节省系统RAM资源;该方案提前对用于存储固件数据包的存储空间执行擦除操作,在获取到固件数据包后可以直接执行写入操作,节约固件数据包的传输时间;进一步,上述擦除操作和写入操作在蓝牙传输空闲时间执行,不仅可以降低蓝牙功耗,而且无需关闭蓝牙收发中断,提高设备之间蓝牙连接的稳定性。In view of this, the embodiment of the present invention provides a firmware upgrade method and related equipment, the firmware upgrade code in the first firmware can be stored in a preset memory to save system RAM resources; this solution is used for storing firmware data in advance. The storage space of the package is erased, and the write operation can be performed directly after the firmware data packet is obtained, saving the transmission time of the firmware data packet; further, the above erase operation and write operation are performed during the idle time of Bluetooth transmission, which not only can Reduce Bluetooth power consumption, and do not need to close the Bluetooth transceiver interrupt, improve the stability of the Bluetooth connection between devices.
第一方面,本发明实施例提供了一种固件升级方法,包括:根据第一固件的 描述信息,确定第一存储空间,其中,所述第一固件的部分或者全部代码存储于预设存储器,所述第一存储空间位于预设存储器;在蓝牙传输的第一空闲时间,对所述第一存储空间执行擦除操作;在蓝牙传输的第二空闲时间,将第一固件的更新包写入所述第一存储空间,其中,所述更新包来自第一蓝牙设备。可选的,所述预设存储器可以是闪存(Flash)存储器。在一个示例中,所述预设存储器可以是NOR Flash存储器。可选的,第一空闲时间可以包括多个子空闲时间,在每个子空闲时间执行一次擦除操作。可选的,第二空闲时间可以包括多个子空闲时间,在每个子空闲时间执行一次写入操作。可选的,上述子空闲时间均可以是指相邻两个收发中断节点之间的空闲时间。In a first aspect, an embodiment of the present invention provides a firmware upgrade method, including: determining a first storage space according to description information of a first firmware, wherein part or all of the code of the first firmware is stored in a preset memory, The first storage space is located in the preset memory; in the first idle time of Bluetooth transmission, an erase operation is performed on the first storage space; in the second idle time of Bluetooth transmission, the update package of the first firmware is written into The first storage space, wherein the update package is from a first Bluetooth device. Optionally, the preset memory may be a flash memory (Flash) memory. In one example, the preset memory may be a NOR Flash memory. Optionally, the first idle time may include a plurality of sub-idle times, and an erase operation is performed in each of the sub-idle times. Optionally, the second idle time may include multiple sub-idle times, and one write operation is performed in each of the sub-idle times. Optionally, the above-mentioned sub-idle time may all refer to the idle time between two adjacent nodes where the transmission and reception are interrupted.
所述第一固件的描述信息是所述第一蓝牙设备确定对第二蓝牙设备中的第一固件升级时发送给所述第二蓝牙设备的。The description information of the first firmware is sent to the second Bluetooth device when the first Bluetooth device determines to upgrade the first firmware in the second Bluetooth device.
可选的,所述第一固件的描述信息包括:第一固件的大小、第一存储空间的起始地址和代码的运行地址。在一些实施例中,第一固件的描述信息包括第一固件的大小。第二蓝牙设备可以根据第一固件的大小自主确定第一存储空间。可选的,第一固件的描述信息可以包括第一固件的大小和第一存储空间的地址,该地址可以是第一存储空间的起始地址。第二蓝牙设备可以根据第一固件的大小和第一存储空间的地址动态确定第一存储空间。当然第一存储空间也可以是预设存储器中的固定空间。代码的运行地址用于确定更新后的第一固件的运行地址。Optionally, the description information of the first firmware includes: the size of the first firmware, the starting address of the first storage space, and the running address of the code. In some embodiments, the description information of the first firmware includes the size of the first firmware. The second Bluetooth device may autonomously determine the first storage space according to the size of the first firmware. Optionally, the description information of the first firmware may include a size of the first firmware and an address of the first storage space, and the address may be a start address of the first storage space. The second Bluetooth device may dynamically determine the first storage space according to the size of the first firmware and the address of the first storage space. Of course, the first storage space may also be a fixed space in the preset memory. The running address of the code is used to determine the running address of the updated first firmware.
可选的,在蓝牙传输的第一空闲时间,对所述第一存储空间执行擦除操作,包括:根据所述第一存储空间的大小,对所述第一存储空间执行M次擦除操作,每次擦除操作均在蓝牙传输的空闲时间执行,每次擦除操作擦除的空间均是单位空间的整数倍,M≥1;其中,如果执行完第M-1次擦除操作之后剩余的待擦除空间小于一个单位空间的大小,则将待擦除空间补足为一个单位空间并执行第M次擦除操作。其中,将待擦除空间补足为一个单位空间的方式可以是根据对应存储器的物理特性延伸补足。Optionally, performing an erasing operation on the first storage space during the first idle time of Bluetooth transmission includes: performing M erasing operations on the first storage space according to the size of the first storage space. , each erasing operation is performed in the idle time of Bluetooth transmission, and the space erased by each erasing operation is an integer multiple of the unit space, M≥1; If the remaining space to be erased is smaller than the size of one unit space, the space to be erased is supplemented as one unit space and the Mth erasing operation is performed. The method of supplementing the space to be erased into a unit space may be extended and supplemented according to the physical characteristics of the corresponding memory.
可选的,对所述第一存储空间执行所述M次中的第Q次擦除操作,包括:确定第Q次擦除操作需要的擦除时间;确定从当前时间到下一个收发中断节点的第一时间;如果所述第一时间与所述擦除时间的差值在第一取值范围,则在所述第一时间执行第Q次擦除操作;否则触发蓝牙连接参数的调整。Optionally, performing the Qth erasing operation in the M times on the first storage space includes: determining an erasing time required for the Qth erasing operation; determining from the current time to the next transmission and reception interrupt node the first time; if the difference between the first time and the erasing time is within the first value range, the Qth erasing operation is performed at the first time; otherwise, the adjustment of the Bluetooth connection parameters is triggered.
可选的,所述方法还包括:在蓝牙连接参数调整后,确定当前时间到下一个收发中断节点的第二时间与所述擦除时间的差值在第一取值范围时,在所述第二时间执行第Q次擦除操作。Optionally, the method further includes: after the Bluetooth connection parameter is adjusted, when it is determined that the difference between the second time from the current time to the next sending and receiving interrupted node and the erasing time is within the first value range, when the The Qth erasing operation is performed at the second time.
可选的,所述第一固件的更新包分为多个子更新包,第一子更新包为第一固件的任意一个子更新包;其中,将所述第一子更新包写入所述第一存储空间,包括:确定将所述第一子更新包写入所述第一存储空间需要的写入时间;确定从当前时间到下一个收发中断节点的第三时间;如果所述第三时间与所述写入时间的差值在第二取值范围,则在所述第三时间将所述第一子更新包写入所述第一存储空间;否则触发蓝牙连接参数的调整。Optionally, the update package of the first firmware is divided into multiple sub-update packages, and the first sub-update package is any sub-update package of the first firmware; wherein, the first sub-update package is written into the first sub-update package. a storage space, including: determining the writing time required for writing the first sub-update package into the first storage space; determining a third time from the current time to the next node for sending and receiving interrupts; if the third time If the difference from the writing time is within the second value range, the first sub-update package is written into the first storage space at the third time; otherwise, the adjustment of the Bluetooth connection parameters is triggered.
可选的,所述方法还包括:在蓝牙连接参数调整后,确定当前时间到下一个收发中断节点的第四时间与所述写入时间的差值在所述第二取值范围时,在所述第四时间将所述第一子更新包写入所述第一存储空间。Optionally, the method further includes: after the Bluetooth connection parameter is adjusted, when it is determined that the difference between the fourth time from the current time to the next sending and receiving interrupt node and the writing time is within the second value range, in the second value range. The first sub-update package is written into the first storage space at the fourth time.
可选的,触发蓝牙连接参数的调整,包括:如果所述第三时间与所述写入时间的差值小于所述第二取值范围的最小边界值,则确定后续N个收发中断节点对应的空闲时间与所述写入时间的差值是否均小于所述最小边界值;如果是,则触发增大蓝牙连接参数的调整。Optionally, triggering the adjustment of the Bluetooth connection parameters includes: if the difference between the third time and the writing time is less than the minimum boundary value of the second value range, determining that the subsequent N transmission and reception interrupt nodes correspond to Whether the difference between the idle time and the write time is less than the minimum boundary value; if so, triggering an adjustment to increase the Bluetooth connection parameters.
可选的,将所述第一固件的更新包写入所述第一存储空间之后,所述方法还包括:在所述第一固件重新启动时,将所述第一固件的更新包代码拷贝至代码的运行地址并运行。Optionally, after the update package of the first firmware is written into the first storage space, the method further includes: when the first firmware is restarted, copying the update package code of the first firmware to the run address of the code and run it.
第二方面,本发明实施例提供了一种固件升级装置,包括:预设存储模块,用于存储第一固件的部分或者全部代码,以及提供第一存储空间;其中,所述第 一固件中对应的固件升级代码包括如下功能模块:确定模块,用于根据第一固件的描述信息,确定第一存储空间;擦写模块,用于在蓝牙传输的第一空闲时间,对所述第一存储空间执行擦除操作;以及用于在蓝牙传输的第二空闲时间,将第一固件的更新包写入所述第一存储空间;蓝牙收发模块,用于从第一蓝牙设备接收更新包。In a second aspect, an embodiment of the present invention provides a firmware upgrade device, including: a preset storage module for storing part or all of the code of the first firmware, and providing a first storage space; wherein, the first firmware contains The corresponding firmware upgrade code includes the following functional modules: a determination module, used for determining the first storage space according to the description information of the first firmware; an erasing module, used for the first idle time of Bluetooth transmission, for the first storage space. The space performs an erasing operation; and is used for writing the update package of the first firmware into the first storage space during the second idle time of Bluetooth transmission; the Bluetooth transceiver module is used for receiving the update package from the first Bluetooth device.
第三方面,本发明实施例提供了一种蓝牙芯片,包括:处理器,其用于执行存储在存储器中的计算机程序指令,其中,当该计算机程序指令被该处理器执行时,触发所述蓝牙芯片执行上述第一方面或者第一方面任一实施例的方法。In a third aspect, an embodiment of the present invention provides a Bluetooth chip, including: a processor configured to execute computer program instructions stored in a memory, wherein, when the computer program instructions are executed by the processor, trigger the The Bluetooth chip executes the method of the first aspect or any one of the embodiments of the first aspect.
第四方面,本发明实施例提供了一种电子设备,包括:至少一个处理器;以及与所述处理器通信连接的至少一个存储器,其中:所述存储器存储有可被所述处理器执行的程序指令,所述处理器调用所述程序指令能够执行上述第一方面或者第一方面任一实施例的方式。In a fourth aspect, an embodiment of the present invention provides an electronic device, including: at least one processor; and at least one memory communicatively connected to the processor, wherein: the memory stores a memory executable that can be executed by the processor Program instructions, where the processor invokes the program instructions to execute the first aspect or any of the embodiments of the first aspect.
第五方面,本发明实施例提供了一种计算机可读存储介质,所述计算机可读存储介质包括存储的程序,其中,在所述程序运行时控制所述计算机可读存储介质所在设备执行上述第一方面或者第一方面任一实施例的方式。In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium includes a stored program, wherein when the program runs, a device on which the computer-readable storage medium is located is controlled to execute the above-mentioned The first aspect or the manner of any embodiment of the first aspect.
本发明实施例方案中,第一固件的OTA代码可以部分或者全部存放在预设存储器,该预设存储器无需是RAM存储器,由此以节省系统RAM资源;该方案提前对用于存储固件数据包的存储空间执行擦除操作,在获取到固件数据包后可以直接执行写入操作,节约固件数据包的传输时间;进一步,上述擦除操作和写入操作在蓝牙传输空闲时间执行,不仅可以降低蓝牙功耗,而且无需关闭蓝牙收发中断,设备之间可以正常进行数据收发,提高设备之间蓝牙连接的稳定性。In the solution of the embodiment of the present invention, part or all of the OTA code of the first firmware may be stored in a preset memory, and the preset memory does not need to be a RAM memory, thereby saving system RAM resources; After the firmware data packet is acquired, the write operation can be performed directly, which saves the transmission time of the firmware data packet; further, the above-mentioned erase operation and write operation are performed in the idle time of Bluetooth transmission, which can not only reduce the Bluetooth power consumption, and there is no need to turn off the Bluetooth transceiver interrupt, data transmission and reception between devices can be performed normally, and the stability of the Bluetooth connection between devices is improved.
附图说明Description of drawings
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据 这些附图获得其它的附图。In order to illustrate the technical solutions of the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.
图1是本发明实施例提供的一种蓝牙系统的结构示意图;1 is a schematic structural diagram of a Bluetooth system provided by an embodiment of the present invention;
图2是本发明实施例提供的一种蓝牙传输的时间节点示意图;2 is a schematic diagram of a time node of Bluetooth transmission provided by an embodiment of the present invention;
图3是本发明实施例提供的一种固件升级方法的流程图;3 is a flowchart of a firmware upgrade method provided by an embodiment of the present invention;
图4-a是本发明实施例提供的另一种固件升级方法的流程图;4-a is a flowchart of another firmware upgrade method provided by an embodiment of the present invention;
图4-b是基于图4-a提供的一种执行擦除操作的流程图;Fig. 4-b is a kind of flow chart of performing erase operation based on Fig. 4-a provided;
图4-c是基于图4-a提供的一种执行写入操作的流程图;Fig. 4-c is a kind of flow chart of performing write operation provided based on Fig. 4-a;
图5是本发明实施例提供的一种固件升级装置的结构示意图;5 is a schematic structural diagram of a firmware upgrade apparatus provided by an embodiment of the present invention;
图6是本发明实施例提供的一种电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了更好的理解本申请的技术方案,下面结合附图对本申请实施例进行详细描述。In order to better understand the technical solutions of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
应当明确,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。It should be clear that the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
在本申请实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. As used in the embodiments of this application and the appended claims, the singular forms "a," "the," and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise.
图1是本发明实施例提供的一种蓝牙系统的结构示意图。如图1所示,该系统包括:第一蓝牙设备和第二蓝牙设备。其中,第一蓝牙设备可以作为蓝牙主设备,第二蓝牙设备可以作为蓝牙从设备。第一蓝牙设备与第二蓝牙设备建立蓝牙连接。第一蓝牙设备可以获取新版的第一固件。第二蓝牙设备设置有旧版的第一固件。第一蓝牙设备确定第二蓝牙设备的第一固件需要升级时,第一蓝牙设备向第二蓝牙设备发送第一固件的相关数据包。如图2所示,在蓝牙通信机制中,蓝牙设备之间基于蓝牙连接参数确定收发中断节点(对应图2中的中断节点),相 邻的两个收发中断节点的时间可以分为工作时间和空闲时间。其中,工作时间又可以分为用于硬件启动、代码调用等的时间以及数据收发时间。可选的,对于本发明实施例重点关注处于工作时间的数据收发时间。在数据收发时间,第一蓝牙设备和第二蓝牙设备可以进行数据交互。例如第一蓝牙设备和第二蓝牙设备在数据收发时间可以进行有效数据的收发;如果第一蓝牙设备和第二蓝牙设备之间没有有效数据则可以进行心跳数据的收发。在空闲时间,第一蓝牙设备和第二蓝牙设备进入睡眠状态。如图2可以看出,相邻两个收发中断节点之间工作时间占据的时间长度不同,对应的空闲时间占据的时间长度也不同。FIG. 1 is a schematic structural diagram of a Bluetooth system according to an embodiment of the present invention. As shown in FIG. 1 , the system includes: a first Bluetooth device and a second Bluetooth device. Wherein, the first Bluetooth device can be used as a Bluetooth master device, and the second Bluetooth device can be used as a Bluetooth slave device. The first Bluetooth device establishes a Bluetooth connection with the second Bluetooth device. The first Bluetooth device may acquire a new version of the first firmware. The second Bluetooth device is provided with an older version of the first firmware. When the first Bluetooth device determines that the first firmware of the second Bluetooth device needs to be upgraded, the first Bluetooth device sends a data packet related to the first firmware to the second Bluetooth device. As shown in Figure 2, in the Bluetooth communication mechanism, the Bluetooth device determines the transmission and reception interruption node (corresponding to the interruption node in Figure 2) based on the Bluetooth connection parameters, and the time of two adjacent transmission and reception interruption nodes can be divided into working time and free time. Among them, the working time can be further divided into the time used for hardware startup, code calling, etc., and the data sending and receiving time. Optionally, for this embodiment of the present invention, the data sending and receiving time during working hours is focused on. During the data sending and receiving time, the first Bluetooth device and the second Bluetooth device can perform data interaction. For example, the first bluetooth device and the second bluetooth device can send and receive valid data during the data sending and receiving time; if there is no valid data between the first bluetooth device and the second bluetooth device, they can send and receive heartbeat data. During idle time, the first Bluetooth device and the second Bluetooth device enter a sleep state. As can be seen from FIG. 2 , the time lengths occupied by the working time between two adjacent sending and receiving interrupt nodes are different, and the time lengths occupied by the corresponding idle time are also different.
上述第一蓝牙设备和第二蓝牙设备均可以是手机、平板电脑、照相机、可穿戴设备、车载设备、楼宇设备、智能家居设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备等电子设备,本申请实施例对电子设备的具体类型不作任何限制。Both the first Bluetooth device and the second Bluetooth device may be mobile phones, tablet computers, cameras, wearable devices, vehicle-mounted devices, building devices, smart home devices, augmented reality (AR)/virtual reality (VR) ) devices and other electronic devices, the embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
图3是本发明实施例提供的一种固件升级方法的流程图。图3所示方法的执行主体可以是上述的第二蓝牙设备。该固件升级方法可以应用于低功耗蓝牙传输方案也可以应用于传统蓝牙传输方案中。可选的,本发明实施例第一固件的代码可以部分或者全部存储在预设存储器。相应的,第一固件包含的固件升级代码的部分或者全部存储在预设存储器。例如,固件升级代码包含将第一固件的更新包写入第一存储空间的代码,该部分代码可以存储在RAM或者ROM存储器,除此之外的固件升级代码均存储在预设存储器。当然,固件升级代码放置在预设存储器、RAM或者ROM存储器的部分可以根据实际需要进行调整,此处不再一一举例。所述预设存储器可以是Flash存储器。在一个示例中,所述预设存储器可以是NOR Flash存储器。该方法的处理步骤包括:FIG. 3 is a flowchart of a firmware upgrade method provided by an embodiment of the present invention. The executing subject of the method shown in FIG. 3 may be the above-mentioned second Bluetooth device. The firmware upgrade method can be applied to a low-power Bluetooth transmission scheme or a traditional Bluetooth transmission scheme. Optionally, part or all of the code of the first firmware in this embodiment of the present invention may be stored in a preset memory. Correspondingly, part or all of the firmware upgrade code included in the first firmware is stored in the preset memory. For example, the firmware upgrade code includes code for writing the update package of the first firmware into the first storage space, and this part of the code may be stored in RAM or ROM memory, and other firmware upgrade codes are stored in a preset memory. Of course, the part of the firmware upgrade code placed in the preset memory, the RAM or the ROM memory can be adjusted according to actual needs, and examples will not be given here. The preset memory may be a Flash memory. In one example, the preset memory may be a NOR Flash memory. The processing steps of the method include:
101,根据第一固件的描述信息,确定第一存储空间。其中,第一固件为第二蓝牙设备中需要升级更新的固件。第一固件可以是第二蓝牙设备中的任意一个固件。第二蓝牙设备获取第一固件的描述信息的方式可以是从固件服务器获取、根 据用户的输入获取或者从第一蓝牙设备获取。可选的,第二蓝牙设备从第一蓝牙设备获取第一固件的描述信息的方式可以包括:第二蓝牙设备与第一蓝牙设备建立连接之后,第一蓝牙设备可以读取第二蓝牙设备中已有的第一固件的版本和/或固件bin文件的版本等信息。第一蓝牙设备根据读取的第一固件的版本和/或固件bin文件的版本等信息确定第二蓝牙设备中已有的第一固件需要升级。此时,第一蓝牙设备可以将第一固件的描述信息发送给第二蓝牙设备。需要说明的是,步骤101中第一固件的描述信息为新版本的第一固件的描述信息。可选的,第一固件的描述信息可以包括:第一固件的大小、第一存储空间的起始地址和代码的运行地址。在一些实施例中,第一固件的描述信息包括第一固件的大小。第二蓝牙设备可以根据第一固件的大小自主确定第一存储空间。可选的,第一固件的描述信息可以包括第一固件的大小和第一存储空间的地址,该地址可以是第一存储空间的起始地址。第二蓝牙设备可以根据第一固件的大小和第一存储空间的地址动态确定第一存储空间。当然第一存储空间也可以是预设存储器中的固定空间。代码的运行地址用于确定更新后的第一固件的运行地址。101. Determine a first storage space according to the description information of the first firmware. The first firmware is firmware that needs to be upgraded and updated in the second Bluetooth device. The first firmware may be any firmware in the second Bluetooth device. The manner in which the second Bluetooth device acquires the description information of the first firmware may be acquisition from a firmware server, acquisition according to user input, or acquisition from the first Bluetooth device. Optionally, the manner in which the second bluetooth device obtains the description information of the first firmware from the first bluetooth device may include: after the second bluetooth device establishes a connection with the first bluetooth device, the first bluetooth device may read the information in the second bluetooth device. Information such as the version of the existing first firmware and/or the version of the firmware bin file. The first Bluetooth device determines that the existing first firmware in the second Bluetooth device needs to be upgraded according to the read information such as the version of the first firmware and/or the version of the firmware bin file. At this time, the first Bluetooth device may send the description information of the first firmware to the second Bluetooth device. It should be noted that the description information of the first firmware in step 101 is the description information of the new version of the first firmware. Optionally, the description information of the first firmware may include: the size of the first firmware, the starting address of the first storage space, and the running address of the code. In some embodiments, the description information of the first firmware includes the size of the first firmware. The second Bluetooth device may autonomously determine the first storage space according to the size of the first firmware. Optionally, the description information of the first firmware may include a size of the first firmware and an address of the first storage space, and the address may be a start address of the first storage space. The second Bluetooth device may dynamically determine the first storage space according to the size of the first firmware and the address of the first storage space. Of course, the first storage space may also be a fixed space in the preset memory. The running address of the code is used to determine the running address of the updated first firmware.
第二蓝牙设备确定对第一固件升级更新之后,可以根据第一固件的描述信息确定第一存储空间。可选的,第二蓝牙设备可以在预设存储器,如上述Flash存储器确定第一存储空间。该第一存储空间用于存储升级后的第一固件的更新包。After the second Bluetooth device determines to upgrade and update the first firmware, the first storage space may be determined according to the description information of the first firmware. Optionally, the second Bluetooth device may determine the first storage space in a preset memory, such as the above-mentioned Flash memory. The first storage space is used to store the updated package of the upgraded first firmware.
102,在蓝牙传输的第一空闲时间,对第一存储空间执行擦除操作。不同于相关技术中,边擦除边向存储空间写入固件数据的方式。本发明实施例中,在确定第一存储空间之后,在蓝牙传输的第一空闲时间对第一存储空间执行擦除操作。其中,在蓝牙传输的第一空闲时间,对所述第一存储空间执行擦除操作可以包括:根据第一存储空间的大小,对第一存储空间执行M次擦除操作,每次擦除操作均在蓝牙传输的空闲时间执行,每次擦除操作擦除的空间均是单位空间的整数倍,M≥1。102. Perform an erasing operation on the first storage space during the first idle time of the Bluetooth transmission. Different from the related art, the firmware data is written to the storage space while erasing. In this embodiment of the present invention, after the first storage space is determined, an erasing operation is performed on the first storage space during the first idle time of Bluetooth transmission. Wherein, in the first idle time of Bluetooth transmission, performing the erasing operation on the first storage space may include: according to the size of the first storage space, performing M erasing operations on the first storage space, each erasing operation All are executed in the idle time of Bluetooth transmission, and the space erased by each erase operation is an integer multiple of the unit space, M≥1.
其中,如果执行完第M-1次擦除操作之后剩余的待擦除空间小于一个单位空 间的大小,则将待擦除空间补足为一个单位空间并执行第M次擦除操作。其中,将待擦除空间补足为一个单位空间的方式可以是根据对应存储器的物理特性延伸补足。Wherein, if the remaining space to be erased after the M-1th erasing operation is performed is less than the size of one unit space, the space to be erased is supplemented as one unit space and the Mth erasing operation is performed. The method of supplementing the space to be erased into a unit space may be extended and supplemented according to the physical characteristics of the corresponding memory.
在一些实施例中,如果第一存储空间小于或者等于一个单位空间,则M等于1。即对第一存储空间执行一次擦除操作。其中,如果第一存储空间小于一个单位空间,则需要将第一存储空间补足为一个单位空间再执行擦除操作。该一次次擦除操作的擦除时间对应一个单位时间,该单位时间为擦除一个单位空间需要的时间。其中,该单位时间是基于预设存储器的物理特性确定的。例如,当预设存储器是Flash存储器时,该单位时间是基于Flash存储器的物理特性确定的。In some embodiments, M is equal to 1 if the first storage space is less than or equal to one unit space. That is, an erasing operation is performed on the first storage space. Wherein, if the first storage space is less than one unit space, the first storage space needs to be supplemented into one unit space before performing the erasing operation. The erasing time of each erasing operation corresponds to a unit time, and the unit time is the time required to erase a unit space. Wherein, the unit time is determined based on the physical characteristics of the preset memory. For example, when the preset memory is a Flash memory, the unit time is determined based on the physical characteristics of the Flash memory.
在一些实施例中,如果第一存储空间大于一个单位空间,则M大于1,即对第一存储空间执行至少两次擦除操作。每次擦除操作的擦除空间为单位空间的整数倍。每次擦除操作的擦除时间根据擦除的单位空间个数确定。例如,第Q次擦除操作对应一个单位空间,则第Q次擦除操作对应一个单位时间。如果第Q次擦除操作对应两个单位空间,则第Q次擦除操作对应两个单位时间。其中,对于最后一次擦除操作,如果不足一个单位空间,则需要将第一存储空间补足为一个单位空间再执行擦除操作。In some embodiments, if the first storage space is larger than one unit space, M is larger than 1, that is, at least two erase operations are performed on the first storage space. The erasing space of each erasing operation is an integer multiple of the unit space. The erasing time of each erasing operation is determined according to the number of unit spaces to be erased. For example, the Qth erasing operation corresponds to one unit space, and the Qth erasing operation corresponds to one unit time. If the Qth erasing operation corresponds to two unit spaces, the Qth erasing operation corresponds to two unit times. Wherein, for the last erasing operation, if there is less than one unit space, the first storage space needs to be supplemented into one unit space before performing the erasing operation.
在一些实施例中,上述单位空间可以包含不同大小的多个单位空间。在执行第Q次擦除操作时,首先确定剩余的待擦除空间是否大于或者等于第一单位空间,如果待擦除空间大于或者等于第一单位空间,则第Q次擦除一个第一单位空间,第一单位空间为第Q-1次擦除操作对应的单位空间。如果剩余的待擦除空间小于第一单位空间,则进一步确定剩余的待擦除空间是否大于或者等于第二单位空间,第二单位空间小于第一单位空间,……直至比较至最小的单位空间。如果剩余的待擦除空间小于或者等于最小的单位空间,则第Q次擦除操作是最后一次擦除操作。可选的,各个大小不同的单位空间对应的单位时间可以相同,也可以不同。在本发明实施例中,各个大小不同的单位空间对应的单位时间相同。因此, 在对第一存储空间擦除时,先基于较大的单位空间擦除,如果不足较大的单位空间,再按照较小的单位空间擦除,由此以提高擦除效率,节约擦除时间。对于最后一次擦除操作,如果最后一次擦除操作对应的剩余待擦除空间不足一个单位空间则补足为一个单位空间。可选的,可以基于最小的单位空间进行补足。In some embodiments, the above-mentioned unit space may include a plurality of unit spaces of different sizes. When performing the Qth erasing operation, first determine whether the remaining space to be erased is greater than or equal to the first unit space, and if the space to be erased is greater than or equal to the first unit space, the Qth erasing a first unit space, the first unit space is the unit space corresponding to the Q-1th erasing operation. If the remaining space to be erased is smaller than the first unit space, further determine whether the remaining space to be erased is greater than or equal to the second unit space, the second unit space is smaller than the first unit space, ... until the smallest unit space is compared . If the remaining space to be erased is less than or equal to the smallest unit space, the Qth erasing operation is the last erasing operation. Optionally, the unit time corresponding to each unit space with different sizes may be the same or different. In the embodiment of the present invention, the unit time corresponding to each unit space with different sizes is the same. Therefore, when erasing the first storage space, first erase based on the larger unit space, and if the larger unit space is insufficient, then erase according to the smaller unit space, thereby improving the erasing efficiency and saving the erasing efficiency. except time. For the last erase operation, if the remaining space to be erased corresponding to the last erase operation is less than one unit space, it will be supplemented as one unit space. Optionally, it can be supplemented based on the smallest unit space.
103,在蓝牙传输的第二空闲时间,将第一固件的更新包写入第一存储空间,其中,第一固件的更新包来自第一蓝牙设备。103. Write the update package of the first firmware into the first storage space during the second idle time of the Bluetooth transmission, where the update package of the first firmware comes from the first Bluetooth device.
本发明实施例中,第二蓝牙设备对第一存储空间擦除完毕后,可以在之后的数据收发时间通知第一蓝牙设备发送第一固件的更新包。第一蓝牙设备根据该通知信息向第二蓝牙设备发送第一固件的更新包。可选的,第一固件的更新包可以分为多个子更新包。各个子更新包可以分别发送给第二蓝牙设备。例如,第一蓝牙设备每次发送一个子更新包给第二蓝牙设备。第二蓝牙设备将该一个子更新包写入第一存储空间之后,再进行下一个子更新包的接收和写入。当然第一蓝牙设备和第二蓝牙设备之间也可以根据实际需要调整子更新包的收发数量和写入时间等。其中,为描述的方便将第一固件的各个子更新包中的任意一个子更新包称为第一子更新包。In the embodiment of the present invention, after the second bluetooth device has finished erasing the first storage space, it can notify the first bluetooth device to send an update package of the first firmware at a later data sending and receiving time. The first Bluetooth device sends an update package of the first firmware to the second Bluetooth device according to the notification information. Optionally, the update package of the first firmware may be divided into multiple sub-update packages. Each sub-update package may be sent to the second Bluetooth device respectively. For example, the first Bluetooth device sends a sub-update packet to the second Bluetooth device each time. After the second Bluetooth device writes the one sub-update package into the first storage space, it receives and writes the next sub-update package. Of course, between the first Bluetooth device and the second Bluetooth device, the number of sending and receiving sub-update packets and the writing time can also be adjusted according to actual needs. Wherein, for the convenience of description, any one of the sub-update packages of the first firmware is referred to as the first sub-update package.
第二蓝牙设备接收到第一子更新包之后,在蓝牙传输的一个空闲时间将第一子更新包写入第一存储空间。该空闲时间可以是第二蓝牙设备接收到第一子更新包之后,下一个收发中断节点之前的空闲时间。例如,当前时间为t 3,下一个收发中断节点的到来时间为t 4,则第二蓝牙设备可以在t 4-t 3的这段空闲时间将第一子更新包写入第一存储空间。 After receiving the first sub-update package, the second Bluetooth device writes the first sub-update package into the first storage space during an idle time of Bluetooth transmission. The idle time may be the idle time before the next transceiving interrupt node after the second Bluetooth device receives the first sub-update packet. For example, if the current time is t 3 and the arrival time of the next node that interrupts transmission and reception is t 4 , the second Bluetooth device can write the first sub-update packet into the first storage space during the idle time from t 4 to t 3 .
本发明实施例的固件升级方法,OTA代码可以部分或者全部存放在预设存储器,该预设存储器无需是RAM存储器,由此以节省系统RAM资源;该方案提前对用于存储固件数据包的存储空间执行擦除操作,在获取到固件数据包后可以直接执行写入操作,节约固件数据包的传输时间;进一步,上述擦除操作和写入操作在蓝牙传输空闲时间执行,不仅可以降低蓝牙功耗,而且无需关闭蓝牙收 发中断,蓝牙设备之间可以正常进行数据收发,提高设备之间蓝牙连接的稳定性。In the firmware upgrade method of the embodiment of the present invention, the OTA code can be partially or completely stored in a preset memory, and the preset memory does not need to be a RAM memory, thereby saving system RAM resources; The space performs the erasing operation, and the writing operation can be directly performed after the firmware data packet is obtained, saving the transmission time of the firmware data packet; further, the above-mentioned erasing operation and writing operation are performed in the idle time of Bluetooth transmission, which can not only reduce the Bluetooth function. In addition, there is no need to turn off the interruption of Bluetooth transmission and reception, and data transmission and reception between Bluetooth devices can be performed normally, which improves the stability of Bluetooth connection between devices.
图4-a是本发明实施例提供的另一种固件升级方法的流程图。如图4-a所示,该方法的处理步骤包括:FIG. 4-a is a flowchart of another firmware upgrade method provided by an embodiment of the present invention. As shown in Figure 4-a, the processing steps of the method include:
201,第一蓝牙设备确定第二蓝牙设备中的第一固件需要升级时,向第二蓝牙设备发送第一固件的描述信息。第一固件的描述信息包括第一固件的大小、第一存储空间的起始地址和和代码的运行地址。该第一固件的大小即为新版本第一固件的大小。201. When the first Bluetooth device determines that the first firmware in the second Bluetooth device needs to be upgraded, it sends description information of the first firmware to the second Bluetooth device. The description information of the first firmware includes the size of the first firmware, the start address of the first storage space, and the running address of the code. The size of the first firmware is the size of the new version of the first firmware.
202,第二蓝牙设备根据第一固件的大小和第一存储空间的起始地址,确定第一存储空间。可选的,第二蓝牙设备可以在NOR FLASH中确定第一存储空间。202. The second Bluetooth device determines the first storage space according to the size of the first firmware and the start address of the first storage space. Optionally, the second Bluetooth device may determine the first storage space in NOR FLASH.
203,第二蓝牙设备根据第一存储空间的大小,对第一存储空间执行M次擦除操作,每次擦除操作均在蓝牙传输的空闲时间执行,每次擦除操作擦除的空间均是单位空间的整数倍,M≥1。203. The second Bluetooth device performs M times of erasing operations on the first storage space according to the size of the first storage space, each erasing operation is performed during the idle time of Bluetooth transmission, and the space erased by each erasing operation is is an integer multiple of the unit space, M≥1.
如果执行完第M-1次擦除操作之后剩余的待擦除空间小于一个单位空间的大小,则将待擦除空间补足为一个单位空间并执行第M次擦除操作。If the remaining space to be erased after the M-1 th erasing operation is performed is smaller than the size of one unit space, the to-be-erased space is supplemented into one unit space and the Mth erasing operation is performed.
本发明实施例中,对所述第一存储空间执行M次中的第Q次擦除操作,如图4-b所示,具体可以包括:In this embodiment of the present invention, the Qth erasing operation in M times is performed on the first storage space, as shown in FIG. 4-b, which may specifically include:
2031,确定第Q次擦除操作需要的擦除时间。Q取值为1、2……M。该擦除时间为单位时间的整数倍,单位时间根据预设存储空间的物理特性确定。在一些实施例中,第一存储空间支持以第一单位空间和第二单位空间为单位进行擦除操作。第一单位空间大于第二单位空间。如果第Q次擦除操作对应的剩余待擦除空间大于或者等于一个第一单位空间,则第Q次擦除一个第一单位空间,擦除时间对应一个第一单位空间需要的单位时间。如果第Q次擦除操作对应的剩余待擦除空间小于一个第一单位空间,大于或等于一个第二单位空间,则第Q次擦除一个第二单位空间,擦除时间对应一个第二单位空间需要的单位时间。如果第Q次擦除操作对应的剩余待擦除空间小于一个第二单位空间,则第Q次擦除操作为最后 一次擦除操作,则将剩余待擦除空间补足为一个第二单位空间并执行擦除操作,擦除时间对应一个第二单位空间需要的单位时间。可选的,第一单位空间和第二单位空间需要的单位时间可以相同,也可以不同,其可以根据Flash的物理特性确定。例如在Flash存储器中,支持以64K和4k为单位执行擦除操作。假设第一存储空间大小为70k,其包含一个64k空间、1个4k空间并剩余1个2k空间。一个64k空间对应的单位擦除时间为a,一个4k空间对应的单位擦除时间为b,剩余的1个2k空间补足为一个4k空间。则实际擦除的空间为64k+4k+4k,擦除时间为a+2b。a和b的取值可以根据Flash的物理特性确定。可选的,a和b可以取值相同。基于上述方式可以尽量降低第一存储空间需要的擦除时间。2031. Determine the erasing time required for the Qth erasing operation. Q takes the value of 1, 2...M. The erasing time is an integer multiple of the unit time, and the unit time is determined according to the physical characteristics of the preset storage space. In some embodiments, the first storage space supports erase operations in units of the first unit space and the second unit space. The first unit space is larger than the second unit space. If the remaining space to be erased corresponding to the Qth erasing operation is greater than or equal to one first unit space, then the Qth erasing a first unit space, and the erasing time corresponds to the unit time required for one first unit space. If the remaining space to be erased corresponding to the Qth erasing operation is less than a first unit space and greater than or equal to a second unit space, then the Qth erasing a second unit space, the erasing time corresponds to a second unit Unit time required for space. If the remaining space to be erased corresponding to the Qth erasing operation is less than a second unit space, then the Qth erasing operation is the last erasing operation, then the remaining space to be erased is supplemented into a second unit space and The erasing operation is performed, and the erasing time corresponds to the unit time required for a second unit space. Optionally, the unit time required by the first unit space and the second unit space may be the same or different, which may be determined according to the physical characteristics of the Flash. In Flash memory, for example, erase operations are supported in units of 64K and 4K. It is assumed that the size of the first storage space is 70k, which includes one 64k space, one 4k space and one 2k space remaining. The unit erasing time corresponding to a 64k space is a, the unit erasing time corresponding to a 4k space is b, and the remaining 2k space is supplemented as a 4k space. Then the actual erasing space is 64k+4k+4k, and the erasing time is a+2b. The values of a and b can be determined according to the physical properties of the Flash. Optionally, a and b can have the same value. Based on the above manner, the erasing time required for the first storage space can be reduced as much as possible.
2032,确定从当前时间到下一个收发中断节点的第一时间。其中,该第一时间即对应一个蓝牙传输的空闲时间。2032. Determine the first time from the current time to the next node that interrupts transmission and reception. The first time corresponds to an idle time of Bluetooth transmission.
2033,第一时间与擦除时间的差值是否在第一取值范围,如果是执行步骤2034,如果否执行步骤2035。其中,第一时间与擦除时间的差值不在第一取值范围包括:第一时间减去擦除时间的差值小于第一取值范围的最小边界值,或者,第一时间减去擦除时间的差值大于第一取值范围的最大边界值。该最小边界值和最大边界值限定的取值范围为第一取值范围。2033. Whether the difference between the first time and the erasing time is within the first value range, if yes, go to step 2034, and if not, go to step 2035. The difference between the first time and the erasing time not in the first value range includes: the difference between the first time minus the erasing time is less than the minimum boundary value of the first value range, or, the first time minus the erasing time The difference divided by time is greater than the maximum boundary value of the first value range. The value range defined by the minimum boundary value and the maximum boundary value is the first value range.
2034,在第一时间执行第Q次擦除操作。2034. Perform the Qth erasing operation at the first time.
2035,触发蓝牙连接参数的调整。其中,触发蓝牙连接参数的调整可以是通过底层硬件调整蓝牙连接参数。可选的,第二蓝牙设备中的第一固件向底层硬件发送调整蓝牙连接参数的第一信息。可选的,此处的第一固件可以是第一固件的升级程序。第二蓝牙设备中的底层硬件根据该第一信息对蓝牙连接参数进行调整,并在经第一蓝牙设备的底层硬件确认后,第二蓝牙设备的底层硬件将调整后的蓝牙连接参数发送给第二蓝牙设备上层的第一固件。2035, triggering the adjustment of the Bluetooth connection parameters. Wherein, triggering the adjustment of the Bluetooth connection parameters may be adjusting the Bluetooth connection parameters through the underlying hardware. Optionally, the first firmware in the second Bluetooth device sends first information for adjusting Bluetooth connection parameters to the underlying hardware. Optionally, the first firmware here may be an upgrade program of the first firmware. The underlying hardware in the second Bluetooth device adjusts the Bluetooth connection parameters according to the first information, and after confirmation by the underlying hardware of the first Bluetooth device, the underlying hardware of the second Bluetooth device sends the adjusted Bluetooth connection parameters to the first Bluetooth device. 2. The first firmware of the upper layer of the Bluetooth device.
如果第一时间减去擦除时间的差值小于第一取值范围的最小边界值,则增大蓝牙连接参数。如果第一时间减去擦除时间的差值大于第一取值范围的最大边界 值,则减小蓝牙连接参数。If the difference between the first time and the erasing time is less than the minimum boundary value of the first value range, the Bluetooth connection parameter is increased. If the difference between the first time and the erasing time is greater than the maximum boundary value of the first value range, the Bluetooth connection parameter is reduced.
2036,在蓝牙连接参数调整后,确定当前时间到下一个收发中断节点的第二时间与所述擦除时间的差值在第一取值范围时,在所述第二时间执行第Q次擦除操作。2036, after the Bluetooth connection parameters are adjusted, when it is determined that the difference between the second time from the current time to the next sending and receiving interrupt node and the erasing time is within the first value range, perform the Qth erasing at the second time. remove operation.
经过上述M次擦除操作,对第一存储空间擦除完毕后,第二蓝牙设备可以通知第一蓝牙设备发送第一固件的更新包。可选的,第二蓝牙设备在通知第一蓝牙设备发送第一固件的更新包之前可以再次调整蓝牙连接参数,该次调整可以为减小蓝牙连接参数,以减小相邻两个收发中断节点之间的间隔,以使后续写入时对应的空闲时间与更新包的大小更加匹配。当然,第二蓝牙设备也可以对第一存储空间擦除完毕后不对蓝牙连接参数进行调整即通知第一蓝牙设备发送第一固件的更新包。After the above M times of erasing operations, after erasing the first storage space, the second Bluetooth device may notify the first Bluetooth device to send an update package of the first firmware. Optionally, the second Bluetooth device may adjust the Bluetooth connection parameters again before notifying the first Bluetooth device to send the update package of the first firmware, and this adjustment may be to reduce the Bluetooth connection parameters to reduce two adjacent nodes that are interrupted in sending and receiving. interval, so that the corresponding idle time for subsequent writes more closely matches the size of the update package. Of course, the second Bluetooth device may also notify the first Bluetooth device to send an update package of the first firmware without adjusting the Bluetooth connection parameters after erasing the first storage space.
204,第二蓝牙设备分别接收第一固件的各个子更新包,并在蓝牙传输的空闲时间分别将各个子更新包写入第一存储空间。其中,将第一子更新包写入第一存储空间的方式,第一子更新包为各个子更新包中的任意一个,如图4-c所示,包括:204. The second Bluetooth device respectively receives each sub-update package of the first firmware, and respectively writes each sub-update package into the first storage space during the idle time of Bluetooth transmission. Wherein, in the way of writing the first sub-update package into the first storage space, the first sub-update package is any one of each sub-update package, as shown in Figure 4-c, including:
2041,第二蓝牙设备确定将第一子更新包写入第一存储空间需要的写入时间。2041. The second Bluetooth device determines the writing time required for writing the first sub-update package into the first storage space.
2042,第二蓝牙设备确定从当前时间到下一个收发中断节点的第三时间(对应图中的T3)。2042. The second Bluetooth device determines a third time (corresponding to T3 in the figure) from the current time to the next node that interrupts transmission and reception.
2043,第二蓝牙设备确定第三时间与写入时间的差值是否在第二取值范围,如果是,执行步骤2044;如果否,执行步骤2045。2043 , the second Bluetooth device determines whether the difference between the third time and the writing time is within the second value range, and if so, executes step 2044 ; if not, executes step 2045 .
其中,第三时间与写入时间的差值不在第二取值范围包括:第三时间减去写入时间的差值小于第二取值范围的最小边界值,或者,第三时间减去写入时间的差值大于第二取值范围的最大边界值。其中,此处的最小边界值和最大边界值限定的取值范围为第二取值范围。Wherein, the difference between the third time and the writing time not in the second value range includes: the difference between the third time minus the writing time is less than the minimum boundary value of the second value range, or, the third time minus the writing time The difference of the incoming time is greater than the maximum boundary value of the second value range. The value range defined by the minimum boundary value and the maximum boundary value here is the second value range.
例如,当前时间为t 3,下一个收发中断节点的到来时间为t 4,则第三时间为 t 4-t 3。如果t 4-t 3-写入时间的差值在第二取值范围内,说明在第三时间内可以比较高效地执行完对第一子更新包的写入操作。但如果t 4-t 3-写入时间的差值大于第二取值范围的最大边界值,说明当前时间到下一个收发中断节点之间的空闲时间远远大于写入时间,会造成不必要的等待,因此可以通过调整蓝牙连接参数将空闲时间调小以提高第一固件的传输效率。如果t 4-t 3-写入时间的差值小于第二取值范围的最小边界值,说明当前蓝牙连接参数下的空闲时间难以完成写入操作,则需要通过调整蓝牙连接参数将空闲时间增大以提高第一固件传输的稳定性。 For example, if the current time is t 3 , and the arrival time of the next node that interrupts transmission and reception is t 4 , the third time is t 4 -t 3 . If the difference between t 4 -t 3 -writing time is within the second value range, it means that the writing operation to the first sub-update packet can be performed efficiently within the third time. However, if the difference between t 4 -t 3 - writing time is greater than the maximum boundary value of the second value range, it means that the idle time between the current time and the next sending and receiving interrupt node is much longer than the writing time, which will cause unnecessary Therefore, the idle time can be reduced by adjusting the Bluetooth connection parameters to improve the transmission efficiency of the first firmware. If the difference between t 4 -t 3 - writing time is less than the minimum boundary value of the second value range, it means that the idle time under the current Bluetooth connection parameters is difficult to complete the writing operation, and it is necessary to increase the idle time by adjusting the Bluetooth connection parameters. Large to improve the stability of the first firmware transfer.
2044,第二蓝牙设备在第三时间将第一子更新包写入第一存储空间。2044. The second Bluetooth device writes the first sub-update package into the first storage space at the third time.
2045,第二蓝牙设备触发蓝牙连接参数的调整。其中,当所述第三时间与所述写入时间的差值小于所述第二取值范围的最小边界值时,第二蓝牙设备确定后续N个收发中断节点对应的空闲时间与所述写入时间的差值是否均小于所述第二取值范围的最小边界值,如果是,则触发增大蓝牙连接参数的调整。2045, the second Bluetooth device triggers the adjustment of the Bluetooth connection parameters. Wherein, when the difference between the third time and the writing time is less than the minimum boundary value of the second value range, the second Bluetooth device determines that the idle time corresponding to the subsequent N transceiving interrupt nodes is the same as the writing time. Whether the difference between the incoming times is smaller than the minimum boundary value of the second value range, and if so, triggering an adjustment to increase the Bluetooth connection parameter.
本发明实施例中,如果第三时间与所述写入时间的差值小于所述第二取值范围的最小边界值,可能是由于代码运行、数据收发时间占用较多造成的。由此可以继续确定后续N个收发中断节点对应的空闲时间是否能满足上述差值要求,如果在第x个中断收发节点与第x-1个中断收发节点之间的空闲时间与写入时间的差值在第二取值范围内,则在该空闲时间将第一子更新包写入第一存储空间。其中,N可以根据实际需要设定,例如可以设置为3,4,5或者其它可能的个数。x为N中的一个取值。如果后续N个收发中断节点对应的空闲时间与写入时间的差值均小于第二取值范围的最小边界值,则可以通过调整蓝牙连接参数使相应的空闲时间满足写入要求。通过此方式,可以减少对蓝牙连接参数的调整,保证蓝牙连接的稳定性。In the embodiment of the present invention, if the difference between the third time and the writing time is smaller than the minimum boundary value of the second value range, it may be caused by the code running and data sending and receiving time taking up a lot. In this way, it can continue to determine whether the idle time corresponding to the subsequent N transceiver interrupt nodes can meet the above difference requirements. If the difference is within the second value range, the first sub-update package is written into the first storage space during the idle time. Wherein, N can be set according to actual needs, for example, can be set to 3, 4, 5 or other possible numbers. x is a value in N. If the difference between the idle time and the write time corresponding to the subsequent N transceiver interrupt nodes is smaller than the minimum boundary value of the second value range, the corresponding idle time can meet the write requirement by adjusting the Bluetooth connection parameters. In this way, the adjustment of the Bluetooth connection parameters can be reduced, and the stability of the Bluetooth connection can be ensured.
2046,在蓝牙连接参数调整后,确定当前时间到下一个收发中断节点的第四时间与所述写入时间的差值在所述第二取值范围时,在所述第四时间将所述第一子更新包写入所述第一存储空间。2046. After the Bluetooth connection parameters are adjusted, it is determined that the difference between the fourth time from the current time to the next sending and receiving interrupt node and the writing time is within the second value range, and the fourth time The first sub-update package is written into the first storage space.
在本实施例中,上述第一子更新包为新版本固件的任意一个子更新包。各个子更新包写入第一存储空间的方式相同,不再赘述。In this embodiment, the above-mentioned first sub-update package is any sub-update package of the new version firmware. The manner in which each sub-update package is written into the first storage space is the same, and details are not repeated here.
第二蓝牙设备将所述第一固件的所有子更新包均写入所述第一存储空间之后,所述方法还包括:在所述第一固件重新启动时,将所述第一固件的更新包代码拷贝至代码的运行地址并运行。After the second Bluetooth device writes all the sub-update packages of the first firmware into the first storage space, the method further includes: when the first firmware is restarted, updating the first firmware The package code is copied to the running address of the code and run.
本发明实施例中,根据新版本固件的大小,可以提前对存储空间执行擦除操作,减少固件升级过程中的擦写时间,增加系统和蓝牙连接的稳定性。进一步,本发明实施例的固件升级代码可以直接存储在NOR FLASH中运行,节省系统RAM资源。进一步,本方案在蓝牙传输的空闲时间执行存储空间的擦除操作和固件升级数据的写入操作,可以提高处理器利用率,加快固件升级速度。另外,该方案可以根据执行擦除操作需要的时间和执行写入操作需要的时间动态调整蓝牙连接参数,可以提高第一固件更新包传输的效率和稳定性。进一步,该估计升级过程无需关闭蓝牙传输中断,可正常进行蓝牙数据的收发,确保设备之间蓝牙连接的稳定性。当然,在固件升级阶段也可以支持闪存挂起/恢复(flash suspend/resume)机制,也支持可被其他中断打断。In the embodiment of the present invention, according to the size of the new version of the firmware, an erasing operation can be performed on the storage space in advance, thereby reducing the erasing time during the firmware upgrade process, and increasing the stability of the system and the Bluetooth connection. Further, the firmware upgrade code of the embodiment of the present invention can be directly stored in NOR FLASH to run, saving system RAM resources. Further, this solution performs the erasing operation of the storage space and the writing operation of the firmware upgrade data in the idle time of the Bluetooth transmission, which can improve the utilization rate of the processor and speed up the firmware upgrade speed. In addition, the solution can dynamically adjust the Bluetooth connection parameters according to the time required to perform the erase operation and the time required to perform the write operation, which can improve the efficiency and stability of the transmission of the first firmware update packet. Further, the estimated upgrade process does not need to turn off the interruption of Bluetooth transmission, and can normally send and receive Bluetooth data to ensure the stability of the Bluetooth connection between devices. Of course, the flash suspend/resume mechanism can also be supported during the firmware upgrade phase, and can also be interrupted by other interrupts.
对应上述固件升级方法,本发明实施例还提供了一种固件升级装置。本领域技术人员可以理解,这些固件升级装置均可使用市售的硬件组件通过本方案所教导的步骤进行配置来构成。Corresponding to the above firmware upgrade method, an embodiment of the present invention further provides a firmware upgrade apparatus. Those skilled in the art can understand that these firmware upgrade apparatuses can be configured by using commercially available hardware components through the steps taught in this solution.
如图5所示,该固件升级装置包括:预设存储模块,该预设存储模块用于存储第一固件的部分或者全部代码,以及提供第一存储空间;如图5所示,第一固件中对应的固件升级代码包括如下功能模块:As shown in FIG. 5 , the firmware upgrade device includes: a preset storage module, the preset storage module is used to store part or all of the codes of the first firmware and provide a first storage space; as shown in FIG. 5 , the first firmware The corresponding firmware upgrade code includes the following functional modules:
确定模块301,用于根据第一固件的描述信息,确定第一存储空间;擦写模块302,用于在蓝牙传输的第一空闲时间,对所述第一存储空间执行擦除操作;以及在蓝牙传输的第二空闲时间,将第一固件的更新包写入所述第一存储空间;蓝牙收发模块303,用于从第一蓝牙设备接收第一固件的更新包。The determining module 301 is used to determine the first storage space according to the description information of the first firmware; the erasing and writing module 302 is used to perform an erasing operation on the first storage space during the first idle time of Bluetooth transmission; and In the second idle time of the Bluetooth transmission, the update package of the first firmware is written into the first storage space; the Bluetooth transceiver module 303 is configured to receive the update package of the first firmware from the first Bluetooth device.
本发明实施例的固件升级装置可以执行图3-图4所示实施例的方法。本实施例未详细描述的部分,可以参考对图3-图4所示实施例的相关说明。该技术方案的执行过程和技术效果参见图3-图4所示实施例中的描述,在此不再赘述。The firmware upgrade apparatus in this embodiment of the present invention may execute the methods of the embodiments shown in FIG. 3 to FIG. 4 . For parts that are not described in detail in this embodiment, reference may be made to the relevant descriptions of the embodiments shown in FIG. 3 to FIG. 4 . For the execution process and technical effects of the technical solution, refer to the descriptions in the embodiments shown in FIG. 3 to FIG. 4 , which will not be repeated here.
应理解,图5所示的固件升级装置的各个模块的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。且这些模块可以全部以软件通过处理元件调用的形式实现;也可以全部以硬件的形式实现;还可以部分模块以软件通过处理元件调用的形式实现,部分模块通过硬件的形式实现。例如,擦写模块可以为单独设立的处理元件,也可以集成在电子设备的某一个芯片中实现。其它模块的实现与之类似。此外这些模块全部或部分可以集成在一起,也可以独立实现。在实现过程中,上述方法的各步骤或以上各个模块可以通过处理器元件中的硬件的集成逻辑电路或者软件形式的指令完成。It should be understood that the division of each module of the firmware upgrade apparatus shown in FIG. 5 is only a division of logical functions, and may be fully or partially integrated into a physical entity in actual implementation, or may be physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also all be implemented in hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in hardware. For example, the erasing and writing module may be a separately established processing element, or may be integrated into a certain chip of an electronic device. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, and can also be implemented independently. In the implementation process, each step of the above-mentioned method or each of the above-mentioned modules can be completed by an integrated logic circuit of hardware in the processor element or an instruction in the form of software.
例如,以上这些模块可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个特定集成电路(Application Specific Integrated Circuit;以下简称:ASIC),或,一个或多个微处理器(Digital Singnal Processor;以下简称:DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array;以下简称:FPGA)等。再如,这些模块可以集成在一起,以片上系统(System-On-a-Chip;以下简称:SOC)的形式实现。For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more specific integrated circuits (Application Specific Integrated Circuit; hereinafter referred to as: ASIC), or, one or more microprocessors Digital Singnal Processor (hereinafter referred to as: DSP), or, one or more Field Programmable Gate Array (Field Programmable Gate Array; hereinafter referred to as: FPGA), etc. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (System-On-a-Chip; hereinafter referred to as: SOC).
本发明实施例还提供了一种蓝牙芯片,包括:处理器,其用于执行存储在存储器中的计算机程序指令,其中,当该计算机程序指令被该处理器执行时,触发所述蓝牙芯片执行上述固件升级方法。可选的,所述存储器可以包括Flash存储器,所述Flash存储器用于存储第一固件的部分或者全部代码。在一个示例中,所述Flash存储器可以是NOR Flash存储器。An embodiment of the present invention further provides a Bluetooth chip, including: a processor configured to execute computer program instructions stored in a memory, wherein when the computer program instructions are executed by the processor, the Bluetooth chip is triggered to execute The above firmware upgrade method. Optionally, the memory may include a Flash memory, where the Flash memory is used to store part or all of the codes of the first firmware. In one example, the Flash memory may be NOR Flash memory.
图6是本发明实施例提供的一种电子设备的结构示意图。图6示出的电子设备仅仅是一个示例,不应对本说明书实施例的功能和使用范围带来任何限制。如 图6所示,电子设备以通用计算设备的形式表现。电子设备的组件可以包括但不限于:一个或者多个处理器410,通信接口420,存储器430,连接不同系统组件(包括存储器430,通信接口420和处理器410)的通信总线440。上述通信接口420可以与其它电子设备或者其它部件连接,例如通信接口420可以与其它蓝牙设备通信。FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. The electronic device shown in FIG. 6 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present specification. As shown in Figure 6, the electronic device takes the form of a general-purpose computing device. Components of an electronic device may include, but are not limited to, one or more processors 410 , a communication interface 420 , a memory 430 , a communication bus 440 connecting various system components including memory 430 , communication interface 420 and processor 410 . The above-mentioned communication interface 420 can be connected with other electronic devices or other components, for example, the communication interface 420 can communicate with other Bluetooth devices.
具体的,在本申请一实施例中,电子设备的处理器可以是片上装置SOC,该处理器中可以包括中央处理器(Central Processing Unit,CPU),还可以进一步包括其他类型的处理器。Specifically, in an embodiment of the present application, the processor of the electronic device may be an on-chip device SOC, and the processor may include a central processing unit (Central Processing Unit, CPU), and may further include other types of processors.
具体的,在本申请一实施例中,涉及的处理器可以例如包括CPU、DSP、微控制器或数字信号处理器,还可包括GPU、嵌入式神经网络处理器(Neural-network Process Units,NPU)和图像信号处理器(Image Signal Processing,ISP),该处理器还可包括必要的硬件加速器或逻辑处理硬件电路,如ASIC,或一个或多个用于控制本申请技术方案程序执行的集成电路等。此外,处理器可以具有操作一个或多个软件程序的功能,软件程序可以存储在存储介质中。Specifically, in an embodiment of the present application, the involved processor may include, for example, a CPU, a DSP, a microcontroller, or a digital signal processor, and may also include a GPU, an embedded Neural-network Process Units (NPU, NPU) ) and an image signal processor (Image Signal Processing, ISP), the processor may also include necessary hardware accelerators or logic processing hardware circuits, such as ASICs, or one or more integrated circuits for controlling the execution of programs in the technical solution of the present application Wait. Furthermore, the processor may have the function of operating one or more software programs, which may be stored in a storage medium.
通信总线440表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(Industry Standard Architecture;以下简称:ISA)总线,微通道体系结构(Micro Channel Architecture;以下简称:MAC)总线,增强型ISA总线、视频电子标准协会(Video Electronics Standards Association;以下简称:VESA)局域总线以及外围组件互连(Peripheral Component Interconnection;以下简称:PCI)总线。 Communication bus 440 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures. For example, these architectures include, but are not limited to, Industry Standard Architecture (hereinafter referred to as: ISA) bus, Micro Channel Architecture (hereinafter referred to as: MAC) bus, enhanced ISA bus, video electronics Standards Association (Video Electronics Standards Association; hereinafter referred to as: VESA) local bus and Peripheral Component Interconnection (Peripheral Component Interconnection; hereinafter referred to as: PCI) bus.
电子设备典型地包括多种计算机系统可读介质。这些介质可以是任何能够被电子设备访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。Electronic devices typically include various computer system readable media. These media can be any available media that can be accessed by the electronic device, including both volatile and nonvolatile media, removable and non-removable media.
存储器430可以包括易失性存储器形式的计算机系统可读介质,例如随机存 取存储器(Random Access Memory;以下简称:RAM)和/或高速缓存存储器。电子设备可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。可选的,存储器430可以包括Flash存储器,Flash存储器用于存储固件的部分或者全部代码。其中,固件代码中的固件升级代码的部分或者全部存储在Flash存储器。当固件升级代码被处理器410调用时执行本说明书各实施例的固件升级方法。可选的,存储器430可以包括RAM存储器,RAM存储器可以用于配合Flash存储器执行本发明实施例的固件升级方法。例如,当通过通信接口420接收到第一蓝牙设备发送的第一固件的数据包,可以将数据包缓存在RAM中,之后再从RAM写入Flash存储器。The memory 430 may include a computer system readable medium in the form of volatile memory, such as random access memory (Random Access Memory; hereinafter referred to as: RAM) and/or cache memory. The electronic device may further include other removable/non-removable, volatile/non-volatile computer system storage media. Optionally, the memory 430 may include a Flash memory, where the Flash memory is used to store part or all of the codes of the firmware. Wherein, part or all of the firmware upgrade code in the firmware code is stored in the flash memory. When the firmware upgrade code is called by the processor 410, the firmware upgrade method of each embodiment of this specification is executed. Optionally, the memory 430 may include a RAM memory, and the RAM memory may be used to cooperate with the Flash memory to execute the firmware upgrade method of the embodiment of the present invention. For example, when a data packet of the first firmware sent by the first Bluetooth device is received through the communication interface 420, the data packet may be buffered in the RAM, and then written into the Flash memory from the RAM.
本发明实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行本说明书图3~图4所示实施例提供的方法。An embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the methods provided by the embodiments shown in FIGS. 3 to 4 of this specification.
上述计算机可读存储介质可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(Read Only Memory;以下简称:ROM)、Flash存储器、可擦式可编程只读存储器(Erasable Programmable Read Only Memory;以下简称:EPROM)或闪存、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。The aforementioned computer-readable storage media may employ any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples (non-exhaustive list) of computer readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (Read Only Memory) ; hereinafter referred to as: ROM), Flash memory, erasable programmable read only memory (Erasable Programmable Read Only Memory; hereinafter referred to as: EPROM) or flash memory, optical fiber, portable compact disk read only memory (CD-ROM), optical storage devices , a magnetic memory device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形 式,包括——但不限于——电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A computer-readable signal medium may include a propagated data signal in baseband or as part of a carrier wave, with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于——无线、电线、光缆、RF等等,或者上述的任意合适的组合。Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that in the embodiments and still achieve desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本说明书的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, description with reference to the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples", etc., mean specific features described in connection with the embodiment or example , structure, material or feature is included in at least one embodiment or example of this specification. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine the different embodiments or examples described in this specification, as well as the features of the different embodiments or examples, without conflicting each other.
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本说明书的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。In addition, the terms "first" and "second" are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implying the number of indicated technical features. Thus, a feature delimited with "first", "second" may expressly or implicitly include at least one of that feature. In the description of the present specification, "plurality" means at least two, such as two, three, etc., unless otherwise expressly and specifically defined.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现定制逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本说明书的优选实施方式的范围包括另外的实现,其中 可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本说明书的实施例所属技术领域的技术人员所理解。Any process or method description in the flowcharts or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing custom logical functions or steps of the process , and the scope of the preferred embodiments of this specification includes alternative implementations in which the functions may be performed out of the order shown or discussed, including performing the functions substantially concurrently or in the reverse order depending upon the functions involved, which should It is understood by those skilled in the art to which the embodiments of this specification belong.
取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”或“响应于检测”。类似地,取决于语境,短语“如果确定”或“如果检测(陈述的条件或事件)”可以被解释成为“当确定时”或“响应于确定”或“当检测(陈述的条件或事件)时”或“响应于检测(陈述的条件或事件)”。Depending on the context, the word "if" as used herein can be interpreted as "at" or "when" or "in response to determining" or "in response to detecting." Similarly, the phrases "if determined" or "if detected (the stated condition or event)" can be interpreted as "when determined" or "in response to determining" or "when detected (the stated condition or event)," depending on the context )" or "in response to detection (a stated condition or event)".
在本说明书所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this specification, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined. Either it can be integrated into another system, or some features can be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
另外,在本说明书各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of this specification may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software functional units.
以上所述仅为本说明书的较佳实施例而已,并不用以限制本说明书,凡在本说明书的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书保护的范围之内。The above descriptions are only preferred embodiments of this specification, and are not intended to limit this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this specification shall be included in this specification. within the scope of protection.

Claims (14)

  1. 一种固件升级方法,其特征在于,所述方法包括:A firmware upgrade method, characterized in that the method comprises:
    根据第一固件的描述信息,确定第一存储空间,其中,所述第一固件的部分或者全部代码存储于预设存储器,所述第一存储空间位于预设存储器;determining a first storage space according to the description information of the first firmware, wherein part or all of the codes of the first firmware are stored in a preset memory, and the first storage space is located in a preset memory;
    在蓝牙传输的第一空闲时间,对所述第一存储空间执行擦除操作;Perform an erasing operation on the first storage space during the first idle time of the Bluetooth transmission;
    在蓝牙传输的第二空闲时间,将所述第一固件的更新包写入所述第一存储空间,其中,所述更新包来自第一蓝牙设备。During the second idle time of Bluetooth transmission, the update package of the first firmware is written into the first storage space, wherein the update package is from the first Bluetooth device.
  2. 根据权利要求1所述的方法,其特征在于,所述第一固件的描述信息是所述第一蓝牙设备确定对第二蓝牙设备中的第一固件升级时发送给所述第二蓝牙设备的。The method according to claim 1, wherein the description information of the first firmware is the information sent to the second Bluetooth device when the first Bluetooth device determines to upgrade the first firmware in the second Bluetooth device .
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一固件的描述信息包括:第一固件的大小、第一存储空间的起始地址和代码的运行地址。The method according to claim 1 or 2, wherein the description information of the first firmware includes: the size of the first firmware, the start address of the first storage space, and the running address of the code.
  4. 根据权利要求1所述的方法,其特征在于,在蓝牙传输的第一空闲时间,对所述第一存储空间执行擦除操作,包括:The method according to claim 1, wherein, in the first idle time of Bluetooth transmission, performing an erasing operation on the first storage space, comprising:
    根据所述第一存储空间的大小,对所述第一存储空间执行M次擦除操作,每次擦除操作均在蓝牙传输的空闲时间执行,每次擦除操作擦除的空间均是单位空间的整数倍,M≥1;According to the size of the first storage space, M erasing operations are performed on the first storage space, each erasing operation is performed in the idle time of Bluetooth transmission, and the space erased by each erasing operation is a unit Integer multiple of space, M≥1;
    其中,如果执行完第M-1次擦除操作之后剩余的待擦除空间小于一个单位空间的大小,则将待擦除空间补足为一个单位空间并执行第M次擦除操作。Wherein, if the remaining space to be erased after the M-1 th erasing operation is performed is smaller than the size of one unit space, the to-be-erased space is supplemented into one unit space and the Mth erasing operation is performed.
  5. 根据权利要求4所述的方法,其特征在于,对所述第一存储空间执行所述M次中的第Q次擦除操作,包括:The method according to claim 4, wherein performing the Qth erasing operation in the M times on the first storage space comprises:
    确定第Q次擦除操作需要的擦除时间;Determine the erasing time required for the Qth erasing operation;
    确定从当前时间到下一个收发中断节点的第一时间;Determine the first time from the current time to the next sending and receiving interrupt node;
    如果所述第一时间与所述擦除时间的差值在第一取值范围,则在所述第一时间执行第Q次擦除操作;否则触发蓝牙连接参数的调整。If the difference between the first time and the erasing time is within the first value range, the Qth erasing operation is performed at the first time; otherwise, the adjustment of the Bluetooth connection parameters is triggered.
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:The method according to claim 5, wherein the method further comprises:
    在蓝牙连接参数调整后,确定当前时间到下一个收发中断节点的第二时间与所述擦除时间的差值在第一取值范围时,在所述第二时间执行第Q次擦除操作。After the Bluetooth connection parameters are adjusted, when it is determined that the difference between the second time from the current time to the next sending and receiving interrupt node and the erasing time is within the first value range, the Qth erasing operation is performed at the second time .
  7. 根据权利要求1所述的方法,其特征在于,所述第一固件的更新包分为多个子更新包,第一子更新包为第一固件的任意一个子更新包;其中,将所述第一子更新包写入所述第一存储空间,包括:The method according to claim 1, wherein the update package of the first firmware is divided into a plurality of sub-update packages, and the first sub-update package is any sub-update package of the first firmware; A sub-update package is written into the first storage space, including:
    确定将所述第一子更新包写入所述第一存储空间需要的写入时间;determining the writing time required to write the first sub-update package into the first storage space;
    确定从当前时间到下一个收发中断节点的第三时间;Determine the third time from the current time to the next sending and receiving interrupt node;
    如果所述第三时间与所述写入时间的差值在第二取值范围,则在所述第三时间将所述第一子更新包写入所述第一存储空间;否则触发蓝牙连接参数的调整。If the difference between the third time and the writing time is within the second value range, write the first sub-update package into the first storage space at the third time; otherwise, trigger a Bluetooth connection parameter adjustment.
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:The method according to claim 7, wherein the method further comprises:
    在蓝牙连接参数调整后,确定当前时间到下一个收发中断节点的第四时间与所述写入时间的差值在所述第二取值范围时,在所述第四时间将所述第一子更新包写入所述第一存储空间。After the Bluetooth connection parameters are adjusted, when it is determined that the difference between the fourth time from the current time to the next sending and receiving interrupt node and the writing time is within the second value range, the first time is set at the fourth time. The sub-update package is written into the first storage space.
  9. 根据权利要求7所述的方法,其特征在于,触发蓝牙连接参数的调整,包括:The method according to claim 7, wherein triggering the adjustment of Bluetooth connection parameters comprises:
    如果所述第三时间与所述写入时间的差值小于所述第二取值范围的最小边界值,则确定后续N个收发中断节点对应的空闲时间与所述写入时间的差值是否均小于所述最小边界值;If the difference between the third time and the writing time is less than the minimum boundary value of the second value range, determine whether the difference between the idle time corresponding to the subsequent N transceiving interrupt nodes and the writing time is not are less than the minimum boundary value;
    如果是,则触发增大蓝牙连接参数的调整。If so, trigger an adjustment that increases the Bluetooth connection parameters.
  10. 根据权利要求1所述的方法,其特征在于,将所述第一固件的更新包写入所述第一存储空间之后,所述方法还包括:The method according to claim 1, wherein after writing the update package of the first firmware into the first storage space, the method further comprises:
    在所述第一固件重新启动时,将所述第一固件的更新包代码拷贝至代码的运行地址并运行。When the first firmware is restarted, the update package code of the first firmware is copied to the running address of the code and executed.
  11. 一种固件升级装置,其特征在于,包括:A firmware upgrade device, comprising:
    预设存储模块,用于存储第一固件的部分或者全部代码,以及提供第一存储空间;其中,所述第一固件中对应的固件升级代码包括如下功能模块:The preset storage module is used to store part or all of the code of the first firmware and provide a first storage space; wherein, the corresponding firmware upgrade code in the first firmware includes the following functional modules:
    确定模块,用于根据第一固件的描述信息,确定第一存储空间;a determining module, configured to determine the first storage space according to the description information of the first firmware;
    擦写模块,用于在蓝牙传输的第一空闲时间,对所述第一存储空间执行擦除操作;以及用于在蓝牙传输的第二空闲时间,将第一固件的更新包写入所述第一存储空间;an erasing module for performing an erasing operation on the first storage space during the first idle time of Bluetooth transmission; and for writing an update package of the first firmware into the first storage space during the second idle time of Bluetooth transmission the first storage space;
    蓝牙收发模块,用于从第一蓝牙设备接收更新包。The Bluetooth transceiver module is used for receiving the update package from the first Bluetooth device.
  12. 一种蓝牙芯片,其特征在于,包括:A Bluetooth chip, characterized in that it includes:
    处理器,其用于执行存储在存储器中的计算机程序指令,其中,当该计算机程序指令被该处理器执行时,触发所述蓝牙芯片执行如权利要求1至10任一所述的方法。a processor for executing computer program instructions stored in the memory, wherein, when the computer program instructions are executed by the processor, the Bluetooth chip is triggered to execute the method according to any one of claims 1 to 10 .
  13. 一种电子设备,其特征在于,包括:An electronic device, comprising:
    至少一个处理器;以及at least one processor; and
    与所述处理器通信连接的至少一个存储器,其中:at least one memory communicatively coupled to the processor, wherein:
    所述存储器存储有可被所述处理器执行的程序指令,所述处理器调用所述程序指令能够执行如权利要求1至10任一所述的方法。The memory stores program instructions executable by the processor, and the processor invokes the program instructions to be able to perform the method as claimed in any one of claims 1 to 10.
  14. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括存储的程序,其中,在所述程序运行时控制所述计算机可读存储介质所在设备执行权利要求1至10任一所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein when the program is run, a device where the computer-readable storage medium is located is controlled to execute any one of claims 1 to 10 the method described.
PCT/CN2021/140018 2021-01-04 2021-12-21 Method for upgrading firmware, and related device WO2022143295A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110004296.4 2021-01-04
CN202110004296.4A CN112799696B (en) 2021-01-04 2021-01-04 Firmware upgrading method and related equipment

Publications (1)

Publication Number Publication Date
WO2022143295A1 true WO2022143295A1 (en) 2022-07-07

Family

ID=75807991

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/140018 WO2022143295A1 (en) 2021-01-04 2021-12-21 Method for upgrading firmware, and related device

Country Status (2)

Country Link
CN (1) CN112799696B (en)
WO (1) WO2022143295A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117202143A (en) * 2022-12-20 2023-12-08 荣耀终端有限公司 Connection parameter updating method, bluetooth device and readable storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112799696B (en) * 2021-01-04 2023-02-28 展讯通信(上海)有限公司 Firmware upgrading method and related equipment
CN114422994A (en) * 2022-03-29 2022-04-29 龙旗电子(惠州)有限公司 Firmware upgrading method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102279712A (en) * 2011-08-10 2011-12-14 北京百度网讯科技有限公司 Storage control method, system and device applied to network storage system
US20140344797A1 (en) * 2013-05-14 2014-11-20 Sandisk Technologies Inc. Firmware updates for multiple product configurations
CN107402776A (en) * 2016-05-20 2017-11-28 南京阿波罗机器人科技有限公司 A kind of mobile phone wireless upgrading stm32 singlechip controller firmware methods based on bluetooth 4
CN110187899A (en) * 2019-06-04 2019-08-30 深圳云里物里科技股份有限公司 A kind of firmware programming method, apparatus and its relevant device
CN112799696A (en) * 2021-01-04 2021-05-14 展讯通信(上海)有限公司 Firmware upgrading method and related equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7039796B2 (en) * 2002-06-04 2006-05-02 Hewlett-Packard Development Company, L.P. Method and system of locating a position in memory at which to store incoming firmware image
US7509121B2 (en) * 2005-04-18 2009-03-24 Terax Communication Technologies Inc. Method of updating firmware using object push profile in the bluetooth object exchange protocol
CN107085525A (en) * 2017-03-17 2017-08-22 深圳市战音科技有限公司 Method for upgrading software and device based on Bluetooth electronic devices
CN109542495A (en) * 2018-11-12 2019-03-29 青岛海信电器股份有限公司 A kind of method for upgrading software and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102279712A (en) * 2011-08-10 2011-12-14 北京百度网讯科技有限公司 Storage control method, system and device applied to network storage system
US20140344797A1 (en) * 2013-05-14 2014-11-20 Sandisk Technologies Inc. Firmware updates for multiple product configurations
CN107402776A (en) * 2016-05-20 2017-11-28 南京阿波罗机器人科技有限公司 A kind of mobile phone wireless upgrading stm32 singlechip controller firmware methods based on bluetooth 4
CN110187899A (en) * 2019-06-04 2019-08-30 深圳云里物里科技股份有限公司 A kind of firmware programming method, apparatus and its relevant device
CN112799696A (en) * 2021-01-04 2021-05-14 展讯通信(上海)有限公司 Firmware upgrading method and related equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117202143A (en) * 2022-12-20 2023-12-08 荣耀终端有限公司 Connection parameter updating method, bluetooth device and readable storage medium

Also Published As

Publication number Publication date
CN112799696B (en) 2023-02-28
CN112799696A (en) 2021-05-14

Similar Documents

Publication Publication Date Title
WO2022143295A1 (en) Method for upgrading firmware, and related device
KR102039796B1 (en) Methods and apparatus for providing individualized power control for peripheral sub-systems
JP6165342B2 (en) Providing command queuing to embedded memory
KR101995623B1 (en) An apparatus, method, and system for a fast configuration mechanism
KR102245247B1 (en) GPU remote communication using triggered actions
KR101565357B1 (en) Systems, methods, and apparatuses for handling timeouts
RU2633126C2 (en) Strengthening mechanism of transfer and/or configuration of one protocol of inter-connections for another protocol of inter-connections
CN107077441B (en) Method and apparatus for providing heterogeneous I/O using RDMA and proactive messages
US20150199137A1 (en) Embedded multimedia card and method of operating the same
JP5537533B2 (en) Hardware dynamic cache power management
US20070079019A1 (en) Cellular phone and portable storage device using the same
JP2012128865A (en) General purpose usb driver
US9680972B2 (en) SD switch box in a cellular handset
KR20150009295A (en) Nonvolatile memory device and device sleep state control method thereof
WO2015199909A1 (en) Accelerating boot time zeroing of memory based on non-volatile memory (nvm) technology
JP2017519294A (en) Multi-host power controller (MHPC) for flash memory-based storage devices
WO2019141157A1 (en) Inter-core data transmission apparatus and method
US11010094B2 (en) Task management method and host for electronic storage device
JP6151465B1 (en) Latency-based power mode unit for controlling the power mode of a processor core, and related methods and systems
WO2019052576A1 (en) Synchrolock-based multi-thread processing method, terminal and storage medium
US20170308154A1 (en) Fast system setting changes
WO2017166207A1 (en) Cooperative scheduling of virtual machines
WO2022126398A1 (en) Message notification method and apparatus
WO2021082877A1 (en) Method and apparatus for accessing solid state disk
US10545562B2 (en) Electronic device and method for operating the same

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21914034

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21914034

Country of ref document: EP

Kind code of ref document: A1