Equipment firmware upgrading method and system and storage medium

By using Android mobile devices as edge nodes in device firmware upgrades, dynamically adjusting the priority of upgrade tasks and network bandwidth allocation, the problem of inefficient upgrades in parallel multiple devices is solved, and efficient and stable firmware upgrades are achieved.

CN120128470APending Publication Date: 2025-06-10XIAMEN LEELEN TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510384114.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

The existing equipment firmware upgrade methods are inefficient in the parallel upgrade scenarios of multiple devices, unevenly utilize network resources, and prone to network congestion.

Method used

By using Android mobile devices as edge nodes, using the LAN protocol to obtain device information, and dynamically adjusting the priority, sequence and network bandwidth allocation of upgrade tasks according to the intelligent scheduling algorithm to achieve efficient multi-device firmware upgrades.

Benefits of technology

Improve the efficiency and stability of equipment firmware upgrades, avoid upgrade failure or waste of resources caused by insufficient network bandwidth, and achieve refined management of the upgrade process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120128470A_ABST
    Figure CN120128470A_ABST
Patent Text Reader

Abstract

The invention discloses a device firmware upgrading method and system and a storage medium, and the method comprises the steps: taking an Android mobile terminal device as an edge node, and obtaining all to-be-upgraded devices in the node and the device information of each to-be-upgraded device through a local area network protocol; according to the equipment information and an intelligent scheduling algorithm, dynamically adjusting the upgrade task priority and the upgrade task sequence of each piece of to-be-upgraded equipment and the network bandwidth distribution among the to-be-upgraded equipment; acquiring and judging whether the current network bandwidth is sufficient or not in real time, and if yes, performing equipment firmware upgrading at least according to the dynamic adjustment result; if not, readjusting the network bandwidth allocation between the to-be-upgraded devices, and then continuing to upgrade the device firmware; and monitoring the upgrading states corresponding to all the to-be-upgraded devices and the current network bandwidth in real time, judging whether an abnormal state exists or not, if so, readjusting the upgrading task priority of the abnormal state devices or the network bandwidth distribution among the abnormal state devices, and if not, continuing real-time monitoring until all the to-be-upgraded devices are upgraded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of device firmware upgrade management, and particularly to a device firmware upgrade method, system and storage medium. Background Art

[0002] Currently, most device firmware upgrade methods rely on cloud systems or PC terminals for control and management. However, with the increase in the number of devices and the limitation of network bandwidth, the existing firmware upgrade methods are difficult to efficiently complete the parallel upgrade of multiple devices, and the upgrade process may be inefficient due to bandwidth overload or device conflicts.

[0003] Traditional firmware upgrade methods usually adopt a fixed upgrade order or a "first come, first served" strategy, resulting in uneven utilization of network resources, slow upgrade speed, and even network congestion, especially in the scenario of parallel upgrade of multiple devices, the problem is particularly prominent.

[0004] That is, the existing device firmware upgrade methods have the problems of low upgrade efficiency and stability. Summary of the Invention

[0005] To solve the above technical problems, the present invention provides a device firmware upgrade method, which includes the following steps:

[0006] Taking the Android mobile device as an edge node, obtaining all devices to be upgraded in the node and the device information of each device to be upgraded through the local area network protocol; the device information at least includes firmware version, firmware package size, network bandwidth, device type and device importance;

[0007] According to the device information and the intelligent scheduling algorithm, dynamically adjusting the upgrade task priority, upgrade task order and network bandwidth allocation among the devices to be upgraded;

[0008] Real-time obtaining and judging whether the current network bandwidth is sufficient. If so, at least performing device firmware upgrade according to the dynamic adjustment result; if not, re-adjusting the network bandwidth allocation among the devices to be upgraded and then continuing with the device firmware upgrade;

[0009] Real-time monitoring the upgrade status corresponding to all devices to be upgraded and the current network bandwidth, and judging whether there is an abnormal state. If so, re-adjusting the upgrade task priority of the device in the abnormal state or the network bandwidth allocation among the devices in the abnormal state. If not, continuing with real-time monitoring until all devices to be upgraded are upgraded.

[0010] Optionally, the intelligent scheduling algorithm at least includes the following steps:

[0011] Obtaining the first priority corresponding to the device type of each device to be upgraded, the second priority corresponding to the firmware package size, and the third priority corresponding to the device importance;

[0012] Obtain the current network bandwidth in real time, calculate and determine whether the current bandwidth utilization rate is greater than the bandwidth utilization rate threshold, and obtain the fourth priority corresponding to the network bandwidth according to the judgment result;

[0013] Obtain the first weight corresponding to the device type of each device to be upgraded and the third weight corresponding to the device importance;

[0014] According to the judgment result, obtain the second weight corresponding to the firmware package size and the fourth weight corresponding to the network bandwidth;

[0015] Calculate the upgrade task priorities of each device to be upgraded according to the first priority, second priority, third priority, fourth priority, first weight, second weight, third weight and fourth weight;

[0016] Sort the upgrade task priorities of all devices to be upgraded from high to low to obtain the upgrade task order;

[0017] According to the upgrade task priorities of each device to be upgraded, allocate the network bandwidth among the devices to be upgraded.

[0018] Optionally, obtain the first priority corresponding to the device type of each device to be upgraded, the second priority corresponding to the firmware package size, and the third priority corresponding to the device importance, specifically:

[0019] When the device type is a critical device, the first priority is the first preset value; when the device type is a non-critical device, the first priority is the second preset value, and the first preset value is greater than the second preset value;

[0020] When the firmware package size is greater than the preset file size threshold, the second priority is the third preset value; when the firmware package size is less than or equal to the preset file size threshold, the second priority is the fourth preset value, and the third preset value is greater than the fourth preset value;

