End-side equipment firmware upgrading method and system based on optimized Bluetooth protocol stack

By dynamically adjusting the transmission parameters in the Bluetooth protocol stack, the problem that the transmission rate cannot match the actual requirements during the firmware upgrade process in the existing technology is solved, and a more efficient firmware upgrade is achieved.

CN119835624AInactive Publication Date: 2025-04-15GUANGZHOU KETENG INFORMATION TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411889904.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The transmission control method of the existing Bluetooth protocol stack cannot flexibly respond to factors such as distance, environmental changes and equipment power between devices, resulting in the transmission rate during firmware upgrades that cannot optimally match actual needs, affecting the upgrade efficiency.

Method used

These parameters are dynamically adjusted during the transmission process to adapt to transmission conditions, environmental changes and equipment status changes by dividing them based on the fragment division parameters of the firmware data packet to be transmitted and transmitted according to the transmission rate, connection interval and priority.

Benefits of technology

By dynamically adjusting the transmission parameters, it can better match actual needs and improve the efficiency and stability of firmware upgrades.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835624A_ABST
    Figure CN119835624A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an end-side equipment firmware upgrading method and system based on an optimized Bluetooth protocol stack. The method comprises the following steps: dividing a to-be-transmitted firmware data packet based on a fragment division parameter of the to-be-transmitted firmware data packet to obtain firmware packet fragments, and transmitting each firmware packet fragment based on a transmission rate, a connection interval and a priority; dynamically adjusting fragment division parameters, a transmission rate, a connection interval and a priority according to the transmission information and the state information of the transmission equipment; and dividing the firmware data packet to be transmitted based on the adjusted fragment division parameter, and transmitting based on the adjusted transmission rate, connection interval and priority. According to the scheme, the parameters can be adaptively and dynamically adjusted in the process that the firmware data packet is divided into the fragments to be transmitted, so that factors such as transmission conditions, environment changes and equipment state changes in the transmission process are flexibly coped with, the transmission parameters are made to be matched with actual requirements, and the upgrading efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of firmware upgrade, and in particular to a method and system for upgrading terminal edge device firmware based on an optimized Bluetooth protocol stack. Background Art

[0002] In the field of power grids, smart grid equipment (such as smart substations, smart distribution network terminals, environmental monitoring sensors, smart meters, etc.) has gradually become an important part of the power system. With the widespread application of IoT technology, the monitoring, management and maintenance of power grid equipment are increasingly dependent on remote upgrades and firmware updates. To ensure the stability and security of equipment, firmware upgrades have become particularly important. However, many power grid devices are in a decentralized location far away from the central control system and are limited by the communication conditions in the power grid environment, which brings many challenges to firmware upgrades.

[0003] Bluetooth technology, especially the Bluetooth 5.x protocol, as a short-range wireless communication technology, has been widely used in edge devices in the power grid field due to its low power consumption, low cost and reliable communication performance. Many devices in the power grid, such as smart meters, sensors, terminal control units (TCUs), etc., usually use the Bluetooth protocol for short-range data transmission and device communication. Through Bluetooth, these devices can efficiently collect, transmit and upgrade firmware. At present, the transmission control method of the Bluetooth protocol stack is usually based on static configuration of connection management and data transmission rate. In the traditional Bluetooth transmission process, data is transmitted between the device and the control center or other devices by establishing a stable connection. The existing Bluetooth connection management and bandwidth allocation methods are usually based on pre-set connection intervals and transmission rates. This static configuration cannot flexibly respond to factors such as the distance between devices, environmental changes (such as signal interference) and device power, resulting in the transmission rate being unable to optimally match actual needs during the firmware upgrade process, thereby affecting the upgrade efficiency. Summary of the invention

[0004] The embodiments of the present application provide a method and system for upgrading the firmware of an end-device based on optimizing the Bluetooth protocol stack, so as to dynamically adjust the parameters during the transmission process and improve the transmission efficiency.

[0005] According to one aspect of the present application, a method for upgrading terminal edge device firmware based on optimizing the Bluetooth protocol stack is provided, the method comprising:

[0006] Divide the firmware data packet to be transmitted based on the segment division parameters of the firmware data packet to be transmitted to obtain firmware packet segments, and transmit each firmware packet segment based on the transmission rate, connection interval and priority;

[0007] During the transmission process, dynamically adjusting the fragment division parameter, the transmission rate, the connection interval and the priority according to the transmission information of the firmware package fragment and the status information of the transmission device;

