OTA upgrading method, device and equipment, storage medium and computer program product

By sending information synchronization instructions to the Bluetooth terminal on the mini program, the device information is determined and sent to the cloud. The cloud determines the OTA upgrade file based on the device information and sends it to the mini program. Then, the OTA upgrade file is sent to the Bluetooth terminal through the agreed Bluetooth communication protocol, solving the problem of unstable transmission during the OTA upgrade process of IoT devices, achieving efficient and stable OTA upgrade file transfer, and improving user experience.

CN119906704APending Publication Date: 2025-04-29SHENZHEN JIUNIU YIMAO INTELLIGENT IOT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411983096.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

During the OTA upgrade process, existing IoT devices have problems such as unstable transmission, poor signal disconnection, too large upgrade package files, and data confusion caused by multiple users, resulting in poor user experience.

Method used

By sending information synchronization instructions to the Bluetooth terminal on the mini program, the device information is determined and sent to the cloud. The cloud determines the OTA upgrade file based on the device information and sends it to the mini program, and then sends the OTA upgrade file to the Bluetooth terminal through the agreed Bluetooth communication protocol to realize OTA upgrade. This method ensures the error tolerance and stability of file transfer through file subcontracting and recording transfer breakpoints.

Benefits of technology

It improves the fault tolerance and stability of OTA upgraded file transfer, reduces transmission failures caused by network instability or device failure, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119906704A_ABST
    Figure CN119906704A_ABST
Patent Text Reader

Abstract

The invention discloses an OTA upgrading method and device, equipment, a storage medium and a computer program product, and relates to the technical field of the Internet of Things, and the method comprises the steps: transmitting an information synchronization instruction to a Bluetooth end, so that the Bluetooth end determines equipment information based on the information synchronization instruction, and transmits the equipment information to an applet end; receiving equipment information sent by the Bluetooth end, sending the equipment information to a cloud end, so that the cloud end determines an OTA upgrading file of the Bluetooth end according to the equipment information, and sending the OTA upgrading file to the applet end; and sending the OTA upgrading file to the Bluetooth end through an agreed Bluetooth communication protocol, so that the Bluetooth end performs OTA upgrading according to the OTA upgrading file. The OTA upgrade file is transmitted through the agreed Bluetooth communication protocol, so that the error-tolerant rate and the stability of file transmission are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet of Things technology, and in particular to OTA upgrade methods, devices, equipment, storage media and computer program products. Background Art

[0002] With the rapid development of the Internet of Things, more and more devices are connected to the Internet. Many IoT devices have Bluetooth functions. At the same time, WeChat applets have penetrated into people's livelihood. Basically, users who use WeChat will use applets. Many Bluetooth devices are also connected and used through WeChat applets. Most devices support OTA (Over-the-Air) function. OTA technology is a technology that transmits software updates, data or configuration information to devices through wireless networks. However, many devices currently provide users with a poor experience when performing OTA upgrades. For example, during the upgrade process, the signal is poor and the connection is disconnected and it has to be restarted. The upgrade package file is too large and takes a long time to transmit. The device is easily confused when it is used by multiple people. These situations occur frequently and are difficult to solve.

