Communication board upgrading method and storage medium

By comparing the partition algorithm values ​​of the communication board and the upgrade package, only the difference partitions are updated, which solves the problem of low upgrade efficiency of the communication board, improves the upgrade efficiency and extends the life of the flash memory, and realizes self-upgrade and inter-communication board communication without the intervention of the host computer. upgrade.

CN118567925APending Publication Date: 2024-08-30SHENZHEN HONGXINYU STORAGE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410715971.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

The existing communication board upgrade method has low efficiency, slow transmission speed, large data traffic, and long upgrade time, which results in inconvenience and delay in the upgrade process and reduces the efficiency of communication board upgrade.

Method used

By receiving the upgrade instructions from the host computer, downloading the upgrade package and obtaining the partition verification information, comparing the upgrade package and the partition algorithm value of the communication board, only performing data transmission and update on the difference partition, complying with the erase and write rules of NOR Flash, reducing The number of flash memory erases.

Benefits of technology

It improves the efficiency of communication board upgrades, reduces data transmission traffic, extends the service life of flash memory, and enables self-upgrades between communication boards without the intervention of the host computer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567925A
    Figure CN118567925A
Patent Text Reader

Abstract

The invention provides a communication board upgrading method and a storage medium. The method comprises the following steps: receiving an upgrade instruction of an upper computer and downloading an upgrade package, wherein the upgrade package comprises partition verification information; obtaining partition verification information and caching the partition verification information to a cache region, wherein the partition verification information comprises a plurality of first algorithm values; obtaining a plurality of second algorithm values of the cache region, the plurality of first algorithm values being in one-to-one correspondence with the plurality of second algorithm values, and the plurality of second algorithm values being respectively corresponding to partitions of the communication board; comparing the plurality of first algorithm values with the plurality of second algorithm values to obtain second algorithm values different from the first algorithm values; determining partitions corresponding to the second algorithm values with differences; information of the corresponding partitions is sent to an upper computer; upgrading data of the upper computer are received, the corresponding partitions are upgraded, and the upgrading data comprise upgrading data of the corresponding partitions. The communication board upgrading efficiency can be improved, the erasing frequency of the flash memory is reduced, and the service life of the flash memory is prolonged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of communication board upgrade, and in particular to a communication board upgrade method and storage medium. Background Art

[0002] During the entire production cycle of a chip, chip testing is one of the important links to test the actual performance of the chip and ensure product quality. Currently, chips are generally tested through communication boards. In order to better meet the testing requirements, upgrading the communication board is a key task.

[0003] For communication boards that have been manufactured and installed in fixed positions, traditional physical upgrade methods such as replacing the main control unit are not easy to operate, and the existing network upgrade has the problem of low efficiency in actual application, which is mainly manifested in slow transmission speed, large data flow, long upgrade time, etc. These problems lead to inconvenience and delays in the upgrade process and reduce the efficiency of communication board upgrades. Summary of the invention

[0004] In view of this, the present application provides a communication board upgrade method and storage medium, which can improve the problem of low efficiency in communication board upgrade.

[0005] The present application provides a communication board upgrade method, comprising: receiving an upgrade instruction from a host computer, and downloading an upgrade package according to the upgrade instruction, wherein the upgrade package includes partition verification information; obtaining the partition verification information and caching it in a cache area, wherein the partition verification information includes multiple first algorithm values; obtaining multiple second algorithm values ​​from the cache area, wherein the multiple first algorithm values ​​correspond one-to-one to the multiple second algorithm values, and the multiple second algorithm values ​​respectively correspond to the partitions of the communication board; comparing the multiple first algorithm values ​​with the multiple second algorithm values ​​to obtain second algorithm values ​​that are different from the first algorithm values; determining the partition corresponding to the second algorithm value that is different; sending the information of the corresponding partition to the host computer; receiving upgrade data corresponding to the corresponding partition from the host computer, and upgrading the corresponding partition, wherein the upgrade data has the upgrade data of the corresponding partition.

[0006] By comparing the upgrade package with the algorithm values ​​corresponding to each partition of the communication board, the partition that needs to be upgraded (or data updated) is determined, and data is transmitted and updated only for this partition, so as to achieve the upgrade of the communication board, which can reduce the data transmission traffic and thus improve the efficiency of the communication board upgrade. In addition, this upgrade method complies with the erase and write rules of the NOR Flash (non-volatile flash memory technology) of the communication board (NOR Flash is based on blocks and needs to be erased before writing), so the number of erase times of the flash memory can be reduced, which is beneficial to extending the service life of the flash memory.

[0007] Optionally, the obtaining of multiple second algorithm values ​​of the cache area includes:

[0008] The data in the multiple partitions of the communication board are cached in the cache area, and a preset encryption algorithm is used to obtain a plurality of second algorithm values ​​corresponding to the data in the multiple partitions.

[0009] This example can be regarded as obtaining multiple second algorithm values ​​through real-time calculation, which is helpful to ensure the real-time nature of the calculation results and avoid obtaining outdated or erroneous second algorithm values.

[0010] Optionally, the obtaining of multiple second algorithm values ​​of the cache area includes:

[0011] Preset at least one verification partition;

[0012] Obtaining a plurality of second algorithm values ​​respectively corresponding to the data in the plurality of partitions of the communication board by using a preset encryption algorithm, and storing the plurality of second algorithm values ​​in the verification partition;

[0013] A plurality of second algorithm values ​​are read from the check partition and cached in the cache area.

[0014] In this example, multiple pre-calculated second algorithm values ​​are directly read from the cache area for comparison during the upgrade, thereby avoiding temporary reading of the stored data of each partition and recalculation, thereby reducing the amount of calculation.

[0015] Optionally, after upgrading the corresponding partition, the method further includes:

[0016] The first algorithm value corresponding to the corresponding partition in the verification partition is erased, and the second algorithm value corresponding to the corresponding partition is written into the verification partition.