[0008] The firmware data packet to be transmitted is divided based on the adjusted segment division parameter to obtain firmware packet segments, and each firmware packet segment is transmitted based on the adjusted transmission rate, the connection interval and the priority.

[0009] According to one aspect of the present application, a terminal device firmware upgrade system based on an optimized Bluetooth protocol stack is provided, the system comprising:

[0010] A firmware packet fragment transmission module, used for dividing the firmware packet to be transmitted based on the fragment division parameters of the firmware packet to be transmitted, obtaining firmware packet fragments, and transmitting each firmware packet fragment based on the transmission rate, connection interval and priority;

[0011] A dynamic adjustment module, used to dynamically adjust the fragment division parameter, the transmission rate, the connection interval and the priority according to the transmission information of the firmware package fragment and the status information of the transmission device during the transmission process;

[0012] The optimized transmission module is used to divide the firmware data packet to be transmitted based on the adjusted segment division parameters to obtain firmware packet segments, and transmit each firmware packet segment based on the adjusted transmission rate, the connection interval and the priority.

[0013] According to another aspect of the present application, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] A memory connected to at least one processor for upgrading edge device firmware based on an optimized Bluetooth protocol stack; wherein,

[0016] The memory stores a computer program that can be executed by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute the terminal device firmware upgrade method based on the optimized Bluetooth protocol stack of any embodiment of the present application.

[0017] According to another aspect of the present application, a computer-readable storage medium is provided, which stores computer instructions, and the computer instructions are used to enable a processor to implement the end-device firmware upgrade method based on an optimized Bluetooth protocol stack of any embodiment of the present application when executed.

[0018] The technical solution of the embodiment of the present application is to divide the firmware data packet to be transmitted based on the fragment division parameters of the firmware data packet to be transmitted to obtain firmware packet fragments, and transmit each firmware packet fragment based on the transmission rate, connection interval and priority; in the process of transmission, dynamically adjust the fragment division parameters, the transmission rate, the connection interval and the priority according to the transmission information of the firmware packet fragment and the status information of the transmission device; divide the firmware data packet to be transmitted based on the adjusted fragment division parameters to obtain firmware packet fragments, and transmit each firmware packet fragment based on the adjusted transmission rate, the connection interval and the priority. The above scheme can adaptively and dynamically adjust various parameters in the process of dividing the firmware data packet into fragments for transmission, so as to flexibly respond to factors such as transmission conditions, environmental changes and device status changes during the transmission process, so that the transmission parameters match the actual needs and improve the upgrade efficiency.

[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 A flowchart of a method for upgrading terminal device firmware based on an optimized Bluetooth protocol stack provided in an embodiment of the present application;

[0022] Figure 2 A schematic diagram of the structure of a terminal device firmware upgrade system based on an optimized Bluetooth protocol stack provided in an embodiment of the present application;

[0023] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0025] It should be noted that the terms "first", "second", "third", "fourth", "actual", "preset", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] Figure 1 The present invention provides a flowchart of a method for upgrading the firmware of an edge device based on an optimized Bluetooth protocol stack. The present invention can be applied to the case where the firmware is upgraded based on the optimized Bluetooth protocol. The method can be executed by an edge device firmware upgrade system based on an optimized Bluetooth protocol stack. The edge device firmware upgrade system based on an optimized Bluetooth protocol stack can be implemented in the form of hardware and / or software. The edge device firmware upgrade system based on an optimized Bluetooth protocol stack can be configured in an electronic device. Figure 1 As shown, the method includes:

[0027] S110 , dividing the firmware data packet to be transmitted based on the segment division parameters of the firmware data packet to be transmitted to obtain firmware packet segments, and transmitting each firmware packet segment based on the transmission rate, connection interval and priority.