[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of this application is to provide an OTA upgrade method, device, equipment, storage medium and computer program product, aiming to solve the technical problem of unstable transmission during OTA upgrade.

[0005] To achieve the above purpose, the present application proposes an OTA upgrade method, which is applied to the mini program end. The method includes:

[0006] Sending an information synchronization instruction to the Bluetooth end, so that the Bluetooth end determines the device information based on the information synchronization instruction, and sends the device information to the mini program end;

[0007] Receive device information sent by the Bluetooth end, and send the device information to the cloud, so that the cloud determines the OTA upgrade file of the Bluetooth end according to the device information, and sends the OTA upgrade file to the mini program end;

[0008] The OTA upgrade file is sent to the Bluetooth terminal through a conventional Bluetooth communication protocol, so that the Bluetooth terminal performs OTA upgrade according to the OTA upgrade file.

[0009] In one embodiment, the step of sending the OTA upgrade file to the Bluetooth terminal through the agreed Bluetooth communication protocol includes:

[0010] Determine the maximum transmission unit of the OTA upgrade file transmission based on the conventional Bluetooth communication protocol;

[0011] Sub-packaging the OTA upgrade file based on the maximum transmission unit to obtain an OTA file package;

[0012] The OTA file package is sent to the Bluetooth terminal, and synchronization information during the transmission of the OTA file package is recorded.

[0013] In one embodiment, the method further comprises:

[0014] When a connection interruption occurs during the transmission of the OTA upgrade file to the Bluetooth terminal, a file transmission breakpoint at which the OTA upgrade file transmission is interrupted is recorded;

[0015] Re-establish the connection with the Bluetooth end, and completely transfer the OTA upgrade file to the Bluetooth end based on the file transfer breakpoint.

[0016] In one embodiment, the OTA upgrade method is applied to a Bluetooth terminal, and the method includes:

[0017] Receive an information synchronization instruction sent by the mini program end, determine the device information of the Bluetooth end according to the information synchronization instruction, send the device information to the mini program end, so that the mini program end sends the device information to the cloud, so that the cloud determines the OTA upgrade file of the Bluetooth end according to the device information, and sends the OTA upgrade file to the mini program end;

[0018] The OTA upgrade file sent by the mini program end is received through the agreed Bluetooth communication protocol, and the Bluetooth end is OTA upgraded according to the OTA upgrade file.

[0019] In one embodiment, the step of performing OTA upgrading on the Bluetooth terminal according to the OTA upgrade file includes:

[0020] Performing data verification on the OTA upgrade file based on the agreed Bluetooth communication protocol;

[0021] If the data verification of the OTA upgrade file passes, the upgrade time countdown is determined according to the preset upgrade time;

[0022] After the upgrade time countdown has passed, the Bluetooth end is OTA upgraded based on the OTA upgrade file.

[0023] In one embodiment, the OTA upgrade method is applied to the cloud, and the method includes:

[0024] Receive device information sent by the mini program end, and determine the OTA upgrade file of the Bluetooth end according to the device information, wherein the device information is determined by the Bluetooth end based on the information synchronization instruction and sent to the mini program end;

[0025] The OTA upgrade file is sent to the mini program end, so that the mini program end sends the OTA upgrade file to the Bluetooth end through the agreed Bluetooth communication protocol, so that the Bluetooth end performs OTA upgrade according to the OTA upgrade file.

[0026] In addition, to achieve the above purpose, the present application also proposes an OTA upgrade device, the OTA upgrade device comprising:

[0027] An information synchronization module, used to send an information synchronization instruction to the Bluetooth end, so that the Bluetooth end determines device information based on the information synchronization instruction, and sends the device information to the mini program end;

[0028] An information receiving module, used to receive device information sent by the Bluetooth terminal, and send the device information to the cloud, so that the cloud determines the OTA upgrade file of the Bluetooth terminal according to the device information, and sends the OTA upgrade file to the mini program terminal;

[0029] The device upgrade module is used to send the OTA upgrade file to the Bluetooth end through the agreed Bluetooth communication protocol, so that the Bluetooth end performs OTA upgrade according to the OTA upgrade file.

[0030] In addition, to achieve the above objectives, the present application also proposes an OTA upgrade device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the OTA upgrade method described above.

[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the OTA upgrade method described above are implemented.

[0032] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the OTA upgrade method described above are implemented.

[0033] One or more technical solutions proposed in this application have at least the following technical effects:

[0034] The embodiment of the present application proposes an OTA upgrade method, device, equipment, storage medium and computer program product, which sends an information synchronization instruction to the Bluetooth end, so that the Bluetooth end determines the device information based on the information synchronization instruction, and sends the device information to the mini program end; receives the device information sent by the Bluetooth end, and sends the device information to the cloud, so that the cloud determines the OTA upgrade file of the Bluetooth end according to the device information, and sends the OTA upgrade file to the mini program end; sends the OTA upgrade file to the Bluetooth end through the agreed Bluetooth communication protocol, so that the Bluetooth end performs OTA upgrade according to the OTA upgrade file. The transmission of OTA upgrade files through the agreed Bluetooth communication protocol improves the fault tolerance and stability of file transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0037] Figure 1 A flowchart of the first embodiment of the OTA upgrade method of this application is provided;

[0038] Figure 2 A flowchart of the steps of a business interaction function scenario defined by the conventional Bluetooth communication protocol provided in an embodiment of the present application;

[0039] Figure 3 A flowchart of the steps of a non-service interaction function scenario defined by the conventional Bluetooth communication protocol provided in an embodiment of the present application;

[0040] Figure 4 A schematic diagram of a transmission data instruction format defined by a conventional Bluetooth communication protocol provided in an embodiment of the present application;

[0041] Figure 5 A flowchart of a specific implementation scenario provided for the OTA upgrade method of this application;

[0042] Figure 6 This is a schematic diagram of the module structure of the OTA upgrade device according to an embodiment of the present application;

[0043] Figure 7 This is a schematic diagram of the device structure of the hardware operating environment involved in the OTA upgrade method in the embodiment of the present application.

[0044] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0045] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0046] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0047] The main solution of the embodiment of the present application is: applied to the mini-program end, sending an information synchronization instruction to the Bluetooth end, so that the Bluetooth end determines the device information based on the information synchronization instruction, and sends the device information to the mini-program end; receiving the device information sent by the Bluetooth end, sending the device information to the cloud, so that the cloud determines the OTA upgrade file of the Bluetooth end according to the device information, and sends the OTA upgrade file to the mini-program end; sending the OTA upgrade file to the Bluetooth end through the agreed Bluetooth communication protocol, so that the Bluetooth end performs OTA upgrade according to the OTA upgrade file.