[0017] In this example, after each upgrade, the communication board can update the second algorithm value in the verification partition, so that the second algorithm value after the latest upgrade can be directly read from the verification partition during the next upgrade. In addition, the communication board only updates the second algorithm value with differences, and does not update all the second algorithm values ​​in the verification partition, which can reduce the amount of updated data and the number of times the communication board is erased, which is conducive to extending the service life of the flash memory.

[0018] Optionally, the upgrade package further includes header information, and the header information includes a mark byte and upgrade package memory; after downloading the upgrade package according to the upgrade instruction, the method further includes:

[0019] Detecting whether the preset byte is consistent with the mark byte, and whether the memory occupied by the downloaded upgrade package is consistent with the memory occupied by the upgrade package in the header information, wherein the preset byte is used to identify the type of the package to which the header information belongs;

[0020] If the detection results are all yes, it is determined that the upgrade package is valid, and the step of obtaining the partition verification information and caching it in the cache area is performed;

[0021] If at least one of the detection results is negative, it is determined that the upgrade package is invalid.

[0022] By judging whether the upgrade package is valid, it is possible to avoid executing subsequent algorithm value comparison and other steps when an invalid upgrade package (such as an incomplete upgrade package, an upgrade package with an incorrect format, a non-data package, etc.) is downloaded, and avoid the resulting difficulty in performing algorithm value comparison and data update on all partitions, thereby reducing data transmission traffic and improving the efficiency of communication board upgrades.

[0023] Another communication board upgrade method provided by the present application includes:

[0024] In response to determining a first communication board and a second communication board from a plurality of communication boards, the second communication board receiving version information of the first communication board;

[0025] The second communication board determines whether the received version information is consistent with the current version information;

[0026] If they are inconsistent, the second communication board obtains a plurality of third algorithm values ​​corresponding to the partition of the first communication board, and puts them into the cache area of ​​the second communication board;

[0027] The second communication board acquires a plurality of fourth algorithm values ​​in the cache area, the plurality of fourth algorithm values ​​correspond one-to-one to the plurality of third algorithm values, and the fourth algorithm values ​​correspond to the partitions of the first communication board;

[0028] The second communication board compares the fourth algorithm value with the third algorithm value to obtain a fourth algorithm value that is different from the third algorithm value;

[0029] Determine the partitions corresponding to the fourth algorithm values ​​that are different;

[0030] The second communication board sends the upgrade information of the corresponding partition to the first communication board;

[0031] The first communication board sends the upgrade data of the corresponding partition to the second communication board;

[0032] The second communication board receives the upgrade data and upgrades the corresponding partition.

[0033] By comparing the algorithm values ​​corresponding to the partitions between the communication boards, the partition that needs to be upgraded (or data updated) is determined, and data is transmitted and updated only for this partition, so as to achieve the upgrade of the communication board. This can reduce the data transmission traffic, thereby improving the efficiency of the communication board upgrade. Moreover, this upgrade method complies with the erase and write rules of the NORFlash of the communication board, so the number of erase times of the flash memory can be reduced, which is beneficial to prolonging the service life of the flash memory. In addition, the upgrade between the communication boards does not require the intervention of the host computer, and self-upgrade between the communication boards can be achieved.

[0034] Optionally, the first communication board is the latest upgraded communication board, and is upgraded by the method described in any one of the above items, and the second communication board is a communication board other than the first communication board among the multiple communication boards. The host computer only needs to upgrade one of the communication boards (as the first communication board) to complete the upgrade between the communication boards, and the upgrade between the second communication boards does not require the intervention of the host computer.

[0035] Optionally, multiple communication boards are located in the same local area network or the same packet network, and / or are connected to each other via broadcast packets or the Internet. For multiple communication boards located in the same local area network or the same packet network, the upgrade of all communication boards can be completed in the same local area network without the need for a host computer, which can prevent the upgrade package from being leaked or tampered with, and is suitable for communication board upgrade scenarios that require confidentiality.

[0036] Optionally, a single first communication board upgrades only one second communication board at a time; the method further includes:

[0037] Preset a first queue and a second queue, divide the first communication board into the first queue, and divide the second communication board into the second queue;

[0038] assigning the upgraded second communication board to the first queue;

[0039] The second communication boards in the second queue are upgraded one-to-one through the first communication boards and the second communication boards in the first queue, and the upgraded second communication boards are divided into the first queue until the number of second communication boards in the second queue is zero.

[0040] This example enables each upgraded second communication board to be equivalent to a first communication board, and the remaining second communication boards that have not been upgraded are upgraded, so that all communication boards can be upgraded quickly, thereby improving the upgrade efficiency.

[0041] Optionally, determining the first communication board and the second communication board from a plurality of communication boards includes:

[0042] S210, comparing the version information of the multiple communication boards, obtaining the communication board with the highest version information and performing a first mark, and performing a second mark on the remaining communication boards;

[0043] S211, comparing the preset parameters of the communication boards marked by the first markers, and obtaining a communication board with the lowest preset parameters;

[0044] S212, assigning the communication board with the lowest preset parameter to a service queue, and assigning the communication board with the second mark to a served queue;

[0045] S213, issuing an upgrade instruction through the communication board of the service queue, obtaining the communication board in the service queue that first responds to the upgrade instruction, and establishing a binding relationship with the communication board of the service queue;

[0046] The other communication boards marked by the first mark repeatedly execute S211 to S213 until all the communication boards marked by the first mark are divided into the service queue and establish a binding relationship with the communication boards in the service queue;

[0047] Using the communication board in the service queue as the first communication board and using the communication board in the served queue as the second communication board;

[0048] The method further comprises:

[0049] The second mark of the upgraded communication board in the service queue is changed to the first mark, the binding relationship is released, and the communication board is divided into the service queue until the number of the communication boards in the service queue is zero.

[0050] This example can automatically determine the latest upgraded device (i.e., the first device) and the non-upgraded device (i.e., the second device) without the help of a controller, and thereby complete the upgrade between communication boards, thereby quickly upgrading all communication boards and improving upgrade efficiency.

[0051] Another communication board upgrade method provided by the present application includes:

[0052] The host computer uses a preset encryption algorithm to obtain a plurality of first algorithm values ​​for the upgrade data according to the partitions of the communication board;