[0021] When the device importance is at the first level, the third priority is the fifth preset value; when the device importance is not at the first level, the third priority is the sixth preset value, and the fifth preset value is greater than the sixth preset value;

[0022] Obtain the fourth priority corresponding to the network bandwidth according to the judgment result, specifically:

[0023] If the current bandwidth utilization rate is greater than the bandwidth utilization rate threshold, the fourth priority is the seventh preset value; if the current bandwidth utilization rate is less than or equal to the bandwidth utilization rate threshold, the fourth priority is the eighth preset value.

[0024] Optionally, obtain the first weight corresponding to the device type of each device to be upgraded, the second weight corresponding to the firmware package size, the third weight corresponding to the device importance level, and the fourth weight corresponding to the network bandwidth. Specifically:

[0025] When the device type is a critical device, the first weight is the first preset weight value; when the device type is a non-critical device, the first weight is the second preset weight value, and the first preset weight value is greater than the second preset weight value.

[0026] When the device importance level is level 1, the third weight is the third preset weight value; when the device importance level is not level 1, the third weight is the fourth preset weight value, and the third preset weight value is greater than the fourth preset weight value.

[0027] According to the judgment result, obtain the second weight corresponding to the firmware package size and the fourth weight corresponding to the network bandwidth. Specifically:

[0028] If the current bandwidth utilization rate is greater than the bandwidth utilization rate threshold, the second weight is the fifth preset weight value, and the fourth weight is the sixth preset weight value.

[0029] If the current bandwidth utilization rate is less than or equal to the bandwidth utilization rate threshold, the second weight is the seventh preset weight value, and the fourth weight is the eighth preset weight value.

[0030] The fifth preset weight value is greater than the seventh preset weight value, and the sixth preset weight value is greater than the eighth preset weight value.

[0031] Optionally, determine whether the current network bandwidth is sufficient. Specifically, calculate and determine whether the current bandwidth utilization rate is less than or equal to the bandwidth utilization rate threshold. If so, the current network bandwidth is sufficient; if not, the current network bandwidth is insufficient.

[0032] Re-adjusting the network bandwidth allocation among the devices to be upgraded includes at least the following steps:

[0033] Determine whether there are other edge nodes. If not, reduce the number of devices to be upgraded that are being upgraded in parallel within this edge node. If so, calculate and determine the current bandwidth utilization rate of other edge nodes, and transfer some upgrade tasks to other edge nodes whose current bandwidth utilization rate is less than or equal to the bandwidth utilization rate threshold.

[0034] Optionally, the upgrade status includes at least the upgrade progress, upgrade result, and reason for upgrade failure. The upgrade progress is normal upgrade progress or delayed upgrade progress, and the upgrade result is upgrade failure or upgrade success.

[0035] The abnormal status is upgrade failure or delayed upgrade progress.

[0036] Optionally, the specific method for readjusting the upgrade task priorities of devices in an abnormal state is as follows: obtain and based on the upgrade task priorities of devices in an abnormal state, postpone or cancel at least one upgrade task with an upgrade task priority lower than that of the devices in an abnormal state;

[0037] Readjust the network bandwidth allocation among devices in an abnormal state, specifically one of the following two methods:

[0038] Calculate and determine whether the current bandwidth utilization rate is greater than the bandwidth utilization rate threshold. If so, delay the execution time of the upgrade task of the device in an abnormal state and continue to execute the upgrade task of the device in an abnormal state when the current bandwidth utilization rate is less than or equal to the bandwidth utilization rate threshold;

[0039] Obtain and based on the historical bandwidth utilization rate, predict the bandwidth idle period, and adjust the execution time of the upgrade task of the device in an abnormal state to the bandwidth idle period.

[0040] Optionally, record and analyze historical data, and optimize the intelligent scheduling algorithm in combination with machine learning algorithms;

[0041] The historical data at least includes the upgrade success rate of each device, the network bandwidth utilization rate, and the upgrade time corresponding to each upgrade task.

[0042] Corresponding to the device firmware upgrade method, the present invention provides a device firmware upgrade system, which includes:

[0043] A data acquisition module, which is used to use the Android mobile device as an edge node to obtain all devices to be upgraded and the device information of each device to be upgraded within the node through the local area network protocol; the device information at least includes the firmware version, firmware package size, network bandwidth, device type, and device importance;

[0044] An intelligent scheduling module, which is used to dynamically adjust the upgrade task priorities, upgrade task sequences, and network bandwidth allocation among devices to be upgraded according to the device information and the intelligent scheduling algorithm; it is also used to readjust the network bandwidth allocation among devices to be upgraded and, when there is an abnormal state, readjust the upgrade task priorities of devices in an abnormal state or the network bandwidth allocation among devices in an abnormal state;

[0045] A monitoring module, which is used to obtain and determine in real time whether the current network bandwidth is sufficient, and is also used to monitor in real time the upgrade status corresponding to all devices to be upgraded and the current network bandwidth, and determine whether there is an abnormal state. If not, continue to monitor in real time until all devices to be upgraded are upgraded;

[0046] An upgrade module, which is used to perform device firmware upgrade at least according to the dynamic adjustment result when the current network bandwidth is sufficient; when the current network bandwidth is insufficient, continue to perform device firmware upgrade according to the readjustment result of the network bandwidth allocation among devices to be upgraded.

[0047] In addition, to achieve the above object, the present invention further provides a computer-readable storage medium, on which a device firmware upgrade program is stored. When the device firmware upgrade program is executed by a processor, the steps of the device firmware upgrade method described above are implemented.

[0048] By using an Android mobile device as an edge node, the present invention can directly manage devices within a local area network, reducing the dependence on the cloud or a PC, thereby avoiding the problem of low upgrade efficiency caused by network transmission delay or high server load. Further, through an intelligent scheduling algorithm, the priority, order, and network bandwidth allocation of the upgrade tasks of each device are dynamically adjusted, realizing refined management of the upgrade process and effectively improving the upgrade efficiency and stability.