[0028] Among them, the firmware data packet to be transmitted is a firmware data packet that needs to be transmitted but has not been transmitted yet. The firmware data packet is a compressed image package of the operating system of an electronic device or digital device, which is responsible for controlling the basic functions and operating logic of the hardware device. The firmware data packet is usually stored in the non-volatile memory of the device, such as flash memory, EEPROM or ROM, and still exists after power failure. The fragment division parameter can be a parameter used to divide the firmware data packet, such as the fragment division size, the number of fragment divisions, etc. The firmware package fragment is the fragment obtained after dividing the firmware data packet. The transmission rate is the rate at which the firmware package fragment is transmitted. The connection interval is the time interval between two firmware package fragment transmission events. In BLE (Bluetooth Low Energy) communication, the connection interval refers to the time interval for interaction between the master device (Master) and the slave device (Slave). The minimum value of the connection interval is 7.5 milliseconds, and the minimum increment is 1.25 milliseconds. The selection of the connection interval has a significant impact on communication performance and power consumption. A shorter connection interval can speed up data transmission, but it will increase the power consumption of the device because the device needs to be frequently awakened for communication. Longer connection intervals can significantly save power because the device can sleep for a longer time between connection events, but it will result in slower data transmission. In actual applications, the connection interval can be adjusted according to needs. For example, when a wearable device is connected to a mobile phone, the connection interval can be set shorter during data transmission to quickly transmit local data, and the connection interval can be set longer after the data transmission is completed to reduce power consumption. In addition, BLE also provides other parameters such as SLA_LATENCY (slave delay) and TIMEOUT (connection timeout) to further optimize the balance between communication performance and power consumption. Priority reflects which firmware package fragments are sent first and which firmware package fragments can be sent later.

[0029] In the embodiment of the present application, the initial fragment division parameters, transmission rate, connection interval and priority can be preset. In the initial case, the firmware data packet to be transmitted is divided according to the preset initial fragment division parameters to obtain firmware packet fragments, and the firmware packet fragments are transmitted based on the preset initial transmission rate, connection interval and priority. The fragment division size in the preset fragment division parameters can be set according to the maximum transmission unit supported by the transmission device, the fragment division size needs to be less than or equal to the maximum transmission unit, and the transmission rate, connection interval and priority can be set according to the actual transmission device hardware performance, transmission performance, etc.

[0030] S120. During the transmission process, dynamically adjust the fragment division parameter, the transmission rate, the connection interval, and the priority according to the transmission information of the firmware package fragment and the status information of the transmission device.

[0031] The transmission information of the firmware package fragment may reflect the real-time status of the firmware package fragment during the transmission process, such as the transmission progress, the amount of data transmitted, the amount of data not transmitted, etc. The status information of the transmission device may reflect the data of the current performance status of the transmission device, such as the remaining power, transmission bandwidth, load and other parameters.

[0032] For example, during the transmission process, the transmission information of the firmware package fragments and the status information of the transmission device may be in a dynamic change process. In the case of dynamic changes, the applicable parameters may change. Therefore, the fragment division parameters, transmission rate, connection interval and priority can be adaptively adjusted dynamically according to the dynamically changing transmission information of the firmware package fragments and the status information of the transmission device to adapt to the current transmission situation.

[0033] S130 , dividing the firmware data packet to be transmitted based on the adjusted segment division parameter to obtain firmware packet segments, and transmitting each firmware packet segment based on the adjusted transmission rate, the connection interval, and the priority.

[0034] Exemplarily, the firmware data packets to be transmitted can be divided based on the adjusted fragment division parameters to obtain firmware package fragments, and then the firmware package fragments can be transmitted based on the adjusted transmission rate, connection interval and priority, so as to adaptively adjust the fragment division parameters, transmission rate, connection interval and priority according to actual conditions to improve the transmission efficiency of the firmware package fragments.

[0035] The technical solution of the embodiment of the present application is to divide the firmware data packet to be transmitted based on the fragment division parameters of the firmware data packet to be transmitted to obtain firmware packet fragments, and transmit each firmware packet fragment based on the transmission rate, connection interval and priority; in the process of transmission, dynamically adjust the fragment division parameters, the transmission rate, the connection interval and the priority according to the transmission information of the firmware packet fragment and the status information of the transmission device; divide the firmware data packet to be transmitted based on the adjusted fragment division parameters to obtain firmware packet fragments, and transmit each firmware packet fragment based on the adjusted transmission rate, the connection interval and the priority. The above scheme can adaptively and dynamically adjust various parameters in the process of dividing the firmware data packet into fragments for transmission, so as to flexibly respond to factors such as transmission conditions, environmental changes and device status changes during the transmission process, so that the transmission parameters match the actual needs and improve the upgrade efficiency.

[0036] As a non-limiting implementation method, dynamically adjusting the fragment division parameter according to the transmission information of the firmware package fragment and the state information of the transmission device includes:

[0037] Determine the maximum transmission unit supported by the transmission device, and determine the remaining battery power ratio, load, and signal-to-noise ratio of the transmission device;

[0038] Determining a battery power dynamic adjustment parameter according to the battery remaining power ratio, and making the battery power dynamic adjustment parameter positively correlated with the battery remaining power ratio;

