Multi-channel firmware upgrading method and system supporting breakpoint resume
By dividing the firmware file into multiple data blocks and generating unique identifiers and checksums, combined with real-time monitoring and breakpoint record update methods, the problem of insufficient interrupt point transmission mechanism for multi-channel firmware upgrades is solved, significantly improving the success rate and efficiency of the upgrade, ensuring data integrity and system stability.
Patent Information
- Application Number
- CN202510092734.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-03-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing multi-channel firmware upgrade method lacks an effective breakpoint continuous transmission mechanism, and cannot continue to upgrade from breakpoints when the network is unstable or transmission is interrupted, resulting in inefficient upgrades.
By dividing the firmware file into multiple data blocks and generating a unique identifier and checksum for each data block, the refined data management is achieved. Task matching with the network transmission channel is performed based on the unique identifier, transmission status is monitored in real time, and breakpoint recording updates are performed on the initial recording document to ensure that the upgrade can continue from the breakpoint when the transmission is interrupted.
It significantly improves the success rate and efficiency of upgrades, ensures the integrity and accuracy of transmitted data, reduces the risk of upgrade failure caused by data errors, and automatically rolls back to previous versions when upgrade failures, minimizing the impact of upgrade failures on the normal operation of the device.
Smart Images

Figure CN119556960A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of air source heat pumps, and in particular to a multi-channel firmware upgrade method and system supporting breakpoint resume. Background Art
[0002] Firmware upgrade is a key means to ensure device function updates, performance optimization and security improvement. It is widely used in the fields of IoT devices, smart homes, industrial control, etc. With the continuous increase in the number of devices and the complexity of the network environment, the traditional single-channel firmware upgrade method has been unable to meet the needs of fast and stable upgrades of large-scale devices. Multi-channel firmware upgrade technology has become an important direction to solve this problem due to its advantages of parallel transmission. However, there are still some problems with the existing multi-channel firmware upgrade methods. First, most methods lack an effective breakpoint resumption mechanism, and cannot continue to upgrade from the breakpoint when the network is unstable or the transmission is interrupted, resulting in low upgrade efficiency. Secondly, the existing methods usually adopt a fixed channel allocation strategy, which fails to fully consider the dynamic changes of the network environment and is difficult to achieve the optimal transmission efficiency. In addition, there is a lack of systematic consideration for data integrity verification during the upgrade process and the rollback mechanism after the upgrade fails, which increases the risk and impact of upgrade failure. Summary of the invention
[0003] The main purpose of the present invention is to provide a multi-channel firmware upgrade method and system that supports breakpoint resumption, which can continuously optimize the upgrade strategy and improve system management efficiency.
[0004] To achieve the above object, the present invention provides a multi-channel firmware upgrade method supporting breakpoint resume, comprising: Splitting the firmware file into a plurality of firmware data blocks, and generating a unique identifier and a checksum for each of the firmware data blocks; Acquire a network transmission channel, perform task matching with the network transmission channel according to the unique identifier, obtain a corresponding assigned transmission task, and establish a corresponding initial record document; Transmitting the firmware data block through the network transmission channel according to the assigned transmission task, monitoring the transmission status in real time, and performing breakpoint record update on the initial record document to obtain a corresponding update document; When the transmission is detected to be complete, the firmware data block is verified according to the checksum, and the firmware data block is reorganized to obtain the firmware file; Writing the firmware file into the corresponding device flash memory and performing the upgrade, automatically rolling back to the previous version when the upgrade fails, and recording the corresponding upgrade information; Based on the update document and the upgrade information, a corresponding upgrade report is generated.
[0005] Furthermore, dividing the firmware file into a plurality of data blocks and generating a unique identifier and a checksum for each of the firmware data blocks includes: Performing overall analysis on the firmware file to obtain the total capacity of the file; The total capacity of the file is divided and calculated according to a preset data block size threshold to obtain the number of data blocks; The firmware file is divided into equal parts according to the number of the firmware data blocks to obtain a plurality of data blocks; Performing hash calculation on each of the firmware data blocks to obtain a corresponding hash value; Concatenate the hash value with the data block sequence number to obtain a unique identifier; Calculate each firmware data block using the MD5 digest algorithm to obtain a corresponding checksum; The calculation process using the MD5 digest algorithm includes preprocessing the firmware data block, including padding and appending length information, to obtain a corresponding processed data block; Initialize four 32-bit registers, divide the processed data block into 512-bit data sub-blocks, and perform four rounds of processing on each of the data sub-blocks. After all the data sub-blocks are processed, concatenate the values of the four 32-bit registers to obtain the 128-bit checksum; The unique identifier and the checksum are associated with the corresponding firmware data block and stored to obtain a data block set with metadata.
[0006] Further, the acquiring of the network transmission channel, matching the task with the network transmission channel according to the unique identifier, obtaining the corresponding assigned transmission task, and establishing the corresponding initial record document, includes: Scan the network transmission channels to obtain a network transmission channel list; Performing channel scoring on the network transmission channel list to obtain a channel scoring result; Sorting the network transmission channels based on the channel scoring results to obtain a priority sorting list; Performing task allocation analysis according to the unique identifier and the priority sorting list to obtain a task allocation scheme, wherein the task allocation analysis adopts a greedy algorithm, including: sorting the firmware data blocks according to the size and priority of the firmware data blocks; Allocate the best matching channel for the high priority data block, calculate the difference between the available bandwidth of each channel and the size of the firmware data block, and select the channel with the smallest difference as the best match; gradually allocating channels for the remaining firmware data blocks, selecting the currently optimal channel data block pair each time, wherein the selection criteria include available channel bandwidth, expected transmission time, and load balancing factor; After each allocation, dynamically update the available bandwidth and expected load of the channel, and recalculate the load balancing factor; When the channel bandwidth is insufficient, the remaining firmware data blocks are temporarily stored in a waiting queue, and are allocated when the channel bandwidth is available to obtain a corresponding allocation result; Optimize the allocation results and try to reduce the overall transmission time by exchanging the allocation channels of adjacent data blocks; Channel matching is performed on the firmware data block and the network transmission channel according to the task allocation scheme to obtain a matching relationship between the data block and the channel; Generate a corresponding task queue based on the matching relationship, and assign a unique task identifier to each task to obtain the assigned transmission task; The initial record document is obtained by recording the initial status, allocation channel and data block information of each task according to the allocated transmission task.
[0007] Further, the firmware data block is transmitted through the network transmission channel according to the assigned transmission task, the transmission status is monitored in real time, and the initial record document is updated at the breakpoint to obtain a corresponding update document, including: Acquire the unique identifier, target transmission channel and transmission priority of each firmware data block according to the assigned transmission task to obtain a transmission task list; Sorting the firmware data blocks according to the transmission priority to generate a priority transmission queue; Transmitting the corresponding firmware data block in the priority transmission queue to the corresponding target transmission channel according to the unique identifier; The transmission process of each firmware data block is monitored in real time, and the transmission start time, the number of bytes transmitted, the number of remaining bytes and the transmission rate are recorded to obtain corresponding monitoring records; Calculating the transmission progress percentage of each firmware data block according to the monitoring record, and writing the transmission progress information into the initial record file; When a transmission interruption is detected, the interruption time and the amount of data transmitted are recorded, and the breakpoint information in the initial record file is updated to obtain the update file.
[0008] Furthermore, the transmission process of each firmware data block is monitored in real time, and the transmission start time, the number of bytes transmitted, the number of remaining bytes and the transmission rate are recorded to obtain corresponding monitoring records, including: Setting a monitoring time window for the firmware data block, recording the transmission start time, sampling data during the transmission process, recording the data transmission volume at the sampling point, and obtaining a transmission data sequence; Calculate the transmission rates of adjacent sampling points to obtain a real-time transmission rate sequence; Performing fractal chaos feature analysis on the real-time transmission rate sequence to obtain corresponding chaotic features, and processing the sequence using an adaptive weight kernel smoothing method to obtain smoothed transmission rate data; According to the smoothed transmission rate data, a rate fluctuation threshold is set, transmission abnormal points are marked, effective transmission time and invalid transmission time are counted, and corresponding statistical time is obtained; Based on the statistical time and the smoothed transmission rate data, the number of transmitted bytes and the number of remaining bytes of the firmware data block are calculated to obtain the monitoring record; Among them, the calculation formula for processing using the adaptive weight kernel smoothing method is: ; : smooth transmission rate at time t, : the i-th sampling time, t: the current sampling time, : real-time transmission rate of the i-th sampling point, λ: maximum Lyapunov exponent, D: fractal dimension, H: Hurst exponent, n: total number of sampling points, : Natural exponential function.
[0009] Further, the calculating the transmission progress percentage of each firmware data block according to the monitoring record and writing the transmission progress information into the initial record file includes: Calculate the basic transmission progress percentage according to the number of bytes transmitted and the number of remaining bytes; Performing rate analysis on the monitoring records to obtain the current transmission rate, initial transmission rate, remaining number of bytes, initial total number of bytes, used time and estimated total time, and calculating the network condition factor, remaining data amount factor and time factor respectively; Calculate the transmission progress based on the basic transmission progress percentage, the network condition factor, the remaining data amount factor and the time factor to obtain a corresponding final transmission progress percentage; Writing the final transmission progress percentage into the initial record file to complete the update of the transmission progress information; Wherein, the network condition factor = the current transmission rate / the initial transmission rate; The remaining data amount factor = 1 - (the remaining number of bytes / the initial total number of bytes) 0.5 The time factor=the used time / the estimated total time.
[0010] Further, when the transmission is detected to be complete, the firmware data block is verified according to the checksum, and the firmware data block is reorganized to obtain the firmware file, including: Performing checksum calculation on each of the firmware data blocks to obtain an actual checksum; Comparing the actual checksum with the checksum to obtain a check result; Marking the verification failed data blocks according to the verification result to obtain a verification failed data block list; Making a data retransmission request according to the verification failed data block list to obtain retransmission data; The retransmitted data replaces the corresponding verification failed data block, and integrates it with the verification successful firmware data block to obtain a verified data block set; Sorting the verified data block set according to the unique identifier to obtain an ordered data block set; Extracting metadata from the data blocks in the ordered data block set to obtain reorganization information; Performing a reorganization operation on the data blocks in the ordered data block set according to the reorganization information to obtain a reorganized file; Performing integrity check on the reorganized file to obtain an integrity result; When the integrity result is complete, the reassembled file is the firmware file; When the integrity result is incomplete, the process returns to re-execute the data block transmission step.
[0011] Furthermore, the firmware file is written into the corresponding device flash memory and the upgrade is performed, and when the upgrade fails, the firmware file is automatically rolled back to the previous version, and the corresponding upgrade information is recorded, including: Performing partition mapping analysis on the firmware file to obtain multiple mapping partitions; Performing parallel writing processing on the device flash memory according to the plurality of mapping partitions to obtain a device flash memory in which writing is completed; The boot program is updated on the device flash memory after writing, and a restart operation is performed to obtain a restart device status; Performing a functional test on the restart device state to obtain a device functional test result; Performing an upgrade judgment on the functional test result of the device to obtain a judgment result; When the judgment result is that the upgrade is successful, the new version of the firmware is marked to obtain the corresponding device status; When the determination result is that the upgrade fails, locating the firmware file of the previous version to obtain a rollback target version; Performing a partition overwrite operation on the device flash memory according to the rollback target version to obtain the device flash memory after the rollback and the device state after the rollback; Timestamp each operation data in the upgrade process to obtain the upgrade log; Corresponding upgrade information is generated according to the upgrade log and the device status.
[0012] Further, generating a corresponding upgrade report based on the update document and the upgrade information includes: Parsing the update document, extracting transmission status information of each data block, and obtaining a transmission status data set; Performing performance evaluation on each of the network transmission channels according to the transmission status data set to obtain a channel performance evaluation result; Extracting the upgrade success rate, upgrade duration, and rollback times of the upgrade information, and integrating them to obtain upgrade performance data; Constructing a multi-dimensional evaluation matrix based on the channel performance evaluation results and the upgrade performance data to obtain a comprehensive performance index; Sorting the performance according to the comprehensive performance indicators to obtain a performance ranking result; A visual report is constructed based on the performance ranking results to obtain the upgrade report.
[0013] The present invention also provides a multi-channel firmware upgrade device supporting breakpoint resumption, which is applied to any of the above multi-channel firmware upgrade methods supporting breakpoint resumption, comprising: A collection module, the collection module is used to divide the firmware file into multiple data blocks, and generate a unique identifier and a checksum for each firmware data block; An analysis module, the analysis module is used to obtain a network transmission channel, perform task matching with the network transmission channel according to the unique identifier, obtain a corresponding assigned transmission task, and establish a corresponding initial record document; An association module, the association module is used to transmit the firmware data block through the network transmission channel according to the assigned transmission task, monitor the transmission status in real time, and perform breakpoint record update on the initial record document to obtain a corresponding update document; A processing module, wherein the processing module is used to verify the firmware data block according to the checksum after the transmission is detected to be completed, and reorganize the firmware data block to obtain the firmware file; A control module, the control module is used to write the firmware file into the corresponding device flash memory and perform the upgrade, automatically roll back to the previous version when the upgrade fails, and record the corresponding upgrade information; An execution module is used to generate a corresponding upgrade report based on the update document and the upgrade information.
[0014] The present invention provides a multi-channel firmware upgrade method and system supporting breakpoint resume, which has the following beneficial effects: By dividing the firmware file into multiple data blocks and generating a unique identifier and checksum for each data block, the refined management of data is achieved, which provides a basis for breakpoint continuation and data integrity verification, and effectively improves the reliability and efficiency of the upgrade process. Task matching is performed based on the unique identifier and the network transmission channel, and a dynamic task allocation strategy is implemented. The transmission plan can be flexibly adjusted according to changes in the network environment, and the available network resources are maximized to improve the transmission efficiency. By real-time monitoring of the transmission status and updating the breakpoint record of the initial record document, an effective breakpoint continuation mechanism is implemented, and the upgrade can be continued from the breakpoint when the network is unstable or the transmission is interrupted, which significantly improves the success rate and efficiency of the upgrade. The checksum is used to verify the data block to ensure the integrity and accuracy of the transmitted data and reduce the risk of upgrade failure caused by data errors. When the upgrade fails, it automatically rolls back to the previous version and records the relevant upgrade information, which improves the stability and reliability of the system and minimizes the impact of upgrade failure on the normal operation of the device. The upgrade report generated based on the update document and upgrade information provides managers with a detailed upgrade process analysis, which helps to continuously optimize the upgrade strategy and improve system management efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 This is a flow chart of a multi-channel firmware upgrade method supporting breakpoint resume provided by the present invention; Figure 2 The present invention provides a multi-channel firmware upgrade system structure diagram supporting breakpoint resume.
[0016] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention 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 invention and are not intended to limit the present invention.
[0018] The present invention is further described below in conjunction with the accompanying drawings and specific implementation methods.
[0019] Reference Figure 1 As shown, the present invention provides 1. a multi-channel firmware upgrade method supporting breakpoint resume, comprising: Step S1: split the firmware file into multiple firmware data blocks, and generate a unique identifier and a checksum for each firmware data block; Step S2: Acquire the network transmission channel, match the task with the network transmission channel according to the unique identifier, obtain the corresponding assigned transmission task, and establish the corresponding initial record document; Step S3: transmitting the firmware data block through the network transmission channel according to the assigned transmission task, monitoring the transmission status in real time, and performing breakpoint record update on the initial record document to obtain the corresponding update document; Step S4: When the transmission is detected to be complete, the firmware data block is verified according to the checksum, and the firmware data block is reorganized to obtain a firmware file; Step S5: writing the firmware file into the corresponding device flash memory and performing the upgrade, automatically rolling back to the previous version when the upgrade fails, and recording the corresponding upgrade information; Step S6: Generate a corresponding upgrade report based on the update document and the upgrade information.
[0020] Based on the above steps, the detailed process is as follows: Step S1: Read the complete firmware file. Divide the firmware file into multiple firmware data blocks according to the preset block size (such as 1MB). Generate a unique identifier for each firmware data block, which can be obtained by using the data block sequence number + timestamp. Calculate the checksum of each firmware data block by using algorithms such as MD5 or SHA256. Store the firmware data block, unique identifier and checksum information in a data structure, such as a list or dictionary.
[0021] Step S2: Detect available network transmission channels, such as WiFi, 4G, Ethernet, etc. Evaluate the bandwidth and stability of each network transmission channel. Develop an allocation strategy based on the number and size of firmware data blocks and the performance of the network transmission channel. Match the unique identifier of the firmware data block with the selected network transmission channel to generate a transmission task list. Create an initial record document for each transmission task, including data block information, transmission channel, start time, etc.
[0022] Step S3: According to the transmission task list, start sending the firmware data block through the corresponding network transmission channel. Monitor the transmission status of each data block in real time, including transmission speed, transmitted size, remaining size, etc. Update the initial record document regularly (such as every second) to record the current transmission progress. If a transmission interruption is detected, immediately mark the breakpoint position in the update document. When the transmission resumes, continue the transmission from the breakpoint position and update the record document. After the transmission is completed, mark the data block transmission completion in the update document.
[0023] Step S4: Check the update document to confirm that all firmware data blocks have been transferred. Recalculate the checksum for each firmware data block. Compare the calculated checksum with the original checksum.
[0024] If the checksum does not match, mark the data block as invalid and consider retransmission. Reassemble all firmware data blocks that pass the checksum in the order of unique identifiers. Write the reassembled data into a new file to obtain a complete firmware file.
[0025] Step S5: Confirm that the device is in an upgradeable state (e.g., it has sufficient power and is not in a critical task). Write the reorganized firmware file to the designated flash memory area of the device. Execute the firmware upgrade procedure, which usually includes steps such as verifying the integrity of the firmware and updating the boot loader. Monitor the upgrade process in real time and record the status of each stage.
[0026] If an error or failure is detected during the upgrade process, the rollback mechanism is triggered immediately. When rolling back, the previous version of the firmware is restored from the backed-up flash area. Whether the upgrade succeeds or fails, detailed upgrade information is recorded, including version number, timestamp, upgrade result, etc.
[0027] Step S6: Collect update documents, including the transfer details of all data blocks. Organize the recorded upgrade information. Analyze key indicators during the transfer process, such as total transfer time, average speed, number of interruptions, etc. Summarize the upgrade results, including whether it is successful, whether a rollback occurs, how long the upgrade takes, etc. Generate a human-readable upgrade report, which may include visualization elements such as charts and statistics. Save the upgrade report as a file or send it to relevant personnel.
[0028] The invention provides a multi-channel firmware upgrade method supporting breakpoint resume transmission. By dividing the firmware file into multiple data blocks and generating a unique identifier and a checksum for each data block, the refined management of data is realized, the basis for breakpoint resume transmission and data integrity verification is provided, and the reliability and efficiency of the upgrade process are effectively improved. Task matching is performed based on the unique identifier and the network transmission channel, a dynamic task allocation strategy is realized, the transmission scheme can be flexibly adjusted according to the changes in the network environment, the available network resources are maximized, and the transmission efficiency is improved. By real-time monitoring of the transmission status and updating the breakpoint record of the initial record document, an effective breakpoint resume transmission mechanism is realized, and the upgrade can be continued from the breakpoint when the network is unstable or the transmission is interrupted, which significantly improves the success rate and efficiency of the upgrade. The checksum is used to verify the data block, which ensures the integrity and accuracy of the transmitted data and reduces the risk of upgrade failure caused by data errors. When the upgrade fails, it automatically rolls back to the previous version and records the relevant upgrade information, which improves the stability and reliability of the system and minimizes the impact of the upgrade failure on the normal operation of the device. An upgrade report is generated based on the update document and the upgrade information, which provides a detailed upgrade process analysis for the management personnel, which is helpful to continuously optimize the upgrade strategy and improve the system management efficiency.
[0029] In one embodiment, dividing a firmware file into a plurality of data blocks and generating a unique identifier and a checksum for each firmware data block includes: Perform an overall analysis of the firmware file to obtain the total file capacity. This step is achieved by reading the metadata of the firmware file or directly calculating the file size, laying the foundation for subsequent block processing.
[0030] The total file capacity is divided and calculated according to the preset data block size threshold to obtain the number of data blocks. The setting of the data block size threshold needs to comprehensively consider factors such as network transmission efficiency, device processing capacity and storage space, and is usually set to a fixed value such as 1MB or 512KB. The calculation formula for the number of data blocks is: Number of data blocks = round up (total file capacity / data block size threshold).
[0031] The firmware file is divided equally according to the number of firmware data blocks to obtain multiple data blocks. File read and write operations are used during the cutting process to ensure that each data block is equal in size (the last data block may be slightly smaller) and to maintain data integrity and continuity.
[0032] Perform hash calculation on each firmware data block to obtain the corresponding hash value. The hash calculation uses a secure hash algorithm (such as SHA-256) to ensure that the generated hash value is sufficiently unique and secure. The generation of the hash value provides the basis for the subsequent creation of a unique identifier.
[0033] The hash value is concatenated with the data block serial number to obtain a unique identifier. The concatenation process usually uses a string connection method, such as the format of "serial number_hash value". This combination method not only ensures the uniqueness of the identifier, but also facilitates the subsequent sorting and management of data blocks.
[0034] The MD5 digest algorithm is used to calculate each firmware data block to obtain the corresponding checksum. The calculation process of the MD5 algorithm includes preprocessing the firmware data block, including padding and appending length information, to obtain the corresponding processed data block. Preprocessing ensures that the data block length is an integer multiple of 512 bits, laying the foundation for subsequent processing.
[0035] The core calculation process of the MD5 algorithm includes initializing four 32-bit registers and splitting the processed data block into 512-bit data sub-blocks. Each data sub-block is processed four times, with each round containing 16 operations. After processing all data sub-blocks, the values of the four 32-bit registers are concatenated to obtain a 128-bit checksum. This process ensures the high uniqueness and security of the checksum.
[0036] The unique identifier and checksum are associated with the corresponding firmware data block to obtain a set of data blocks with metadata. The associated storage can be in the form of key-value pairs, where the unique identifier is used as the key and the corresponding data block content and checksum are used as the value. This storage method facilitates subsequent data management, transmission and verification.
[0037] This embodiment implements the breakpoint-resume function during the firmware upgrade process by processing the firmware file in blocks and generating a unique identifier, greatly improving the reliability and efficiency of the upgrade. The preset data block size threshold can be flexibly adjusted according to the actual network environment and device capabilities to meet the needs of different scenarios. The unique identifier is generated by splicing the hash value with the data block sequence number, which not only ensures the uniqueness of the identifier, but also facilitates the sorting and management of data blocks. The calculation of the MD5 checksum provides an integrity verification mechanism for each data block, effectively preventing data damage or tampering during transmission. The associated storage method closely combines the data block content with the metadata, which is convenient for subsequent data management and verification. This block transmission and verification mechanism not only improves the success rate of the firmware upgrade, but also enables breakpoint-resume transmission when the network is unstable, greatly enhancing the robustness of the upgrade process and user experience.
[0038] In one embodiment, a network transmission channel is obtained, tasks are matched with the network transmission channel according to the unique identifier, a corresponding assigned transmission task is obtained, and a corresponding initial record document is established, including: Scan the network transmission channels to obtain a list of available network transmission channels. This step aims to fully understand the available transmission resources in the current network environment.
[0039] The network transmission channel list is scored to obtain the channel scoring result. The scoring process takes into account multiple factors, such as channel bandwidth, stability, latency, etc., to comprehensively evaluate the transmission performance of each channel.
[0040] Based on the scoring results, the network transmission channels are prioritized and a priority list is generated. This step provides a decision basis for subsequent task allocation and ensures that high-performance channels are allocated first.
[0041] The task allocation analysis uses a greedy algorithm to sort the firmware data blocks according to their size and priority. This sorting method ensures that important large data blocks can get transmission resources first.
[0042] The best matching channel is assigned to the high priority data block. The best match is determined by calculating the difference between the available bandwidth of each channel and the firmware data block size, and the channel with the smallest difference is selected to achieve the best utilization of resources.
[0043] For the remaining firmware data blocks, channels are allocated step by step. Each time, the optimal channel data block pair is selected, taking into account factors such as available channel bandwidth, expected transmission time, and load balancing factors. This dynamic allocation strategy can adapt to changes in network conditions and maximize transmission efficiency.
[0044] After each allocation, the channel available bandwidth and expected load are dynamically updated, and the load balancing factor is recalculated. This real-time adjustment mechanism ensures the accuracy and fairness of resource allocation.
[0045] When the channel bandwidth is insufficient, the remaining firmware data blocks will be temporarily stored in the waiting queue. Once the channel has available bandwidth, it will be immediately reallocated to ensure the continuity and integrity of the transmission task.
[0046] Optimizing the allocation results is a key step to improve transmission efficiency. By exchanging the allocation channels of adjacent data blocks, we try to reduce the overall transmission time and achieve the global optimal transmission solution.
[0047] According to the optimized task allocation scheme, the firmware data blocks are matched with the network transmission channels to establish the corresponding relationship between the data blocks and the channels. This step lays the foundation for the actual transmission operation.
[0048] Based on the matching relationship, a corresponding task queue is generated and a unique identifier is assigned to each task. This precise task management mechanism facilitates subsequent transmission monitoring and exception handling.
[0049] According to the assigned transmission tasks, the initial status, assigned channel and data block information of each task are recorded to generate the initial record document. This document provides an important basis for monitoring the transmission process, resuming transmission from breakpoints and recovering from failures.
[0050] This embodiment achieves accurate grasp of available resources by comprehensively scanning and scoring the network transmission channels, providing a reliable basis for subsequent task allocation. The greedy algorithm is used for task allocation analysis to ensure that high-priority data blocks obtain the best transmission channel and improve the overall transmission efficiency. The introduction of dynamic update mechanism and load balancing factor enables the system to adapt to changes in network conditions in real time, ensuring the fairness and efficiency of resource allocation. By setting waiting queues and optimizing allocation results, the system can flexibly respond to abnormal situations such as insufficient bandwidth, and reduce the overall transmission time by exchanging the allocation channels of adjacent data blocks, thereby achieving global optimization of the transmission plan. Assigning a unique identifier to each task and generating an initial record document provides strong support for breakpoint resumption and fault recovery, and significantly improves the reliability and stability of firmware upgrades.
[0051] In one embodiment, the firmware data block is transmitted through the network transmission channel according to the assigned transmission task, the transmission status is monitored in real time, and the initial record file is updated with breakpoint records to obtain a corresponding update file, including: According to the assigned transmission task, the unique identifier, target transmission channel and transmission priority of each firmware data block are obtained to obtain the transmission task list. The transmission task list contains detailed information of each data block and provides basic data support for the subsequent transmission process. The unique identifier ensures the uniqueness of the data block, the target transmission channel specifies the data transmission path, and the transmission priority determines the processing order of the data block.
[0052] The firmware data blocks are sorted according to the transmission priority to generate a priority transmission queue. The generation of the priority transmission queue takes into account the importance and timeliness of the data blocks, ensuring that key data can be transmitted first and improving the overall transmission efficiency. The sorting algorithm can be selected according to specific needs, such as quick sort or heap sort.
[0053] The corresponding firmware data block in the priority transmission queue is transmitted to the corresponding target transmission channel according to the unique identifier. This step realizes the actual transmission of the data block and ensures that the data block is correctly sent to the specified transmission channel by matching the unique identifier. During the transmission process, factors such as network bandwidth and transmission protocol are considered to optimize transmission performance.
[0054] The transmission process of each firmware data block is monitored in real time, and the transmission start time, number of bytes transmitted, number of remaining bytes and transmission rate are recorded to obtain the corresponding monitoring records. The real-time monitoring mechanism can reflect the transmission status in time, providing a basis for breakpoint resumption and transmission optimization. The monitoring record contains the key parameters of the transmission process, which are used to evaluate the transmission effect and diagnose potential problems.
[0055] According to the monitoring records, the transfer progress percentage of each firmware data block is calculated, and the transfer progress information is written to the initial record document. The calculation and recording of the transfer progress provides intuitive transfer status feedback, which helps users understand the upgrade process. The initial record document serves as a persistent storage of the transfer status, laying the foundation for the breakpoint resume function.
[0056] When a transmission interruption is detected, the interruption time and amount of data transmitted are recorded, the breakpoint information in the initial record document is updated, and an updated document is obtained. Breakpoint record update is a key step in achieving breakpoint resume. By recording interruption information in a timely manner, the breakpoint position can be accurately located when resuming transmission, avoiding repeated transmission of successfully transmitted data, and improving transmission efficiency and reliability.
[0057] This embodiment implements flexible and efficient transmission task management by assigning a unique identifier and transmission priority to each firmware data block, adapting to different network environments and upgrade requirements. The generation of a priority transmission queue ensures the timely transmission of key data and improves the overall upgrade efficiency. The real-time monitoring mechanism can reflect the transmission status in a timely manner, provide an accurate basis for breakpoint resumption, and greatly improve the reliability of firmware upgrades. Through the accurate calculation and recording of the transmission progress, users can intuitively understand the upgrade process and enhance the user experience. The breakpoint record update function effectively solves the problem of transmission interruption caused by network instability, avoids repeated transmission, and saves network resources and time. The multi-channel transmission strategy makes full use of the network bandwidth and significantly improves the efficiency of large-scale firmware upgrades. Overall, this method implements an efficient, reliable, and flexible firmware upgrade process, which is suitable for various complex network environments and device types.
[0058] In one embodiment, the transmission process of each firmware data block is monitored in real time, and the transmission start time, the number of bytes transmitted, the number of bytes remaining, and the transmission rate are recorded to obtain corresponding monitoring records, including: Set a monitoring time window for the firmware data block, record the transmission start time, sample the data during the transmission process, record the data transmission volume at the sampling point, and obtain the transmission data sequence. The monitoring time window is set based on the size of the firmware data block and the estimated transmission time to ensure that the data changes during the transmission process can be fully captured. The data sampling frequency is dynamically adjusted according to the transmission speed and monitoring accuracy requirements to balance the monitoring accuracy and system resource consumption.
[0059] The transmission rates of adjacent sampling points are calculated to obtain a real-time transmission rate sequence. The calculation of the transmission rate takes into account the changes in the sampling time interval and the amount of data transmitted, and can reflect the speed fluctuations during the transmission process. The real-time transmission rate sequence provides basic data for subsequent analysis.
[0060] The fractal chaos feature analysis of the real-time transmission rate series is performed to obtain the corresponding chaotic features, and the adaptive weight kernel smoothing method is used to process it to obtain smoothed transmission rate data. Fractal chaos feature analysis can reveal the inherent law of transmission rate changes and help identify potential transmission anomalies. The adaptive weight kernel smoothing method dynamically adjusts the smoothing parameters according to the data characteristics, reduces the impact of noise while retaining the data characteristics, and improves the reliability of the data.
[0061] According to the smoothed transmission rate data, the rate fluctuation threshold is set, the transmission abnormal points are marked, and the effective transmission time and invalid transmission time are counted to obtain the corresponding statistical time. The rate fluctuation threshold is set based on historical transmission data and current network conditions, which can accurately identify abnormal fluctuations in the transmission process. The marking of transmission abnormal points helps in subsequent analysis and optimization of transmission strategies. The statistics of effective transmission time and invalid transmission time provide an important basis for evaluating transmission efficiency.
[0062] Based on the statistical time and smoothed transmission rate data, the number of bytes transmitted and the number of bytes remaining in the firmware data block are calculated to obtain the monitoring record. The calculation process takes into account the effective transmission time and the actual transmission rate, which can accurately reflect the current transmission progress. The monitoring record contains key information such as the transmission start time, the number of bytes transmitted, the number of bytes remaining, and the average transmission rate, providing data support for breakpoint resumption and transmission optimization.
[0063] Among them, the calculation formula for processing using the adaptive weight kernel smoothing method is: ; : smooth transmission rate at time t, : the i-th sampling time, t: the current sampling time, : real-time transmission rate of the i-th sampling point, λ: maximum Lyapunov exponent, D: fractal dimension, H: Hurst exponent, n: total number of sampling points, : Natural exponential function.
[0064] This embodiment can fully grasp the transmission status by real-time monitoring of the firmware data block transmission process, provide accurate data support for breakpoint resumption, and improve the reliability and efficiency of firmware upgrades. Fractal chaos feature analysis and adaptive weight kernel smoothing methods are used to process transmission rate data, effectively identify transmission anomalies, and improve the accuracy and stability of monitoring. By setting rate fluctuation thresholds and marking transmission anomalies, accurate assessment of transmission quality is achieved, providing a basis for optimizing transmission strategies. Statistics of effective transmission time and invalid transmission time, combined with smoothed transmission rate data to calculate transmission progress, not only improves the accuracy of progress estimation, but also provides an important reference for resource allocation of multi-channel transmission. This comprehensive and accurate monitoring method significantly improves the overall performance and adaptability of multi-channel firmware upgrades, and provides reliable guarantees for firmware upgrades in different network environments.
[0065] In one embodiment, according to the monitoring record, the transmission progress percentage of each firmware data block is calculated, and the transmission progress information is written into the initial record file, including: The basic transfer progress percentage is calculated based on the number of bytes transferred and the number of bytes remaining. This step provides basic data for subsequent transfer progress calculations and reflects the original progress status of the current transfer.
[0066] Perform rate analysis on the monitoring records to obtain the current transmission rate, initial transmission rate, remaining bytes, initial total bytes, used time, and estimated total time. Rate analysis is a key step in evaluating network transmission conditions. By comparing the current transmission rate with the initial transmission rate, the changing trend of network conditions can be determined. At the same time, the comparison of the remaining bytes with the initial total bytes, and the comparison of the used time with the estimated total time, provide necessary parameters for subsequent factor calculations.
[0067] The network condition factor, remaining data factor, and time factor are calculated separately. The network condition factor measures changes in network conditions by the ratio of the current transmission rate to the initial transmission rate. The remaining data factor is expressed as the complement of the square root of the ratio of the remaining bytes to the initial total bytes. This calculation method can better reflect the characteristic that the transmission progress speeds up as the remaining data decreases. The time factor is directly expressed as the ratio of the used time to the estimated total time, reflecting the relationship between the actual transmission time and the expected time.
[0068] Based on the basic transmission progress percentage, network condition factor, remaining data volume factor and time factor calculated above, the transmission progress is calculated to obtain the corresponding final transmission progress percentage. This step comprehensively considers multiple influencing factors, making the calculated transmission progress more accurate and reasonable, and better reflecting the actual transmission situation.
[0069] The calculated final transfer progress percentage is written into the initial record document to complete the update of the transfer progress information.
[0070] Wherein, network condition factor = current transmission rate / initial transmission rate; Remaining data factor = 1 - (remaining bytes / initial total bytes) 0.5 Time factor = elapsed time / estimated total time.
[0071] This embodiment achieves accurate calculation of the firmware data block transmission progress by performing multi-dimensional analysis on the monitoring records. Combining network conditions, remaining data volume and time factors, the calculated transmission progress more accurately reflects the actual situation, effectively improving the predictability and controllability of the firmware upgrade process. The square root complement calculation method of the remaining data volume factor cleverly reflects the characteristic that the transmission speed increases as the remaining data volume decreases, making the progress estimation more in line with the actual transmission law. By writing the calculated final transmission progress percentage into the initial record document in a timely manner, reliable data support is provided for the breakpoint resume function, greatly improving the fault tolerance and recoverability of the firmware upgrade process. This progress calculation method that takes into account multiple factors not only improves the stability and efficiency of firmware upgrades, but also provides users with more accurate upgrade progress information and optimizes the user experience.
[0072] In one embodiment, when the transmission is detected to be complete, the firmware data block is verified according to the checksum, and the firmware data block is reorganized to obtain a firmware file, including: Perform a checksum calculation on each firmware data block to obtain the actual checksum. This step generates a value for verifying data integrity by calculating the data block content using a specific algorithm.
[0073] The actual checksum is compared with the checksum to obtain the verification result. The checksum is usually calculated in advance before data transmission and sent along with the data. By comparing the actual calculated checksum with the preset checksum, it is determined whether the data has been changed or damaged during the transmission process.
[0074] According to the verification result, the data blocks that failed the verification are marked to obtain a list of data blocks that failed the verification. This step records the information of all data blocks that failed the verification in preparation for subsequent retransmission operations.
[0075] The system will request the sender to retransmit the data blocks that failed verification to ensure that the data is complete and correct.
[0076] The retransmitted data replaces the corresponding verification failed data blocks and is integrated with the verified firmware data blocks to obtain the verified data block set. This step combines all the correct data blocks together to prepare for the subsequent reorganization operation.
[0077] The verified data block set is sorted according to the unique identifier to obtain an ordered data block set. Each data block usually has a unique identifier to determine its position in the original file. By sorting, the correct order of the data blocks can be restored.
[0078] Metadata is extracted from the data blocks in the ordered data block set to obtain the reorganization information. Metadata usually contains information such as file structure and the relationship between data blocks, which is crucial for correctly reorganizing files.
[0079] The data blocks in the ordered data block set are reorganized according to the reorganization information to obtain a reorganized file. This step combines the sorted data blocks according to the instructions in the metadata to form a complete file structure.
[0080] Perform integrity check on the reassembled file to obtain the integrity result. This is the final verification step to ensure that the reassembled file is completely consistent with the original file.
[0081] When the integrity result is complete, the reassembled file is the required firmware file, which means that the entire transfer and reassembly process is successfully completed and a complete and correct firmware file is obtained.
[0082] When the integrity result is incomplete, the data block transfer step is returned and re-executed. If the final check fails, it means that there are still problems in the transmission or reassembly process, and the whole process needs to be repeated to ensure that the correct firmware file is obtained.
[0083] This embodiment can quickly identify the data blocks with errors during the transmission process by checking, calculating and comparing each firmware data block, thereby improving the accuracy and efficiency of the upgrade process. The list of data blocks that failed to be checked is used for retransmission requests, which avoids repeated transmission of data that has been correctly received, saving network bandwidth and transmission time. The data blocks are sorted using unique identifiers to ensure the correctness of data reorganization and prevent firmware damage caused by incorrect data block order. Through metadata extraction and reorganization operations, accurate reconstruction of scattered data is achieved, improving the integrity and reliability of firmware files. The final integrity check mechanism serves as a double guarantee to further ensure the security of the upgrade process. The multiple verification and retransmission mechanisms throughout the process greatly improve the success rate of firmware upgrades in complex network environments, reduce the risk of upgrade failures caused by transmission errors, and provide a strong guarantee for the stable operation of the device.
[0084] In one embodiment, the firmware file is written into the corresponding device flash memory and the upgrade is performed. When the upgrade fails, it is automatically rolled back to the previous version, and the corresponding upgrade information is recorded, including: Perform partition mapping analysis on the firmware file to obtain multiple mapped partitions. This step analyzes the structure of the firmware file and divides it into different functional areas, such as boot area, system area, application area, etc. For example, an embedded device firmware may contain a bootloader partition, a kernel partition, and a root file system partition.
[0085] The device flash memory is written in parallel according to the multiple mapped partitions to obtain the written device flash memory. The corresponding partition data is written to different flash memory areas at the same time by using multi-threading or multi-process technology to improve the writing efficiency. For example, the bootloader and kernel data can be written to different blocks of the NAND flash memory at the same time.
[0086] Update the bootloader to the written device flash memory and restart the device to get the restart device status. This step ensures that the device can correctly boot the new firmware. For example, update the configuration parameters of the U-Boot bootloader to point to the new kernel location, and then restart the device to load the new firmware.
[0087] Perform functional tests on the restarted device state and obtain device functional test results. This includes automated testing of key device functions such as network connectivity, sensor readings, actuator control, etc. For example, for a smart home device, its WiFi connectivity, temperature sensor readings, and remote control functions may be tested.
[0088] The device function test results are upgraded to obtain the judgment results. The test results are evaluated according to the preset success criteria to determine whether the upgrade is successful. For example, if all key function tests pass and the device can run stably for more than 5 minutes, the upgrade is determined to be successful.
[0089] When the upgrade is successful, the new version of the firmware is marked to obtain the corresponding device status. This may include updating the version information of the device, setting the corresponding flag bit, etc. For example, the new firmware version number and upgrade timestamp are recorded in the device configuration file.
[0090] When the upgrade fails, the previous version of the firmware file is located to obtain the rollback target version. This usually involves reading the backup information stored in the device to determine the last stable running version. For example, the backup version information is read from a specific flash memory area of the device.
[0091] Perform a partition overwrite operation on the device flash memory according to the rollback target version to obtain the rolled-back device flash memory and the rolled-back device state. This step restores the device to the state before the upgrade. For example, the current system partition is overwritten with the backup firmware stored in another flash memory partition.
[0092] Timestamp each operation data in the upgrade process to obtain the upgrade log. Record key events and time points in the upgrade process, including start time, completion time of each partition write, test start and end time, etc. For example, record "2023-04-01 10:00:15 - Start upgrade", "2023-04-01 10:02:30 - System partition write completed" and other information.
[0093] This embodiment significantly improves the efficiency of firmware upgrades and shortens the time required for upgrades by performing partition mapping analysis and parallel write processing on firmware files. Functional testing and automatic judgment mechanisms are used to ensure the reliability of the upgrade process and effectively reduce the risk of upgrade failure. The introduction of an automatic rollback function allows rapid recovery to the previous stable version when an upgrade fails, minimizing device downtime and improving system availability. Detailed upgrade log recording and information generation provide strong support for subsequent problem diagnosis and system optimization.
[0094] In one embodiment, based on the update document and the upgrade information, a corresponding upgrade report is generated, including: Parse the update document, extract the transmission status information of each data block, and obtain the transmission status data set. The transmission status data set contains information such as the transmission success rate, transmission time, and number of retransmissions of each data block. For example, for an update document containing 100 data blocks, a data set containing 100 elements may be obtained, and each element records the transmission details of the corresponding data block.
[0095] The performance of each network transmission channel is evaluated based on the transmission status data set to obtain the channel performance evaluation results. The evaluation process takes into account factors such as transmission speed, stability, and reliability. The channel performance evaluation results may include indicators such as average transmission rate, packet loss rate, and delay. For example, the evaluation results of a channel may show that its average transmission rate is 10Mbps, the packet loss rate is 0.1%, and the average delay is 50ms.
[0096] The upgrade success rate, upgrade duration, and rollback times of the upgrade information are extracted and integrated to obtain the upgrade performance data. The upgrade performance data reflects the efficiency and reliability of the entire upgrade process. For example, the performance data of an upgrade may show that the upgrade success rate is 99%, the total upgrade duration is 30 minutes, and the rollback times are 1.
[0097] A multi-dimensional evaluation matrix is constructed based on the channel performance evaluation results and the upgrade performance data to obtain a comprehensive performance index. The multi-dimensional evaluation matrix normalizes and weights the performance data of different dimensions to ultimately obtain a comprehensive performance score. For example, different weights can be assigned to indicators such as transmission speed, stability, and upgrade success rate, and the final comprehensive performance score can be obtained through weighted average.
[0098] The performance ranking results are obtained by sorting the performance according to the comprehensive performance indicators. The sorting process considers the comprehensive performance of each channel and the upgrade process and gives an objective performance ranking. The ranking results may include the overall ranking and the ranking of each individual indicator.
[0099] Based on the performance ranking results, a visual report is constructed to obtain an upgrade report. The visual report uses charts, data tables, etc. to intuitively display the performance evaluation results. The report content may include a performance data overview, a performance comparison chart for each channel, a timeline chart of the upgrade process, etc., so that managers can quickly understand the overall situation and key indicators of the upgrade process.
[0100] This embodiment achieves a comprehensive performance evaluation of the firmware upgrade process by systematically analyzing and evaluating the update documents and upgrade information. This method can not only independently evaluate the performance of each network transmission channel, but also comprehensively consider factors such as the upgrade success rate, duration, and number of rollbacks, thereby providing a more comprehensive and objective performance evaluation. By constructing a multi-dimensional evaluation matrix, the performance data of different dimensions are integrated into a comprehensive performance indicator, which effectively solves the problem of insufficient evaluation of a single indicator. This method can more accurately reflect the overall performance of each channel and the upgrade process, providing a more reliable basis for management decisions. The performance evaluation results are presented in the form of a visual report, which greatly improves the readability and comprehensibility of the data. Through intuitive charts and data tables, managers can quickly grasp the key information of the upgrade process, which helps to find problems in a timely manner and optimize the upgrade strategy.
[0101] Reference Figure 2 As shown, the present invention also provides a multi-channel firmware upgrade device supporting breakpoint resumption, which is applied to any of the above multi-channel firmware upgrade methods supporting breakpoint resumption, comprising: The acquisition module is used to divide the firmware file into multiple data blocks and generate a unique identifier and a checksum for each firmware data block; An analysis module is used to obtain a network transmission channel, match tasks with the network transmission channel according to a unique identifier, obtain corresponding assigned transmission tasks, and establish a corresponding initial record document; The association module is used to transmit the firmware data block through the network transmission channel according to the assigned transmission task, monitor the transmission status in real time, and perform breakpoint record update on the initial record document to obtain the corresponding update document; The processing module is used to verify the firmware data block according to the checksum after the transmission is detected to be completed, and reorganize the firmware data block to obtain the firmware file; A control module, which is used to write the firmware file into the corresponding device flash memory and perform the upgrade, automatically roll back to the previous version when the upgrade fails, and record the corresponding upgrade information; The execution module is used to generate a corresponding upgrade report based on the update document and upgrade information.
[0102] The invention provides a multi-channel firmware upgrade system supporting breakpoint resume transmission. By dividing the firmware file into multiple data blocks and generating a unique identifier and a checksum for each data block, the system realizes refined data management, provides a basis for breakpoint resume transmission and data integrity verification, and effectively improves the reliability and efficiency of the upgrade process. Task matching is performed based on the unique identifier and the network transmission channel, a dynamic task allocation strategy is implemented, the transmission scheme can be flexibly adjusted according to changes in the network environment, the available network resources are maximized, and the transmission efficiency is improved. By real-time monitoring of the transmission status and updating the breakpoint record of the initial record document, an effective breakpoint resume transmission mechanism is implemented, and the upgrade can be continued from the breakpoint when the network is unstable or the transmission is interrupted, which significantly improves the success rate and efficiency of the upgrade. The checksum is used to verify the data block, which ensures the integrity and accuracy of the transmitted data and reduces the risk of upgrade failure caused by data errors. When the upgrade fails, the system automatically rolls back to the previous version and records the relevant upgrade information, which improves the stability and reliability of the system and minimizes the impact of the upgrade failure on the normal operation of the device. An upgrade report is generated based on the update document and the upgrade information, which provides a detailed upgrade process analysis for the management personnel, and helps to continuously optimize the upgrade strategy and improve the system management efficiency.
[0103] It should be noted that technicians in the relevant technical field can clearly understand that for the convenience and conciseness of description, the specific working process of the system and each module described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0104] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A multi-channel firmware upgrade method supporting breakpoint resume, characterized in that: include: Splitting the firmware file into a plurality of firmware data blocks, and generating a unique identifier and a checksum for each of the firmware data blocks; Acquire a network transmission channel, perform task matching with the network transmission channel according to the unique identifier, obtain a corresponding assigned transmission task, and establish a corresponding initial record document; Transmitting the firmware data block through the network transmission channel according to the assigned transmission task, monitoring the transmission status in real time, and performing breakpoint record update on the initial record document to obtain a corresponding update document; When the transmission is detected to be complete, the firmware data block is verified according to the checksum, and the firmware data block is reorganized to obtain the firmware file; Writing the firmware file into the corresponding device flash memory and performing the upgrade, automatically rolling back to the previous version when the upgrade fails, and recording the corresponding upgrade information; Based on the update document and the upgrade information, a corresponding upgrade report is generated.
2. The multi-channel firmware upgrade method supporting breakpoint resume according to claim 1, characterized in that: The step of dividing the firmware file into a plurality of data blocks and generating a unique identifier and a checksum for each of the firmware data blocks comprises: Performing overall analysis on the firmware file to obtain the total capacity of the file; The total capacity of the file is divided and calculated according to a preset data block size threshold to obtain the number of data blocks; The firmware file is divided into equal parts according to the number of the firmware data blocks to obtain a plurality of data blocks; Performing hash calculation on each of the firmware data blocks to obtain a corresponding hash value; Concatenate the hash value with the data block sequence number to obtain a unique identifier; Calculate each firmware data block using the MD5 digest algorithm to obtain a corresponding checksum; The calculation process using the MD5 digest algorithm includes preprocessing the firmware data block, including padding and appending length information, to obtain a corresponding processed data block; Initialize four 32-bit registers, divide the processed data block into 512-bit data sub-blocks, and perform four rounds of processing on each of the data sub-blocks. After all the data sub-blocks are processed, concatenate the values of the four 32-bit registers to obtain the 128-bit checksum; The unique identifier and the checksum are associated with the corresponding firmware data block and stored to obtain a data block set with metadata.
3. The multi-channel firmware upgrade method supporting breakpoint resume according to claim 1, characterized in that: The acquiring of the network transmission channel, matching the task with the network transmission channel according to the unique identifier, obtaining the corresponding assigned transmission task, and establishing the corresponding initial record document, includes: Scan the network transmission channels to obtain a network transmission channel list; Performing channel scoring on the network transmission channel list to obtain a channel scoring result; Sorting the network transmission channels based on the channel scoring results to obtain a priority sorting list; Performing task allocation analysis according to the unique identifier and the priority sorting list to obtain a task allocation scheme, wherein the task allocation analysis adopts a greedy algorithm, including: sorting the firmware data blocks according to the size and priority of the firmware data blocks; Allocate the best matching channel for the high priority data block, calculate the difference between the available bandwidth of each channel and the size of the firmware data block, and select the channel with the smallest difference as the best match; gradually allocating channels for the remaining firmware data blocks, selecting the currently optimal channel data block pair each time, wherein the selection criteria include available channel bandwidth, expected transmission time, and load balancing factor; After each allocation, dynamically update the available bandwidth and expected load of the channel, and recalculate the load balancing factor; When the channel bandwidth is insufficient, the remaining firmware data blocks are temporarily stored in a waiting queue, and are allocated when the channel bandwidth is available to obtain a corresponding allocation result; Optimize the allocation results and try to reduce the overall transmission time by exchanging the allocation channels of adjacent data blocks; Channel matching is performed on the firmware data block and the network transmission channel according to the task allocation scheme to obtain a matching relationship between the data block and the channel; Generate a corresponding task queue based on the matching relationship, and assign a unique task identifier to each task to obtain the assigned transmission task; The initial record document is obtained by recording the initial status, allocation channel and data block information of each task according to the allocated transmission task.
4. The multi-channel firmware upgrade method supporting breakpoint resume according to claim 1, characterized in that: The firmware data block is transmitted through the network transmission channel according to the assigned transmission task, the transmission status is monitored in real time, and the initial record document is updated at the breakpoint to obtain a corresponding update document, including: Acquire the unique identifier, target transmission channel and transmission priority of each firmware data block according to the assigned transmission task to obtain a transmission task list; Sorting the firmware data blocks according to the transmission priority to generate a priority transmission queue; Transmitting the corresponding firmware data block in the priority transmission queue to the corresponding target transmission channel according to the unique identifier; The transmission process of each firmware data block is monitored in real time, and the transmission start time, the number of bytes transmitted, the number of remaining bytes and the transmission rate are recorded to obtain corresponding monitoring records; Calculating the transmission progress percentage of each firmware data block according to the monitoring record, and writing the transmission progress information into the initial record file; When a transmission interruption is detected, the interruption time and the amount of data transmitted are recorded, and the breakpoint information in the initial record file is updated to obtain the update file.
5. The multi-channel firmware upgrade method supporting breakpoint resume according to claim 4, characterized in that: The transmission process of each firmware data block is monitored in real time, and the transmission start time, the number of bytes transmitted, the number of remaining bytes and the transmission rate are recorded to obtain corresponding monitoring records, including: Setting a monitoring time window for the firmware data block, recording the transmission start time, sampling data during the transmission process, recording the data transmission volume at the sampling point, and obtaining a transmission data sequence; Calculate the transmission rates of adjacent sampling points to obtain a real-time transmission rate sequence; Performing fractal chaos feature analysis on the real-time transmission rate sequence to obtain corresponding chaotic features, and processing the sequence using an adaptive weight kernel smoothing method to obtain smoothed transmission rate data; According to the smoothed transmission rate data, a rate fluctuation threshold is set, transmission abnormal points are marked, effective transmission time and invalid transmission time are counted, and corresponding statistical time is obtained; Based on the statistical time and the smoothed transmission rate data, the number of transmitted bytes and the number of remaining bytes of the firmware data block are calculated to obtain the monitoring record; Among them, the calculation formula for processing using the adaptive weight kernel smoothing method is: ; : smooth transmission rate at time t, : the i-th sampling time, t: the current sampling time, : real-time transmission rate of the i-th sampling point, λ: maximum Lyapunov exponent, D: fractal dimension, H: Hurst exponent, n: total number of sampling points, : Natural exponential function.
6. The multi-channel firmware upgrade method supporting breakpoint resume according to claim 4, characterized in that: The step of calculating the transmission progress percentage of each firmware data block according to the monitoring record and writing the transmission progress information into the initial record document comprises: Calculate the basic transmission progress percentage according to the number of bytes transmitted and the number of remaining bytes; Performing rate analysis on the monitoring records to obtain the current transmission rate, initial transmission rate, remaining number of bytes, initial total number of bytes, used time and estimated total time, and calculating the network condition factor, remaining data amount factor and time factor respectively; Calculate the transmission progress based on the basic transmission progress percentage, the network condition factor, the remaining data amount factor and the time factor to obtain a corresponding final transmission progress percentage; Writing the final transmission progress percentage into the initial record file to complete the update of the transmission progress information; Wherein, the network condition factor = the current transmission rate / the initial transmission rate; The remaining data amount factor = 1 - (the remaining number of bytes / the initial total number of bytes) 0.5 The time factor=the used time / the estimated total time.
7. The multi-channel firmware upgrade method supporting breakpoint resume according to claim 1, characterized in that: When the transmission is detected to be complete, the firmware data block is verified according to the checksum, and the firmware data block is reorganized to obtain the firmware file, including: Performing checksum calculation on each of the firmware data blocks to obtain an actual checksum; Comparing the actual checksum with the checksum to obtain a check result; Marking the verification failed data blocks according to the verification result to obtain a verification failed data block list; Making a data retransmission request according to the verification failed data block list to obtain retransmission data; The retransmitted data replaces the corresponding verification failed data block, and integrates it with the verification successful firmware data block to obtain a verified data block set; Sorting the verified data block set according to the unique identifier to obtain an ordered data block set; Extracting metadata from the data blocks in the ordered data block set to obtain reorganization information; Performing a reorganization operation on the data blocks in the ordered data block set according to the reorganization information to obtain a reorganized file; Performing integrity check on the reorganized file to obtain an integrity result; When the integrity result is complete, the reassembled file is the firmware file; When the integrity result is incomplete, the process returns to re-execute the data block transmission step.
8. The multi-channel firmware upgrade method supporting breakpoint resume according to claim 1, characterized in that: The firmware file is written into the corresponding device flash memory and upgraded, and when the upgrade fails, it is automatically rolled back to the previous version, and the corresponding upgrade information is recorded, including: Performing partition mapping analysis on the firmware file to obtain multiple mapping partitions; Performing parallel writing processing on the device flash memory according to the plurality of mapping partitions to obtain a device flash memory in which writing is completed; The boot program is updated on the device flash memory after writing, and a restart operation is performed to obtain a restart device status; Performing a functional test on the restart device state to obtain a device functional test result; Performing an upgrade judgment on the functional test result of the device to obtain a judgment result; When the judgment result is that the upgrade is successful, the new version of the firmware is marked to obtain the corresponding device status; When the determination result is that the upgrade fails, locating the firmware file of the previous version to obtain a rollback target version; Performing a partition overwrite operation on the device flash memory according to the rollback target version to obtain the device flash memory after the rollback and the device state after the rollback; Timestamp each operation data in the upgrade process to obtain the upgrade log; Corresponding upgrade information is generated according to the upgrade log and the device status.
9. The multi-channel firmware upgrade method supporting breakpoint resume according to claim 1, characterized in that: The generating a corresponding upgrade report based on the update document and the upgrade information includes: Parsing the update document, extracting the transmission status information of each data block, and obtaining a transmission status data set; Performing performance evaluation on each of the network transmission channels according to the transmission status data set to obtain a channel performance evaluation result; Extracting the upgrade success rate, upgrade duration, and rollback times of the upgrade information, and integrating them to obtain upgrade performance data; Constructing a multi-dimensional evaluation matrix based on the channel performance evaluation results and the upgrade performance data to obtain a comprehensive performance index; Sorting the performance according to the comprehensive performance indicators to obtain a performance ranking result; A visual report is constructed based on the performance ranking results to obtain the upgrade report.
10. A multi-channel firmware upgrade device supporting breakpoint resume, characterized in that: The multi-channel firmware upgrade method supporting breakpoint resume applied to any one of claims 1 to 9 above comprises: A collection module, the collection module is used to divide the firmware file into multiple data blocks, and generate a unique identifier and a checksum for each firmware data block; An analysis module, the analysis module is used to obtain a network transmission channel, perform task matching with the network transmission channel according to the unique identifier, obtain a corresponding assigned transmission task, and establish a corresponding initial record document; An association module, the association module is used to transmit the firmware data block through the network transmission channel according to the assigned transmission task, monitor the transmission status in real time, and perform breakpoint record update on the initial record document to obtain a corresponding update document; A processing module, wherein the processing module is used to verify the firmware data block according to the checksum after the transmission is detected to be completed, and reorganize the firmware data block to obtain the firmware file; A control module, the control module is used to write the firmware file into the corresponding device flash memory and perform the upgrade, automatically roll back to the previous version when the upgrade fails, and record the corresponding upgrade information; An execution module is used to generate a corresponding upgrade report based on the update document and the upgrade information.
Citation Information
Cited By
Data hierarchical caching and intelligent continuous transmission method and device in network disconnection environment
CN119814882A
Data hierarchical caching and intelligent resuming method and device in off-network environment
CN119814882B
Cache processing method and device of gateway router and network equipment
CN119922140A
Firmware upgrading method capable of returning version
CN119938106A
Data breakpoint transmission method, device, equipment and program product
CN120050278A