A chip software upgrade method
By performing data verification and appropriate writing methods during the chip software upgrade process, the problem of the transmission object being damaged or tampered with is solved, the upgrade efficiency and device stability are improved, and the stability and reliability of the software upgrade are ensured.
Patent Information
- Application Number
- CN202210705595.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-21
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-06-21
AI Technical Summary
During the chip software upgrade process, transmission objects may be damaged or tampered with, resulting in software upgrade failure and poor reliability of normal system operation.
When the main control chip receives the new version of software data, it performs data integrity and accuracy verification based on the configuration information, selects the appropriate writing method to write the data into the backup program area, and replaces the old version data after restarting to ensure data integrity. and accuracy.
It improves the efficiency of software upgrades and the stability of the device, ensuring that old version software data can still be run synchronously even if errors or packet loss occur during the download process, ensuring the stable operation of the device and the stability and reliability of the upgrade process.
Smart Images

Figure CN115129341B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software upgrade, and in particular to a chip software upgrade method. Background Art
[0002] With the advancement of technology, chips gradually support the self-upgrade function of software. Through certain channels, including but not limited to serial communication, TCP / IP, USB interface, SD card, etc., the burning code is transmitted to the chip, and the chip writes the burning code data into the chip's flash to complete the software upgrade. Although this method can make software upgrades extremely convenient, there is often a situation in which the transmission object is destroyed or tampered with during the transmission process. This situation will cause the software upgrade to fail and even affect the normal operation of the system, resulting in poor reliability. Summary of the invention
[0003] In order to solve the above problems, the present invention provides a chip software upgrade method, and the specific technical solution is as follows:
[0004] A chip software upgrade method comprises the following steps:
[0005] S1. When the main control chip receives the new version of software data transmitted by the service terminal, the main control chip performs data integrity and data accuracy verification based on the configuration information carried in the new version of software data;
[0006] S2. When the main control chip determines that the data verification is successful, the main control chip selects a corresponding writing method to write the new version of the software data to the target location of the backup program area according to the data type and the amount of data to be written, and enters the restart mode when it is determined that the writing is completed;
[0007] S3. When the main control chip determines that the restart is completed, the new version of the software data written at the target location in the backup program area is used to replace the original old version of the software data to achieve the old version of the software upgrade.
[0008] Preferably, the configuration information in step S1 includes key data fields, association information between key data fields, and signature authentication information.
[0009] Preferably, the step S1 specifically includes the following steps:
[0010] S11, the main control chip performs integrity check on each key data field and obtains corresponding test results;
[0011] S12. When the main control chip determines that the number of key data fields that pass the integrity check is greater than a preset number threshold based on the inspection result, the main control chip matches the associations between the key data fields.
[0012] S13. When determining that the correlation match is successful, the main control chip performs signature authentication based on the signature authentication information to verify data accuracy.
[0013] Preferably, the backup program area in step S2 is divided into a plurality of storage areas, and each storage area is used to store different types of write data.
[0014] Preferably, the step S2 specifically includes the following steps:
[0015] S21, the main control chip selects a corresponding target storage area from multiple storage areas in the backup program area according to the type of data;
[0016] S22. Determine the target data volume of the target data to be written, and when it is determined that the target data volume is less than the readable storage capacity of the target storage area, write the target data into the target storage area of the backup program area, and, when it is determined that the target data volume is greater than or equal to the readable storage capacity of the target storage area, release the storage space of the target storage area and / or perform lossless data compression to ensure smooth writing of the target data.
[0017] Preferably, the step S22 further comprises: the main control chip adjusts the writing speed of the target data according to the readable storage capacity of the target storage area and the internal operation performance data, and writes the target data into the target storage area of the backup program area at the adjusted writing speed.
[0018] Preferably, the step S3 specifically includes the following steps:
[0019] S31, when determining that the writing of the new version of the software data is completed, the main control chip sets a valid upgrade flag bit, and binds and caches the valid upgrade flag bit to a storage area associated with the corresponding new version of the software data;
[0020] S32. During the restart process, the main control chip detects the effective upgrade flag based on the preset detection rules;
[0021] S33, when the main control chip determines that the corresponding valid upgrade flag is successfully detected, the main control chip associates the corresponding new version software data, and replaces the old version software data in the application area based on the associated new version software data to achieve the old version software upgrade;
[0022] S34. After completing the upgrade of the old version of the software, the main control chip sets an invalid upgrade flag and / or clears the corresponding valid upgrade flag to avoid an erroneous upgrade during the next restart.
[0023] Preferably, it also includes:
[0024] S4. For the target software whose upgrade status is to be confirmed, the main control chip will read the upgrade information of the target software, match the upgrade information with the preset upgrade rules, and determine whether to upgrade the old version of the software based on the matching result, wherein the upgrade information includes at least one of the upgraded software version number, software running status, comparison between the software historical running parameters and the software real-time running parameters, and the frequency of abnormal events occurring in the software after the upgrade.
[0025] Preferably, it also includes:
[0026] S5. When the main control chip determines that the upgrade of the old version of the software fails, it restores the software to the version before the upgrade and sends an upgrade exception instruction to the service terminal to trigger the service terminal to resend the new version of the software data or stop sending the new version of the software data when it is determined that there is abnormal data tampering.
[0027] Preferably, it also includes: in step S1, the service terminal will check whether there is any update to the software data within a preset detection period, and / or determine the update status of the software data based on the version update information. If yes, the latest software data will be acquired, and the acquired latest software data will be sent to the main control chip, so that the main control chip can upgrade the old version of the software based on the received latest software data.
[0028] The beneficial effects of the present invention are as follows: The present invention provides a chip software upgrade method, in which the main control chip performs data integrity and data accuracy verification on the new version of the software data according to the configuration information, thereby solving the problem of incomplete data in the upgrade process due to the lack of a data integrity protection mechanism, thereby improving the upgrade efficiency. In addition, when the new version of the software data is written into the backup program area, the writing speed is adjusted according to the type of data and the amount of data to be written, so as to alleviate the storage pressure and ensure the normal operation of the device, thereby improving the stability of the device operation. Finally, during the upgrade process, the new version of the software to be upgraded is downloaded to the program backup area in the main chip, so that if an error or packet loss occurs during the download process, the old version of the software data can still be run synchronously to ensure the stable operation of the device, wherein, after receiving all the data of the new version of the software data, the main control chip uses the written new version of the software data to replace the old version of the software data in the application program area, thereby further ensuring the stability and reliability of the upgrade process. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the specific embodiments or the description of the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual scale.
[0030] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0033] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0034] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0035] like Figure 1 As shown, a specific embodiment of the present invention provides a chip software upgrade method, comprising the following steps:
[0036] S1. When the main control chip receives the new version of software data transmitted by the service terminal, it performs data integrity and data accuracy verification based on the configuration information carried in the new version of software data; the configuration information includes key data fields, association information between key data fields, and signature authentication information.
[0037] The main control chip performs data integrity and data accuracy verification based on the configuration information carried in the new version of the software data, including the following steps:
[0038] S11. The main control chip performs integrity check on each key data field and obtains the corresponding test result; specifically, in order to avoid the occurrence of data packet loss without knowing it during the transmission process, when performing data integrity check, each key data field is used as a detection object, and the main control chip can use a hash algorithm and a key to perform hash calculation on each detection object respectively to obtain a corresponding first hash value. After that, the first hash value and the corresponding detection object are sent to the data sender (i.e., the service terminal). Subsequently, after receiving the data sent by the main control chip, the service terminal uses the same hash algorithm and key to perform hash calculation to obtain the corresponding second hash value. If the first and second hash values are considered to be the same, the data is considered to be complete. At this time, the service terminal will feedback the corresponding response information to the main control chip so that the main control chip can obtain the corresponding test results in time.
[0039] S12. Based on the inspection result, when the main control chip determines that the number of key data fields that pass the integrity check is greater than a preset threshold value, the main control chip matches the association between the key data fields; specifically, the main control chip can execute a key field matching algorithm related to the data structure on the key data fields to match the association between the key data fields, thereby further ensuring data integrity and accuracy and avoiding upgrade failures caused by the writing of invalid data.
[0040] S13. When the main control chip determines that the correlation match is successful, it performs signature authentication based on the signature authentication information to verify the data accuracy. Specifically, the signature authentication process includes: first, the main control chip receives the signature authentication information, wherein the signature authentication information includes a digital signature, an electronic original, and a public key of the sender. Afterwards, the main control chip performs signature verification based on the signature authentication information, wherein the verification process includes: the main control chip first decrypts the digital signature with the sender's public key and derives a digital summary; then, the same hash algorithm is applied to the original electronic document to obtain a new digital summary; finally, by comparing the hash values of the two summaries obtained above, if the results are the same, the signature is considered to be verified, otherwise, the signature can be considered invalid.
[0041] The main control chip verifies the data integrity and accuracy of the new version of the software based on the configuration information, solving the problem of incomplete data during the upgrade process due to the lack of a data integrity protection mechanism and improving the upgrade efficiency.
[0042] S2. When the main control chip determines that the data verification is successful, it selects a corresponding writing method to write the new version of the software data to the target location of the backup program area according to the data type and the amount of data to be written, and enters the restart mode when it determines that the writing is completed.
[0043] The backup program area is divided into several storage areas, and each storage area is used to store different types of written data. Specifically, the main control chip can divide the backup program area into several storage areas of the same size in an equal division manner based on the overall available storage space of the backup program area. The types of the corresponding stored data in each storage area are inconsistent, so as to facilitate the classification management of data.
[0044] It should be noted that the program memory, data memory, registers and I\O terminals are arranged in the same order in the 4GB address space, and are connected to the controlled bus. The memory itself does not have address information. Its address is assigned by the chip manufacturer or user. The process of assigning addresses to the memory is called memory mapping. In one embodiment, the memory area is divided by the ARM processor dividing the 4GB storage space into 8 areas on average. On the one hand, the size of each area is 512MB (this capacity is very large). On the other hand, the ARM processor divides the 4GB capacity into blocks according to its function, so each area block obtained by the division has its special purpose.
[0045] The main control chip selects a corresponding writing method to write the new version of the software data to the target location of the backup program area according to the type of data and the amount of data to be written, including the steps of:
[0046] S21. The main control chip selects a corresponding target storage area from multiple storage areas in the backup program area according to the type of data. Specifically, the main control chip can attach a corresponding index mark to each storage area to indicate the type of data stored.
[0047] The main control chip can construct an index condition based on the type of data, and perform an associated match of the index identifier based on the index condition, and when the match is successful, feedback the location of the corresponding target storage area.
[0048] S22. Determine the target data volume of the target data to be written, and when it is determined that the target data volume is less than the readable storage capacity of the target storage area, write the target data into the target storage area of the backup program area, and, when it is determined that the target data volume is greater than or equal to the readable storage capacity of the target storage area, release the storage space of the target storage area and / or perform lossless data compression to ensure smooth writing of the target data.
[0049] Specifically, in the case where the target storage area needs to be released, the main control chip can control other slave modules (wherein the slave modules can be understood as functional modules that do not affect the operation of the device when not running) to enter a non-working state mode when it determines that the device is in an idle state, or when the normal operation of the main module of the device is guaranteed, and adopts a corresponding release mode (for example, defragmentation operation, garbage file recovery operation, etc., which is not limited in the embodiments of the present application) to release the storage space to ensure the smooth writing of the target data.
[0050] Specifically, in the case of lossless data compression, the main control chip can perform data compression according to the principle of first dividing and then compressing.
[0051] In one embodiment, the main control chip can segment the data field based on a preset segmentation rule, such as semantics or data features. Subsequently, before data compression, the main control chip extracts features using a preset data feature extraction method, and then uses corresponding compression methods to perform data compression for fields with different data features. For example, the first field that belongs to an enumerated string feature can be compressed using binary, and the second field that belongs to a string numerical feature can be compressed using integer conversion or floating point conversion.
[0052] The above embodiment can obtain the required compressed data without loss of data, and further ensure the smooth execution of software upgrade.
[0053] In step S22, the main control chip writes the target data into the target storage area of the backup program area, including:
[0054] Step S221, the main control chip adjusts the writing speed of the target data according to the readable storage capacity of the target storage area and the internal operation performance data, and writes the target data into the target storage area of the backup program area according to the adjusted writing speed.
[0055] Specifically, the internal operation performance data may include performance indicator information and its corresponding indicator value, wherein the performance indicator information includes at least one of operating temperature, memory number, process time, and memory. In one embodiment, the main control chip can assign corresponding weight values to each performance indicator information according to the degree of influence on the device operation performance, and perform weighted sum calculation based on the weight of the performance indicator information and the corresponding indicator value to obtain the score of the internal operation performance. Among them, when the score value is less than the score threshold and the readable storage capacity of the target storage area is small (but it can still guarantee the storage of the target data), the writing speed of the target data can be appropriately slowed down.
[0056] In one embodiment, the main control chip can also score the internal operation performance or perform operation rate trend analysis while writing the target data. If it is determined that the current writing speed will have a significant impact on the device operation effect (such as causing the device to run stuck), it will simultaneously reduce the speed. Conversely, the writing speed can be gradually increased to relieve storage pressure and ensure the normal operation of the device.
[0057] S3. When the main control chip determines that the restart is completed, the new version of the software data written at the target location in the backup program area is used to replace the original old version of the software data to achieve the old version of the software upgrade. The main control chip implements the old version of the software upgrade based on the written new version of the software data, including the steps of:
[0058] S31. When the main control chip determines that the writing of the new version of the software data is completed, the effective upgrade flag is set, and the effective upgrade flag is bound and cached in the storage area associated with the corresponding new version of the software data; specifically, the effective upgrade flag can be set to 0, T, etc., which is not limited in the embodiments of the present application. The corresponding invalid upgrade flag can be set to 1, F, etc., which can be flexibly set based on specific needs in different embodiments.
[0059] S32. During the restart process, the main control chip detects the effective upgrade flag based on the preset detection rules;
[0060] S33, when the main control chip determines that the corresponding valid upgrade flag is successfully detected, the main control chip associates the corresponding new version software data, and replaces the old version software data in the application area based on the associated new version software data to achieve the old version software upgrade;
[0061] Specifically, the main control chip can associate the valid upgrade flag with the corresponding new version software data in advance, and when the valid flag is detected, the old version software is upgraded based on the associated new version software data. By setting the flag, it can be timely determined whether there is an upgrade demand at present, thereby improving the efficiency of software upgrade.
[0062] S34. After completing the upgrade of the old version of the software, the main control chip sets an invalid upgrade flag and / or clears the corresponding valid upgrade flag to avoid an erroneous upgrade during the next restart.
[0063] Specifically, when the main control chip determines that the software is successfully upgraded, it will erase the valid upgrade flag bit, so that on the one hand, storage space can be released, and on the other hand, the occurrence of erroneous upgrades can be avoided.
[0064] In one of the embodiments, the main control chip can also determine whether the valid upgrade flag is true or false, and when it is determined that the valid upgrade flag is true, perform software upgrade based on the written new software data.
[0065] In the above embodiment, by setting an invalid upgrade flag and / or clearing a corresponding valid upgrade flag, the occurrence of erroneous upgrade is avoided and the software upgrade efficiency is improved.
[0066] In one embodiment, after step S3, the method further includes:
[0067] S4. For the target software whose upgrade status is to be confirmed, the main control chip will read the upgrade information of the target software, match the upgrade information with the preset upgrade rules, and determine whether to upgrade the old version of the software based on the matching result, wherein the upgrade information includes at least one of the upgraded software version number, software running status, comparison between the software historical running parameters and the software real-time running parameters, and the frequency of abnormal events occurring in the software after the upgrade.
[0068] Specifically, the main control chip can comprehensively judge whether the software upgrade is successful based on at least one of the comparison between the current software version number and the historical version number, the software running status and the performance improvement brought about by the software upgrade after the preliminary determination of the software upgrade, and the frequency of abnormal events occurring in the software after the upgrade.
[0069] The above embodiment combines a variety of upgrade judgment methods to judge whether to implement the old version of the software upgrade, which more comprehensively ensures the accurate judgment of the software upgrade situation and further ensures the stable operation of the device.
[0070] In one embodiment, the method further comprises:
[0071] Step S5, when the main control chip determines that the upgrade of the old version of the software fails, it restores the software to the version before the upgrade, and sends an upgrade exception instruction to the service terminal to trigger the service terminal to resend the new version of the software data or stop sending the new version of the software data when it is determined that there is abnormal data tampering.
[0072] Specifically, before the main control chip receives the new version of software data sent by the service terminal again, it is also necessary to erase the invalid data previously stored in the backup program area and useless for software upgrade to release storage space.
[0073] In one embodiment, when the service terminal determines that there is abnormal data tampering, it can first obtain the operation log information corresponding to the tampered data, wherein the operation log information contains the target identification information corresponding to the tampering program (the target identification information can be, for example, access port information and access address, etc., which is not limited in the embodiment of the present application). Afterwards, the service terminal determines the tampering path according to the target identification information and stops sending the new version data.
[0074] The above embodiment provides a mechanism for analyzing tampered data, and stops sending new version software data when it is determined that abnormal data tampering exists, thereby achieving data security protection.
[0075] In one of the embodiments, in step S1, the service terminal will check whether there is any update to the software data within a preset detection period, and / or determine the update status of the software data based on the version update information. If so, the latest software data will be acquired and sent to the main control chip, so that the main control chip can upgrade the old version of the software based on the received latest software data.
[0076] Specifically, the service terminal may compare the newly released first program package with the currently running second program package to determine whether the software data is updated. For example, when it is determined that the first program package matches the second program package, it is considered that the software data is updated successfully.
[0077] In one embodiment, the main control chip will calculate the average time required for software upgrade and the success rate of software upgrade when multiple successful upgrades are determined. Afterwards, if the average upgrade time is within the specified time range and the success rate of software upgrade is higher than a certain ratio, it is considered to have passed the upgrade efficiency test. Otherwise, the reason for the low efficiency of the upgrade success can be queried based on the real-time operation information and performance parameters of the device.
[0078] The main control chip of the present invention performs data integrity and data accuracy verification on the new version of software data according to the configuration information, solves the problem of incomplete data in the upgrade process due to the lack of data integrity protection mechanism, thereby improving the upgrade efficiency. In addition, when the new version of software data is written to the backup program area, the write speed is adjusted according to the type of data and the amount of data to be written, so as to alleviate the storage pressure and ensure the normal operation of the equipment, thereby improving the stability of the equipment operation. Finally, during the upgrade process, the new version of software that needs to be upgraded is downloaded to the program backup area in the main chip, so that if an error or packet loss occurs during the download process, the old version of software data can still be run synchronously to ensure the stable operation of the equipment, wherein, after receiving all the data of the new version of software data, the main control chip replaces the old version of software data in the application program area with the written new version of software data, thereby further ensuring the stability and reliability of the upgrade process.
[0079] Those of ordinary skill in the art will appreciate that the units of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition of each example has been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0080] In the embodiments provided in the present application, it should be understood that the division of units is merely a logical function division, and there may be other division methods in actual implementation, for example, multiple units may be combined into one unit, one unit may be split into multiple units, or some features may be ignored.
[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.
Claims
1. A chip software upgrade method, characterized in that: The following steps are involved: S1. When the main control chip receives the new version of software data transmitted by the service terminal, it performs data integrity and data accuracy verification based on the configuration information carried in the new version of software data; S2. When the main control chip determines that the data verification is successful, the main control chip selects a corresponding writing method to write the new version of the software data to the target location of the backup program area according to the data type and the amount of data to be written, and enters the restart mode when it is determined that the writing is completed; S3. When the main control chip determines that the restart is completed, the new version of the software data written at the target location in the backup program area is used to replace the original old version of the software data, so as to achieve the old version of the software upgrade; The configuration information in step S1 includes key data fields, association information between key data fields, and signature authentication information; The step S1 specifically includes the following steps: S11, the main control chip performs integrity check on each key data field to obtain a corresponding test result; when performing data integrity check, by taking each key data field as a test object, the main control chip uses a hash algorithm and a key to perform hash calculation on each test object respectively to obtain a corresponding first hash value; then, the first hash value and the corresponding test object are sent together to the data sender, that is, the service terminal; subsequently, after receiving the data sent by the main control chip, the service terminal uses the same hash algorithm and key to perform hash calculation to obtain a corresponding second hash value, wherein, if the first and second hash values obtained are considered to be the same, the data is considered to be complete, and at this time the service terminal will feedback corresponding response information to the main control chip, so that the main control chip can obtain the corresponding test result in time; S12. The main control chip matches the associations between the key data fields when it is determined based on the inspection result that the number of key data fields that pass the integrity inspection is greater than a preset number threshold; S13. When determining that the correlation match is successful, the main control chip performs signature authentication based on the signature authentication information to verify the data accuracy. The signature authentication process includes: first, the main control chip receives the signature authentication information, wherein the signature authentication information includes a digital signature, an electronic original, and a public key of the sender; then, the main control chip performs signature verification based on the signature authentication information, wherein the verification process includes: the main control chip first decrypts the digital signature with the public key of the sender to derive a digital summary; then, the same hash algorithm is applied to the original electronic document to obtain a new digital summary; finally, by comparing the hash values of the two summaries obtained above, if the results are the same, the signature is considered to be verified, otherwise, the signature is considered invalid.
2. A chip software upgrade method according to claim 1, characterized in that: In the step S2, the backup program area is divided into a plurality of storage areas, and each storage area is used to store different types of write data.
3. A chip software upgrade method according to claim 2, characterized in that: The step S2 specifically includes the following steps: S21, the main control chip selects a corresponding target storage area from multiple storage areas in the backup program area according to the type of data; S22. Determine the target data volume of the target data to be written, and when it is determined that the target data volume is less than the readable storage capacity of the target storage area, write the target data into the target storage area of the backup program area, and, when it is determined that the target data volume is greater than or equal to the readable storage capacity of the target storage area, release the storage space of the target storage area and / or perform lossless data compression to ensure smooth writing of the target data.
4. A chip software upgrade method according to claim 3, characterized in that: The step S22 also includes: the main control chip adjusts the writing speed of the target data according to the readable storage capacity of the target storage area and the internal operation performance data, and writes the target data into the target storage area of the backup program area according to the adjusted writing speed.
5. A chip software upgrade method according to claim 1, characterized in that: The step S3 specifically comprises the following steps: S31, when determining that the writing of the new version of the software data is completed, the main control chip sets a valid upgrade flag bit, and binds and caches the valid upgrade flag bit to a storage area associated with the corresponding new version of the software data; S32. During the restart process, the main control chip detects the effective upgrade flag based on the preset detection rules; S33, when the main control chip determines that the corresponding valid upgrade flag is successfully detected, the main control chip associates the corresponding new version software data, and replaces the old version software data in the application area based on the associated new version software data to achieve the old version software upgrade; S34. After completing the upgrade of the old version of the software, the main control chip sets an invalid upgrade flag and / or clears the corresponding valid upgrade flag to avoid an erroneous upgrade during the next restart.
6. A chip software upgrade method according to claim 1, characterized in that: Also includes: S4. For the target software whose upgrade status is to be confirmed, the main control chip will read the upgrade information of the target software, match the upgrade information with the preset upgrade rules, and determine whether to upgrade the old version of the software based on the matching result, wherein the upgrade information includes at least one of the upgraded software version number, software running status, comparison between the software historical running parameters and the software real-time running parameters, and the frequency of abnormal events occurring in the software after the upgrade.
7. A chip software upgrade method according to claim 6, characterized in that: Also includes: S5. When the main control chip determines that the upgrade of the old version of the software fails, it restores the software to the version before the upgrade and sends an upgrade exception instruction to the service terminal to trigger the service terminal to resend the new version of the software data or stop sending the new version of the software data when it is determined that there is abnormal data tampering.
8. A chip software upgrade method according to claim 1, characterized in that: It also includes: in step S1, the service terminal will check whether there is any update to the software data within a preset detection period, and / or determine the update status of the software data based on the version update information. If so, the latest software data will be obtained, and the obtained latest software data will be sent to the main control chip, so that the main control chip can upgrade the old version of the software based on the received latest software data.