[0053] Forming partition verification information of the upgrade package according to the obtained multiple first algorithm values;

[0054] The host computer sends an upgrade instruction to the communication board to control the communication board to execute the communication board upgrade method as described in any one of the above items.

[0055] By comparing the upgrade package with the algorithm values ​​corresponding to each partition of the communication board, the partition that needs to be upgraded (or data updated) is determined, and data is transmitted and updated only for this partition, so as to achieve the upgrade of the communication board. This can reduce the data transmission traffic, thereby improving the efficiency of the communication board upgrade. In addition, this upgrade method complies with the erase and write rules of the NOR Flash of the communication board, so the number of erase times of the flash memory can be reduced, which is beneficial to extending the service life of the flash memory.

[0056] The present application provides a storage medium storing a program, which, when executed by a processor, implements the communication board upgrade method as described in any of the above items, and also has the corresponding beneficial effects of the above methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 A schematic diagram of a flow chart of a first communication board upgrade method provided in an embodiment of the present application;

[0058] Figure 2 A flow chart of a second communication board upgrade method provided in an embodiment of the present application;

[0059] Figure 3 A schematic diagram of the structure of an upgrade package provided in an embodiment of the present application;

[0060] Figure 4 A schematic diagram of a process for generating an upgrade package provided in an embodiment of the present application;

[0061] Figure 5 An interactive diagram of an upper computer and a communication board performing an upgrade provided in an embodiment of the present application;

[0062] Figure 6 A schematic diagram of the storage structure of a flash memory of a communication board provided in an embodiment of the present application;

[0063] Figure 7 A corresponding relationship diagram between upgrade data and APP main program provided in an embodiment of the present application;

[0064] Figure 8 A schematic diagram of the structure of a flash memory APP Backup provided in an embodiment of the present application;

[0065] Fig. 9 A schematic diagram of the storage structure of another flash memory of a communication board provided in an embodiment of the present application;

[0066] Fig.10 A flowchart of a third communication board upgrade method provided in an embodiment of the present application;

[0067] Fig.11 A schematic diagram of a process for upgrading between multiple communication boards provided in an embodiment of the present application;

[0068] Fig.12 A flowchart of the fourth communication board upgrade method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0069] In order to solve the above problems existing in the prior art, the present application provides a communication board upgrade method and storage medium. The two protection themes are based on the same concept, and the principles of solving the problems are basically the same or similar. The implementation methods of each protection theme can refer to each other, and the repeated parts will not be repeated.

[0070] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be clearly described below in conjunction with specific embodiments and corresponding drawings. Obviously, the embodiments described below are only part of the embodiments of the present application, not all of the embodiments. In the absence of conflict, the following embodiments and their technical features can be combined with each other and also belong to the technical solutions of the present application.

[0071] Figure 1 The present invention provides a flow chart of a communication board upgrade method provided in an embodiment of the present invention, wherein the execution subject of the method is a communication board. Figure 1 and Figure 2 As shown, the method includes steps S11 to S15.

[0072] S11: receiving an upgrade instruction from a host computer, and downloading an upgrade package according to the upgrade instruction, wherein the upgrade package includes partition verification information.

[0073] S12: Obtain partition verification information and cache it in a cache area, wherein the partition verification information includes a plurality of first algorithm values.

[0074] The upgrade package is generated by the host computer. In one example, after the code contained in the upgrade package is compiled, that is, the upgrade data is completed, the host computer calls the synthesis tool, and the necessary information contained in the upgrade package is generated by the synthesis tool, such as at least partition verification information. The host computer obtains the number of partitions of the flash memory of the communication board, and divides the upgrade data into equal number of data segments (also called "partition Bins") according to the number of partitions of the flash memory, and then calculates each partition Bin through a preset encryption algorithm to obtain multiple first algorithm values, and the multiple first algorithm values ​​correspond to the partitions of the communication board one by one.

[0075] The preset encryption algorithm includes but is not limited to a hash algorithm, and the first algorithm value includes but is not limited to a corresponding md5 value. The hash algorithm is used to generate a hash value of a fixed length (e.g., 16 bytes) from data of any length, and the byte lengths of the multiple first algorithm values ​​generated here are the same. For ease of description and understanding, some parts of this article and the accompanying drawings are described using the md5 value as an example.

[0076] In the process of generating an upgrade package, for the scenario where the memory occupied by the upgrade data is less than the sum of the memory occupied by all the partitions of the flash memory, after the upgrade data is divided into equal number of partition segments according to the number of partitions of the flash memory, there will be a partition segment with a capacity less than the capacity of the corresponding flash memory partition. In this regard, the present application can fill the partition segment with a capacity less than the capacity of the corresponding flash memory partition with the byte 0xff, and calculate the filled partition segment through the preset encryption algorithm to obtain the corresponding first algorithm value. For example, there are four physical storage partitions of the flash memory, and the capacity of each partition is 1K (that is, the total memory occupied is 4K), the memory occupied by the upgrade segment of the upgrade package is only 3.5K, and there are four partition segments obtained by division. The memory occupied by the last partition segment is only 0.5K. Before calculating the first algorithm value corresponding to the partition segment, it is necessary to fill it with the byte 0xff to fill it up to 1K, and then obtain the corresponding first algorithm value through the preset encryption algorithm.

[0077] Combination Figure 3 In the example shown, the upgrade package may also include header information and upgrade data (ie, data that currently needs to be upgraded, also called "upgrade Bin").

[0078] The header information includes a tag byte, upgrade package memory and version information. The tag byte indicates that this is an upgrade package, which can be expressed as four specific bytes; the upgrade package memory indicates the size of the upgrade data; the version information indicates the version of the upgrade program, and the program can only be upgraded from a lower version to a higher version.