[0048] In this embodiment, for the convenience of description, the following description is made by taking the identification of the OTA upgrade device as the execution subject.

[0049] With the rapid development of the Internet of Things, more and more devices are connected to the Internet. Many IoT devices have Bluetooth functions. At the same time, WeChat applets have penetrated into people's livelihood. Basically, users who use WeChat will use applets. Many Bluetooth devices are also connected and used through WeChat applets. Most devices support OTA (Over-the-Air Technology) function. OTA technology is a technology that transmits software updates, data or configuration information to devices through wireless networks. However, many devices currently provide users with a poor experience when performing OTA upgrades. For example, during the upgrade process, the signal is poor and the connection is disconnected and it has to be restarted. The upgrade package file is too large and takes a long time to transmit. The device is easily confused when it is used by multiple people. These situations occur frequently and are difficult to solve.

[0050] The present application provides a solution for transmitting OTA upgrade files through a conventional Bluetooth communication protocol, thereby improving the fault tolerance and stability of file transmission.

[0051] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, an OTA upgrade device, etc. The following takes the OTA upgrade device as an example to illustrate this embodiment and the following embodiments.

[0052] Based on this, the embodiment of the present application provides an OTA upgrade method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the OTA upgrade method of the present application. The OTA upgrade method is applied to the mini program end, including steps S10 to S30:

[0053] Step S10, sending an information synchronization instruction to the Bluetooth end, so that the Bluetooth end determines the device information based on the information synchronization instruction, and sends the device information to the mini program end.

[0054] It should be noted that the Bluetooth end is a device that supports Bluetooth function, has a built-in Bluetooth module, and supports Bluetooth communication protocol. The Bluetooth end is a device equipped with a BLE module that supports Bluetooth protocol 4.0 or higher. It is characterized by reduced cost and power consumption, so it has a wide range of applications, such as: smart home (Bluetooth lock, Bluetooth light), data transmission of sensor equipment (blood pressure monitor, temperature sensor), consumer electronics (electronic cigarettes, remote control toys), etc. Bluetooth technology is an open global specification for wireless data and voice communications. It is a special short-range wireless technology connection based on low-cost short-range wireless connection to establish a communication environment for fixed and mobile devices.

[0055] In addition, it should be noted that the mini program end refers to the application or platform that runs the mini program. The mini program is an application that can be used without downloading and installing. It usually runs on third-party platforms such as WeChat, Alipay, and Baidu. The mini program end communicates with the Bluetooth end and the cloud by calling the API (application programming interface) provided by the platform. It has the characteristics of high functional scalability, small size, fast download, easy to reach, and can be used and left. It is currently widely used. It can be used by governments, enterprises, and individuals, and is basically known to everyone.

[0056] In addition, it should be noted that the information synchronization instruction refers to an instruction sent by the mini program end to the Bluetooth end, requesting the Bluetooth end to return its current status information.

[0057] In addition, it should be noted that the device information refers to the current status information of the Bluetooth terminal, including but not limited to the working status and firmware version of the Bluetooth terminal, and if the OTA upgrade file is currently being transmitted, the content and number of OTA file packages received by the Bluetooth terminal. The device information includes the working status, firmware version, and the number of OTA packages received.

[0058] Specifically, the mini program side calls the built-in Bluetooth API or related library to initialize the Bluetooth side to ensure that the Bluetooth function of the Bluetooth side is in an available state; then the mini program side starts the Bluetooth scanning function to search for available Bluetooth devices. After scanning the target Bluetooth device, it initiates a pairing request to the Bluetooth device. After the pairing is successful, the mini program side and the Bluetooth side establish a connection.

[0059] After the connection between the mini program and the Bluetooth end is established, the mini program constructs an information synchronization instruction according to the protocol and format of Bluetooth communication, and sends the information synchronization instruction to the Bluetooth end. After receiving the information synchronization instruction, the Bluetooth end sends a reply instruction to the mini program end indicating that the information synchronization instruction has been received. The information synchronization instruction is then parsed and the device information of the Bluetooth end is obtained according to the instruction requirements. The device information is then sent to the mini program end. The device information includes but is not limited to the working status of the Bluetooth end, the firmware version, and the content and quantity of the OTA file packages received.

[0060] Step S20, receiving the device information sent by the Bluetooth end, and sending the device information to the cloud, so that the cloud determines the OTA upgrade file of the Bluetooth end according to the device information, and sends the OTA upgrade file to the mini program end.

[0061] It should be noted that the cloud is a remote server or server cluster located on the network, which communicates and exchanges data with the mini-program end through the Internet. The cloud has the OTA upgrade file of the latest version of the device firmware where the Bluetooth end is located.

