CN112256297A - Bluetooth peripheral firmware upgrading method and system and mobile phone terminal - Google Patents

Bluetooth peripheral firmware upgrading method and system and mobile phone terminal Download PDF

Info

Publication number
CN112256297A
CN112256297A CN202011016353.2A CN202011016353A CN112256297A CN 112256297 A CN112256297 A CN 112256297A CN 202011016353 A CN202011016353 A CN 202011016353A CN 112256297 A CN112256297 A CN 112256297A
Authority
CN
China
Prior art keywords
fragment
upgrading
firmware
bluetooth peripheral
peripheral end
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011016353.2A
Other languages
Chinese (zh)
Inventor
许山蒙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suning Intelligent Terminal Co ltd
Original Assignee
Suning Intelligent Terminal Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suning Intelligent Terminal Co ltd filed Critical Suning Intelligent Terminal Co ltd
Priority to CN202011016353.2A priority Critical patent/CN112256297A/en
Publication of CN112256297A publication Critical patent/CN112256297A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Abstract

The invention discloses a Bluetooth peripheral firmware upgrading method, a Bluetooth peripheral firmware upgrading system and a mobile phone terminal, and belongs to the technical field of computer processing. The method comprises the following steps: receiving a user upgrading request, sending the user upgrading request and an upgrading breakpoint position request to a Bluetooth peripheral end, and acquiring upgrading confirmation information and upgrading breakpoint position information from the Bluetooth peripheral end; and jumping to the upgrading breakpoint position, carrying out fragment processing on the firmware according to a preset firmware fragment transmission rule, and transmitting the fragmented fragment data to the Bluetooth peripheral end to complete fragment verification, whole packet verification and upgrading in sequence. The invention not only ensures that the firmware is transmitted correctly and completely, but also reduces the time spent on firmware upgrade, improves the firmware upgrade efficiency and improves the user experience.

Description