[0079] The upgrade data contains the data required for the communication board upgrade. For ease of understanding, Figure 3 It is represented in the form of partition Bins, and the number of partition Bins is equal to the number of partitions in the flash memory. Figure 3 In the scenario shown, the communication board is provided with four partitions, numbered 1 to 4, and the upgrade data includes partition 1Bin, partition 2Bin, partition 3Bin and partition 4Bin, and the partition Bins with the same number correspond to the partitions one by one. It should be understood that other examples of this application can set other numbers of partition Bins and corresponding md5s to meet the scenario requirements of upgrading communication boards with other numbers of partitions, which is not limited here.

[0080] Combination Figure 4 As shown, the host computer obtains the file size (i.e., the memory occupied by the upgrade package) and version information through a synthesis tool, and then forms the fixed mark bytes, the memory occupied by the upgrade package and the version information into header information, and combines the header information, partition verification information and upgrade data to form an upgrade package and output it.

[0081] After generating the upgrade package, combine Figure 5As shown, the host computer sends a query instruction, and after receiving the query instruction, the communication board sends the current version information (such as version number) of the communication board to the host computer; the host computer determines whether the communication board needs to be upgraded based on the current version information. When the current version information is the same as the new version information, the host computer does not send an upgrade instruction, and the communication board does not execute the S11 step; when the current version information is lower than the version information contained in the generated upgrade package (called "new version information"), the host computer sends an upgrade instruction to enable the communication board to execute step S11.

[0082] After downloading the upgrade package, the communication board can determine whether the upgrade package is valid. For example, if the upgrade package includes Figure 3 In the scenario of the header information shown, the method may further include step S111: detecting whether a preset byte is consistent with a mark byte, and whether the memory occupied by the downloaded upgrade package is consistent with the memory occupied by the upgrade package in the header information, wherein the preset byte is used to identify the type of the package to which the header information belongs.

[0083] After receiving the upgrade instruction from the host computer, the communication board can download the header information of the upgrade package and the entire upgrade package memory through the input file path contained in the upgrade instruction. The input file path is generally expressed as a specified address based on the http protocol, such as http: / / 192.168.1.200 / update.bin. Then, the communication board calls its own preset byte, which can be a byte in the application backup (APP Backup) area of ​​the communication board, used to identify the type of package to which the header information with the preset byte belongs. For example, when the preset byte is the first preset byte (such as 0x88996633), it indicates that the corresponding package is an upgrade package. When the preset byte is the second preset byte, it indicates that the corresponding package is a package of other types. Next, the communication board detects whether its own preset byte is consistent with the mark byte in the header information.

[0084] If the detection results are all yes, it is determined that the upgrade package is valid, and step S12 is executed.

[0085] If at least one of the detection results is negative, it is determined that the upgrade package is invalid, and the process can return to step S11, for example, continue to download the partition verification information of the upgrade package from the host computer through the http protocol until all the detection results are positive, and then execute step S12.

[0086] By judging whether the upgrade package is valid, it is possible to avoid executing subsequent algorithm value comparison and other steps when an invalid upgrade package (such as an incomplete upgrade package, an upgrade package with an incorrect format, a non-data package, etc.) is downloaded, and avoid the resulting difficulty in performing algorithm value comparison and data update on all partitions, thereby reducing data transmission traffic and improving the efficiency of communication board upgrades.

[0087] S13: Acquire multiple second algorithm values ​​in the cache area, the multiple first algorithm values ​​correspond to the multiple second algorithm values ​​one by one, and the multiple second algorithm values ​​correspond to the partitions of the communication board respectively.

[0088] Combination Figure 6 As shown, the storage structure of the cache area (e.g., flash memory) of the communication board includes a bootloader area, a user data area, an APP main program area, and an application backup area. APP can be a related program installed and run on the communication board, such as a related program for executing chip testing. The bootloader area is used to boot or upgrade the communication board; the user data area is used to store data generated by the operation of the communication board; the APP main program area is an area for performing normal logic processing and operation. When the communication board is upgraded, only the code in this area needs to be upgraded, corresponding to the upgrade data, for example, see Figure 7 , the number of partitions for upgrading data is divided according to the number of partitions for physical storage of the APP main program area. The APP main program area also includes partitions 1 to 4. The capacity of each partition is the same as the memory occupied by the corresponding partition segment; the application backup area is used to store the downloaded upgrading data. Figure 8 As shown, the application backup area includes header information and upgrade data, the header information includes each partition segment information, the partition segment information may include the write position of the partition segment, the size of the partition segment (also known as "partition segment memory") and the second algorithm value, and optionally also includes the aforementioned preset bytes. The second algorithm value is calculated by the preset encryption algorithm for the upgrade data currently contained in the communication board, and these second algorithm values ​​correspond one-to-one to the partitions of the communication board, and correspond one-to-one to the first algorithm value in step S11.

[0089] In one example, the multiple second algorithm values ​​may be obtained by: the communication board caches the data in the multiple partitions into a cache area, and obtains the multiple second algorithm values ​​corresponding to the data in the multiple partitions through a preset encryption algorithm.

[0090] This example can be regarded as a real-time calculation to obtain multiple second algorithm values, which is conducive to ensuring the real-time nature of the calculation results and avoiding obtaining outdated or erroneous second algorithm values. The preset encryption algorithm used to calculate the multiple second algorithm values ​​and the multiple first algorithm values ​​is the same.

[0091] In another example, the plurality of second algorithm values ​​may be obtained by combining Fig. 9 As shown, the communication board presets at least one verification partition in its own storage structure; a preset encryption algorithm is used to obtain a plurality of second algorithm values ​​corresponding to the data in the plurality of partitions of the communication board, and the plurality of second algorithm values ​​are stored in the verification partition; then, the plurality of second algorithm values ​​are read from the verification partition and cached in the cache area, and finally the plurality of second algorithm values ​​are read from the cache area.

[0092] Compared with the aforementioned real-time calculation to obtain multiple second algorithm values, this example directly reads multiple pre-calculated second algorithm values ​​from the cache area for comparison during the upgrade, avoiding reading the stored data of the APP main program and calculating again, thereby reducing the amount of calculation.

[0093] S14: Compare the multiple first algorithm values ​​with the multiple second algorithm values ​​to obtain the second algorithm values ​​that are different from the first algorithm values.