[0049] The present invention determines the priority by obtaining multi-dimensional information such as device type, firmware package size, and device importance, and dynamically adjusts the weight in combination with the real-time network bandwidth situation, making the upgrade task scheduling more scientific and reasonable.

[0050] The present invention clarifies the corresponding relationship between device type, firmware package size, device importance, and priority. Through the differential setting of preset values, the system can flexibly adjust the priority according to the specific characteristics of the device.

[0051] The present invention obtains the corresponding weights according to the device type and device importance, and dynamically adjusts the weights of the firmware package size and network bandwidth in combination with the network bandwidth usage situation, making the upgrade task scheduling more accurate and further improving the upgrade efficiency and stability.

[0052] The present invention realizes the dynamic optimal allocation of bandwidth resources by judging whether the current network bandwidth is sufficient and taking corresponding adjustment measures when the bandwidth is insufficient, such as reducing the number of devices upgraded in parallel or transferring tasks to other edge nodes.

[0053] By clarifying the specific content of the upgrade status, including upgrade progress, upgrade result, and reason for upgrade failure, etc., the present invention enables the system to comprehensively and meticulously monitor the upgrade situation of each device. For example, when an abnormal state such as upgrade failure or progress delay occurs, the system can timely obtain relevant information and take corresponding adjustment measures, thereby improving the controllability and reliability of the upgrade process, reducing upgrade failures or resource waste caused by abnormal situations, and further enhancing the overall efficiency and stability of device firmware upgrade.

[0054] By readjusting the priority of the upgrade tasks and network bandwidth allocation of devices in an abnormal state, the system of the present invention can effectively cope with various abnormal situations occurring during the upgrade process.

[0055] The present invention optimizes the intelligent scheduling algorithm by recording and analyzing historical data and combining machine learning algorithms, enabling the system to continuously learn and adapt to different network environments and device states. Brief Description of the Drawings

[0056] The drawings described herein are used to provide a further understanding of the present invention and form a part of the present invention. The illustrative embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0057] Figure 1 is a flowchart of an embodiment of the method for upgrading the device firmware of the present invention;

[0058] Figure 2 is a framework diagram of an embodiment of the device firmware upgrade system of the present invention. Detailed Embodiments

[0059] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.

[0060] As Figure 1 shown, a method for upgrading the device firmware of the present invention includes the following steps:

[0061] Taking the Android mobile device as an edge node, obtaining all devices to be upgraded and the device information of each device to be upgraded within the node through the local area network protocol; the device information includes at least the firmware version, firmware package size, network bandwidth, device type, and device importance;

[0062] According to the device information and the intelligent scheduling algorithm, dynamically adjusting the upgrade task priorities, upgrade task sequences, and network bandwidth allocations between the devices to be upgraded;

[0063] Real-time obtaining and judging whether the current network bandwidth is sufficient. If so, performing device firmware upgrade at least according to the dynamic adjustment result; if not, re-adjusting the network bandwidth allocation between the devices to be upgraded and then continuing with the device firmware upgrade;

[0064] Monitor the upgrade status corresponding to all devices to be upgraded and the current network bandwidth in real time, and determine whether there is an abnormal status. If so, readjust the upgrade task priorities of the devices with abnormal status or the network bandwidth allocation among the devices with abnormal status. If not, continue to monitor in real time until all devices to be upgraded are upgraded.

[0065] By using the Android mobile device as an edge node, the present invention can directly manage devices within a local area network, reducing the dependence on the cloud or PC, thereby avoiding the problem of low upgrade efficiency caused by network transmission delay or high server load. Further, through an intelligent scheduling algorithm, the upgrade task priorities, order, and network bandwidth allocation of each device are dynamically adjusted, realizing refined management of the upgrade process and effectively improving the upgrade efficiency and stability.

[0066] In this embodiment, during the firmware upgrade process, the upgrade protocol most suitable for the current device and network environment is automatically selected to reduce the delay of protocol adaptation and data transmission, further improving the efficiency of firmware upgrade.

[0067] Preferably, the local area network protocols at least include mDNS (Multicast DNS) and UPnP (Universal Plug and Play).

[0068] In this embodiment, if the current network bandwidth is sufficient, the number of devices to be upgraded with parallel upgrade can also be increased to maximize the utilization of network bandwidth. For the upgrade tasks with parallel upgrade, multi-thread technology is adopted, and threads are respectively allocated to execute tasks based on the priorities and bandwidth requirements of the devices, thereby improving the execution efficiency of the upgrade tasks.

[0069] In this embodiment, the intelligent scheduling algorithm at least includes the following steps:

[0070] Obtain the first priority corresponding to the device type of each device to be upgraded, the second priority corresponding to the firmware package size, and the third priority corresponding to the importance of the device;

[0071] Obtain the current network bandwidth in real time, calculate and determine whether the current bandwidth utilization rate is greater than the bandwidth utilization rate threshold, and obtain the fourth priority corresponding to the network bandwidth according to the judgment result;

[0072] Obtain the first weight corresponding to the device type of each device to be upgraded and the third weight corresponding to the importance of the device;

[0073] According to the judgment result, obtain the second weight corresponding to the firmware package size and the fourth weight corresponding to the network bandwidth;

[0074] Calculate the upgrade task priority of each device to be upgraded according to the first priority, second priority, third priority, fourth priority, first weight, second weight, third weight, and fourth weight;

[0075] Sort the upgrade task priorities of all devices to be upgraded from high to low to obtain the upgrade task order;

[0076] Allocate network bandwidth among the devices to be upgraded according to the upgrade task priorities of each device to be upgraded.