Bluetooth peripheral firmware upgrading method and system and mobile phone terminal
Technical Field
The invention relates to the technical field of computer processing, in particular to a Bluetooth peripheral firmware upgrading method, a Bluetooth peripheral firmware upgrading system and a mobile phone terminal.
Background
Bluetooth Firmware (Firmware) refers to software loaded in a Bluetooth module, and is the core of the work of the Bluetooth module, different Bluetooth Firmware finishes different functional applications, and high-quality Firmware is a necessary condition for stable operation of products. The GCM series can be preassembled with standard firmware, is developed by combining long-term practical application experience based on the PROFILES application specification of the Bluetooth standard, has stable performance and practical functions, basically meets the conventional application of Bluetooth wireless transmission in various industries, and is presented along with free preassembly of modules when a user purchases the modules.
Along with the development of smart phones, for example, bluetooth headset, bluetooth intelligence wearing equipment etc. have also become a hot door, and current bluetooth equipment either does not support firmware upgrading, or upgrading process user experience is very unsatisfactory. At present, most Bluetooth equipment firmware is upgraded, and once data transmission is wrong or Bluetooth is abnormally disconnected in the transmission process of a firmware upgrade package, upgrading is not successful and needs to be started again, and Bluetooth equipment is damaged.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and a system for upgrading a bluetooth peripheral firmware, and a mobile phone terminal, which not only ensure that a firmware is correctly and completely transmitted, but also reduce the time spent on upgrading the firmware, improve the firmware upgrading efficiency, and improve the user experience. The technical scheme is as follows:
in one aspect, a bluetooth peripheral firmware upgrading method is provided, where the method includes:
receiving a user upgrading request, sending the user upgrading request and an upgrading breakpoint position request to a Bluetooth peripheral end, and acquiring upgrading confirmation information and upgrading breakpoint position information from the Bluetooth peripheral end;
and jumping to the upgrading breakpoint position, carrying out fragment processing on the firmware according to a preset firmware fragment transmission rule, and transmitting the fragmented fragment data to the Bluetooth peripheral end to complete fragment verification, whole packet verification and upgrading in sequence.
Preferably, a user upgrading request is received, the user upgrading request and an upgrading breakpoint position request are sent to a Bluetooth peripheral end, and upgrading confirmation information and upgrading breakpoint position information from the Bluetooth peripheral end are obtained; the method comprises the following steps:
generating an upgrading starting instruction according to the user upgrading request, and sending the upgrading starting instruction to the Bluetooth peripheral end;
receiving upgrade starting reply information from the Bluetooth peripheral end, and sending a breakpoint requesting instruction to the Bluetooth peripheral end;
and receiving breakpoint position reply information from the Bluetooth peripheral end.
Preferably, the upgrade starting instruction at least comprises a firmware version number, a firmware size and a firmware verification value, and the breakpoint position refers to an interrupt fragment position transmitted by the last firmware upgrade.
Preferably, according to a preset firmware fragment transmission rule, the firmware is fragmented, and fragmented data is transmitted to the bluetooth peripheral end to complete fragment verification, whole packet verification and upgrade in sequence, including:
determining the initial fragment size of the firmware and the transmission time threshold range of each fragment according to the preset firmware fragment transmission rule, dividing the fragments according to the initial fragment size, and sequentially transmitting and verifying the fragments of each fragment divided by the fragments until all the fragments are transmitted, and verifying and upgrading the whole packet.
Preferably, the transmitting and the fragment checking of each fragment divided by the fragment in sequence includes:
sending current fragment data and a fragment verification request to the Bluetooth peripheral end;
receiving a fragment checking result from the Bluetooth peripheral end, judging whether the fragment checking is successful according to the fragment checking result, and if not, retransmitting the current fragment until the fragment checking is successful;
judging whether there is any non-transmitted fragment, if so, recalculating the size of the fragment according to the current fragment data transmission condition, and then dynamically adjusting the non-transmitted fragment according to the calculation result.
Preferably, the re-calculating the fragment size according to the current fragment data transmission condition, and then dynamically adjusting the fragments which are not transmitted according to the calculation result, includes:
and judging whether the transmission time of the current fragment exceeds the upper limit of the output time threshold range and is less than the lower limit of the output time threshold range, if so, changing the size of the fragment to be half of the size of the current fragment, and if so, changing the size of the fragment to be twice of the size of the current fragment.
Preferably, the whole packet check includes:
and sending a whole package of verification request to the Bluetooth peripheral end, verifying whether the splicing of all the fragments of the transmitted firmware is correct or not, if so, starting upgrading, and otherwise, sending an upgrading failure and/or retry notice.
Preferably, the method further comprises:
and in the firmware transmission process, if the firmware transmission interruption is detected, recording the position information of the upgrade breakpoint.
On the other hand, the Bluetooth peripheral firmware upgrading system comprises an APP end and a Bluetooth peripheral end, wherein the APP end receives a user upgrading request and sends the user upgrading request and an upgrading breakpoint position request to the Bluetooth peripheral end, and the Bluetooth peripheral end returns upgrading confirmation information and upgrading breakpoint position information to the APP end; and the APP end skips to the position of the upgrade breakpoint, performs fragment processing on the firmware according to a preset firmware fragment transmission rule, and transmits the fragmented fragment data to the Bluetooth peripheral end to complete fragment verification, whole packet verification and upgrade in sequence.
In another aspect, a mobile phone terminal is provided, where the mobile phone terminal is configured to: receiving a user upgrading request, sending the user upgrading request and an upgrading breakpoint position request to a Bluetooth peripheral end, and acquiring upgrading confirmation information and upgrading breakpoint position information from the Bluetooth peripheral end; and jumping to the upgrading breakpoint position, carrying out fragment processing on the firmware according to a preset firmware fragment transmission rule, and transmitting the fragmented fragment data to the Bluetooth peripheral end to complete fragment verification, whole packet verification and upgrading in sequence.
Preferably, a user upgrading request is received, the user upgrading request and an upgrading breakpoint position request are sent to a Bluetooth peripheral end, and upgrading confirmation information and upgrading breakpoint position information from the Bluetooth peripheral end are obtained; the method comprises the following steps:
generating an upgrading starting instruction according to the user upgrading request, and sending the upgrading starting instruction to the Bluetooth peripheral end;
receiving upgrade starting reply information from the Bluetooth peripheral end, and sending a breakpoint requesting instruction to the Bluetooth peripheral end;
and receiving breakpoint position reply information from the Bluetooth peripheral end.
Preferably, the upgrade starting instruction at least comprises a firmware version number, a firmware size and a firmware verification value, and the breakpoint position refers to an interrupt fragment position transmitted by the last firmware upgrade.
Preferably, according to a preset firmware fragment transmission rule, the firmware is fragmented, and fragmented data is transmitted to the bluetooth peripheral end to complete fragment verification, whole packet verification and upgrade in sequence, including:
determining the initial fragment size of the firmware and the transmission time threshold range of each fragment according to the preset firmware fragment transmission rule, dividing the fragments according to the initial fragment size, and sequentially transmitting and verifying the fragments of each fragment divided by the fragments until all the fragments are transmitted, and verifying and upgrading the whole packet.
Preferably, the transmitting and the fragment checking of each fragment divided by the fragment in sequence includes:
sending current fragment data and a fragment verification request to the Bluetooth peripheral end;
receiving a fragment checking result from the Bluetooth peripheral end, judging whether the fragment checking is successful according to the fragment checking result, and if not, retransmitting the current fragment until the fragment checking is successful;
judging whether there is any non-transmitted fragment, if so, recalculating the size of the fragment according to the current fragment data transmission condition, and then dynamically adjusting the non-transmitted fragment according to the calculation result.
Preferably, the re-calculating the fragment size according to the current fragment data transmission condition, and then dynamically adjusting the fragments which are not transmitted according to the calculation result, includes:
and judging whether the transmission time of the current fragment exceeds the upper limit of the output time threshold range and is less than the lower limit of the output time threshold range, if so, changing the size of the fragment to be half of the size of the current fragment, and if so, changing the size of the fragment to be twice of the size of the current fragment.
Preferably, the whole packet check includes:
and sending a whole package of verification request to the Bluetooth peripheral end, verifying whether the splicing of all the fragments of the transmitted firmware is correct or not, if so, starting upgrading, and otherwise, sending an upgrading failure and/or retry notice.
Preferably, the mobile phone terminal is further configured to: and in the firmware transmission process, if the firmware transmission interruption is detected, recording the position information of the upgrade breakpoint.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
(1) the method adopts a fragmentation mechanism, the firmware is divided into a plurality of fragments, each fragment is verified once, after the fragment verification fails, retransmission of the fragments can be tried, the beginning of the retransmission is not needed, and the data correctness and the data transmission stability are ensured;
(2) when the Bluetooth equipment is disconnected in the firmware transmission process, the Bluetooth peripheral records the position of the last transmission fragment, and the upgrade continues to be transmitted from the recorded interrupted fragment position after the equipment is connected next time, so that the starting is not needed, the waiting time of a user is reduced, and the firmware upgrade efficiency is improved;
(3) the size of the fragments can be dynamically adjusted along with the transmission efficiency in the transmission process, so that the problem that the retransmission cost is increased once the fragment verification fails when the transmission time of a single fragment is too long due to unstable signals is solved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a bluetooth peripheral firmware upgrading method according to an embodiment of the present invention;
FIG. 2 is a flow chart of sub-steps of step S1 in FIG. 1;
FIG. 3 is a flow chart of sub-steps of step S2 in FIG. 1;
FIG. 4 is a schematic structural diagram of a Bluetooth peripheral firmware upgrade system according to an embodiment of the present invention;
FIG. 5 is a flowchart of the Bluetooth peripheral firmware upgrade service provided by the preferred embodiment of the present invention;
FIG. 6 is a timing diagram of the embodiment of FIG. 5;
fig. 7 is a firmware patch data pattern example.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
According to the Bluetooth peripheral firmware upgrading method, the Bluetooth peripheral firmware upgrading system and the mobile phone terminal, a fragment mechanism is adopted, and after verification of fragments fails, the fragments can be tried to be retransmitted without starting again; when the Bluetooth equipment is disconnected, the Bluetooth peripheral records the position of the fragment transmitted last time, the fragment is updated after the Bluetooth peripheral is connected with the equipment next time, the transmission is continued from the recorded position, the updating is not required to be started again, the size of the fragment can be dynamically adjusted along with the transmission efficiency in the transmission process, and the phenomenon that the retransmission cost is increased once the verification of the fragment fails when the transmission time of a single fragment is too long due to unstable signals is avoided. Therefore, the Bluetooth peripheral firmware upgrading not only ensures that the firmware is transmitted correctly and completely, but also reduces the time spent on firmware upgrading, improves the firmware upgrading efficiency, improves the user experience, and is suitable for various application scenes related to Bluetooth peripheral firmware upgrading.
The following describes in detail a method, a system, and a mobile phone terminal for upgrading a bluetooth peripheral firmware according to embodiments of the present invention with reference to specific embodiments and accompanying drawings.
Fig. 1 is a flowchart of a bluetooth peripheral firmware upgrading method according to an embodiment of the present invention. Fig. 2 is a flow chart of sub-steps of step S1 in fig. 1. Fig. 3 is a flow chart of sub-steps of step S2 in fig. 1.
As shown in fig. 1 to fig. 3, a method for upgrading a bluetooth peripheral firmware provided by an embodiment of the present invention includes the following steps:
s1, receiving the user upgrading request, sending the user upgrading request and the upgrading breakpoint position request to the Bluetooth peripheral end, and acquiring upgrading confirmation information and upgrading breakpoint position information from the Bluetooth peripheral end.
Preferably, the step S1 includes the following sub-steps:
s11, generating an upgrade starting instruction according to the user upgrade request, and sending the upgrade starting instruction to the Bluetooth peripheral end;
s12, receiving upgrade starting reply information from the Bluetooth peripheral end, and sending a breakpoint requesting instruction to the Bluetooth peripheral end;
and S13, receiving the breakpoint position reply information from the Bluetooth peripheral end.
Here, the upgrade start instruction includes at least a firmware version number, a firmware size, and a firmware verification value, and may further include any other information possible in the prior art; the breakpoint location refers to the interrupt fragment location of the last update firmware transmission.
It is noted that the process of step S1 may be implemented in other ways besides the way described in the above steps without departing from the concept of the present invention, and the specific way is not limited by the embodiment of the present invention.
S2, jumping to the position of an upgrade breakpoint, carrying out fragment processing on the firmware according to a preset firmware fragment transmission rule, and transmitting the fragmented fragment data to the Bluetooth peripheral end to complete fragment verification, whole packet verification and upgrade in sequence.
Preferably, the initial fragment size of the firmware and the transmission time threshold range of each fragment are determined according to a preset firmware fragment transmission rule, the fragments are divided according to the initial fragment size, and each fragment divided by the fragments is sequentially transmitted and verified by the fragments until all the fragments are transmitted, so that the whole package is verified and upgraded. Preferably, the whole packet checking here includes: and sending a whole package of verification request to the Bluetooth peripheral end, verifying whether the splicing of all fragments of the transmitted firmware is correct or not, if so, starting upgrading, and otherwise, sending an upgrading failure and/or retry notice.
Further preferably, the step S2 includes the following sub-steps:
s21, sending the current fragment data and the fragment verification request to a Bluetooth peripheral end;
s22, receiving a fragment checking result from the Bluetooth peripheral end, judging whether the fragment checking is successful according to the fragment checking result, and if not, retransmitting the current fragment until the fragment checking is successful;
s23, judging whether there is any non-transmitted fragment, if yes, recalculating the fragment size according to the current fragment data transmission condition, and then dynamically adjusting the non-transmitted fragment according to the calculation result. Preferably, it is determined whether the current slice transmission time exceeds an upper limit of the output time threshold range and is less than a lower limit of the output time threshold range, if the current slice transmission time exceeds the upper limit of the output time threshold range, the size of the current slice is changed to half of the size of the current slice, and if the current slice transmission time is less than the lower limit of the output time threshold range, the size of the current slice is changed to twice of the size of the current slice.
It is noted that the process of step S2 may be implemented in other ways besides the way described in the above steps without departing from the concept of the present invention, and the specific way is not limited by the embodiment of the present invention.
In addition, preferably, the method for upgrading the firmware of the bluetooth peripheral provided by the embodiment of the present invention further includes the following steps:
in the firmware transmission process, if the firmware transmission interruption is detected, recording the position information of the upgrade breakpoint, preferably, the position information of the upgrade breakpoint includes the interruption fragment position and the version number transmitted by the firmware upgraded last time.
Fig. 4 is a schematic structural diagram of a bluetooth peripheral firmware upgrade system according to an embodiment of the present invention. As shown in fig. 4, the bluetooth peripheral firmware upgrading system provided by the embodiment of the present invention includes an APP end and a bluetooth peripheral end, where the APP end receives a user upgrading request and sends the user upgrading request and an upgrading breakpoint position request to the bluetooth peripheral end, and the bluetooth peripheral end returns upgrading confirmation information and upgrading breakpoint position information to the APP end; the APP terminal skips to the position of an upgrade breakpoint, performs fragment processing on the firmware according to a preset firmware fragment transmission rule, and transmits fragmented fragment data to the Bluetooth peripheral terminal to complete fragment verification, whole packet verification and upgrade in sequence.
In addition, the embodiment of the present invention further provides a mobile phone terminal, and specifically, the mobile phone terminal is configured to: receiving a user upgrading request, sending the user upgrading request and an upgrading breakpoint position request to a Bluetooth peripheral end, and acquiring upgrading confirmation information and upgrading breakpoint position information from the Bluetooth peripheral end; skipping to the upgrade breakpoint position, carrying out fragment processing on the firmware according to a preset firmware fragment transmission rule, and transmitting the fragmented fragment data to the Bluetooth peripheral end to complete fragment verification, whole packet verification and upgrade in sequence.
The method, the system and the mobile phone terminal for upgrading the bluetooth peripheral firmware provided by the embodiment of the present invention are exemplarily described below with reference to a preferred embodiment.
Fig. 5 is a flowchart of the bluetooth peripheral firmware upgrade service provided by the preferred embodiment of the present invention. Fig. 6 is a timing diagram of the embodiment of fig. 5. Fig. 7 is a firmware patch data pattern example.
As shown in fig. 5 to 7, the embodiment is as follows:
1. a user selects firmware upgrade at a mobile phone terminal or an APP terminal (for example, the APP terminal of the mobile phone terminal) (at this time, the mobile phone terminal or the APP terminal is already connected with a Bluetooth peripheral through SPP or BLE);
2. the mobile phone terminal or the APP terminal sends an instruction for starting upgrading, wherein the instruction comprises information such as a firmware version number, a firmware size and a firmware check value (such as CRC32 and MD 5);
3. the Bluetooth peripheral end receives the upgrading starting instruction and sends a reply to the mobile phone terminal or the APP end;
4. after receiving the reply of the upgrading starting instruction, the mobile phone terminal or the APP end sends a breakpoint requesting instruction;
5. after receiving the breakpoint request instruction, the Bluetooth peripheral sends a breakpoint position reply, wherein the reply comprises the position of the last OTA upgrade breakpoint, and if no breakpoint exists, the Bluetooth peripheral can reply 0;
6. the mobile phone terminal or the APP end receives the breakpoint position reply and starts to send data from the breakpoint position;
7. dividing a new firmware packet into a plurality of fragments, setting the size of an initial fragment, wherein the size of the initial fragment can be set to about one tenth of the size of the firmware packet according to the size of the whole firmware packet, for example, the size of the firmware packet is about 1MB, the size of the initial fragment can be set to 128KB, and the upper limit and the lower limit of a threshold range of fragment transmission time are set simultaneously, for example, the lower limit is 30 seconds, and the upper limit is 60 seconds; due to the limitation of a Bluetooth SPP/BLE data MTU (maximum transmission unit), if the size of the fragment exceeds the size of the MTU, each fragment can be divided into a plurality of data packets to be transmitted in sequence, the size of each data packet does not exceed the MTU, and each time after a Bluetooth peripheral end receives a new data packet, the new data packet is spliced into the received fragment;
8. carrying out fragment check once after each fragment is transmitted, and sending a fragment check instruction by the mobile phone terminal or the APP terminal, wherein the instruction carries a check value of the fragment (such as CRC32 and MD 5);
9. the Bluetooth peripheral end receives the fragment checking instruction, starts to perform fragment checking, splices the fragments to the received firmware once the fragments are checked, and sends the checking result to the mobile phone terminal or the APP end;
10. the mobile phone terminal or the APP terminal receives the fragment verification result, if the verification fails, the fragment is retransmitted, here, the retransmission times can also be limited, for example, if the verification fails for 3 times continuously, the user upgrade fails at the same time, and information for reminding the user of upgrading again is sent;
11. if the fragment verification is successful, the Bluetooth peripheral end records the fragment position, the position can be used for subsequent breakpoint continuous transmission, then the APP detects whether the whole firmware packet is transmitted, if the firmware packet is not transmitted, the fragment size is recalculated, the specific rule is that the transmission time of the last fragment is checked, if the transmission time of the last fragment exceeds the upper limit of the transmission time threshold range, the fragment size is changed to be half of the last fragment, such as the original 128KB, 64KB, and if the transmission time of the last fragment is less than the lower limit of the transmission time threshold range, the fragment size is changed to be twice of the previous fragment, such as the original 128KB, 256 KB;
12. after the size of the fragment is recalculated, starting to transmit the next fragment;
13. if the whole firmware package is transmitted, the mobile phone terminal or the APP terminal sends a whole package check instruction, and after the Bluetooth peripheral terminal receives the whole package check instruction, the whole package check is executed to ensure that the firmware is spliced correctly, and a check result is sent to the mobile phone terminal or the APP terminal;
14. if the whole package fails to be checked, the mobile phone terminal or the APP end prompts the user that the upgrade fails;
15. if the whole package is successfully verified, the Bluetooth peripheral starts firmware upgrading, and the mobile phone terminal or the APP terminal waits for a firmware upgrading result;
16. after the Bluetooth peripheral firmware is upgraded, sending a firmware upgrading result to a mobile phone terminal or an APP terminal;
17. and after receiving the firmware upgrading result, the mobile phone terminal or the APP terminal informs the user of the success or failure of firmware upgrading.
In the firmware transmission process, if the bluetooth connection is unexpectedly disconnected, the bluetooth peripheral end records the position of the last received fragment, when the bluetooth is reconnected, the firmware is upgraded again, and when the mobile phone terminal or the APP end requests breakpoint information in the step 5, the position is returned to the mobile phone terminal or the APP end.
All the above-mentioned optional technical solutions can be combined arbitrarily to form the optional embodiments of the present invention, and are not described herein again.
In summary, the method, the system and the mobile phone terminal for upgrading the bluetooth peripheral firmware provided by the embodiment of the invention have the following beneficial effects compared with the prior art:
(1) the method adopts a fragmentation mechanism, the firmware is divided into a plurality of fragments, each fragment is verified once, after the fragment verification fails, retransmission of the fragments can be tried, the beginning of the retransmission is not needed, and the data correctness and the data transmission stability are ensured;
(2) when the Bluetooth equipment is disconnected in the firmware transmission process, the Bluetooth peripheral records the position of the last transmission fragment, and the upgrade continues to be transmitted from the recorded interrupted fragment position after the equipment is connected next time, so that the starting is not needed, the waiting time of a user is reduced, and the firmware upgrade efficiency is improved;
(3) the size of the fragments can be dynamically adjusted along with the transmission efficiency in the transmission process, so that the problem that the retransmission cost is increased once the fragment verification fails when the transmission time of a single fragment is too long due to unstable signals is solved.
It should be noted that: the embodiment of the bluetooth peripheral firmware upgrading system, the embodiment of the mobile phone terminal and the embodiment of the bluetooth peripheral firmware upgrading method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the true scope of the embodiments of the present application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A Bluetooth peripheral firmware upgrade method, the method comprising:
receiving a user upgrading request, sending the user upgrading request and an upgrading breakpoint position request to a Bluetooth peripheral end, and acquiring upgrading confirmation information and upgrading breakpoint position information from the Bluetooth peripheral end;
and jumping to the upgrading breakpoint position, carrying out fragment processing on the firmware according to a preset firmware fragment transmission rule, and transmitting the fragmented fragment data to the Bluetooth peripheral end to complete fragment verification, whole packet verification and upgrading in sequence.
2. The method according to claim 1, characterized in that a user upgrade request is received, the user upgrade request and an upgrade breakpoint position request are sent to a Bluetooth peripheral end, and upgrade confirmation information and upgrade breakpoint position information from the Bluetooth peripheral end are acquired; the method comprises the following steps:
generating an upgrading starting instruction according to the user upgrading request, and sending the upgrading starting instruction to the Bluetooth peripheral end;
receiving upgrade starting reply information from the Bluetooth peripheral end, and sending a breakpoint requesting instruction to the Bluetooth peripheral end;
and receiving breakpoint position reply information from the Bluetooth peripheral end.
3. The method of claim 2, wherein the upgrade start command comprises at least a firmware version number, a firmware size, and a firmware check value, and wherein the breakpoint location refers to a break fragment location of a last firmware upgrade transmission.
4. The method of claim 1, wherein the step of fragmenting the firmware according to a preset firmware fragmentation transmission rule and transmitting fragmented fragment data to the bluetooth peripheral end to sequentially complete fragmentation verification, whole packet verification and upgrading comprises:
determining the initial fragment size of the firmware and the transmission time threshold range of each fragment according to the preset firmware fragment transmission rule, dividing the fragments according to the initial fragment size, and sequentially transmitting and verifying the fragments of each fragment divided by the fragments until all the fragments are transmitted, and verifying and upgrading the whole packet.
5. The method of claim 4, wherein the sequentially transmitting and checking each of the divided slices comprises:
sending current fragment data and a fragment verification request to the Bluetooth peripheral end;
receiving a fragment checking result from the Bluetooth peripheral end, judging whether the fragment checking is successful according to the fragment checking result, and if not, retransmitting the current fragment until the fragment checking is successful;
judging whether there is any non-transmitted fragment, if so, recalculating the size of the fragment according to the current fragment data transmission condition, and then dynamically adjusting the non-transmitted fragment according to the calculation result.
6. The method of claim 5, wherein recalculating the slice size according to the current slice data transmission condition and then dynamically adjusting the undelivered slices according to the calculation result comprises:
and judging whether the transmission time of the current fragment exceeds the upper limit of the output time threshold range and is less than the lower limit of the output time threshold range, if so, changing the size of the fragment to be half of the size of the current fragment, and if so, changing the size of the fragment to be twice of the size of the current fragment.
7. The method of claim 1, wherein the whole packet check comprises:
and sending a whole package of verification request to the Bluetooth peripheral end, verifying whether the splicing of all the fragments of the transmitted firmware is correct or not, if so, starting upgrading, and otherwise, sending an upgrading failure and/or retry notice.
8. The method according to any one of claims 1 to 7, further comprising:
and in the firmware transmission process, if the firmware transmission interruption is detected, recording the position information of the upgrade breakpoint.
9. A Bluetooth peripheral firmware upgrading system is characterized by comprising an APP end and a Bluetooth peripheral end, wherein the APP end receives a user upgrading request and sends the user upgrading request and an upgrading breakpoint position request to the Bluetooth peripheral end, and the Bluetooth peripheral end returns upgrading confirmation information and upgrading breakpoint position information to the APP end; and the APP end skips to the position of the upgrade breakpoint, performs fragment processing on the firmware according to a preset firmware fragment transmission rule, and transmits the fragmented fragment data to the Bluetooth peripheral end to complete fragment verification, whole packet verification and upgrade in sequence.
10. A mobile phone terminal, characterized in that the mobile phone terminal is configured to: receiving a user upgrading request, sending the user upgrading request and an upgrading breakpoint position request to a Bluetooth peripheral end, and acquiring upgrading confirmation information and upgrading breakpoint position information from the Bluetooth peripheral end; and jumping to the upgrading breakpoint position, carrying out fragment processing on the firmware according to a preset firmware fragment transmission rule, and transmitting the fragmented fragment data to the Bluetooth peripheral end to complete fragment verification, whole packet verification and upgrading in sequence.
CN202011016353.2A 2020-09-24 2020-09-24 Bluetooth peripheral firmware upgrading method and system and mobile phone terminal Pending CN112256297A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011016353.2A CN112256297A (en) 2020-09-24 2020-09-24 Bluetooth peripheral firmware upgrading method and system and mobile phone terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011016353.2A CN112256297A (en) 2020-09-24 2020-09-24 Bluetooth peripheral firmware upgrading method and system and mobile phone terminal