[0094] S15: Determine the partition corresponding to the second algorithm value with a difference.

[0095] For any partition of the communication board, if the corresponding second algorithm value is the same as the first algorithm value, it means that the current data of the partition is the same as the corresponding data that needs to be upgraded in the upgrade package, and there is no need to update the data of the partition, and you can return to continue executing step S11; if the corresponding second algorithm value is different from the first algorithm value, it means that the current data of the partition is different from the corresponding data that needs to be upgraded in the upgrade package, and the data of the partition needs to be updated, then execute steps S15 to S17.

[0096] S16: Send the corresponding partition information to the host computer.

[0097] S17: receiving upgrade data corresponding to the corresponding partition from the host computer, and upgrading the corresponding partition, wherein the upgrade data includes the upgrade data of the corresponding partition.

[0098] In step S16, the information at least includes the identifier of the partition that needs to be updated. After receiving the information, the host computer reads the upgrade data of the corresponding partition in the upgrade package according to the identifier and sends it to the communication board. The communication board upgrades the corresponding partition according to the received data.

[0099] In one example, combining Figure 2 As shown, the corresponding partition is upgraded, including the following steps S171 to S175.

[0100] S171: Download the upgrade data of the corresponding partition through, for example, the http protocol. For the convenience of description, the upgrade data of each partition is called "partition Bin", and the partition Bin is written to the application backup area of ​​the communication board, and the write position of the partition Bin is updated, that is, the location address of the partition Bin in the communication board.

[0101] S172: Check whether the partition Bin is written successfully.

[0102] The communication board can verify whether the writing is successful by comparing whether the first algorithm values ​​are the same. Specifically, the partition Bin is read from the application backup area and the first algorithm value of the partition Bin is calculated. The calculated first algorithm value is compared with the first algorithm value of the corresponding partition contained in the downloaded upgrade data. If they are the same, it indicates that the writing is successful; if they are different, it indicates that the writing has failed.

[0103] If it fails, the process may return to step S171.

[0104] If successful, step S173 is executed: the write position, the memory occupied by the partition Bin and the corresponding first algorithm value are saved to the header information of the application backup area, and an upgrade mark is set.

[0105] S174: Restart the communication board.

[0106] S175: When the upgrade mark is detected, the communication board verifies whether the partition Bin is valid according to the header information of the application backup area. For example, the validity of the partition Bin can be verified in the manner of the aforementioned step S111.

[0107] If it is valid, then execute step S176: replace the partition Bin with the corresponding partition and erase the upgrade mark. If it is invalid, then do not replace the partition Bin with the corresponding partition, do not erase the upgrade mark, and return to and continue to execute step S171.

[0108] As described above, the present application determines the partition that needs to update data by comparing the algorithm values ​​corresponding to the upgrade package and each partition of the communication board, and only transmits and updates data to the partition, so as to achieve the upgrade of the communication board, which can reduce the data transmission traffic and thus improve the efficiency of the communication board upgrade. In addition, this upgrade method complies with the erase and write rules of the NOR Flash of the communication board, so the number of erase times of the flash memory can be reduced, which is beneficial to extend the service life of the flash memory.

[0109] In a scenario where the communication board presets at least one verification partition, after the corresponding partition is upgraded, the method further includes: erasing the first algorithm value corresponding to the corresponding partition in the verification partition, and writing the second algorithm value corresponding to the corresponding partition into the verification partition. Here, after each upgrade, the communication board can update the second algorithm value in the verification partition, so that the second algorithm value after the most recent upgrade can be directly read from the verification partition during the next upgrade. In addition, the communication board only updates the second algorithm value with differences, that is, it does not update all the second algorithm values ​​in the verification partition, which can reduce the amount of updated data and reduce the number of erasures of the communication board.

[0110] Continue reading Figure 5After the upgrade is completed, the host computer can periodically check whether the upgrade status of the communication board is completed. For example, the host computer sends an inquiry command, and the communication board feedbacks whether the upgrade status is completed after receiving the inquiry command; after determining that the upgrade status of the communication board is completed, the host computer queries the latest version information of the software in the communication board, and compares whether the latest version information is the target version information (i.e., the version information of the latest upgrade package generated in the host computer). If so, it is determined that the upgrade is successful, and if not, it is determined that the upgrade fails. Specifically, the host computer sends a query command, and the communication board sends the latest version information to the host computer after receiving the query command. When the latest version information is the same as the target version information, the upgrade is determined to be successful; and when the latest version information is different from the target version information (for example, the latest version information is lower than the target version information), the upgrade is determined to have failed.

[0111] Fig.10 A flow chart of another communication board upgrade method provided in an embodiment of the present application. The execution subject of the method is the second communication board. In one example, the first communication board can be the latest upgraded communication board, for example, the aforementioned Figures 1 to 9 In the upgrade performed by the method of any of the examples described, the second communication board is a communication board among the multiple communication boards except the first communication board, and can also be understood as a communication board that needs to be upgraded or has not been upgraded yet.

[0112] See also Fig.10 As shown, the communication board upgrading method includes steps S21 to S29.

[0113] S21: In response to determining a first communication board and a second communication board from a plurality of communication boards, the second communication board receives version information of the first communication board.

[0114] The manner of establishing a communication connection between the second communication board and the first communication board includes but is not limited to at least one of the following: a broadcast packet, the Internet, a local area network, and a packet network.

[0115] The group network can be a regional network in the Internet that is artificially divided or divided according to preset rules (for example, communication boards located in the same place or of the same type form a group). Several communication boards in the group network are divided into first communication boards and second communication boards, and upgraded.

[0116] S22: The second communication board determines whether the received version information is consistent with the current version information.

[0117] If they are consistent, it means that the second communication board does not need to be upgraded at present, and can return and continue to execute step S21 to receive the version information of the first communication board next time. If they are inconsistent, execute step S23: the second communication board obtains multiple third algorithm values ​​corresponding to the partition of the first communication board.

[0118] S24: The second communication board obtains a plurality of fourth algorithm values ​​in the cache area, the plurality of fourth algorithm values ​​correspond one-to-one to the plurality of third algorithm values, and the fourth algorithm values ​​correspond to the partitions of the first communication board.