[0077] The present invention determines the priority by obtaining multi-dimensional information such as device type, firmware package size, and device importance, and dynamically adjusts the weight in combination with the real-time network bandwidth situation, making the upgrade task scheduling more scientific and reasonable.

[0078] Preferably, the bandwidth usage threshold is 70% or 80%.

[0079] In this embodiment, the upgrade task priority of each device to be upgraded is specifically calculated by the following preset formula:

[0080] P task = w 1 ·T type + w 2 ·T size + w 3 ·T importance + w 4 ·T bandwidth ;

[0081] Wherein, P task is the upgrade task priority, w 1 is the first weight, T type is the first priority, w 2 is the second weight, T size is the second priority, w 3 is the third weight, T importance is the third priority, w 4 is the fourth weight, T bandwidth is the fourth priority.

[0082] Preferably, the value ranges of the first weight, second weight, third weight, and fourth weight are all 0-1, and the sum of the first weight, second weight, third weight, and fourth weight is 1.

[0083] In this embodiment, obtaining the first priority corresponding to the device type of each device to be upgraded, the second priority corresponding to the firmware package size, and the third priority corresponding to the device importance is specifically as follows:

[0084] When the device type is a critical device, the first priority is the first preset value; when the device type is a non-critical device, the first priority is the second preset value, and the first preset value is greater than the second preset value.

[0085] When the firmware package size is greater than the preset file size threshold, the second priority is the third preset value; when the firmware package size is less than or equal to the preset file size threshold, the second priority is the fourth preset value, and the third preset value is greater than the fourth preset value.

[0086] When the device importance level is level one, the third priority is the fifth preset value; when the device importance level is not level one, the third priority is the sixth preset value, and the fifth preset value is greater than the sixth preset value.

[0087] Obtain the fourth priority corresponding to the network bandwidth according to the judgment result, specifically:

[0088] If the current bandwidth utilization rate is greater than the bandwidth utilization rate threshold, the fourth priority is the seventh preset value; if the current bandwidth utilization rate is less than or equal to the bandwidth utilization rate threshold, the fourth priority is the eighth preset value.

[0089] The present invention clarifies the corresponding relationship between the device type, the firmware package size, the device importance level and the priority. Through the differential setting of the preset values, the system can flexibly adjust the priority according to the specific characteristics of the device.

[0090] In this embodiment, a higher priority is assigned to critical devices to ensure that these devices complete firmware upgrades first. Specifically, critical devices include at least one of a gateway device, a controller device, a core router, an intelligent hub, a sensor, and an actuator.

[0091] Gateway device: A device that connects a local area network to an external network and is responsible for data transmission and communication management.

[0092] Controller device: The core unit used to control other devices in the system, such as the controller of a smart home system.

[0093] Core router: A device in the network responsible for data routing and traffic management to ensure the normal operation of data transmission.

[0094] Intelligent hub: A device that connects multiple devices and provides centralized management and control.

[0095] Sensors and actuators: Such as temperature control sensors, motion sensors, etc., which have critical functions.

[0096] In this embodiment, a larger firmware package occupies more bandwidth. Bandwidth resources are preferentially provided for devices with large firmware packages (the size of the firmware package is greater than the preset file size threshold) to ensure the data transmission efficiency during the firmware upgrade process and avoid upgrade delays or failures caused by overly large firmware packages. Preferably, the preset file size threshold is 100MB.

[0097] In this embodiment, the first weight corresponding to the device type of each device to be upgraded, the second weight corresponding to the firmware package size, the third weight corresponding to the device importance level, and the fourth weight corresponding to the network bandwidth are obtained as follows:

[0098] When the device type is a critical device, the first weight is the first preset weight value; when the device type is a non-critical device, the first weight is the second preset weight value, and the first preset weight value is greater than the second preset weight value.

[0099] When the device importance level is level one, the third weight is the third preset weight value; when the device importance level is not level one, the third weight is the fourth preset weight value, and the third preset weight value is greater than the fourth preset weight value.

[0100] According to the judgment result, the second weight corresponding to the firmware package size and the fourth weight corresponding to the network bandwidth are obtained as follows:

[0101] If the current bandwidth utilization rate is greater than the bandwidth utilization rate threshold, the second weight is the fifth preset weight value, and the fourth weight is the sixth preset weight value.

[0102] If the current bandwidth utilization rate is less than or equal to the bandwidth utilization rate threshold, the second weight is the seventh preset weight value, and the fourth weight is the eighth preset weight value.

[0103] The fifth preset weight value is greater than the seventh preset weight value, and the sixth preset weight value is greater than the eighth preset weight value.

[0104] The present invention obtains corresponding weights according to the device type and device importance level, and dynamically adjusts the weights of the firmware package size and network bandwidth in combination with the network bandwidth usage situation, making the upgrade task scheduling more accurate and further improving the upgrade efficiency and stability.

[0105] In this embodiment, the devices with a device importance level of level one at least include one of a core controller, a gateway device, a security monitoring system, a sensor device, and a power management device.

[0106] Core controller: A device responsible for managing and coordinating all devices in the system, such as the central controller of a smart home or the main control unit of an Internet of Things platform.

[0107] Gateway device: A bridge connecting different networks and devices, such as a communication gateway between a home network and the cloud or an external system.

[0108] Security monitoring system: including cameras, intrusion detection systems, etc., to ensure the security of the system. Usually, these devices cannot be interrupted during operation.

[0109] Sensor devices: such as temperature and humidity sensors, smoke alarms, etc. Some key sensors are crucial for the monitoring and response of the system.

[0110] Power management devices: such as batteries, UPS, etc., which are devices to ensure continuous power supply for the system.