[0062] In addition, it should be noted that the OTA upgrade file is a file package containing the firmware update content of the device where the Bluetooth end is located. It is used to transmit the new firmware version or update content to the target device wirelessly to achieve the upgrade or update of the device. It usually contains all the update content of the device firmware, which may involve functional improvements, performance optimization, security patches, bug fixes, etc. The content of the upgrade package will vary depending on the model of the device, the current firmware version and the target firmware version. Over-the-Air (Over-the-Air) technology In the field of science and technology, OTA mainly refers to a technology that remotely updates and upgrades the software and firmware of mobile terminal devices (such as smartphones, tablets, car systems, etc.) through the air interface of mobile communications (such as Bluetooth, 2G, 3G, 4G, 5G).

[0063] Specifically, the device information sent by the Bluetooth end is received, and then the OTA upgrade file request instruction containing the device information is sent to the cloud. After receiving the device information, the cloud analyzes and obtains the firmware version of the device where the Bluetooth end is located contained in the device information, queries the cloud database to obtain the latest firmware version information, and then compares the latest firmware version with the firmware version in the device information. If the firmware version in the device information is lower than the latest firmware version, the latest version of the OTA upgrade file of the device where the Bluetooth end is located is sent to the mini program end; if the firmware version in the device information is already the latest firmware version, a reply message containing the latest version of the firmware is sent to the mini program end.

[0064] More specifically, if the firmware version in the device information is lower than the latest firmware version, a version reply message containing the latest firmware version information will be sent to the mini program end. After receiving the latest version information, the mini program end will query whether the latest version of the OTA upgrade file is cached in the local storage of the device where the mini program end is located. If there is the latest version of the OTA upgrade file, a message containing the information of the latest version of the OTA upgrade file will be sent to the cloud; if there is no latest version of the OTA upgrade file, an OTA upgrade file request instruction will be sent to the cloud. In response to the OTA upgrade file request instruction, the cloud will send the latest version of the OTA upgrade file to the mini program end. The OTA upgrade file request instruction is used to request the latest version of the OTA upgrade file from the cloud.

[0065] Step S30, sending the OTA upgrade file to the Bluetooth terminal through the agreed Bluetooth communication protocol, so that the Bluetooth terminal performs OTA upgrade according to the OTA upgrade file.

[0066] It should be noted that the agreed Bluetooth communication protocol is a customized communication protocol, which defines how to exchange data and instructions between the mini program end and the Bluetooth end. Through a series of clear rules and steps, it improves the reliability, efficiency and automation of communication between the Bluetooth device and the user end, and also facilitates the firmware management and upgrade of the device.

[0067] More specifically, the agreed-upon Bluetooth communication protocol defines clear rules and steps. The mini program sends a command to the Bluetooth end. If the Bluetooth end receives and parses the command successfully, it returns the command. If the parsing fails, the command is not returned. For example, the mini program sends an information synchronization command, and the Bluetooth end returns the information synchronization command after receiving it, indicating that the information synchronization command has been received, and then the device information of the device where the Bluetooth end is located is combined into a new data packet and sent to the mini program end; if there is no business interaction function, the Bluetooth end only returns this command. Figure 2 As shown, Figure 2This is a flowchart of the steps in the business interaction function scenario defined by the agreed Bluetooth communication protocol. The mini program sends the information synchronization instruction to the Bluetooth end. After receiving the information synchronization instruction, the Bluetooth end sends the received information synchronization instruction and device information to the mini program end. Figure 3 As shown, Figure 3 This is a step flow chart for the non-business interaction function scenario defined by the agreed Bluetooth communication protocol. The mini program side sends the OTA file upgrade package to the Bluetooth side. After receiving it, the Bluetooth side sends a message containing the received OTA file upgrade package information to the mini program side.

[0068] More specifically, the transmission data instruction format defined by the conventional Bluetooth communication protocol is referred to as Figure 4 , Figure 4 The protocol header is a fixed instruction code with an instruction prefix, which occupies 2 bytes; the command code indicates the operation type of the instruction, which occupies 1 byte, such as 01 synchronization information, 02 control function, F1 OTA upgrade and other different operations. The command code is the key to distinguish different instructions. The total number of packets indicates the total number of packets of all data, which occupies 1 byte. It is used to tell the receiver how many data packets will be in the entire data transmission process. The number of subpackets indicates the sequence number of the current transmission data packet, which occupies 1 byte. It is used to identify the position of the current data packet in the entire data transmission process, so that the receiver can reassemble the data packet in the correct order. Data 1 and data 2 indicate the data in this data packet. The number of bytes occupied changes with the maximum transmission unit MTU (Maximum Transmission Unit) value. The data field contains the specific content or parameters of the instruction. The crc check code is a field used to check the integrity of the data, which occupies 1 byte. It ensures that the data has not been tampered with or damaged during transmission by calculating the cyclic redundancy check crc value of the data field. The protocol tail is the end mark or check field of the instruction, which is used to identify the end of the instruction and / or perform additional checks, which occupies 2 bytes.