[0119] S25: The second communication board compares the fourth algorithm value with the third algorithm value to obtain a fourth algorithm value that is different from the third algorithm value.

[0120] S26: Determine the partition corresponding to the fourth algorithm value with a difference.

[0121] S27: The second communication board sends the corresponding partition information to the first communication board.

[0122] S28: The first communication board sends the upgrade data of the corresponding partition to the second communication board.

[0123] S29: The second communication board receives the upgrade data corresponding to the corresponding partition from the host computer, and upgrades the corresponding partition.

[0124] The methods for obtaining the third algorithm value and the fourth algorithm value can refer to the methods for obtaining the first algorithm value and the second algorithm value respectively. The methods for the second communication board to obtain the partition to be updated and the corresponding upgrade data can also refer to the above, which will not be repeated here.

[0125] In the aforementioned Figures 1 to 9 Based on the intended effects of any of the examples described, this example can realize self-upgrade between communication boards without or with only one host computer involved.

[0126] In one example, there are multiple communication boards, each of which is connected via a broadcast packet (the broadcast packet does not contain a target address, but only contains a source address that identifies the sender), and at least one of the communication boards can use the aforementioned Figures 1 to 9The method of any of the examples described is used for upgrading. When the upgrade is completed, it can be used as the first communication board. At this time, any of the other communication boards can be used as the second communication board. The first communication board sends its own version signal through a broadcast packet. The second communication board receives the version information of the first communication board and determines whether it is consistent with the version information of the first communication board. If it is inconsistent, the second communication board obtains the third algorithm value (such as md5 value) of each partition from the APP backup of the first communication board, and caches the third algorithm value of each partition obtained in the APP backup of the second communication board. The second communication board obtains the fourth algorithm value of each partition of itself, and determines the partition that needs to be upgraded based on the comparison of the fourth algorithm value and the third algorithm value, so as to perform targeted upgrades. In this example scenario, the host computer only needs to upgrade one of the communication boards (as the first communication board) to complete the upgrade between the communication boards, and the upgrade between the second communication boards does not require the intervention of the host computer.

[0127] The third algorithm value in the APP backup of the upgraded first communication board can be calculated by the second communication board after obtaining the complete upgrade data of the upgraded first communication board, or it can be sent by the upgraded first communication board based on the request of the second communication board. In actual situations, if the second communication board actively calculates the third algorithm value, it will reduce the upgrade efficiency, so it is preferred to use Fig. 9 The described verification partition obtains the third algorithm value. After the upgrade is completed, the first communication board updates the latest third algorithm value to its own verification partition. After receiving the upgrade request of the second communication board, the third algorithm value can be quickly read from the verification partition and sent to the second communication board without the need for recalculation, which can improve the upgrade efficiency.

[0128] In another example scenario, there are multiple communication boards in the same local area network, one of which can be upgraded through the Internet or hardware. After the upgrade is completed, it can be used as the first communication board. The first communication board sends a version signal in the local area network, and the second communication board that has not been upgraded is upgraded in the above manner. This example scenario does not require a host computer. All communication boards are in a local area network, and the upgrade of all communication boards can be completed in the same local area network, which can prevent the upgrade package from being leaked or tampered with. Therefore, it is suitable for communication board upgrade scenarios that require confidentiality.

[0129] For multiple communication boards, based on Fig.10The described upgrade scheme may result in a situation where only one upgraded communication board can be upgraded for one non-upgraded communication board, for example, a single first communication board can only upgrade one second communication board at a time. In this regard, the present application can preset a first queue and a second queue, divide the first communication board into the first queue and the second communication board into the second queue, and then upgrade the second communication board in the second queue through the first communication board, and divide the upgraded second communication board into the first queue, and then perform a one-to-one upgrade on the second communication board in the second queue through the first communication board and the second communication board in the first queue, and divide the upgraded second communication board into the first queue, and so on, until the number of second communication boards in the second queue is zero, at which time all communication boards have completed the upgrade.

[0130] For example, the number of communication boards in the first queue (i.e., the first communication board) is N, and the number of communication boards in the second queue (i.e., the second communication board) is M, and M is greater than N. After the first upgrade is completed, the number of communication boards in the first queue is N+N (because an upgraded communication board only upgrades one non-upgraded communication board at a time), and the number of communication boards in the second queue is MN; when the second upgrade is completed, the number of communication boards in the first queue is N (original number) + N (number after the first upgrade) + N 2 (number of second upgrades), the number of communication boards in the second queue is M (original number) - N (number after the first upgrade) - N 2 (The number of the second upgrade.) And so on, until the number of communication boards in the second queue is zero.

[0131] Through this method, each upgraded second communication board can also be equivalent to the first communication board, and the remaining second communication boards that have not been upgraded are upgraded, so that all communication boards can be upgraded quickly, improving the upgrade efficiency.

[0132] For multiple communication boards, and at least one of the multiple communication boards includes an upgraded communication board, based on Fig.10 The described upgrade scheme determines a first communication board and a second communication board from a plurality of communication boards, and includes the following steps S210 to S214.

[0133] S210: Compare version information of multiple communication boards, obtain a communication board with the highest version information and perform a first mark, and perform a second mark on the remaining communication boards.

[0134] S211. Compare the preset parameters of the communication boards with the first mark to obtain a communication board with the lowest preset parameters; the preset parameters include but are not limited to ID, that is, the unique device identity of the communication board.

[0135] S212: assign the communication board with the lowest preset parameter to a service queue, and assign the communication board with the second mark to a served queue.

[0136] S213: Send an upgrade instruction through the communication board of the service queue, obtain the communication board in the service queue that first responds to the upgrade instruction, and establish a binding relationship with the communication board of the service queue.

[0137] The other communication boards marked with the first mark repeatedly perform S211 to S213 until all the communication boards marked with the first mark are divided into the service queue and establish a binding relationship with the communication boards in the service queue.

[0138] S214: Use the communication board in the service queue as the first communication board, and use the communication board in the serviced queue as the second communication board.