[0111] Preferably, the first preset value is 1, the third preset value is 0.8, the fifth preset value is 1, and the seventh preset value is 0.5; the first preset weight value is 0.3, the third preset weight value is 0.3, the fifth preset weight value is 0.2, and the sixth preset weight value is 0.2. It should be noted that the preset weight values corresponding to each priority can be set according to needs in actual applications. For example, if the current bandwidth utilization rate is greater than the bandwidth utilization rate threshold, it means that the current network bandwidth is tight, then the fourth weight can be increased to prompt the algorithm to consider network bandwidth allocation more; if there are multiple key devices that need to be upgraded, the first weight and the third weight can be increased to ensure the priority upgrade of these devices. It can be understood that the above values are only examples and do not constitute an improper limitation to the present invention.

[0112] Suppose the device information of a device to be upgraded is as follows:

[0113] The device type is a key device, the firmware package size is 120MB, the device importance level is first level: the current bandwidth utilization rate is 91%. At this time, the first priority is 1, the second priority is 0.8, the third priority is 1, and the fourth priority is 0.5; the first weight is 0.3, the second weight is 0.3, the third weight is 0.2, and the fourth weight is 0.2. Then the calculation result of the upgrade task priority of the device to be upgraded is as follows:

[0114] P task = 0.3×1 + 0.2×0.8 + 0.3×1 + 0.2×0.5 = 0.86.

[0115] In this embodiment, to determine whether the current network bandwidth is sufficient, specifically, it is to calculate and determine whether the current bandwidth utilization rate is less than or equal to the bandwidth utilization rate threshold. If so, the current network bandwidth is sufficient; if not, the current network bandwidth is insufficient.

[0116] The present invention realizes the dynamic optimal allocation of bandwidth resources by determining whether the current network bandwidth is sufficient and taking corresponding adjustment measures when the bandwidth is insufficient, such as reducing the number of parallel upgraded devices or transferring tasks to other edge nodes.

[0117] Preferably, the current bandwidth utilization rate is calculated based on the current total network bandwidth and the current network bandwidth usage, or based on the current total network bandwidth and the sum of the bandwidth requirements of each device. For example, the current bandwidth utilization rate = current network bandwidth usage ÷ current total network bandwidth × 100%; or, the current bandwidth utilization rate = sum of the bandwidth requirements of each device ÷ current total network bandwidth × 100%.

[0118] Among them, the current total network bandwidth: that is, the maximum bandwidth shared by all devices in the local area network.

[0119] Current network bandwidth usage: the sum of the upload and download requirements of all devices.

[0120] Bandwidth requirement of each device: According to the size of the device firmware package, device type, and priority, the bandwidth requirement of each device can be predicted.

[0121] In this embodiment, readjusting the network bandwidth allocation among the devices to be upgraded at least includes the following steps:

[0122] Determine whether there are other edge nodes. If not, reduce the number of devices to be upgraded that are upgraded in parallel within this edge node. If so, calculate and determine the current bandwidth utilization rate of other edge nodes, and transfer some upgrade tasks to other edge nodes whose current bandwidth utilization rate is less than or equal to the bandwidth utilization rate threshold.

[0123] In this embodiment, the upgrade status at least includes the upgrade progress, upgrade result, and reason for upgrade failure. The upgrade progress is normal upgrade progress or delayed upgrade progress, and the upgrade result is upgrade failure or upgrade success;

[0124] The abnormal status is upgrade failure or delayed upgrade progress.

[0125] By clearly defining the specific content of the upgrade status, including the upgrade progress, upgrade result, and reason for upgrade failure, etc., the system of the present invention can comprehensively and meticulously monitor the upgrade situation of each device. For example, when an abnormal status such as upgrade failure or progress delay occurs, the system can promptly obtain relevant information and take corresponding adjustment measures, thereby improving the controllability and reliability of the upgrade process, reducing upgrade failures or resource waste caused by abnormal situations, and further enhancing the overall efficiency and stability of device firmware upgrade.

[0126] In this embodiment, readjusting the priority of the upgrade tasks of devices in the abnormal status specifically means: obtaining and based on the priority of the upgrade tasks of devices in the abnormal status, postponing or canceling at least one upgrade task whose priority is lower than that of the devices in the abnormal status;

[0127] Readjusting the network bandwidth allocation among devices in the abnormal status is specifically one of the following two methods:

[0128] Calculate and determine whether the current bandwidth utilization rate is greater than the bandwidth utilization rate threshold. If so, delay the execution time of the upgrade task for the device in the abnormal state, and continue to execute the upgrade task for the device in the abnormal state when the current bandwidth utilization rate is less than or equal to the bandwidth utilization rate threshold;

[0129] Obtain and predict the bandwidth idle period based on the historical bandwidth utilization rate, and adjust the execution time of the upgrade task for the device in the abnormal state to the bandwidth idle period.

[0130] Through readjusting the upgrade task priorities of devices in the abnormal state and the network bandwidth allocation, the system of the present invention can effectively cope with various abnormal situations occurring during the upgrade process.

[0131] In this embodiment, it further includes: recording and analyzing historical data, and optimizing the intelligent scheduling algorithm in combination with machine learning algorithms;

[0132] The historical data at least includes the upgrade success rate of each device, the network bandwidth utilization rate, and the upgrade time corresponding to each upgrade task.

[0133] By recording and analyzing historical data and optimizing the intelligent scheduling algorithm in combination with machine learning algorithms, the present invention enables the system to continuously learn and adapt to different network environments and device states.

[0134] In other embodiments of the present invention, outside the edge nodes, a hybrid architecture combining the cloud and edge computing can also be adopted to allocate some tasks to the cloud for processing to cope with the network pressure brought about by large-scale device upgrades.

[0135] As Figure 2 shown, the present invention also correspondingly provides a device firmware upgrade system, which includes:

[0136] A data acquisition module 10, configured to use an Android mobile device as an edge node to obtain all devices to be upgraded and the device information of each device to be upgraded within the node through a local area network protocol; the device information at least includes the firmware version, the firmware package size, the network bandwidth, the device type, and the device importance;

