Firmware upgrading method, system and device, computer equipment and storage medium
By determining the upgrade priority in the photovoltaic energy storage system based on the equipment's firmware upgrade package size and communication bandwidth, and optimizing the upgrade sequence using the target firmware upgrade strategy, the problem of inefficient firmware upgrade in the photovoltaic energy storage system is solved, and more efficient firmware upgrades are achieved.
Patent Information
- Application Number
- CN202510223598.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2045-02-27
AI Technical Summary
In photovoltaic energy storage systems, the increase in the number and types of equipment makes it difficult to manage bandwidth allocation and upgrade sequence during firmware upgrade, resulting in inefficient upgrades.
By obtaining the firmware upgrade package and communication bandwidth of each slave device, determine the upgrade priority of each device, and filter out the highest priority device according to the priority to perform firmware upgrade. For the remaining devices, determine the target firmware upgrade policy to be the policy with the shortest firmware upgrade time, and then perform firmware upgrade.
Improves the efficiency of firmware upgrades, ensuring that firmware upgrades to all devices are completed in the shortest possible time, and avoids the problem of slow update speed or failure of updates due to bandwidth limitations.
Smart Images

Figure CN119718386A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of firmware upgrade, and in particular to a firmware upgrade method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] With the increasing popularity of photovoltaic energy storage systems, the number and types of devices in the system are constantly increasing. These devices have significant differences in communication bandwidth and processing capabilities. When the device firmware needs to be upgraded, there are great challenges in bandwidth allocation and firmware upgrade sequence.
[0003] In traditional solutions, a unified upgrade strategy is usually adopted. The transmission method and installation process for firmware upgrades of each device are unified. All devices receive the update instruction at the same time, start downloading and installing the firmware, and upgrade to the same firmware version at the same time.
[0004] However, since firmware updates need to be transmitted over the network, especially in IoT devices such as optical storage devices, if the number of devices is too large, the network bandwidth will be limited, resulting in slower update speeds or even update failures. Therefore, the traditional firmware upgrade method has a low upgrade efficiency. Summary of the invention
[0005] Based on this, it is necessary to provide a firmware upgrade method, system, apparatus, computer device, computer-readable storage medium and computer program product that can improve the efficiency of firmware upgrade in response to the above technical problems.
[0006] In a first aspect, the present application provides a firmware upgrade method. The method comprises:
[0007] Obtain the firmware upgrade package and communication bandwidth of each slave device;
[0008] Determining the upgrade priority of each slave device according to the size of the firmware upgrade package and the communication bandwidth;
[0009] Screening out the first slave device with the highest upgrade priority, and performing firmware upgrade on the first slave device;
[0010] For the remaining second slave devices except the first slave device, determining a target firmware upgrade policy for the second slave device, wherein the target firmware upgrade policy is a firmware upgrade policy with the shortest firmware upgrade time;
[0011] According to the target firmware upgrade policy, the firmware of the second slave device is upgraded.
[0012] In one embodiment, determining the target firmware upgrade strategy of the second slave device includes:
[0013] Determine an initial upgrade state of the second slave device as a current upgrade state, wherein the initial upgrade state indicates that the second slave device has not completed the firmware upgrade;
[0014] Determine a candidate upgrade state for the next time step, and determine a state transfer equation value corresponding to each candidate upgrade state according to a preset state transfer equation, wherein the state transfer equation value represents the number of second slave devices that have completed the firmware upgrade in the candidate upgrade state;
[0015] Determining the upgrade state of the next time step according to the state transfer equation value corresponding to each candidate upgrade state;
[0016] The upgrade state of the next time step is updated to the current upgrade state, and the step of determining the candidate upgrade state of the next time step is returned until the current upgrade state is the target upgrade state, and the upgrade state of the second slave device at each time step is obtained, wherein the target upgrade state indicates that the second slave device has completed the firmware upgrade, and the upgrade state indicates the upgrade status of the second slave device at each time step;
[0017] According to the upgrade status of each time step, a target firmware upgrade strategy of the second slave device is determined.
[0018] In one embodiment, the method further comprises:
[0019] Determine, according to the size of the firmware upgrade package of the second slave device, the communication bandwidth, and a preset evaluation function, the evaluation function value corresponding to each of the candidate upgrade states, the preset evaluation function comprising an actual cost function and an estimated cost function, the actual cost function representing the communication bandwidth allocated to the second slave device, and the estimated cost function representing the remaining firmware upgrade time of the second slave device;
[0020] The upgrade state of the next time step is determined according to the state transfer equation value corresponding to the candidate upgrade state and the evaluation function value corresponding to each candidate upgrade state.
[0021] In one embodiment, determining the upgrade priority of each slave device according to the size of the firmware upgrade package and the communication bandwidth includes:
[0022] For each slave device, calculating a ratio of a communication bandwidth of the slave device to a size of the firmware upgrade package;
[0023] Based on the ratio, an upgrade priority of the slave device is determined, and the ratio is positively correlated with the upgrade priority.
[0024] In one embodiment, screening out the first slave device with the highest upgrade priority and performing firmware upgrade on the first slave device includes:
[0025] Filter out the first slave device with the highest upgrade priority;
[0026] In the case that the number of the screened first slave devices is multiple, determining the firmware upgrade order of the first slave devices according to the sizes of the firmware upgrade packages of the first slave devices;
[0027] The firmware of the first slave device is upgraded according to the firmware upgrade sequence of the first slave device.
[0028] In a second aspect, the present application also provides a firmware upgrade system. The system includes a master device and a plurality of slave devices connected to each other;
[0029] The master control device is used to obtain a firmware upgrade package and a communication bandwidth of each slave device, determine an upgrade priority of each slave device according to the size of the firmware upgrade package and the communication bandwidth, screen out a first slave device with the highest upgrade priority, send the firmware upgrade package of the first slave device to the first slave device, and allocate a communication bandwidth to the first slave device; for the second slave devices remaining except the first slave device, determine a target firmware upgrade strategy of the second slave device, the target firmware upgrade strategy is a firmware upgrade strategy with the shortest firmware upgrade time, send the firmware upgrade package of the second slave device to the second slave device according to the target firmware upgrade strategy, and allocate a communication bandwidth to the second slave device;
[0030] The slave device is used to receive the firmware upgrade package, perform integrity check on the firmware upgrade package, and install the firmware upgrade package if the firmware upgrade package passes the integrity check.
[0031] In one embodiment, the system also includes a networking module connected to the master control device, which is used to obtain the firmware version information of each of the slave devices and the latest firmware version information. When the firmware version information does not match the latest firmware version information, the firmware upgrade package of each of the slave devices is obtained, and the firmware upgrade package of each of the slave devices is sent to the master control device.
[0032] In a third aspect, the present application also provides a firmware upgrade device. The device comprises:
[0033] A data acquisition module is used to obtain the firmware upgrade package and communication bandwidth of each slave device;
[0034] A priority determination module, used to determine the upgrade priority of each slave device according to the size of the firmware upgrade package and the communication bandwidth;
[0035] A first firmware upgrade module, used for screening out the first slave device with the highest upgrade priority, and performing firmware upgrade on the first slave device;
[0036] a policy formulation module, configured to determine, for the remaining second slave devices except the first slave device, a target firmware upgrade policy for the second slave device, wherein the target firmware upgrade policy is a firmware upgrade policy with the shortest firmware upgrade time;
[0037] The second firmware upgrade module is used to upgrade the firmware of the second slave device according to the target firmware upgrade policy.
[0038] In a fourth aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps in the above-mentioned firmware upgrade method embodiments are implemented.
[0039] In a fifth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the above-mentioned firmware upgrade method embodiments are implemented.
[0040] In a sixth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned firmware upgrade method embodiments are implemented.
[0041] The above-mentioned firmware upgrade method, system, device, computer equipment, storage medium and computer program product obtain the firmware upgrade package size and communication bandwidth of each slave device, then determine the upgrade priority of each slave device, screen and then select the first slave device with the highest upgrade priority, and perform firmware upgrade on the first slave device. Since the firmware upgrade package size and communication bandwidth of different slave devices may be different, the upgrade priority is determined by the firmware upgrade package size and communication bandwidth, which can be more in line with the specific characteristics of the slave device. Further, when determining the target firmware upgrade strategy for the second slave device other than the first slave device, the firmware upgrade strategy with the shortest firmware upgrade time is selected as the target firmware upgrade strategy, and then when performing firmware upgrade on the second slave device, the firmware upgrade of the second slave device can be completed in the shortest possible time, thereby comprehensively improving the efficiency of firmware upgrade of slave devices in the entire system. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1An application environment diagram of a firmware upgrade method in an embodiment;
[0043] Figure 2 A flowchart of a firmware upgrade method in an embodiment;
[0044] Figure 3 A schematic diagram of a process for dynamically planning and determining a target firmware upgrade strategy in an embodiment;
[0045] Figure 4 is a flowchart of a firmware upgrade method in another embodiment;
[0046] Figure 5 is a flowchart of a firmware upgrade method in yet another embodiment;
[0047] Figure 6 A flowchart of a firmware upgrade method in a detailed embodiment;
[0048] Figure 7 A structural block diagram of a firmware upgrade system in one embodiment;
[0049] Figure 8 is a structural block diagram of a firmware upgrade system in another embodiment;
[0050] Fig. 9 is a structural block diagram of a firmware upgrade device in an embodiment;
[0051] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] The firmware upgrade method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the master device 102 communicates with the slave device 104 through a network. The data storage system can store data that the master device 102 needs to process. The data storage system can be integrated on the master device 102, or placed on the cloud or other network servers.
[0054] Specifically, the master device 102 can obtain the firmware upgrade package and communication bandwidth of each slave device 104 from the data storage system, and then determine the upgrade priority of each slave device 104 according to the size of the firmware upgrade package and the communication bandwidth. Further, the first slave device with the highest upgrade priority among the slave devices 104 is screened out, and the firmware of the first slave device is upgraded. Then, the master device 102 determines the firmware upgrade strategy with the shortest firmware upgrade time for the remaining second slave devices except the first slave device as the target firmware upgrade strategy, and upgrades the firmware of the second slave device according to the target firmware upgrade strategy.
[0055] Taking a photovoltaic energy storage system as an example, the slave device 104 may be, but is not limited to, an inverter, a battery management system, a maximum power point tracking controller, etc. The master device 102 may be implemented by an independent server or a server cluster consisting of multiple servers.
[0056] In one embodiment, Figure 2 As shown, a firmware upgrade method is provided. The following explanation is given by taking the method applied to a photovoltaic energy storage system as an example. Figure 1 Taking the master control device 102 in the example as an example, the following steps are included:
[0057] S100, obtaining a firmware upgrade package and a communication bandwidth of each slave device.
[0058] Among them, in the photovoltaic energy storage system, the master device can be a central monitoring unit, and the slave device can be a battery management system, inverter and other devices. The master device and the slave device can be elected by the master-slave election algorithm. Firmware refers to the device "driver" stored inside the device. It is a software embedded in the hardware device and is usually stored in the non-volatile memory inside the device. The firmware upgrade package is a software package used to update the device firmware. It contains the binary file of the new firmware version and some configuration files and instruction documents required for the update. Communication bandwidth refers to the amount of data that can be transmitted by the communication line or communication equipment in a unit of time. Under the same other conditions, the higher the communication bandwidth, the faster the data is transmitted.
[0059] For example, the firmware upgrade package can be obtained by the networking module from the upgrade server. After the networking module downloads the firmware upgrade package from the upgrade server, it will distribute it to the master device, and the master device obtains the firmware upgrade package. In addition, the master device has a certain status monitoring function for the slave device, and can obtain information such as the communication bandwidth and processing capacity (such as CPU frequency, memory) of the slave device.
[0060] S300: Determine the upgrade priority of each slave device according to the size of the firmware upgrade package and the communication bandwidth.
[0061] Specifically, a greedy algorithm can be used to calculate the upgrade priority of each slave device, and then determine the order of firmware upgrade. Exemplarily, the firmware upgrade time of each slave device can be estimated, and the upgrade priority of each slave device can be determined according to the firmware upgrade time. Among them, the firmware upgrade time is equal to the ratio of the size of the firmware upgrade package and the communication bandwidth. After estimating the firmware upgrade time of each slave device, the slave devices can be sorted according to the firmware upgrade time. The slave devices with short firmware upgrade time have a higher priority, because upgrading these slave devices first can complete the firmware upgrade tasks of some slave devices faster, reduce the overall firmware upgrade time, and release network bandwidth resources faster.
[0062] In addition to the firmware upgrade time, the importance of the slave devices in the PV energy storage system can also be considered when determining the upgrade priority. For example, for those slave devices that directly affect the safe operation of the PV energy storage system (such as inverters, battery management modules, etc.), their upgrade priority can be appropriately increased.
[0063] In addition, during the operation of the system, the operating status of the slave devices is constantly changing. At this time, the priority of some slave devices may change. For example, a slave device with a lower priority originally needs to be upgraded first due to the increased importance of the task. At this time, the existing upgrade priority needs to be adjusted.
[0064] S500: Filter out a first slave device with the highest upgrade priority, and perform firmware upgrade on the first slave device.
[0065] Following the above steps, after determining the upgrade priority of each slave device, the master device may send the corresponding firmware upgrade package to the first slave device, and send a firmware upgrade instruction to the screened first slave device, informing it to start the firmware upgrade operation. After receiving the firmware upgrade instruction, the first slave device downloads the firmware upgrade package. Before downloading the firmware upgrade package, a series of decryption, identity authentication, integrity verification and other operations may be performed. When the firmware upgrade package is completely downloaded to the first slave device, the first slave device installs the new firmware according to the established installation process, and restarts the new firmware after the installation is complete. If the new firmware can be initialized normally and perform basic functions, the firmware upgrade of the first slave device is completed.
[0066] S700: For the remaining second slave devices except the first slave device, determine a target firmware upgrade policy of the second slave device, where the target firmware upgrade policy is a firmware upgrade policy with the shortest firmware upgrade time.
[0067] The firmware upgrade strategy refers to a series of rules formulated by comprehensively considering various factors during the firmware upgrade process of the second slave device, including but not limited to the upgrade sequence of the second slave device, bandwidth allocation, etc.
[0068] Specifically, for the second slave device that has not yet performed a firmware upgrade, the size of the firmware upgrade package of different second slave devices may vary greatly, and different firmware upgrade strategies may have a greater impact on the total firmware upgrade time. Therefore, it is necessary to use the firmware upgrade strategy with the shortest firmware upgrade time as the target firmware upgrade strategy. It should be noted that if the total communication bandwidth resources of the system are sufficient, the greedy algorithm in the above steps can be used to evaluate the priority and perform firmware upgrades according to the priority for all slave devices. However, in fact, the total communication bandwidth resources of the system are usually tight. For example, there are multiple slave devices that perform firmware upgrades at the same time, and their bandwidth requirements exceed the total communication bandwidth of the system, or the CPU and memory resources of the master device are close to the upper limit and can no longer process more firmware upgrade requests of slave devices. The greedy algorithm only considers the local optimum and it is difficult to consider the global optimum. Therefore, for the second slave device that has not yet performed a firmware upgrade, a dynamic programming algorithm can be used. The dynamic programming takes into account that multiple slave devices share limited bandwidth and processing power, and can perform global optimal optimization sequence selection and bandwidth resource scheduling in the firmware upgrade process of the entire second slave device.
[0069] S900: Perform firmware upgrade on the second slave device according to the target firmware upgrade policy.
[0070] Continuing from the above embodiment, after determining the target firmware upgrade strategy, it is first necessary to confirm whether the current operating status of the second slave device is suitable for firmware upgrade. If the second slave device is in a busy data transmission stage or there is an abnormal error, it is necessary to solve the relevant problem first or wait for it to enter a relatively idle and stable state before starting the firmware upgrade process.
[0071] Further, according to the bandwidth allocation scheme determined in the target firmware upgrade strategy, the corresponding communication bandwidth is allocated to the second slave device being upgraded through the configuration function of the network device (such as a router, switch, etc.) or the network management software of the system, so that the second slave device can stably use this bandwidth resource to download the firmware upgrade package during the upgrade process. Similar to the first slave device, after the second slave device completely downloads the firmware upgrade package, the second slave device starts the firmware installation program, for example, guided by the installation script in the upgrade package, or operated according to the device's own built-in firmware update mechanism. After the firmware upgrade package is installed, the second slave device restarts the device to make the new firmware effective.
[0072] It should be noted that during the firmware upgrade process, the device status of each second slave device also needs to be considered. For example, during the firmware upgrade process, some second slave devices may need temporary storage space to download the firmware upgrade package. If the storage space is insufficient, the second slave device will not be able to complete the download, and the target firmware upgrade strategy needs to be readjusted. Alternatively, a second slave device fails during the firmware upgrade process (such as communication interruption, hardware failure, etc.), causing it to be unable to receive the firmware upgrade package. At this time, the target firmware upgrade strategy needs to be dynamically adjusted. For example, the second slave device A fails during the firmware upgrade process and cannot continue. In this case, the bandwidth originally allocated to the second slave device A can be reallocated to the second slave device B and the second slave device C.
[0073] The above firmware upgrade method obtains the firmware upgrade package size and communication bandwidth of each slave device, then determines the upgrade priority of each slave device, and then selects the first slave device with the highest upgrade priority, and performs firmware upgrade on the first slave device. Since the firmware upgrade package size and communication bandwidth of different slave devices may be different, the upgrade priority is determined by the firmware upgrade package size and communication bandwidth, which can be more in line with the specific characteristics of the slave device. Furthermore, when determining the target firmware upgrade strategy for the second slave device other than the first slave device, the firmware upgrade strategy with the shortest firmware upgrade time is selected as the target firmware upgrade strategy, and then when performing firmware upgrade on the second slave device, the firmware upgrade of the second slave device can be completed in the shortest possible time, thereby comprehensively improving the efficiency of firmware upgrade of slave devices in the entire system.
[0074] In one embodiment, Figure 3 As shown, S700 includes:
[0075] S710: Determine the initial upgrade state of the second slave device as the current upgrade state.
[0076] S720, determining the candidate upgrade states for the next time step, and determining the state transfer equation value corresponding to each candidate upgrade state according to a preset state transfer equation.
[0077] S730, determining the upgrade state of the next time step according to the state transfer equation value corresponding to each candidate upgrade state.
[0078] S740, updating the upgrade state of the next time step to the current upgrade state.
[0079] S750, determining whether the current upgrade state is the target upgrade state, the target upgrade state indicating that the second slave devices have completed the firmware upgrade, if not, returning to S720.
[0080] S760: If yes, determine the target firmware upgrade strategy for the second slave device according to the upgrade status of each time step.
[0081] Among them, the initial upgrade state represents that the second slave device has not completed the firmware upgrade, and the state transfer equation value represents the number of second slave devices that have completed the firmware upgrade in the candidate upgrade state. Assuming that there are N second slave devices that need firmware upgrade, the communication bandwidth Bi of each second slave device and the size Si of the firmware upgrade package are different, and the total communication bandwidth Btotal of the system is limited. The goal of dynamic programming is to maximize the firmware upgrade efficiency and minimize the overall firmware upgrade time within the limited total communication bandwidth and time. In dynamic programming, the optimal firmware upgrade strategy for each time step can be found by recursively calculating the state transfer equation.
[0082] For example, the current upgrade state is that all second slave devices are still in the state of unfinished firmware upgrade. Assuming that there are three second slave devices, namely device X, device Y and device Z, which have not completed the firmware upgrade in the current upgrade state, at each time step, it is necessary to find all possible candidate upgrade states for the next time step based on the current actual situation (such as the dependency relationship of the second slave devices, the remaining communication bandwidth and other factors). For example, considering the dependency relationship between the second slave devices, if the upgrade of device Y depends on the device X completing the firmware upgrade first, then at a certain time step, when device X has not yet completed the firmware upgrade, there will be no candidate upgrade state for the device Y to upgrade its firmware alone. At the same time, the communication bandwidth situation must also be considered. If the current remaining communication bandwidth is not sufficient to support the simultaneous firmware upgrade of some devices, then the state of the simultaneous firmware upgrade of these devices cannot be used as a candidate upgrade state. For each candidate upgrade state of the next time step, the state transition equation value can be calculated by a preset state transition equation, where the state transition equation is shown in formula (1):
[0083] (1)
[0084] In formula (1), Indicates that in the previous time step of the current time step, The second slave device is assigned The maximum benefit obtained per unit of communication bandwidth resources, represents the benefit of allocating a unit of communication bandwidth resource to the second slave device i. When the communication bandwidth is allocated to the second slave device i, the original basic benefit Add , to reflect the additional benefits brought by allocating communication bandwidth resources to the second slave device i. is the value of the state transfer equation, representing the maximum benefit that can be obtained by allocating j units of communication bandwidth resources to the first i second slave devices at time step t. For example, it represents the number of second slave devices that have completed firmware upgrades in the candidate upgrade state, and can also represent the amount of firmware data that has been transmitted, etc. Specifically, the firmware upgrade packages of some second slave devices can be quickly downloaded and upgraded. If communication bandwidth resources can be preferentially allocated to such second slave devices, the upgrades of multiple second slave devices can be completed in a short time, which brings higher benefits.
[0085] It should be noted that some second slave devices may be more critical than other second slave devices in the system, or some second slave devices may have better performance, and the same communication bandwidth resources can be allocated to complete the firmware upgrade faster, or some second slave devices have a smaller communication bandwidth and can efficiently complete the firmware upgrade task under the allocated communication bandwidth resources, that is, the bandwidth resource utilization rate is high, or some second slave devices will affect system security after the firmware upgrade fails, and upgrading these second slave devices first can also be regarded as obtaining high benefits. Furthermore, a weighted approach can also be used to consider the above multiple factors simultaneously when evaluating the benefits.
[0086] Furthermore, a candidate upgrade state that appears to be optimal in the current time step is selected to enter the next time step. For example, the candidate upgrade state with the largest value of the state transfer equation is selected and determined as the upgrade state for the next time step. The upgrade state for the next time step is then set as the new current upgrade state, thus completing a state update iteration.
[0087] In this way, by recursively calculating the state transition of each time step until the current upgrade state is the target upgrade state, the target firmware upgrade strategy is gradually found. Specifically, the current upgrade state is the target upgrade state, and the upgrade state changes at each time step in the entire process can be reviewed. For example, the upgrade state changes at each time step can be shown through the state transition table shown in Table 1:
[0088] Table 1 State transition table
[0089]
[0090] Then, based on the above state transition table, the target firmware upgrade strategy is determined, for example, the upgrade sequence of the second slave device, the allocation of communication bandwidth resources at each time step and other information can be determined, and then the firmware upgrade operation of the second slave device is performed according to the target firmware upgrade strategy. In addition, for the dynamic programming problem of the three-dimensional state in this embodiment, the time complexity (O(T*N*B)) and space complexity (O(T*N*B)) of the dynamic programming can be calculated, where the time complexity focuses on the time required for dynamic programming, and represents the growth of the time for dynamic programming execution as the input scale increases. The space complexity focuses on the memory space required in the dynamic programming process, and represents the growth of the memory occupied by dynamic programming as the input scale increases. T is the total time, N is the number of second slave devices, and B is the total communication bandwidth of the system. In order to reduce space complexity, a rolling array can be used to store the intermediate states of the dynamic programming process. In some cases, it is not necessary to keep all intermediate upgrade states, only the most recent part of the upgrade state is needed. At this time, a rolling array can be used to replace the regular array to reduce unnecessary space occupation. For example, dp[t][i] represents the upgrade state of the i-th second slave device at the t-th time. However, sometimes, the current upgrade state only depends on the state of the previous time step. At this time, the rolling array strategy can be used to store only the data of the previous time step and the current time step.
[0091] In this embodiment, considering that the importance of different second slave devices, the size of firmware upgrade packages, their own processing capabilities, etc. are different, and the total communication bandwidth resources are often limited, the introduction of state transfer equations and the use of dynamic programming can effectively help system administrators to formulate firmware upgrade strategies to achieve the best upgrade effect, such as completing the firmware upgrade of all devices in the shortest time, or allowing more important second slave devices to complete the firmware upgrade with high quality first, thereby improving the efficiency of firmware upgrades.
[0092] In one embodiment, the method also includes: determining the valuation function value corresponding to each candidate upgrade state according to the size of the firmware upgrade package of the second slave device, the communication bandwidth, and a preset valuation function, the preset valuation function includes an actual cost function and an estimated cost function, the actual cost function represents the communication bandwidth allocated to the second slave device, the estimated cost function represents the remaining firmware upgrade time of the second slave device, and determining the upgrade state of the next time step according to the state transfer equation value corresponding to the candidate upgrade state and the valuation function value corresponding to each candidate upgrade state.
[0093] Following the above embodiment, in order to shorten the time of selecting the upgrade state of the next time step from the candidate upgrade states, a heuristic algorithm, such as the A-star algorithm, can be introduced to combine the heuristic search with the cost function to find the target firmware upgrade strategy with the minimum cost.
[0094] Specifically, when planning the firmware upgrade strategy for the second slave device, we not only rely on the state transition equation to judge the pros and cons of different candidate upgrade states, but also introduce a preset evaluation function (including actual cost function and estimated cost function) to comprehensively consider the allocated resources and the time required for the remaining devices to upgrade and other factors, so as to more comprehensively and accurately determine the upgrade state of the next time step. The evaluation function is shown in formula (2):
[0095] (2)
[0096] In formula (2), is an actual cost function, which in this embodiment represents the communication bandwidth allocated to the second slave device, and reflects the communication bandwidth resources invested in the second slave device in the current upgrade state. For example, in a candidate upgrade state, 5Mbps, 3Mbps and 4Mbps communication bandwidths have been allocated to three second slave devices respectively, then the value of this actual cost function is 12Mbps, or other specific conditions that reflect the communication bandwidth resources allocated to each second slave device, which can be used to measure the current communication bandwidth resource utilization and the remaining communication bandwidth resources that can be allocated later. To estimate the cost function, in this embodiment, the firmware upgrade time of the remaining second slave devices is characterized. By considering the size of the firmware upgrade package of the remaining second slave devices and the communication bandwidth, it is possible to roughly calculate how long it will take to complete the upgrade of these remaining second slave devices, which is used to measure the difficulty and time cost of subsequent firmware upgrades under different candidate upgrade states.
[0097] It should be noted that, assuming that the communication bandwidth has been allocated to the first i second slave devices at the current moment, the actual cost function It can be expressed as the total transmission time spent by all second slave devices up to the current moment, or as the communication bandwidth ratio of the communication bandwidth allocated to the second slave devices to the total communication bandwidth, or as the normalized weighted sum of the total transmission time and the communication bandwidth ratio.
[0098] For example, assuming that there are three second slave devices in the system, second slave device A: firmware upgrade package size Sa = 100MB, communication bandwidth Ba = 10Mbps; second slave device B: firmware upgrade package size Sb = 50MB, communication bandwidth Bb = 5Mbps; second slave device C: firmware upgrade package size Sc = 80MB, communication bandwidth Bc = 2Mbps; total bandwidth Btotal == 12Mbps. Then the estimated firmware upgrade time of the second slave device A is h(A) = Sa / Ba = 100 / 10 = 10 seconds; the estimated firmware upgrade time of the second slave device B is h(B) = Sb / Bb = 50 / 5 = 10 seconds; the estimated firmware upgrade time of the second slave device C is h(C) = Sc / Bc = 80 / 2 = 40 seconds.
[0099] Furthermore, after obtaining the state transition equation value corresponding to each candidate upgrade state and the evaluation function value corresponding to each candidate upgrade state, it is necessary to combine the information of the two to determine the upgrade state of the next time step. This is because in the dynamic programming process, if there are N second slave devices, the number of possible firmware upgrade strategies will increase exponentially with the number of second slave devices. The traditional exhaustive search method needs to traverse all possible firmware upgrade strategies to find the optimal solution. By introducing the above-mentioned evaluation function, the search can be guided in the most promising direction, greatly reducing the search space.
[0100] In this embodiment, by combining heuristic algorithms and dynamic programming, it is possible to find out the firmware upgrade strategy that meets the target more quickly and efficiently. In the dynamic programming scenario of this embodiment, the planning goal is to find the target firmware upgrade strategy with the shortest firmware upgrade time. The introduction of the evaluation function can exclude some possible strategies in the search space that obviously deviate from the target firmware upgrade strategy, thereby finding the target firmware upgrade strategy more quickly and improving the firmware upgrade efficiency.
[0101] In one embodiment, Figure 4 As shown, S300 includes:
[0102] S310: For each slave device, calculate a ratio of a communication bandwidth of the slave device to a size of a firmware upgrade package.
[0103] S320: Determine an upgrade priority of the slave device based on the ratio, where the ratio is positively correlated with the upgrade priority.
[0104] Specifically, the upgrade priority can be calculated based on formula (3):
[0105] (3)
[0106] In formula (3), is the communication bandwidth of the slave device, For the size of the firmware upgrade package, the slave devices with high communication bandwidth and small firmware upgrade package are preferred for firmware upgrade first, because these slave devices can quickly complete the firmware upgrade, thereby releasing the communication bandwidth resources of the system. For example, assuming there are 3 slave devices, the communication bandwidth and the size of the firmware upgrade package are: Slave device A: Communication bandwidth = 10Mbps, the size of the firmware upgrade package = 100Mb; Slave device B: communication bandwidth = 5Mbps, the size of the firmware upgrade package = 50MB; Slave device C: communication bandwidth = 2Mbps, the size of the firmware upgrade package = 80MB, the upgrade priority of each slave device is calculated as follows: The upgrade priority of slave device B = 5 / 50=0.1, the upgrade priority of slave device A =5 / 50=0.1, the upgrade priority of slave device C = 2 / 80=0.025, therefore, slave device A and slave device B are given priority in firmware upgrade. Slave device A has a larger communication bandwidth, so although the firmware upgrade package is larger, it can still be completed quickly. Slave device B can also complete the upgrade quickly because the firmware upgrade package is smaller.
[0107] In this embodiment, under the action of the greedy algorithm, the firmware upgrade order of each slave device is the optimal solution based on the current system state, which means that the optimal slave device is selected for firmware distribution. By giving priority to slave devices with smaller firmware upgrade packages and larger communication bandwidth, the upgrade of some slave devices can be completed quickly, thereby reducing the number of slave devices waiting for upgrade in the system, utilizing the largest possible bandwidth and the smallest possible waiting time, reducing the waste of communication bandwidth resources, and improving the efficiency of firmware upgrade.
[0108] In one embodiment, Figure 5 As shown, S500 includes:
[0109] S510, screening out a first slave device with the highest upgrade priority.
[0110] S520: When there are multiple first slave devices screened out, determine a firmware upgrade order for the first slave devices according to sizes of firmware upgrade packages of the first slave devices.
[0111] S530: Perform firmware upgrade on the first slave device according to the firmware upgrade sequence of the first slave device.
[0112] Following the above embodiment, based on the ratio of communication bandwidth to firmware upgrade package size, and the ratio is positively correlated with the upgrade priority, all slave devices are evaluated and sorted, and those slave devices with the highest upgrade priority are screened out and marked as the first slave devices. In extreme cases, if a large number of slave devices have the same priority, if there is no further distinction between them, problems such as bandwidth competition and storage / processing bottlenecks may arise. That is, when multiple slave devices download the firmware upgrade package at the same time, too much communication bandwidth resources may be consumed, resulting in a decrease in transmission speed, and may even cause timeouts or transmission errors. In addition, the processing power and storage space of the slave devices are limited. If multiple slave devices perform firmware reception and verification operations at the same time, it may cause resource overload and increase the risk of failure.
[0113] Therefore, when there are multiple first slave devices with the highest upgrade priority, the specific upgrade order can be determined according to the size of their firmware upgrade packages. For example, slave devices with smaller firmware upgrade packages are upgraded first. The upgrade priority of slave device B is Pb = 5 / 50=0.1, and the upgrade priority of slave device A is Pa=5 / 50=0.1. Since the firmware upgrade package of slave device B is relatively small, the firmware of slave device B is upgraded.
[0114] In addition, when the upgrade priorities of multiple slave devices are the same, a secondary upgrade priority strategy can be introduced, such as detailed sorting based on the slave device identification, the time sequence of access to the network, the size of the firmware upgrade package, or the current status of the slave device (such as whether it is idle). Or a batch distribution strategy can be adopted to divide the slave devices with the same upgrade priority into several groups, and gradually distribute the firmware instead of distributing them all at once. For example, each batch is limited to N slave devices, and after these slave devices have completed receiving, they are distributed to the next batch of slave devices, or the maximum number of slave devices that can be upgraded in parallel is set, so that only a certain number of slave devices can be upgraded at a time. The download speed can also be dynamically allocated to each slave device based on the communication bandwidth of the slave device and the currently available communication bandwidth. Through bandwidth allocation optimization, the problem of resource shortage caused by all slave devices consuming too much bandwidth at the same time can be reduced.
[0115] In this embodiment, by first screening out the first slave device with the highest upgrade priority for firmware upgrade, those slave devices that are theoretically faster to upgrade or are more important to the system can complete the firmware upgrade first. If there are multiple slave devices with the highest upgrade priority, a subdivided priority strategy or a batch upgrade strategy can be introduced to reduce the problem of multiple slave devices consuming too much bandwidth at the same time, resulting in resource constraints.
[0116] In order to make a clearer description of the firmware upgrade method provided by the present application, the following is a specific embodiment and the attached Figure 6To illustrate, this specific embodiment includes the following steps:
[0117] S601, obtaining a firmware upgrade package and a communication bandwidth of each slave device, and calculating, for each slave device, a ratio of the communication bandwidth of the slave device to the size of the firmware upgrade package.
[0118] S602: Determine the upgrade priority of the slave device based on the ratio, where the ratio is positively correlated with the upgrade priority, and select the first slave device with the highest upgrade priority.
[0119] S603, when there are multiple screened first slave devices, determine the firmware upgrade order of the first slave devices according to the size of the firmware upgrade packages of the first slave devices, and perform firmware upgrade on the first slave devices according to the firmware upgrade order of the first slave devices.
[0120] S604: Determine the initial upgrade state of the second slave device as the current upgrade state.
[0121] S605, determine the candidate upgrade state for the next time step, determine the state transition equation value corresponding to each candidate upgrade state according to the preset state transition equation, and determine the valuation function value corresponding to each candidate upgrade state according to the size of the firmware upgrade package of the second slave device, the communication bandwidth, and the preset valuation function.
[0122] S606, determining the upgrade state of the next time step according to the state transfer equation value corresponding to the candidate upgrade state and the evaluation function value corresponding to each candidate upgrade state, and updating the upgrade state of the next time step to the current upgrade state.
[0123] S607, determining whether the current upgrade state is the target upgrade state, the target upgrade state indicating that the second slave devices have completed the firmware upgrade, if not, returning to S606.
[0124] S608: If yes, determine the target firmware upgrade strategy for the second slave device according to the upgrade status of each time step, and perform firmware upgrade on the second slave device according to the target firmware upgrade strategy.
[0125] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0126] In one embodiment, the present application also provides a firmware upgrade system 700, such as Figure 7 As shown, the firmware upgrade system 700 includes a master device 710 and a plurality of slave devices 720 connected to each other.
[0127] The master control device 710 is used to obtain the firmware upgrade package and communication bandwidth of each slave device 720, determine the upgrade priority of each slave device 720 according to the size of the firmware upgrade package and the communication bandwidth, screen out the first slave device 720 with the highest upgrade priority, send the firmware upgrade package of the first slave device 720 to the first slave device 720, and allocate communication bandwidth to the first slave device 720, and determine the target firmware upgrade strategy of the second slave device 720 for the second slave devices 720 remaining except the first slave device 720, the target firmware upgrade strategy is the firmware upgrade strategy with the shortest firmware upgrade time, send the firmware upgrade package of the second slave device 720 to the second slave device 720 according to the target firmware upgrade strategy, and allocate communication bandwidth to the second slave device 720;
[0128] The slave device 720 is used to receive the firmware upgrade package, perform integrity check on the firmware upgrade package, and install the firmware upgrade package if the firmware upgrade package passes the integrity check.
[0129] Specifically, the master device 710 combines the greedy algorithm and dynamic programming to distribute the firmware upgrade package and allocate the communication bandwidth to the slave device 720. The slave device 720 downloads the firmware upgrade package, and then performs integrity check on the firmware upgrade package to determine whether the firmware upgrade package is damaged during the transmission process. The integrity check method includes but is not limited to: the slave device 720 uses MD5 check when downloading the firmware upgrade package. The firmware upgrade package carries an MD5 check value (a 32-character hash value), which is the hash operation result of the entire firmware upgrade package. After downloading the firmware upgrade package, the slave device 720 will also calculate an MD5 value based on the received firmware upgrade package. After the download is completed, the calculated MD5 value is compared with the MD5 check value carried by the firmware upgrade package. If the two are consistent, it means that the downloaded firmware upgrade package is complete and correct. If they are inconsistent, it means that the firmware upgrade package data is damaged during the download process and needs to be downloaded again.
[0130] The firmware upgrade package is transmitted using CRC16 checksum. During the transmission process of the firmware upgrade package, the firmware upgrade package is usually split into multiple data packets, each of which is accompanied by a CRC16 checksum value (a 16-bit checksum). Whenever a data packet arrives at the slave device 720, the slave device 720 recalculates the CRC16 value of the received data packet and compares it with the CRC16 value in the data packet. If the two are consistent, the data packet is complete. If the two are inconsistent, it means that an error has occurred in the transmission of the data packet and the data packet is requested to be resent.
[0131] It should be noted that the specific greedy algorithm and dynamic programming strategy have been introduced in detail in the above firmware upgrade method embodiment and will not be repeated here.
[0132] In one embodiment, Figure 8 As shown, the firmware upgrade system 700 also includes a networking module 730 connected to the master control device 710, which is used to obtain the firmware version information of each slave device 720 and the latest firmware version information. When the firmware version information does not match the latest firmware version information, the firmware upgrade package of each slave device 720 is obtained and the firmware upgrade package of each slave device 720 is sent to the master control device.
[0133] Specifically, the master device 710 may send the firmware version information of the slave device 720 to the networking module 730, and the networking module 730 may periodically obtain the latest firmware version information from the upgrade server, compare the firmware version information of the slave device 720 with the latest firmware version information, and determine whether the slave device 720 needs a firmware upgrade. For example, it may determine whether the firmware version number is incremented, whether the slave device 720 is compatible with the new firmware, whether it is a mandatory upgrade, the security verification of the firmware upgrade package (such as signature verification), and the current status of the slave device 720 (such as power, network conditions, etc.). Only when these conditions are met, the system 700 will perform subsequent firmware upgrade operations.
[0134] In addition, during the firmware upgrade of the slave device 720 , the master device 710 monitors the real-time upgrade status of the slave device 720 and feeds back to the networking module 730 , so that the user or server can monitor the firmware upgrade process of the slave device 720 in real time.
[0135] Based on the same inventive concept, the embodiment of the present application also provides a firmware upgrade device for implementing the firmware upgrade method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more firmware upgrade device embodiments provided below can refer to the limitations on the firmware upgrade method above, and will not be repeated here.
[0136] In one embodiment, Fig. 9 As shown, a firmware upgrade device 800 is provided, including: a data acquisition module 810, a priority determination module 820, a first firmware upgrade module 830, a policy formulation module 840 and a second firmware upgrade module 850, wherein:
[0137] The data acquisition module 810 is used to acquire the firmware upgrade package and communication bandwidth of each slave device.
[0138] The priority determination module 820 is used to determine the upgrade priority of each slave device according to the size of the firmware upgrade package and the communication bandwidth.
[0139] The first firmware upgrade module 830 is used to screen out the first slave device with the highest upgrade priority and perform firmware upgrade on the first slave device.
[0140] The policy formulation module 840 is used to determine the target firmware upgrade policy of the second slave devices remaining except the first slave device, wherein the target firmware upgrade policy is the firmware upgrade policy with the shortest firmware upgrade time.
[0141] The second firmware upgrade module 850 is used to upgrade the firmware of the second slave device according to the target firmware upgrade policy.
[0142] In one embodiment, the policy formulation module 840 is also used to determine the initial upgrade state of the second slave device as the current upgrade state, the initial upgrade state indicates that the second slave device has not completed the firmware upgrade, determine the candidate upgrade state for the next time step, determine the state transfer equation value corresponding to each candidate upgrade state according to a preset state transfer equation, the state transfer equation value indicates the number of second slave devices that have completed the firmware upgrade under the candidate upgrade state, determine the upgrade state for the next time step according to the state transfer equation value corresponding to each candidate upgrade state, update the upgrade state for the next time step to the current upgrade state, and execute the step of determining the candidate upgrade state for the next time step again until the current upgrade state is the target upgrade state, and obtain the upgrade state of the second slave device at each time step, the target upgrade state indicates that the second slave devices have completed the firmware upgrade, and the upgrade state indicates the upgrade status of the second slave devices at each time step, and determine the target firmware upgrade policy for the second slave device according to the upgrade state at each time step.
[0143] In one embodiment, the firmware upgrade device 800 is also used to determine the valuation function value corresponding to each candidate upgrade state according to the size of the firmware upgrade package of the second slave device, the communication bandwidth, and the preset valuation function, the preset valuation function includes an actual cost function and an estimated cost function, the actual cost function represents the communication bandwidth allocated to the second slave device, and the estimated cost function represents the remaining firmware upgrade time of the second slave device. The strategy formulation module 840 is also used to determine the upgrade state of the next time step according to the state transition equation value corresponding to the candidate upgrade state and the valuation function value corresponding to each candidate upgrade state.
[0144] In one embodiment, the priority determination module 820 is also used to calculate the ratio of the communication bandwidth of each slave device to the size of the firmware upgrade package, and determine the upgrade priority of the slave device based on the ratio, and the ratio is positively correlated with the upgrade priority.
[0145] In one embodiment, the first firmware upgrade module 830 is also used to screen out the first slave devices with the highest upgrade priority. When the number of screened out first slave devices is multiple, the firmware upgrade order of the first slave devices is determined according to the size of the firmware upgrade package of the first slave devices, and the firmware of the first slave devices is upgraded according to the firmware upgrade order of the first slave devices.
[0146] Each module in the above firmware upgrade device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0147] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as firmware upgrade packages and communication bandwidth of each slave device. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a firmware upgrade method is implemented.
[0148] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0149] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above firmware upgrade method embodiment when executing the computer program.
[0150] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above firmware upgrade method embodiment are implemented.
[0151] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above firmware upgrade method embodiment when executed by a processor.
[0152] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0153] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0154] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0155] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A firmware upgrade method, characterized in that: The method comprises: Obtain the firmware upgrade package and communication bandwidth of each slave device; Determining the upgrade priority of each slave device according to the size of the firmware upgrade package and the communication bandwidth; Screening out the first slave device with the highest upgrade priority, and performing firmware upgrade on the first slave device; For the remaining second slave devices except the first slave device, determining a target firmware upgrade policy for the second slave device, wherein the target firmware upgrade policy is a firmware upgrade policy with the shortest firmware upgrade time; According to the target firmware upgrade policy, the firmware of the second slave device is upgraded.
2. The method according to claim 1, characterized in that The determining of the target firmware upgrade strategy of the second slave device includes: Determine an initial upgrade state of the second slave device as a current upgrade state, wherein the initial upgrade state indicates that the second slave device has not completed the firmware upgrade; Determine a candidate upgrade state for the next time step, and determine a state transfer equation value corresponding to each candidate upgrade state according to a preset state transfer equation, wherein the state transfer equation value represents the number of second slave devices that have completed the firmware upgrade in the candidate upgrade state; Determining the upgrade state of the next time step according to the state transfer equation value corresponding to each candidate upgrade state; The upgrade state of the next time step is updated to the current upgrade state, and the step of determining the candidate upgrade state of the next time step is returned until the current upgrade state is the target upgrade state, and the upgrade state of the second slave device at each time step is obtained, wherein the target upgrade state indicates that the second slave device has completed the firmware upgrade, and the upgrade state indicates the upgrade status of the second slave device at each time step; According to the upgrade status of each time step, a target firmware upgrade strategy of the second slave device is determined.
3. The method according to claim 2, characterized in that The method further comprises: Determine, according to the size of the firmware upgrade package of the second slave device, the communication bandwidth, and a preset evaluation function, the evaluation function value corresponding to each of the candidate upgrade states, the preset evaluation function comprising an actual cost function and an estimated cost function, the actual cost function representing the communication bandwidth allocated to the second slave device, and the estimated cost function representing the remaining firmware upgrade time of the second slave device; The upgrade state of the next time step is determined according to the state transfer equation value corresponding to the candidate upgrade state and the evaluation function value corresponding to each candidate upgrade state.
4. The method according to any one of claims 1 to 3, characterized in that: Determining the upgrade priority of each slave device according to the size of the firmware upgrade package and the communication bandwidth includes: For each slave device, calculating a ratio of a communication bandwidth of the slave device to a size of the firmware upgrade package; Based on the ratio, an upgrade priority of the slave device is determined, and the ratio is positively correlated with the upgrade priority.
5. The method according to any one of claims 1 to 3, characterized in that: The step of screening out the first slave device with the highest upgrade priority and performing firmware upgrade on the first slave device comprises: Filter out the first slave device with the highest upgrade priority; In the case that the number of the screened first slave devices is multiple, determining the firmware upgrade order of the first slave devices according to the sizes of the firmware upgrade packages of the first slave devices; The firmware of the first slave device is upgraded according to the firmware upgrade sequence of the first slave device.
6. A firmware upgrade system, characterized in that: The system includes a master device and a plurality of slave devices connected to each other; The master control device is used to obtain a firmware upgrade package and a communication bandwidth of each slave device, determine an upgrade priority of each slave device according to the size of the firmware upgrade package and the communication bandwidth, screen out a first slave device with the highest upgrade priority, send the firmware upgrade package of the first slave device to the first slave device, and allocate a communication bandwidth to the first slave device; for the second slave devices remaining except the first slave device, determine a target firmware upgrade strategy of the second slave device, the target firmware upgrade strategy is a firmware upgrade strategy with the shortest firmware upgrade time, send the firmware upgrade package of the second slave device to the second slave device according to the target firmware upgrade strategy, and allocate a communication bandwidth to the second slave device; The slave device is used to receive the firmware upgrade package, perform integrity check on the firmware upgrade package, and install the firmware upgrade package if the firmware upgrade package passes the integrity check.
7. The system according to claim 6, characterized in that The system also includes a networking module connected to the master control device, which is used to obtain the firmware version information of each of the slave devices and the latest firmware version information. When the firmware version information does not match the latest firmware version information, the firmware upgrade package of each of the slave devices is obtained and the firmware upgrade package of each of the slave devices is sent to the master control device.
8. A firmware upgrade device, characterized in that: The device comprises: A data acquisition module is used to obtain the firmware upgrade package and communication bandwidth of each slave device; A priority determination module, used to determine the upgrade priority of each slave device according to the size of the firmware upgrade package and the communication bandwidth; A first firmware upgrade module, used for screening out the first slave device with the highest upgrade priority, and performing firmware upgrade on the first slave device; a policy formulation module, configured to determine, for the remaining second slave devices except the first slave device, a target firmware upgrade policy for the second slave device, wherein the target firmware upgrade policy is a firmware upgrade policy with the shortest firmware upgrade time; The second firmware upgrade module is used to upgrade the firmware of the second slave device according to the target firmware upgrade policy.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Software upgrading method and device, equipment and medium
CN117032747A
Set top box upgrading method and system, computer equipment and storage medium
CN117539512A
Security-based multi-device software upgrading method
CN117850837A
Equipment system upgrading method and device, medium and equipment
CN118349243A
Display device, firmware upgrading method and server
CN118400264A