[0039] Determining a load dynamic adjustment parameter according to the load, and making the load dynamic adjustment parameter negatively correlated with the load;

[0040] Determining a signal-to-noise ratio dynamic adjustment parameter according to the signal-to-noise ratio, and making the signal-to-noise ratio dynamic adjustment parameter positively correlated with the signal-to-noise ratio;

[0041] The maximum transmission unit is used as the first reference parameter, the product of the maximum transmission unit and the battery power dynamic adjustment parameter is used as the second reference parameter, the product of the maximum transmission unit and the load dynamic adjustment parameter is used as the third reference parameter, the product of the maximum transmission unit and the signal-to-noise ratio dynamic adjustment parameter is used as the fourth reference parameter, and the minimum value of the first reference parameter, the second reference parameter, the third reference parameter and the fourth reference parameter is taken as the adjusted segment division parameter.

[0042] Specifically, the adjusted segment division parameter may be determined according to the following formula:

[0043] S f =min(S max ,α battery ×S max ,α load ×S max ,α SNR ×S max );

[0044] Among them, S f Divide the size of the adjusted fragment. max Indicates the maximum transmission unit supported by the transmission device; in the case of Bluetooth protocol transmission, the transmission device is the Bluetooth device. battery It is a parameter for dynamically adjusting the battery power, which is positively correlated with the remaining battery power ratio and can be directly expressed by the remaining battery power ratio. load It is a load dynamic adjustment parameter, which is negatively correlated with the load, for example, it can be 1-load size. SNR is a dynamic adjustment parameter for the signal-to-noise ratio, which is positively correlated with the signal-to-noise ratio and can be directly expressed by the signal-to-noise ratio. Based on the above formula, the lower the remaining battery power of the transmission device, the smaller the fragment size; the greater the load, the smaller the fragment size; the smaller the signal-to-noise ratio, the smaller the fragment size. Based on the above formula, the size S of each firmware package fragment is determinedf , the firmware data packets to be transmitted are divided according to the determined size.

[0045] As a non-limiting implementation, dynamically adjusting the transmission rate according to the transmission information of the firmware package fragment and the state information of the transmission device includes:

[0046] The transmission rate is dynamically adjusted based on the following formula:

[0047]

[0048] Where: R data Indicates the dynamically adjusted transmission rate; S f Indicates the fragment division size; S max represents the maximum transmission unit; f(S f ,S max ) represents a regulating factor, as S f Increase, adjust the rate; C max Indicates the maximum bandwidth of the transmission channel; E battery Indicates the current battery power of the transmission device; E max Indicates the maximum battery power of the device; L load Indicates the current load of the device; L max Indicates the maximum load of the device; SNR indicates signal-to-noise ratio;

[0049] in:

[0050]

[0051] Where: γ represents the adjustment coefficient, and its value is between 0 and 1.

[0052] As a non-limiting implementation, dynamically adjusting the connection interval according to the transmission information of the firmware package fragment and the state information of the transmission device includes:

[0053] The connection interval is dynamically adjusted based on the following formula:

[0054] T new =T base ×(1+α1)×(1+α2)×(1+α3)×(1+α4);

[0055]

[0056] Where: T new Indicates the adjusted connection interval; T base represents the default connection interval; α1, α2, α3 and α4 are adjustment factors; S f Indicates the fragment division size; S max Indicates the maximum transmission unit; Ebattery Indicates the current battery power of the transmission device; E max Indicates the maximum battery power of the transmitting device; L load Indicates the current load of the device; L max represents the maximum load of the device; SNR represents the signal-to-noise ratio; R success represents the success rate of firmware package fragment transmission, R loss Indicates the packet loss rate, represents transmission delay; k1, k2, k3, and k4 all represent empirical coefficients; α1 (historical), α2 (historical), α3 (historical), and α4 (historical) all represent historical adjustment factors; The ratio of packet loss rate to transmission delay reflects the relationship between device load and transmission quality.

[0057] As a non-limiting implementation method, dynamically adjusting the priority according to the transmission information of the firmware package fragment and the status information of the transmission device includes:

[0058] The priority is dynamically adjusted based on the following formula:

[0059]

[0060] P priority is the adjusted priority, W1, W2, W3, W4, and W5 all represent weight coefficients; P progress Indicates the transfer progress of the firmware package fragment; P importance Indicates the transmission importance score of the firmware package fragment, ranging from 0 to 1; E battery Indicates the current battery power of the transmission device; L load Indicates the current load of the device; SNR indicates signal-to-noise ratio.