Publications (1)

Publication Number Publication Date
CN112256297A true CN112256297A (en) 2021-01-22

Family

ID=74231207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011016353.2A Pending CN112256297A (en) 2020-09-24 2020-09-24 Bluetooth peripheral firmware upgrading method and system and mobile phone terminal

Country Status (1)

Country Link
CN (1) CN112256297A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884935A (en) * 2022-04-26 2022-08-09 深圳绿米联创科技有限公司 Data upgrading method and device, electronic equipment and storage medium
CN116132975A (en) * 2023-01-17 2023-05-16 青岛海尔智能家电科技有限公司 Method, device and storage medium for over-the-air downloading in a network of node devices
CN117133401A (en) * 2023-10-26 2023-11-28 北京中薪科技有限公司 AI-based traditional Chinese medicine prescription data management system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160299753A1 (en) * 2015-04-09 2016-10-13 Rex Poway Tseng Firmware upgrading method for bluetooth electronic scales
CN106302589A (en) * 2015-05-27 2017-01-04 腾讯科技(深圳)有限公司 Document transmission method and terminal
CN110096294A (en) * 2019-05-07 2019-08-06 柏科智能(厦门)科技有限公司 It is a kind of can break-point radio upgrade MCU application program method
CN111240713A (en) * 2019-12-28 2020-06-05 杭州拓深科技有限公司 Method for detecting remote breakpoint continuous transmission through power utilization

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160299753A1 (en) * 2015-04-09 2016-10-13 Rex Poway Tseng Firmware upgrading method for bluetooth electronic scales
CN106302589A (en) * 2015-05-27 2017-01-04 腾讯科技(深圳)有限公司 Document transmission method and terminal
CN110096294A (en) * 2019-05-07 2019-08-06 柏科智能(厦门)科技有限公司 It is a kind of can break-point radio upgrade MCU application program method
CN111240713A (en) * 2019-12-28 2020-06-05 杭州拓深科技有限公司 Method for detecting remote breakpoint continuous transmission through power utilization

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884935A (en) * 2022-04-26 2022-08-09 深圳绿米联创科技有限公司 Data upgrading method and device, electronic equipment and storage medium
CN116132975A (en) * 2023-01-17 2023-05-16 青岛海尔智能家电科技有限公司 Method, device and storage medium for over-the-air downloading in a network of node devices
CN117133401A (en) * 2023-10-26 2023-11-28 北京中薪科技有限公司 AI-based traditional Chinese medicine prescription data management system
CN117133401B (en) * 2023-10-26 2024-02-13 北京中薪科技有限公司 Traditional Chinese medicine prescription data management system