[0069] Specifically, after the mini program end receives the OTA upgrade file, it verifies the integrity and correctness of the file. After the verification is completed, the OTA upgrade file is sent to the Bluetooth end through the agreed Bluetooth communication protocol. Further, based on the total number of packets in the agreed Bluetooth communication protocol and the total file size of the OTA upgrade file, the Bluetooth maximum transmission unit MTU (Maximum Transmission Unit) in the OTA upgrade file transmission process is determined. After the maximum transmission unit is determined, the mini program end sends an MTU setting instruction to the Bluetooth end. The MTU setting instruction is used to set the space size for transmitting a file package between the mini program end and the Bluetooth end. After receiving the MTU setting instruction, the Bluetooth end modifies the maximum transmission unit of the transmission. After the modification is successful, the modification success information is returned to the mini program end. Generally, the default value of Bluetooth transmission is 20 bytes. In one embodiment of the present application, the MTU setting instruction modifies 20 bytes to 255 bytes, which increases the size of the transmitted file package and improves the transmission rate.

[0070] This embodiment adopts the above scheme to transmit OTA upgrade files through the agreed Bluetooth communication protocol, thereby improving the fault tolerance and stability of file transmission.

[0071] Based on the above implementation scheme, in a feasible implementation manner, sending the OTA upgrade file to the Bluetooth terminal through the agreed Bluetooth communication protocol includes steps S31 to S33:

[0072] Step S31, determining a maximum transmission unit for the OTA upgrade file transmission based on the conventional Bluetooth communication protocol.

[0073] It should be noted that the maximum transmission unit is the maximum transmission unit value in Bluetooth transmission. Generally, the default value of a Bluetooth device is 20 bytes per maximum transmission unit.

[0074] Specifically, based on the total number of packets in the agreed Bluetooth communication protocol and the total file size of the OTA upgrade file, the Bluetooth maximum transmission unit MTU during the OTA upgrade file transmission process is determined.

[0075] Step S32: packetize the OTA upgrade file based on the maximum transmission unit to obtain an OTA file package.

[0076] It should be noted that the OTA file package refers to small file packages obtained by subpackaging the OTA upgrade file.

[0077] Specifically, the total size of the OTA file is obtained, and according to the determined MTU value, the OTA upgrade file is split into multiple data packets whose size is less than or equal to the MTU value to obtain an OTA file packet. The format of the data packet is Figure 4The transmission data instruction format defined by the conventional Bluetooth communication protocol shown.

[0078] Step S33, sending the OTA file package to the Bluetooth terminal, and recording the synchronization information during the transmission of the OTA file package.

[0079] Specifically, the divided OTA file packages are sent to the Bluetooth end in order. When each file is sent, the mini program end records the sending time, number of packages (file package number) and other synchronization information. When the Bluetooth end receives the OTA file package, it also records the corresponding receiving time, number of packages (file package number) and other synchronization information.

[0080] This embodiment uses the above solution to determine the MTU based on the agreed Bluetooth communication protocol, which can ensure that during the Bluetooth communication process, the amount of data transmitted each time will not be too large to cause transmission failure, nor too small to waste transmission resources. This data transmission based on the MTU agreed upon in the protocol can fully utilize the bandwidth of Bluetooth communication and improve transmission efficiency.

[0081] Based on the above implementation scheme, in a feasible implementation scheme, the OTA upgrade method further includes steps S40 to S50:

[0082] Step S40, when a connection interruption occurs during the transmission of the OTA upgrade file to the Bluetooth terminal, a file transmission breakpoint where the OTA upgrade file transmission is interrupted is recorded.

[0083] It should be noted that the file transfer breakpoint refers to the end position of the last valid data packet that failed to be successfully sent due to a connection interruption during the OTA upgrade file transmission via Bluetooth. This position marks the boundary between the data that has been successfully sent and received and the data that has not yet been sent during the transmission process.

[0084] Specifically, during the OTA upgrade file transmission process, the stability of the Bluetooth connection is monitored in real time. Once the Bluetooth connection is interrupted (for example, through the receipt of an error code or abnormal signal), the file transfer is stopped immediately. The serial number of the OTA file package that has been successfully transmitted by the mini program end is recorded, and the serial number of the OTA file package that has been successfully received by the Bluetooth end is recorded. The serial number of the OTA file package that has been successfully received by the Bluetooth end is used as the file transfer breakpoint.

[0085] Step S50, reestablishing the connection with the Bluetooth end, and completely transmitting the OTA upgrade file to the Bluetooth end based on the file transfer breakpoint.

[0086] Specifically, after detecting that the connection is interrupted, try to re-initiate the Bluetooth connection request. If the Bluetooth device is in a connectable state, re-establish the Bluetooth connection. If the connection fails, retry according to a predetermined retry strategy (such as number of retries, retry interval, etc.); if multiple retries still fail, display an error message to the user, and prompt the user to check the Bluetooth device status or re-pair; after successfully re-establishing the Bluetooth connection, read the previously recorded file transfer breakpoint from the local storage or database, and locate the untransmitted part of the OTA upgrade file based on the breakpoint information, and continue to transfer the OTA upgrade file from the breakpoint. During the transmission process, continue to monitor the stability of the Bluetooth connection. When all file data packets are successfully transmitted to the Bluetooth end, send a completion signal to the Bluetooth device, indicating that the OTA upgrade file transfer is complete.