[0061] The transfer progress of the firmware package fragments reflects the current transfer status of each firmware package fragment. If some firmware package fragments have been transferred but not completed, it may cause delays or impacts on the subsequent device recovery and upgrade process. At this time, adjusting the priority can ensure that the above-mentioned firmware package fragments that have not yet completed the transfer, especially important system modules or core functional parts, are transferred first to avoid affecting the key functions of the device.

[0062] For example, if a firmware data package contains multiple system modules, one system module is critical to the core functions of the device, while the functions of other system modules are less important. During the upgrade process, as the transmission progress changes, the firmware package fragments of these important system modules are prioritized to ensure that these firmware package fragments can be upgraded as soon as possible, improving the normal operation of the device.

[0063] Secondly, during the firmware upgrade process, the transmission environment may change, such as signal quality fluctuations, increased device load, or decreased battery power. These factors may affect the stability and speed of data transmission. By dynamically adjusting the priority during the transmission process, the system can adjust the transmission order in real time according to the current environmental status, giving priority to transmitting those data fragments that can be successfully completed and are more important.

[0064] For example, if the current signal is poor, small-capacity firmware package fragments can be transmitted first to reduce the probability of packet loss; when the signal strength is restored, larger firmware package fragments can be transmitted first to improve transmission efficiency.

[0065] As a non-limiting implementation, the process of determining the importance score includes:

[0066] Predetermine the correspondence between different system modules and importance scores;

[0067] The system module to which the firmware package fragment belongs is determined, and the importance score corresponding to the system module to which the firmware package fragment belongs is determined based on the corresponding relationship.

[0068] Exemplarily, it is assumed that the corresponding relationship between different system modules and importance scores is as shown in Table 1.

[0069] Table 1

[0070]

[0071]

[0072] During the transmission of the firmware package fragment, the system module to which the firmware package fragment belongs is determined according to the type or function of the firmware package fragment, and the system module to which the firmware package fragment belongs can be determined by the file name, path, structure of the firmware data packet, etc. The importance score corresponding to the system module is found from the corresponding relationship. For example, if the system module to which the firmware package fragment belongs is the operating system kernel, the importance score can be determined to be 0.9 according to Table 1.

[0073] As a non-limiting implementation, each firmware package fragment is transmitted based on a transmission rate, a connection interval, and a priority, including:

[0074] Allocate corresponding Bluetooth channel resources according to the size, transmission rate, connection interval and priority of the firmware package fragment;

[0075] Multiple firmware package fragments are transmitted in parallel using each Bluetooth channel resource of the Bluetooth protocol.

[0076] As a non-limiting implementation, the method further includes:

[0077] If a transmission failure log returned by the receiving end is received, the failed firmware package fragment that failed to be transmitted is determined according to the transmission failure log, and the number of retransmissions is calculated;

[0078] Based on the number of retransmissions, the failed firmware package segment is retransmitted.

[0079] Exemplarily, if the receiving end fails to transmit the firmware package fragment, it will return a transmission failure log to the transmission device, and the transmission device can determine the firmware package fragment that failed to be transmitted according to the transmission failure log as the failed firmware package fragment. The number of retransmissions is determined based on the current transmission situation. Based on the number of retransmissions, the failed firmware package fragment is retransmitted.

[0080] As a non-limiting implementation, the number of retransmissions is calculated, including:

[0081] The number of retransmissions is calculated based on the following formula:

[0082]

[0083] k3, k4, k5 are all empirical coefficients; N retry,base Indicates the basic retransmission times; R loss Indicates the current packet loss rate; T delay Represents transmission delay; N retry The basic number of retransmissions may be a number of retransmissions pre-set according to actual conditions.

[0084] In the embodiment of the present application, each firmware package fragment is verified in real time during the transmission process to ensure integrity. The receiver verifies whether the received data fragment is complete through methods such as cyclic redundancy check (CRC); after the transmission is successful, the system confirms that the firmware upgrade is completed and the device enters normal working state.

[0085] Figure 2 This is a schematic diagram of the structure of a terminal device firmware upgrade system based on an optimized Bluetooth protocol stack provided in an embodiment of the present application. The system can execute the terminal device firmware upgrade method based on an optimized Bluetooth protocol stack provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. Figure 2 As shown, the system comprises:

[0086] The firmware packet fragment transmission module 210 is used to divide the firmware packet to be transmitted based on the fragment division parameters of the firmware packet to be transmitted, obtain firmware packet fragments, and transmit each firmware packet fragment based on the transmission rate, connection interval and priority;

[0087] A dynamic adjustment module 220, used to dynamically adjust the fragment division parameter, the transmission rate, the connection interval and the priority according to the transmission information of the firmware package fragment and the status information of the transmission device during the transmission process;

[0088] The optimized transmission module 230 is used to divide the firmware data packets to be transmitted based on the adjusted segment division parameters to obtain firmware packet segments, and transmit each firmware packet segment based on the adjusted transmission rate, the connection interval and the priority.

[0089] In the embodiment of the present application, the dynamic adjustment module 220 dynamically adjusts the segment division parameters according to the transmission information of the firmware package segment and the status information of the transmission device, including:

[0090] Determine the maximum transmission unit supported by the transmission device, and determine the remaining battery power ratio, load, and signal-to-noise ratio of the transmission device;

[0091] Determining a battery power dynamic adjustment parameter according to the battery remaining power ratio, and making the battery power dynamic adjustment parameter positively correlated with the battery remaining power ratio;

[0092] Determining a load dynamic adjustment parameter according to the load, and making the load dynamic adjustment parameter negatively correlated with the load;

[0093] Determining a signal-to-noise ratio dynamic adjustment parameter according to the signal-to-noise ratio, and making the signal-to-noise ratio dynamic adjustment parameter positively correlated with the signal-to-noise ratio;

[0094] The maximum transmission unit is used as the first reference parameter, the product of the maximum transmission unit and the battery power dynamic adjustment parameter is used as the second reference parameter, the product of the maximum transmission unit and the load dynamic adjustment parameter is used as the third reference parameter, the product of the maximum transmission unit and the signal-to-noise ratio dynamic adjustment parameter is used as the fourth reference parameter, and the minimum value of the first reference parameter, the second reference parameter, the third reference parameter and the fourth reference parameter is taken as the adjusted segment division parameter.

[0095] In the embodiment of the present application, the dynamic adjustment module 220 dynamically adjusts the transmission rate according to the transmission information of the firmware package fragment and the status information of the transmission device, including:

[0096] The transmission rate is dynamically adjusted based on the following formula:

[0097]

[0098] Where: R data Indicates the dynamically adjusted transmission rate; S f Indicates the fragment division size; Smax represents the maximum transmission unit; f(S f ,S max ) represents a regulating factor, as S f Increase, adjust the rate; C max Indicates the maximum bandwidth of the transmission channel; E battery Indicates the current battery power of the transmission device; E max Indicates the maximum battery power of the device; L load Indicates the current load of the device; L max Indicates the maximum load of the device; SNR indicates signal-to-noise ratio;

[0099] in:

[0100]

[0101] Where: γ represents the adjustment coefficient, and its value is between 0 and 1.

[0102] In the embodiment of the present application, the dynamic adjustment module 220 dynamically adjusts the connection interval according to the transmission information of the firmware package fragment and the status information of the transmission device, including:

[0103] The connection interval is dynamically adjusted based on the following formula:

[0104] T new =T base ×(1+α1)×(1+α2)×(1+α3)×(1+α4);

[0105]

[0106]

[0107] Where: T new Indicates the adjusted connection interval; T base represents the default connection interval; α1, α2, α3 and α4 are adjustment factors; S f Indicates the fragment division size; S max Indicates the maximum transmission unit; E battery Indicates the current battery power of the transmission device; E max Indicates the maximum battery power of the transmitting device; L load Indicates the current load of the device; L max represents the maximum load of the device; SNR represents the signal-to-noise ratio; R success represents the success rate of firmware package fragment transmission, R loss Indicates the packet loss rate, represents transmission delay; k1, k2, k3, and k4 all represent empirical coefficients; α1 (historical), α2 (historical), α3 (historical), and α4 (historical) all represent historical adjustment factors; The ratio of packet loss rate to transmission delay reflects the relationship between device load and transmission quality.

[0108] In the embodiment of the present application, the dynamic adjustment module 220 dynamically adjusts the priority according to the transmission information of the firmware package fragment and the status information of the transmission device, including:

[0109] The priority is dynamically adjusted based on the following formula:

[0110]