[0139] That is to say, after a communication board with a first mark enters the service queue, it establishes a binding relationship with the communication board with a second mark in the service queue. After binding, the communication board with the first mark sends a broadcast message to notify other communication boards with the first mark to continue to select a communication board with the lowest preset parameters to continue the binding, and the binding is repeated until all communication boards with the first mark enter the service queue, that is, all communication boards with the first mark have established a binding relationship with the communication board with the second mark. Then the communication board in the service queue is used as the first communication board, and the communication board in the service queue is used as the second communication board, and the following is adopted: Fig.10 The method shown upgrades the second communication board in the service queue.

[0140] The method also includes: after the upgrade, changing the second mark of the upgraded communication board in the service queue to the first mark, releasing the binding relationship, and dividing it into the service queue until the number of communication boards in the service queue is zero, at which time all communication boards have completed the upgrade.

[0141] Combination Fig.11 As shown, the upgrade example based on steps S210 to S214 is as follows:

[0142] In the T1 time period (which may be called the "first time threshold"), these communication boards send out their own version information through broadcast packets (which may be called "a type of broadcast message"), and these communication boards compare version information with each other. All communication boards will obtain the version information of other communication boards. Each communication board can know whether it is currently the highest version by comparing version information. If so, it will perform the first marking (i.e., marking it as a high version), if not, it will perform the second marking (i.e., marking it as a low version), until all communication boards are marked. Among them, there may be multiple communication boards with the first marking.

[0143] After all communication boards are compared and marked, within the T2 time period (which can be called the "second time threshold"), the communication board with the first mark will send a broadcast packet (which can be called the "second-class broadcast message", also known as the "comparison signal") to compare IDs, so as to compare IDs between the communication boards with the first mark. When a communication board with the first mark does not receive the comparison signal, it means that there is only one communication board with the highest version, and the communication board with the first mark directly enters the service queue; when the comparison signal is received, the communication boards with the first mark compare with each other, obtain the communication board with the lowest ID and enter the service queue, and the communication board with the second mark enters the service queue.

[0144] During the T3 time period (also known as the "third time threshold"), the communication board of the service queue sends an upgrade instruction via a broadcast packet (also known as a "third type of broadcast message"), and the communication board that first receives and responds to the service queue (i.e. the second marked communication board) establishes a binding relationship with the communication board of the service queue.

[0145] After establishing the binding relationship, the communication board of the service queue sends a broadcast message through a broadcast packet (which can be called "fourth type of broadcast message"). Other communication boards with the first mark continue to select the communication board with the smallest ID according to the broadcast message and enter the service queue to establish a binding relationship with the communication board of the served queue and upgrade, and the cycle is repeated in sequence until all communication boards with the first mark enter the service queue. At this time, all communication boards with the first mark have established a binding relationship with the communication board with the second mark. The communication board after sending the broadcast (at this time as the first communication board) will provide upgrade service to the bound communication board (i.e., the second communication board). When the upgrade is completed, the communication board with the second mark sends an upgrade completion signal to the communication board with the first mark. The communication board with the first mark notifies the communication board with the second mark after the upgrade is completed to modify the second mark to the first mark, cancel the binding relationship, and enter the service queue; the above binding scheme is repeated, and when there is no communication board in the served queue (i.e., the communication board with the second mark) that can propose a binding relationship, the upgrade is completed.

[0146] pass Fig.11 In the manner shown, the present application can automatically determine the latest upgraded device (i.e., the first device) and the non-upgraded device (i.e., the second device) without the aid of a controller, and thereby complete the upgrade between communication boards, thereby quickly upgrading all communication boards and improving upgrade efficiency.

[0147] The embodiment of the present application also provides a communication board upgrade method, and the execution subject may be a host computer. Fig.12 and the aforementioned Figure 2 , Figure 4 , the method includes the following steps S31 to S33.

[0148] S31: The host computer uses a preset encryption algorithm to obtain a plurality of first algorithm values ​​for the upgrade data according to the partitions of the communication board.

[0149] S32: The host computer forms partition verification information of the upgrade package according to the obtained multiple first algorithm values.

[0150] In one example, the host computer obtains the number of partitions of the communication board, and divides the upgrade data into partition data of equal number (i.e., the aforementioned "partition Bin") according to the number of partitions; then, the host computer calculates the corresponding first algorithm value for each partition data through a preset encryption algorithm; then, the host computer uses the mark byte, upgrade package memory and version information as header information, forms partition verification information according to multiple first algorithm values, and combines the header information, partition verification information and upgrade data to form an upgrade package.

[0151] S33: The host computer sends an upgrade instruction to the communication board to control the communication board to execute the upgrade program.

[0152] The communication board can be Figures 1 to 9 The method of any of the described examples executes an upgrade procedure, so the method of this example can achieve the beneficial effects that can be achieved by the aforementioned examples.

[0153] An embodiment of the present application also provides a storage medium on which a (computer) program is stored. When the program is executed by a processor, steps corresponding to the communication board upgrade method in any example are implemented.

[0154] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0155] Since the instructions stored in the storage medium can execute the steps in any communication board upgrade method provided in the embodiments of the present application, the beneficial effects that can be achieved by any communication board upgrade method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0156] In addition, the communication board, host computer and storage medium provided in the embodiments of the present application are complete devices respectively, and also have the corresponding structures of known devices. This application only provides an illustrative description of some structural elements involved in the upgrade of the communication board, and other structural elements are not listed one by one.

[0157] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. For ordinary technicians in this field, all equivalent structural changes made using the contents of this specification and drawings are also included in the patent protection scope of the present application.

[0158] This document uses step codes such as S11, S12, etc., the purpose of which is to express the corresponding content more clearly and concisely, and does not constitute a substantial limitation on the sequence. When implementing the step codes, those skilled in the art may execute S13 first and then S12, etc., but these should all be within the scope of protection of this application.

