[0047]The technical solution in the present application examples, the overall idea is as follows: By dividing the new firmware into several sub-firmware, the difference data of each sub firmware and the old firmware is compared, and each sub firmware of the difference data is packaged into a PATCH file. The PATCH file is upgraded to the CTID access control to enhance the utilization of CTID access control, and thereby extending more features of CTID access control.
[0048]Please refer toFigure 1 to 2As shown, a preferred embodiment of a CTID access control firmware upgrade method includes the following steps:
[0049]Step S10, divide the new firmware into several sub-firmware, which is compared to the difference data of the subjuntener and the old firmware by the BSDIFF algorithm (different amount update algorithm);
[0050]Step S20, based on the difference data, the corresponding sub firmware mark head identification, tail identification, length identification, and block identifier;
[0051]Step S30, pack the sub firmware after the label into the PATCH file and publish it to the server;
[0052]Step S40, the CTID access control is downloaded from the server. After the PATCH file is inteacted, the upgrade operation is upgraded, and the upgrade of the CTID access control firmware is completed.
[0053]The step S10 is specifically:
[0054]Based on the size of the CTID access control Flash setting a file size, the new firmware is divided into several sub-firmware based on the file size, and the BSDIFF algorithm is used to compare the difference between the subjunteners and the old firmware to obtain difference data.
[0055]For example, the size of the CTID access control Flash is 1MB, the set file size is 2KB, and the CTID access control Flash exists 512 2 kb small storage space; the new firmware is divided into several sub firmware.
[0056]In the step S20, the head identifies a head for tagning the difference data, the tail identifier for tailoring the tail of the difference data, the length identifier for tagging the length of the difference data, the block identification for tag Number of sub firmware.
[0057]The step S30 specifically includes:
[0058]In step S31, the marked the subjuntener is sequentially stitched in order of the Flash address of the old firmware, and generates a differential package;
[0059]The subjobs of the labeled subjunction correspond to the Flash address of the old firmware to generate address data;
[0060]For example, the size of the address data is 512 bytes, each byte is in order to correspond to a small storage space in the CTID access control flanh, and when the subjuntener is differential data, the address data is present. The value of the 5th byte of the 5th byte is set, and the sub firmware does not exist, then the value of the 6th byte of the address data is 0, and the sub-solids having the difference data are labeled. The address relationship corresponding to the old firmware.
[0061]Step S32, perform DM5 calculation (information summary algorithm) for the difference (information summary algorithm) of the difference (information summary algorithm) to obtain the first hash value;
[0062]Step S33, package the difference, address data, and the first hash value into the PATCH file and publish it to the server.
[0063]The step S40 specifically includes:
[0064]Step S41, the CTID access control downloads the PATCH file from the server, parsing the PATCH file to obtain differential package, address data, and first hash value;
[0065]Step S42, perform DM5 calculation of the difference score and address data to obtain a second hash value, which is the same as the second hash value and the second hash value, if yes, the integrity verification passes, and Go to step S43; if not, the integrity check is not passed, and the process is ended;
[0066]Step S43, based on the head identifier, the tail identification, the length identity, and the block identifier are extracted from the differential packet;
[0067]Step S44, the difference data is updated based on the address data to the FLASH of the CTID access control, and the upgrade of the CTID access control is completed. For example, the value of the first 4 bytes in the address data is 0, the value of the 5th byte is 1, and based on the block identity, the first difference data in the difference package is extracted, updated to the CTID access control flash. The 5th 2kb small storage space.
[0068]A preferred embodiment of a CTID access control firmware upgrade system includes a module:
[0069]Difference data alignment module, is used to divide new firmware into several sub firmware, and use the BSDIFF algorithm (different amount update algorithm) to compare differences in the difference between the subjunteners and the old firmware;
[0070]Difference data tag module, used to correspond to the corresponding sub firmware mark head identification, tail identification, length identification, and block identity based on the difference data;
[0071]The Patch file release module is configured to pack each sub firmware after the tag into a Patch file and publish it to the server;
[0072]The firmware upgrade module is used for the CTID access control to download the PATCH file from the server. After the PATCH file is integrated, the upgrade operation is performed, and the upgrade of the CTID access control is completed.
[0073]The difference data is specifically:
[0074]Based on the size of the CTID access control Flash setting a file size, the new firmware is divided into several sub-firmware based on the file size, and the BSDIFF algorithm is used to compare the difference between the subjunteners and the old firmware to obtain difference data.
[0075]For example, the size of the CTID access control Flash is 1MB, the set file size is 2KB, and the CTID access control Flash exists 512 2 kb small storage space; the new firmware is divided into several sub firmware.
[0076]In the differential data tag module, the head identifies a head for tagning the difference data, the tail identifier for tailoring the tail of the difference data, the length identifier for tagging the length of the difference data, the block identification The number of the marked subs firmware.
[0077]The PATCH file publishing module includes:
[0078]Differential packages and address data generating units for sequentially stitching the subjunters of the marked according to the Flash address of the old firmware to generate a differential package;
[0079]The subjobs of the labeled subjunction correspond to the Flash address of the old firmware to generate address data;
[0080]For example, the size of the address data is 512 bytes, each byte is in order to correspond to a small storage space in the CTID access control flanh, and when the subjuntener is differential data, the address data is present. The value of the 5th byte of the 5th byte is set, and the sub firmware does not exist, then the value of the 6th byte of the address data is 0, and the sub-solids having the difference data are labeled. The address relationship corresponding to the old firmware.
[0081]The DM5 calculation unit is used to perform DM5 calculation (information summary algorithm) for the difference (information summary algorithm) of the difference (information abstract algorithm) to obtain the first hash value;
[0082]Patch file packing unit, is used to pack the differences, address data, and the first hash value into a patch file, and publish it to the server.
[0083]The firmware upgrade module specifically includes:
[0084]The PATCH file resolution unit is used for the CTID access control to download the PATCH file from the server, and parsing the PATCH file to obtain differential package, address data, and first hash value;
[0085]The DM5 check unit is configured to perform DM5 calculation of the difference score and address data to obtain a second hash value, which is the same as the first hash value and the second hash value. If yes, complete sexy school Pass, and enter the difference data extraction unit; if, the integrity check is not passed, and the process is ended;
[0086]Difference data extraction unit, for extracting difference data from the differential packet based on the head identifier, tail identification, length identification, and block identity;
[0087]The difference data update unit is used to update each of the difference data update the address data to the FLASH of the CTID access control, and complete the upgrade of the CTID access control firmware. For example, the value of the first 4 bytes in the address data is 0, the value of the 5th byte is 1, and based on the block identity, the first difference data in the difference package is extracted, updated to the CTID access control flash. The 5th 2kb small storage space.
[0088]In summary, the advantage of the present invention is:
[0089]By dividing the new firmware into several sub-firmware, the difference data is compared to the difference data of each sub firmware and the old firmware, based on the difference data, the respective sub firmware labeled after the corresponding sub-firmware mark head identifier, the tail ID, the length identifier, and the block identifier is based on the difference data. Packing into a Patch file, upgrading the CTID access control is upgraded using the Patch file, which is greatly reduced to the traditional uploading of the entire firmware file, which greatly reduces the size of the download file, and only small storage space can complete the CTID. The upgrade of the access control firmware, more storage space can be used to compile the storage of program software, and finally enhance the utilization of CTID access control storage space, and can extend more functions of CTID access control.
[0090]While the embodiments of the present invention have been described above, those skilled in the art will appreciate that the specific embodiments we describe are intended to be illustrative, not the scope of the invention, familiar with the scope of the invention. The technical personnel should be included within the scope of the invention according to the claims of the present invention in accordance with the spirit of the invention.