[0111] P priority is the adjusted priority, W1, W2, W3, W4, and W5 all represent weight coefficients; P progress Indicates the transfer progress of the firmware package fragment; P importance Indicates the transmission importance score of the firmware package fragment, ranging from 0 to 1; E battery Indicates the current battery power of the transmission device; L load Indicates the current load of the device; SNR indicates signal-to-noise ratio.

[0112] In the embodiment of the present application, the system further includes:

[0113] A corresponding relationship determination module is used to predetermine the corresponding relationship between different system modules and importance scores;

[0114] The importance score determination module is used to determine the system module to which the firmware package fragment belongs, and determine the importance score corresponding to the system module to which the firmware package fragment belongs based on the corresponding relationship.

[0115] In the embodiment of the present application, the optimized transmission module 230 transmits each firmware package fragment based on the transmission rate, connection interval and priority, including:

[0116] Allocate corresponding Bluetooth channel resources according to the size, transmission rate, connection interval and priority of the firmware package fragment;

[0117] Multiple firmware package fragments are transmitted in parallel using each Bluetooth channel resource of the Bluetooth protocol.

[0118] In the embodiment of the present application, the device further includes:

[0119] A retransmission count calculation module is used to determine the failed firmware package fragment that failed to be transmitted according to the transmission failure log if a transmission failure log returned by the receiving end is received, and calculate the retransmission count;

[0120] The retransmission module is used to retransmit the failed firmware package fragment based on the number of retransmissions.

[0121] In the embodiment of the present application, the retransmission number calculation module calculates the retransmission number, including:

[0122] The number of retransmissions is calculated based on the following formula:

[0123]

[0124] k3, k4, k5 are all empirical coefficients; N retry,base Indicates the basic retransmission times; R loss Indicates the current packet loss rate; T delay Represents transmission delay; N retry The adjusted number of retransmissions

[0125] Figure 3 A schematic diagram of an electronic device 10 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0126] like Figure 3 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11 based on communication, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0127] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0128] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as a method for upgrading the end-device firmware based on an optimized Bluetooth protocol stack.

[0129] In some embodiments, the end-device firmware upgrade method based on the optimized Bluetooth protocol stack can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the end-device firmware upgrade method based on the optimized Bluetooth protocol stack described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the end-device firmware upgrade method based on the optimized Bluetooth protocol stack in any other appropriate manner (for example, by means of firmware).

[0130] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0131] Computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable communication system, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0132] In the context of the present application, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.

[0133] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0134] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0135] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0136] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the information expected by the technical solution of this application can be achieved, and this document is not limited here.

[0137] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A method for upgrading the firmware of an edge device based on optimizing the Bluetooth protocol stack, characterized in that: The method comprises: Divide the firmware data packet to be transmitted based on the segment division parameters of the firmware data packet to be transmitted to obtain firmware packet segments, and transmit each firmware packet segment based on the transmission rate, connection interval and priority; During the transmission process, dynamically adjusting the fragment division parameter, the transmission rate, the connection interval and the priority according to the transmission information of the firmware package fragment and the status information of the transmission device; The firmware data packet to be transmitted is divided based on the adjusted segment division parameter to obtain firmware packet segments, and each firmware packet segment is transmitted based on the adjusted transmission rate, the connection interval and the priority.

2. The method according to claim 1, characterized in that Dynamically adjusting the fragment division parameters according to the transmission information of the firmware package fragment and the state information of the transmission device includes: Determine the maximum transmission unit supported by the transmission device, and determine the remaining battery power ratio, load, and signal-to-noise ratio of the transmission device; Determining a battery power dynamic adjustment parameter according to the battery remaining power ratio, and making the battery power dynamic adjustment parameter positively correlated with the battery remaining power ratio; Determining a load dynamic adjustment parameter according to the load, and making the load dynamic adjustment parameter negatively correlated with the load; Determining a signal-to-noise ratio dynamic adjustment parameter according to the signal-to-noise ratio, and making the signal-to-noise ratio dynamic adjustment parameter positively correlated with the signal-to-noise ratio; The maximum transmission unit is used as the first reference parameter, the product of the maximum transmission unit and the battery power dynamic adjustment parameter is used as the second reference parameter, the product of the maximum transmission unit and the load dynamic adjustment parameter is used as the third reference parameter, the product of the maximum transmission unit and the signal-to-noise ratio dynamic adjustment parameter is used as the fourth reference parameter, and the minimum value of the first reference parameter, the second reference parameter, the third reference parameter and the fourth reference parameter is taken as the adjusted segment division parameter.