[0087] Through the above scheme, this embodiment records the file transfer breakpoints. When the connection is interrupted, it can continue from the last successful transmission location without starting from the beginning. This greatly improves the efficiency and reliability of transmission; reduces transmission failures caused by network instability or equipment failure, making the OTA upgrade process more stable while also improving the user experience.

[0088] Based on the above implementation scheme, in a feasible implementation scheme, the OTA upgrade method is applied to the Bluetooth end, including steps S60 to S70:

[0089] Step S60, receive the information synchronization instruction sent by the mini program end, determine the device information of the Bluetooth end according to the information synchronization instruction, send the device information to the mini program end, so that the mini program end sends the device information to the cloud, so that the cloud determines the OTA upgrade file of the Bluetooth end according to the device information, and sends the OTA upgrade file to the mini program end.

[0090] Specifically, after the mini program end and the Bluetooth end establish a connection, the mini program end constructs an information synchronization instruction according to the protocol and format of Bluetooth communication, and sends the information synchronization instruction to the Bluetooth end. After receiving the information synchronization instruction, the Bluetooth end parses the information synchronization instruction and obtains the device information of the Bluetooth end according to the instruction requirements, and then sends the device information to the mini program end. The device information includes but is not limited to the working status of the Bluetooth end, the firmware version, and the content and quantity of the received OTA file packages. After receiving the device information, the mini program end sends the OTA upgrade file request instruction containing the device information to the cloud. After receiving the device information, the cloud analyzes and obtains the firmware version of the device where the Bluetooth end is located contained in the device information, queries the cloud database to obtain the latest firmware version information, and sends the latest version of the OTA upgrade file of the firmware of the device where the Bluetooth end is located to the mini program end.

[0091] Step S70, receiving the OTA upgrade file sent by the mini program end through the agreed Bluetooth communication protocol, and performing OTA upgrade on the Bluetooth end according to the OTA upgrade file.

[0092] Specifically, after receiving the OTA upgrade file on the mini program side, the OTA upgrade file is packaged through the agreed Bluetooth communication protocol and then sent to the Bluetooth side in sequence. After receiving the OTA upgrade file, the Bluetooth side verifies the file and performs data verification based on the CRC check code in the OTA file package. If the data verification of the OTA upgrade file passes, the upgrade time countdown is determined according to the preset upgrade time; after the upgrade time countdown passes, the Bluetooth side is OTA upgraded based on the OTA upgrade file, and the original program of the firmware is overwritten to complete the OTA upgrade.

[0093] Based on the above implementation scheme, in a feasible implementation scheme, the OTA upgrade of the Bluetooth terminal according to the OTA upgrade file includes steps S71 to S73:

[0094] Step S71, performing data verification on the OTA upgrade file based on the conventional Bluetooth communication protocol.

[0095] Specifically, the Bluetooth end receives the OTA upgrade file sent from the mini-program end through the agreed Bluetooth communication protocol, extracts the data required for verification from the received OTA upgrade file, such as the CRC check code, uses the CRC check algorithm for verification, and compares the calculated verification result with the check value contained in the OTA upgrade file. If the verification results are consistent, it means that the OTA upgrade file is complete and has not been tampered with, and proceeds to the next step; if the verification results are inconsistent, an error message is recorded, and it may be necessary to notify the mini-program end or the user to resend the OTA upgrade file.

[0096] Step S72: If the data verification of the OTA upgrade file passes, the upgrade time countdown is determined according to the preset upgrade time.

[0097] Specifically, if the data verification of the OTA upgrade file passes, the preset OTA upgrade time is read from the device where the Bluetooth terminal is located, the current time of the Bluetooth terminal is obtained, and the upgrade countdown is obtained according to the preset upgrade time and the current time of the device, and a countdown mechanism is started. This countdown can be implemented on the internal clock or timer of the Bluetooth terminal. During the countdown, the Bluetooth terminal can continue to perform other functions, but it should be ensured that it will not enter the sleep or shutdown state before the countdown ends. In one embodiment of the present application, the preset upgrade time is twelve o'clock in the evening, the current device time is obtained, and the difference between the current time and twelve o'clock in the evening is calculated to determine the upgrade time countdown.

[0098] Step S73: After the upgrade time countdown is completed, the Bluetooth terminal is OTA upgraded based on the OTA upgrade file.

[0099] Specifically, when the countdown ends, the Bluetooth end checks its status to ensure that the upgrade time has arrived; then, according to the instructions of the OTA upgrade file, it starts to update the firmware or software of the Bluetooth end to complete the firmware overwrite upgrade. After the upgrade is completed, the Bluetooth end completes the upgrade process. After restarting, the Bluetooth end should perform a self-check to ensure that the upgrade is successful and the device functions normally, and then notify the user that the OTA upgrade has been completed.