Similar Documents

Publication Publication Date Title
CN112256297A (en) Bluetooth peripheral firmware upgrading method and system and mobile phone terminal
CN108848163B (en) Upgrading method of TWS earphone and TWS earphone
US8437751B2 (en) Method, apparatus and computer program product for providing confirmed over-the-air terminal configuration
CN107835040B (en) Data communication method, equipment and storage medium based on Bluetooth
CN110096294B (en) Method for wirelessly upgrading MCU application program at any breakpoint
EP2177996A2 (en) Remote patching of operating code in a mobile unit
CN110730104A (en) Method for upgrading multi-device batch firmware of mesh network device
CN107015817B (en) Method for upgrading equipment firmware in air
CN108989103B (en) Device upgrading method, debugger, network device and network system
CN102510409A (en) Method and system for quickly and remotely updating program of mobile terminal by using wireless network
CN105610966B (en) Internet of things terminal and upgrading method thereof
CN108833542B (en) Upgrading method of TWS earphone and TWS earphone
CN111200811B (en) TWS earphone, upgrading method and device thereof and readable storage medium
US10338911B2 (en) Method and device for downloading software version, and storage medium
CN112383908A (en) Bluetooth device upgrading method and system
US7571374B2 (en) Method for transmitting and processing command and data
CN111901142A (en) Firmware silent upgrading method and device for embedded equipment cluster
CN113568640A (en) Upgrading method of main program of air conditioner external unit, operation control device and air conditioner
WO2017049557A1 (en) Adapter upgrade method, mobile terminal, and adapter
CN114007209A (en) BLE-based data transmission method and device and BLE master equipment
CN113138788A (en) Air conditioner program upgrading method and air conditioner system
CN109445806B (en) Ble-based multi-device upgrading method, device, system and terminal
CN111885564B (en) Data transmission method, equipment upgrading method and computer readable storage medium
CN113452603A (en) Data transmission method and related device
CN112055314B (en) Bluetooth broadcast communication method, system and master device and slave device thereof

Legal Events

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