[0159] Although the terms "first, second", etc. are used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. In addition, the singular forms "one", "an", and "the" are intended to include plural forms as well. The terms "or" and "and / or" are interpreted as inclusive, or mean any one or any combination. Only when the combination of elements, functions, steps, or operations is inherently mutually exclusive in some way, an exception to this definition will occur.

Claims

1. A communication board upgrade method, It is characterized in that include: Receive an upgrade instruction from a host computer, and download an upgrade package according to the upgrade instruction, wherein the upgrade package includes partition verification information; Acquire the partition verification information and cache it in a cache area, wherein the partition verification information includes a plurality of first algorithm values; Acquire a plurality of second algorithm values ​​of the cache area, wherein the plurality of first algorithm values ​​correspond to the plurality of second algorithm values ​​one by one, and the plurality of second algorithm values ​​correspond to the partitions of the communication board respectively; Compare the multiple first algorithm values ​​with the multiple second algorithm values ​​to obtain second algorithm values ​​that are different from the first algorithm values; Determine the partition corresponding to the second algorithm value having a difference; Sending the corresponding partition information to the host computer; Receive the upgrade data of the host computer and upgrade the corresponding partition, wherein the upgrade data includes the upgrade data of the corresponding partition.

2. The method according to claim 1, It is characterized in that The obtaining of a plurality of second algorithm values ​​of the cache area comprises: The data in the multiple partitions are cached in the cache area, and a preset encryption algorithm is used to obtain a plurality of second algorithm values ​​corresponding to the data in the multiple partitions.

3. The method according to claim 1, It is characterized in that The obtaining of a plurality of second algorithm values ​​of the cache area comprises: Preset at least one verification partition; Obtaining a plurality of second algorithm values ​​respectively corresponding to the data in the plurality of partitions by using a preset encryption algorithm, and storing the plurality of second algorithm values ​​in the verification partition; A plurality of second algorithm values ​​are read from the check partition and cached in the cache area.

4. The method according to claim 3, It is characterized in that After the corresponding partition is upgraded, the method further includes: The first algorithm value corresponding to the corresponding partition in the verification partition is erased, and the second algorithm value corresponding to the corresponding partition is written into the verification partition.

5. The method according to any one of claims 1 to 4, It is characterized in that The upgrade package also includes header information, and the header information includes a mark byte and the upgrade package memory; After downloading the upgrade package according to the upgrade instruction, the method further includes: Detecting whether the preset byte is consistent with the mark byte, and whether the memory occupied by the downloaded upgrade package is consistent with the memory occupied by the upgrade package in the header information, wherein the preset byte is used to identify the type of the package to which the header information belongs; If the detection results are all yes, it is determined that the upgrade package is valid, and the step of obtaining the partition verification information and caching it in the cache area is performed.

6. A communication board upgrade method, It is characterized in that include: In response to a plurality of communication boards, and determining a first communication board and a second communication board, the second communication board receiving version information of the first communication board; The second communication board determines whether the received version information is consistent with the current version information; If they are inconsistent, the second communication board obtains a plurality of third algorithm values ​​corresponding to the partition of the first communication board, and puts them into the cache area of ​​the second communication board; The second communication board acquires a plurality of fourth algorithm values ​​in the cache area, the plurality of fourth algorithm values ​​correspond one-to-one to the plurality of third algorithm values, and the fourth algorithm values ​​correspond to the partitions of the first communication board; The second communication board compares the fourth algorithm value with the third algorithm value to obtain a fourth algorithm value that is different from the third algorithm value; Determine the partitions corresponding to the fourth algorithm values ​​that are different; The second communication board sends the upgrade information of the corresponding partition to the first communication board; The first communication board sends the upgrade data of the corresponding partition to the second communication board; The second communication board receives the upgrade data and upgrades the corresponding partition.

7. The method according to claim 6, It is characterized in that The first communication board is a newly upgraded communication board and is upgraded by the method according to any one of claims 1 to 5, and the second communication board is a communication board among the multiple communication boards except the first communication board.

8. The method according to claim 6, It is characterized in that The multiple communication boards are located in the same local area network or the same packet network, and / or are connected to each other via broadcast packets or the Internet.

9. The method according to claim 6, It is characterized in that The method further comprises: Preset a first queue and a second queue, divide the first communication board into the first queue, and divide the second communication board into the second queue; assigning the upgraded second communication board to the first queue; The second communication boards in the second queue are upgraded one-to-one through the first communication boards and the second communication boards in the first queue, and the upgraded second communication boards are divided into the first queue until the number of second communication boards in the second queue is zero.

10. The method according to claim 6, It is characterized in that The step of determining a first communication board and a second communication board from a plurality of communication boards comprises: S210, comparing the version information of the multiple communication boards, obtaining the communication board with the highest version information and performing a first mark, and performing a second mark on the remaining communication boards; S211, comparing the preset parameters of the communication boards marked by the first markers, and obtaining a communication board with the lowest preset parameters; S212, assigning the communication board with the lowest preset parameter to a service queue, and assigning the communication board with the second mark to a served queue; S213, issuing an upgrade instruction through the communication board of the service queue, obtaining the communication board in the service queue that first responds to the upgrade instruction, and establishing a binding relationship with the communication board of the service queue; The other communication boards marked by the first mark repeatedly execute S211 to S213 until all the communication boards marked by the first mark are divided into the service queue and establish a binding relationship with the communication boards in the service queue; Using the communication board in the serving queue as the first communication board and using the communication board in the served queue as the second communication board; The method further comprises: The second mark of the upgraded communication board in the service queue is changed to the first mark, the binding relationship is released, and the communication board is divided into the service queue until the number of the communication boards in the service queue is zero.

11. A communication board upgrade method, It is characterized in that include: The host computer uses a preset encryption algorithm to obtain a plurality of first algorithm values ​​for the upgrade data according to the partitions of the communication board; Forming partition verification information of the upgrade package according to the obtained multiple first algorithm values; The host computer sends an upgrade instruction to the communication board to control the communication board to execute the method according to any one of claims 1 to 10.

12. A storage medium, It is characterized in that A program is stored, and when the program is executed by a processor, the communication board upgrading method according to any one of claims 1 to 11 is implemented.