[0100] Through the above scheme, this embodiment performs data verification on the OTA upgrade file to ensure that the file is not tampered with or damaged during the transmission process, thereby ensuring the security and integrity of the file; determining the upgrade time countdown according to the preset upgrade time can ensure that the OTA upgrade is performed at the appropriate time, avoiding upgrades during peak device usage periods or during the execution of critical tasks, and improving the stability of OTA upgrades while reducing interference to users during the upgrade process, thereby improving user experience.

[0101] Based on the above implementation scheme, in a feasible implementation scheme, the OTA upgrade method is applied to the cloud, including steps S80 to S90:

[0102] Step S80, receiving the device information sent by the mini program end, and determining the OTA upgrade file of the Bluetooth end according to the device information. The device information is determined by the Bluetooth end based on the information synchronization instruction and sent to the mini program end.

[0103] Specifically, after the communication connection is established between the mini program and the cloud, the mini program will send device information to the cloud. When the cloud receives the device information sent by the mini program, it receives and stores the information. The cloud server parses the received device information, extracts key information, obtains the current firmware version of the device where the Bluetooth end is located, queries the cloud database to obtain the latest firmware version information, and then compares the latest firmware version with the firmware version in the device information to determine the OTA upgrade file corresponding to the latest version.

[0104] Step S90, sending the OTA upgrade file to the mini program end, so that the mini program end sends the OTA upgrade file to the Bluetooth end through the agreed Bluetooth communication protocol, so that the Bluetooth end performs OTA upgrade according to the OTA upgrade file.

[0105] Specifically, if the firmware version in the device information is lower than the latest firmware version, the OTA upgrade file of the latest version of the device where the Bluetooth end is located will be sent to the mini program end; if the firmware version in the device information is already the latest firmware version, a reply message containing the latest version of the firmware will be sent to the mini program end.

[0106] More specifically, if the firmware version in the device information is lower than the latest firmware version, a version reply message containing the latest firmware version information will be sent to the mini program end. After receiving the latest version information, the mini program end will query whether the latest version of the OTA upgrade file is cached in the local storage of the device where the mini program end is located. If there is the latest version of the OTA upgrade file, a message containing the information of the latest version of the OTA upgrade file will be sent to the cloud; if there is no latest version of the OTA upgrade file, an OTA upgrade file request instruction will be sent to the cloud. In response to the OTA upgrade file request instruction, the cloud will send the latest version of the OTA upgrade file to the mini program end. The OTA upgrade file request instruction is used to request the latest version of the OTA upgrade file from the cloud.

[0107] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the OTA upgrade method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0108] This application also provides an OTA upgrade device, please refer to Figure 6 , the OTA upgrade device comprises:

[0109] An information synchronization module 601 is used to send an information synchronization instruction to the Bluetooth terminal, so that the Bluetooth terminal determines device information based on the information synchronization instruction and sends the device information to the mini program terminal;

[0110] An information receiving module 602 is used to receive device information sent by the Bluetooth terminal, and send the device information to the cloud, so that the cloud determines the OTA upgrade file of the Bluetooth terminal according to the device information, and sends the OTA upgrade file to the mini program terminal;

[0111] The device upgrade module 603 is used to send the OTA upgrade file to the Bluetooth terminal through the agreed Bluetooth communication protocol, so that the Bluetooth terminal performs OTA upgrade according to the OTA upgrade file.

[0112] The OTA upgrade device provided by the present application adopts the OTA upgrade method in the above embodiment, which can solve the technical problem of unstable transmission during OTA upgrade. Compared with the prior art, the beneficial effects of the OTA upgrade device provided by the present application are the same as the beneficial effects of the OTA upgrade method provided by the above embodiment, and the other technical features in the OTA upgrade device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0113] The present application provides an OTA upgrade device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the OTA upgrade method in the above-mentioned embodiment one.

[0114] Reference below Figure 7 , which shows a schematic diagram of the structure of an OTA upgrade device suitable for implementing an embodiment of the present application. The OTA upgrade device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The OTA upgrade device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0115] like Figure 7 As shown, the OTA upgrade device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the OTA upgrade device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the OTA upgrade device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an OTA upgrade device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0116] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0117] The OTA upgrade device provided by this application adopts the OTA upgrade method in the above embodiment, which can solve the technical problem of unstable transmission during OTA upgrade. Compared with the prior art, the beneficial effects of the OTA upgrade device provided by this application are the same as the beneficial effects of the OTA upgrade method provided by the above embodiment, and the other technical features in the OTA upgrade device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0118] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0119] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0120] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the OTA upgrade method in the above-mentioned embodiment.

[0121] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0122] The computer-readable storage medium may be included in the OTA upgrade device; or may exist independently without being assembled into the OTA upgrade device.