3. The method according to claim 1, characterized in that Dynamically adjusting the transmission rate according to the transmission information of the firmware package fragment and the state information of the transmission device, including: The transmission rate is dynamically adjusted based on the following formula: Where: R data Indicates the dynamically adjusted transmission rate; S f Indicates the fragment division size; S max represents the maximum transmission unit; f(S f ,S max ) represents a regulating factor, as S f Increase, adjust the rate; C max Indicates the maximum bandwidth of the transmission channel; E battery Indicates the current battery power of the transmission device; E max Indicates the maximum battery power of the device; L load Indicates the current load of the device; L max Indicates the maximum load of the device; SNR indicates signal-to-noise ratio; in: Where: γ represents the adjustment coefficient, and its value is between 0 and 1.

4. The method according to claim 1, characterized in that: Dynamically adjusting the connection interval according to the transmission information of the firmware package fragment and the state information of the transmission device includes: The connection interval is dynamically adjusted based on the following formula: T new =T base ×(1+α1)×(1+α2)×(1+α3)×(1+α4); Where: T new Indicates the adjusted connection interval; T base represents the default connection interval; α1, α2, α3 and α4 are adjustment factors; S f Indicates the fragment division size; S max Indicates the maximum transmission unit; E battery Indicates the current battery power of the transmission device; E max Indicates the maximum battery power of the transmitting device; L load Indicates the current load of the device; L max represents the maximum load of the device; SNR represents the signal-to-noise ratio; R success represents the success rate of firmware package fragment transmission, R loss Indicates the packet loss rate, represents transmission delay; k1, k2, k3, and k4 all represent empirical coefficients; α1 (historical), α2 (historical), α3 (historical), and α4 (historical) all represent historical adjustment factors; The ratio of packet loss rate to transmission delay reflects the relationship between device load and transmission quality.

5. The method according to claim 1, characterized in that: Dynamically adjusting the priority according to the transmission information of the firmware package fragment and the state information of the transmission device includes: The priority is dynamically adjusted based on the following formula: P priority is the adjusted priority, W1, W2, W3, W4, and W5 all represent weight coefficients; P progress Indicates the transfer progress of the firmware package fragment; P importance Indicates the transmission importance score of the firmware package fragment, ranging from 0 to 1; E battery Indicates the current battery power of the transmission device; L load Indicates the current load of the device; SNR indicates signal-to-noise ratio.

6. The method according to claim 5, characterized in that The process of determining the importance score includes: Predetermine the correspondence between different system modules and importance scores; The system module to which the firmware package fragment belongs is determined, and the importance score corresponding to the system module to which the firmware package fragment belongs is determined based on the corresponding relationship.

7. The method according to claim 1, characterized in that Each firmware package fragment is transmitted based on the transmission rate, connection interval and priority, including: Allocate corresponding Bluetooth channel resources according to the size, transmission rate, connection interval and priority of the firmware package fragment; Multiple firmware package fragments are transmitted in parallel using each Bluetooth channel resource of the Bluetooth protocol.

8. The method according to claim 1, characterized in that The method further comprises: If a transmission failure log returned by the receiving end is received, the failed firmware package fragment that failed to be transmitted is determined according to the transmission failure log, and the number of retransmissions is calculated; Based on the number of retransmissions, the failed firmware package segment is retransmitted.

9. The method according to claim 8, characterized in that Calculate the number of retransmissions, including: The number of retransmissions is calculated based on the following formula: k3, k4, k5 are all empirical coefficients; N retry,base Indicates the basic retransmission times; R loss Indicates the current packet loss rate; T delay Represents transmission delay; N retry The adjusted number of retransmissions.

10. A terminal device firmware upgrade system based on an optimized Bluetooth protocol stack, characterized in that: The system comprises: A firmware packet fragment transmission module, used for dividing the firmware packet to be transmitted based on the fragment division parameters of the firmware packet to be transmitted, obtaining firmware packet fragments, and transmitting each firmware packet fragment based on the transmission rate, connection interval and priority; A dynamic adjustment module, used to dynamically adjust the fragment division parameter, the transmission rate, the connection interval and the priority according to the transmission information of the firmware package fragment and the status information of the transmission device during the transmission process; The optimized transmission module is used to divide the firmware data packet to be transmitted based on the adjusted segment division parameters to obtain firmware packet segments, and transmit each firmware packet segment based on the adjusted transmission rate, the connection interval and the priority.

Citation Information

Cited By

  • Data transmission method and device based on communication protocol, equipment and medium

    CN121603924A