[0137] An intelligent scheduling module 20, configured to dynamically adjust the upgrade task priorities, the upgrade task order, and the network bandwidth allocation among the devices to be upgraded according to the device information and the intelligent scheduling algorithm; and is also configured to readjust the network bandwidth allocation among the devices to be upgraded, and when there is an abnormal state, readjust the upgrade task priority of the device in the abnormal state or the network bandwidth allocation among the devices in the abnormal state;

[0138] The monitoring module 30 is used to obtain and judge in real time whether the current network bandwidth is sufficient, and is also used to monitor in real time the upgrade status corresponding to all devices to be upgraded and the current network bandwidth, and judge whether there is an abnormal status. If not, continue to monitor in real time until all devices to be upgraded are upgraded;

[0139] The upgrade module 40 is used to perform device firmware upgrade at least according to the dynamic adjustment result when the current network bandwidth is sufficient; when the current network bandwidth is insufficient, continue to perform device firmware upgrade according to the readjustment result of the network bandwidth allocation among the devices to be upgraded.

[0140] Preferably, the device firmware upgrade system further includes an optimization module for recording and analyzing historical data and optimizing the intelligent scheduling algorithm in combination with machine learning algorithms;

[0141] The historical data at least includes task information (such as the upgrade success rate of each device, task arrival time, execution duration corresponding to each upgrade task, priority, etc.), resource usage (such as network bandwidth utilization rate, available resource quantity, load rate of each resource), scheduling decisions and results (such as task scheduling order, completion time, waiting time). By learning in real time the best scheduling scheme under different network environments and device states, the algorithm can continuously improve the accuracy of scheduling decisions, thereby further improving the efficiency and success rate of the upgrade process. By recording and analyzing historical data and using these data to train the intelligent scheduling algorithm; based on the historical upgrade task data of each device and the real-time network bandwidth, the machine learning algorithm can intelligently predict the upgrade requirements of each device, optimize the allocation of upgrade tasks and resource scheduling, and ensure that each device is upgraded at the best time.

[0142] In this embodiment, the deep reinforcement learning algorithm (taking the deep Q-network DQN as an example) is incorporated into the optimization process of the intelligent scheduling algorithm to improve the intelligence and efficiency of scheduling decisions. The whole method includes stages such as historical data collection and storage, data preprocessing and feature construction, deep reinforcement learning environment modeling, DQN model construction and training, model deployment and real-time scheduling optimization, and online learning and feedback optimization mechanism, which are described in detail as follows.

[0143] Historical data collection and storage: The system continuously collects historical data related to scheduling during operation and stores it for model training. The collected data is obtained through methods such as log recording and sensor monitoring and stored in a database or distributed storage system. The role of historical data is to provide real-scene samples for training the deep reinforcement learning model, help the model understand typical scheduling situations and performance indicators, and lay a foundation for subsequent modeling and training.

[0144] Data preprocessing and feature construction: For the collected original historical data, necessary cleaning and preprocessing are carried out to ensure data quality and consistency. The preprocessing steps include removing abnormal or incomplete data records, normalizing or standardizing data with different dimensions, and sorting the scheduling event sequence in chronological order. On this basis, feature vectors are extracted and constructed according to the requirements of the scheduling scenario to describe the state of the scheduling system and task characteristics. These features can include the number of tasks currently waiting for scheduling, the remaining processing time of each task, the idle / occupied status of resources, the current time slice of the system, etc. Through feature construction, the original data is converted into a numerical vector or tensor representation that can be used as the input of the model, ensuring that the deep reinforcement learning model can extract effective information from it to represent the scheduling state.

[0145] Deep reinforcement learning environment modeling: The intelligent scheduling problem is modeled as a Markov Decision Process (MDP) to apply deep reinforcement learning algorithms for solution. In this model, elements such as the state space, action space, and reward function are defined. The state space S consists of information that can completely describe the state of the scheduling system at a certain moment, such as the previously constructed feature vector, which contains the relevant features of all current tasks waiting for scheduling and resources; the action space A is defined as the set of decisions that the scheduling algorithm can execute, such as selecting a task from the waiting queue and assigning it to a certain resource for execution, or deciding the priority order among several tasks. Each action represents a specific scheduling decision operation; the reward function R is set according to the effect of the scheduling decision, that is, after executing an action, a reward value or penalty value is given according to the impact of the scheduling result on the predetermined goal. For example, reducing the task completion time and improving resource utilization can be regarded as positive rewards, while long waiting times or wasted resource idleness caused by scheduling are given negative rewards. By reasonably designing the reward function, the policy that maximizes the cumulative reward corresponds to the optimal scheduling performance. The above environment modeling determines the "state-action-reward" relationship when the agent (i.e., the deep reinforcement learning agent) interacts with the scheduling environment, and constructs a simulation environment or mathematical model for DQN model training and decision-making.

[0146] DQN model construction and training: A DQN model is constructed using a deep neural network to approximate the state-action value function Q(s,a). The network structure of the DQN model can be designed according to the characteristics of the scheduling problem, and generally includes an input layer, several hidden layers, and an output layer. The input layer accepts a feature vector representing the scheduling state; the hidden layer can use a fully connected neuron layer, or combine structures such as a convolutional layer and a recurrent unit to extract the temporal or spatial relationship in the state features; the output layer corresponds to each candidate action in the action space, and outputs the estimated Q value of each action in the current state. Through this network structure, the DQN agent can predict the potential rewards of different scheduling actions for any given state. During the model training process, the Q learning strategy of reinforcement learning is used to continuously optimize the network parameters. Specifically, the DQN agent repeatedly interacts with the scheduling environment, generating a large number of state transition samples (state transition), each of which contains the current state, the selected action, the reward obtained by executing the action, and the next state to which the environment transfers (s,a,r,s ’ ). These samples are stored in the experience replay buffer to disrupt the correlation before being used for training. During training, a small batch of samples are randomly selected from the experience pool as the training set, and the Q value is updated using the Bellman equation to calculate the target Q value of each sample:

[0147] r+γmax a′ Q target (s ’ ,a ’ );

[0148] Where γ is the discount factor, s ’ is the new state, a ’ For the next move, Q target Represents the target network's estimate of the Q value of the next state. Then, the mean square error between the predicted Q value of action a in state s by the current network (policy network) and the above target Q value is used as the loss for back propagation to adjust the network weights. To ensure the stability of training, DQN introduces a target network mechanism, that is, maintaining a delayed copy of the policy network parameters as the target network for calculating the target Q value. The target network is synchronously updated to the new parameters of the policy network at fixed steps, thereby avoiding instability caused by violent fluctuations in the target value during training. In addition, the ε-greedy strategy is also used for action selection during the training phase to explore different scheduling actions with a certain probability and avoid being limited to the current strategy, thereby balancing exploration and utilization. Through repeated iterations of the above training mechanism, the parameters of the DQN model gradually converge, and the Q value output by it can accurately evaluate the long-term benefits of each scheduling action, and finally obtain an approximately optimal scheduling strategy.

[0149] Model Deployment and Real-time Scheduling Optimization: Integrate the converged DQN model after training into the actual scheduling system for real-time decision support. Specifically, when the scheduling system is running, the scheduling module will obtain the current state characteristics of the system in real time (such as the current list of unprocessed tasks, the idle status of each resource, etc.), and input this state into the deployed DQN model. The DQN model outputs the Q-values of all optional scheduling actions based on the input state characteristics, and the scheduling module selects the scheduling decision corresponding to the action with the highest Q-value (for example, selecting a task with the highest priority and assigning it to an idle resource for execution). The selected scheduling action is then executed in the system immediately to schedule the task to run. In this way, the DQN model is embedded in the scheduling process as an intelligent decision-making unit, providing optimized decision-making suggestions at each scheduling decision point, replacing or assisting traditional rule algorithms. Since the model has been trained extensively to maximize the cumulative reward, its decisions implicitly optimize the scheduling performance metrics, such as reducing the average waiting time of tasks, increasing the system throughput and resource utilization, etc. Therefore, the deployed scheduling system can make more optimal scheduling decisions in real time, achieving intelligent scheduling optimization.

[0150] An embodiment of the present invention also provides a computer-readable storage medium. This computer-readable storage medium can be the computer-readable storage medium contained in the memory in the above embodiment; it can also exist independently and be a computer-readable storage medium not assembled into the device. At least one instruction is stored in the computer-readable storage medium, and the instruction is loaded and executed by the processor to implement Figure 1 the device firmware upgrade method shown. The computer-readable storage medium can be a read-only memory, a disk, an optical disc, etc.

[0151] It should be noted that the embodiments in this specification are all described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the system embodiments and the storage medium embodiments, since they are basically similar to the method embodiments, they are described relatively simply, and the relevant parts can refer to the partial description of the method embodiments.

[0152] Moreover, in this article, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or device including the element.

[0153] The foregoing description illustrates and describes preferred embodiments of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein, and should not be regarded as excluding other embodiments. Instead, it can be used in various other combinations, modifications, and environments, and can be altered within the scope of the inventive concept herein through the above teachings or the skills or knowledge in related fields. Any alterations and changes made by those skilled in the art without departing from the spirit and scope of the present invention shall fall within the protection scope of the appended claims of the present invention.

Claims

1. A device firmware upgrade method, characterized in that: The following steps are involved: The Android mobile device is used as an edge node, and the device information of all devices to be upgraded and each device to be upgraded in the node is obtained through the local area network protocol; the device information at least includes the firmware version, firmware package size, network bandwidth, device type and device importance; Dynamically adjust the upgrade task priority, upgrade task sequence and network bandwidth allocation between devices to be upgraded based on device information and intelligent scheduling algorithms; Obtain and determine in real time whether the current network bandwidth is sufficient. If so, perform device firmware upgrade at least according to the dynamic adjustment result; if not, readjust the network bandwidth allocation between the devices to be upgraded and continue the device firmware upgrade; Monitor the upgrade status and current network bandwidth of all devices to be upgraded in real time, and determine whether there is an abnormal state. If so, readjust the upgrade task priority of the abnormal state device or the network bandwidth allocation between the abnormal state devices. If not, continue real-time monitoring until all devices to be upgraded are upgraded.

2. The device firmware upgrade method according to claim 1, characterized in that: The intelligent scheduling algorithm includes at least the following steps: Obtain the first priority corresponding to the device type of each device to be upgraded, the second priority corresponding to the firmware package size, and the third priority corresponding to the device importance; Obtain the current network bandwidth in real time, calculate and determine whether the current bandwidth usage is greater than the bandwidth usage threshold, and obtain the fourth priority corresponding to the network bandwidth according to the determination result; Obtaining a first weight corresponding to the device type of each device to be upgraded and a third weight corresponding to the device importance; According to the determination result, a second weight corresponding to the firmware package size and a fourth weight corresponding to the network bandwidth are obtained; Calculate the upgrade task priority of each device to be upgraded according to the first priority, the second priority, the third priority, the fourth priority, the first weight, the second weight, the third weight and the fourth weight; Sort the upgrade task priorities of all devices to be upgraded from high to low to obtain the upgrade task sequence; The network bandwidth between the devices to be upgraded is allocated according to the upgrade task priority of each device to be upgraded.