[0123] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the OTA upgrade device, the OTA upgrade device: sends an information synchronization instruction to the Bluetooth end, so that the Bluetooth end determines the device information based on the information synchronization instruction, and sends the device information to the mini-program end; receives the device information sent by the Bluetooth end, and sends the device information to the cloud, so that the cloud determines the OTA upgrade file of the Bluetooth end according to the device information, and sends the OTA upgrade file to the mini-program end; sends the OTA upgrade file to the Bluetooth end through the agreed Bluetooth communication protocol, so that the Bluetooth end performs OTA upgrade according to the OTA upgrade file.

[0124] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0125] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0126] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0127] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned OTA upgrade method, and can solve the technical problem of unstable transmission during OTA upgrade. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the OTA upgrade method provided in the above-mentioned embodiment, and will not be repeated here.

[0128] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned OTA upgrade method when executed by a processor.

[0129] The computer program product provided by this application can solve the technical problem of unstable transmission during OTA upgrade. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the OTA upgrade method provided by the above embodiment, which will not be repeated here.

[0130] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. An OTA upgrade method, characterized in that: The over-the-air OTA upgrade method is applied to the mini program side, and the method includes: Sending an information synchronization instruction to the Bluetooth end, so that the Bluetooth end determines the device information based on the information synchronization instruction, and sends the device information to the mini program end; Receive device information sent by the Bluetooth end, and send the device information to the cloud, so that the cloud determines the OTA upgrade file of the Bluetooth end according to the device information, and sends the OTA upgrade file to the mini program end; The OTA upgrade file is sent to the Bluetooth terminal through a conventional Bluetooth communication protocol, so that the Bluetooth terminal performs OTA upgrade according to the OTA upgrade file.

2. The method according to claim 1, characterized in that The step of sending the OTA upgrade file to the Bluetooth terminal through the agreed Bluetooth communication protocol includes: Determine the maximum transmission unit of the OTA upgrade file transmission based on the conventional Bluetooth communication protocol; Sub-packaging the OTA upgrade file based on the maximum transmission unit to obtain an OTA file package; The OTA file package is sent to the Bluetooth terminal, and synchronization information during the transmission of the OTA file package is recorded.

3. The method according to claim 1, characterized in that The method further comprises: When a connection interruption occurs during the transmission of the OTA upgrade file to the Bluetooth terminal, a file transmission breakpoint at which the OTA upgrade file transmission is interrupted is recorded; Re-establish the connection with the Bluetooth end, and completely transfer the OTA upgrade file to the Bluetooth end based on the file transfer breakpoint.

4. An OTA upgrade method, characterized in that: The OTA upgrade method is applied to the Bluetooth terminal, and the method includes: Receive an information synchronization instruction sent by the mini program end, determine the device information of the Bluetooth end according to the information synchronization instruction, send the device information to the mini program end, so that the mini program end sends the device information to the cloud, so that the cloud determines the OTA upgrade file of the Bluetooth end according to the device information, and sends the OTA upgrade file to the mini program end; The OTA upgrade file sent by the mini program end is received through the agreed Bluetooth communication protocol, and the Bluetooth end is OTA upgraded according to the OTA upgrade file.

5. The method according to claim 4, characterized in that The step of performing OTA upgrading on the Bluetooth terminal according to the OTA upgrade file comprises: Performing data verification on the OTA upgrade file based on the agreed Bluetooth communication protocol; If the data verification of the OTA upgrade file passes, the upgrade time countdown is determined according to the preset upgrade time; After the upgrade time countdown has passed, the Bluetooth end is OTA upgraded based on the OTA upgrade file.

6. An OTA upgrade method, characterized in that: The OTA upgrade method is applied to the cloud, and the method includes: Receive device information sent by the mini program end, and determine the OTA upgrade file of the Bluetooth end according to the device information, wherein the device information is determined by the Bluetooth end based on the information synchronization instruction and sent to the mini program end; The OTA upgrade file is sent to the mini program end, so that the mini program end sends the OTA upgrade file to the Bluetooth end through the agreed Bluetooth communication protocol, so that the Bluetooth end performs OTA upgrade according to the OTA upgrade file.

7. An OTA upgrade device, characterized in that: The device comprises: An information synchronization module, used to send an information synchronization instruction to the Bluetooth end, so that the Bluetooth end determines device information based on the information synchronization instruction, and sends the device information to the mini program end; An information receiving module, used to receive device information sent by the Bluetooth terminal, and send the device information to the cloud, so that the cloud determines the OTA upgrade file of the Bluetooth terminal according to the device information, and sends the OTA upgrade file to the mini program terminal; The device upgrade module is used to send the OTA upgrade file to the Bluetooth end through the agreed Bluetooth communication protocol, so that the Bluetooth end performs OTA upgrade according to the OTA upgrade file.

8. An OTA upgrade device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the OTA upgrade method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the OTA upgrade method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the OTA upgrade method according to any one of claims 1 to 6 are implemented.