3. The device firmware upgrade method according to claim 2, characterized in that: Get the first priority corresponding to the device type of each device to be upgraded, the second priority corresponding to the firmware package size, and the third priority corresponding to the device importance, specifically: When the device type is a critical device, the first priority is a first preset value, and when the device type is a non-critical device, the first priority is a second preset value, and the first preset value is greater than the second preset value; When the firmware package size is greater than the preset file size threshold, the second priority is the third preset value; when the firmware package size is less than or equal to the preset file size threshold, the second priority is the fourth preset value, and the third preset value is greater than the fourth preset value; When the importance of the device is level one, the third priority is the fifth preset value; when the importance of the device is not level one, the third priority is the sixth preset value, and the fifth preset value is greater than the sixth preset value; The fourth priority corresponding to the network bandwidth is obtained according to the judgment result, which is: If the current bandwidth usage is greater than the bandwidth usage threshold, the fourth priority is the seventh preset value; if the current bandwidth usage is less than or equal to the bandwidth usage threshold, the fourth priority is the eighth preset value.

4. The device firmware upgrade method according to claim 2, characterized in that: The first weight corresponding to the device type of each device to be upgraded, the second weight corresponding to the firmware package size, the third weight corresponding to the device importance, and the fourth weight corresponding to the network bandwidth are obtained, specifically: When the device type is a critical device, the first weight is a first preset weight value, and when the device type is a non-critical device, the first weight is a second preset weight value, and the first preset weight value is greater than the second preset weight value; When the importance of the device is level one, the third weight is a third preset weight value; when the importance of the device is not level one, the third weight is a fourth preset weight value, and the third preset weight value is greater than the fourth preset weight value; According to the judgment result, the second weight corresponding to the firmware package size and the fourth weight corresponding to the network bandwidth are obtained, specifically: If the current bandwidth usage is greater than the bandwidth usage threshold, the second weight is the fifth preset weight value, and the fourth weight is the sixth preset weight value; If the current bandwidth usage is less than or equal to the bandwidth usage threshold, the second weight is the seventh preset weight value, and the fourth weight is the eighth preset weight value; The fifth preset weight value is greater than the seventh preset weight value, and the sixth preset weight value is greater than the eighth preset weight value.

5. The device firmware upgrade method according to claim 1, characterized in that: Determine whether the current network bandwidth is sufficient, specifically by calculating and determining whether the current bandwidth usage is less than or equal to the bandwidth usage threshold. If so, the current network bandwidth is sufficient; if not, the current network bandwidth is insufficient; Readjusting the network bandwidth allocation between the devices to be upgraded includes at least the following steps: Determine whether there are other edge nodes. If not, reduce the number of devices to be upgraded in parallel in this edge node. If so, calculate and determine the current bandwidth usage of other edge nodes, and transfer part of the upgrade tasks to other edge nodes whose current bandwidth usage is less than or equal to the bandwidth usage threshold.

6. The device firmware upgrade method according to claim 1, characterized in that: The upgrade status at least includes the upgrade progress, upgrade result and upgrade failure reason. The upgrade progress is normal or delayed, and the upgrade result is upgrade failure or upgrade success. The abnormal status is upgrade failure or upgrade progress delay.

7. The device firmware upgrade method according to claim 1, characterized in that: Re-adjusting the upgrade task priority of the abnormal state device specifically includes: obtaining and, according to the upgrade task priority of the abnormal state device, postponing or canceling at least one upgrade task whose upgrade task priority is lower than that of the abnormal state device; Re-adjust the network bandwidth allocation between abnormal devices, specifically in one of the following two ways: Calculate and determine whether the current bandwidth usage is greater than the bandwidth usage threshold. If so, delay the execution time of the upgrade task of the abnormal state device, and continue to execute the upgrade task of the abnormal state device when the current bandwidth usage is less than or equal to the bandwidth usage threshold; Obtain and predict bandwidth idle periods based on historical bandwidth usage, and adjust the upgrade task execution time of abnormal status devices to the bandwidth idle period.

8. The device firmware upgrade method according to claim 1, characterized in that: Also includes: Record and analyze historical data, and optimize intelligent scheduling algorithms in combination with machine learning algorithms; The historical data at least includes the upgrade success rate of each device, the network bandwidth usage rate and the upgrade time corresponding to each upgrade task.

9. A device firmware upgrade system, characterized in that: include: The data acquisition module is used to use the Android mobile device as an edge node to obtain all devices to be upgraded in the node and the device information of each device to be upgraded through the local area network protocol; the device information at least includes the firmware version, firmware package size, network bandwidth, device type and device importance; The intelligent scheduling module is used to dynamically adjust the upgrade task priority, upgrade task sequence and network bandwidth allocation between the devices to be upgraded according to the device information and the intelligent scheduling algorithm; it is also used to readjust the network bandwidth allocation between the devices to be upgraded and, when an abnormal state exists, readjust the upgrade task priority of the abnormal state device or the network bandwidth allocation between the abnormal state devices; The monitoring module is used to obtain and determine in real time whether the current network bandwidth is sufficient, and is also used to monitor in real time the upgrade status and current network bandwidth of all devices to be upgraded, and determine whether there is an abnormal state. If not, continue to monitor in real time until all devices to be upgraded are upgraded; An upgrade module, used to upgrade the device firmware at least according to the dynamic adjustment result when the current network bandwidth is sufficient; When the current network bandwidth is insufficient, the device firmware upgrade is continued based on the result of readjustment of the network bandwidth allocation between the devices to be upgraded.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a device firmware upgrade program, and when the device firmware upgrade program is executed by the processor, the steps of the device firmware upgrade method according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Multi-patrolling device software collaborative upgrading method, device, equipment and medium

    CN121934865A

  • A method, apparatus, equipment and medium for collaborative software upgrade of multiple loitering aircraft

    CN121934865B

  • Batch firmware updating method and system for energy storage power station equipment

    CN122152341A