MCU program update method, system, device and storage medium

By using the update program data table and hash value matching in the device system, combined with program verification code and update time verification, the problem of MCU slave program update failure is solved, and the update success rate and accuracy are improved.

CN117111979BActive Publication Date: 2024-09-10SIGAS MEASUREMENT ENG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311019845.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-14
Publication Date
2024-09-10
Estimated Expiration
2043-08-14

AI Technical Summary

Technical Problem

When updating the MCU slave program in existing equipment systems, it is easy to fail in parsing or parse out non-corresponding programs, resulting in program update failure and a low success rate.

Method used

By setting the update program data table in the host, calculate the consistency between the current hash value of the MCU slave and the original hash value, obtain device attribute information, match and distribute the corresponding update program, and ensure that only the corresponding update program is distributed to The MCU slave uses the program check code and update time for verification to ensure the correctness and accuracy of the update program.

Benefits of technology

It improves the program update success rate of the device system, improves the accuracy and efficiency of the MCU slave update program, and ensures that the distributed update program corresponds to the MCU slave.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117111979B
    Figure CN117111979B
Patent Text Reader

Abstract

The present application relates to the field of device system update, and in particular to an MCU program update method, system, device and storage medium, which includes obtaining update request information and device attribute information sent by an MCU slave; calculating the current hash value of the update program corresponding to the MCU slave in the preset update program data table according to the update request information, and judging whether the current hash value is consistent with the original hash value corresponding to the update program; if not, calculating the first device attribute hash value of the corresponding device attribute information, processing the update program data table according to the first device attribute hash value, and obtaining the update program corresponding to the first device attribute hash value; sending the update program to the corresponding MCU slave for program update. The present application has the effect of facilitating the improvement of the success rate of device system program update.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of device system update, and in particular to an MCU program update method, system, device and storage medium. Background Art

[0002] With the iteration of equipment system functions, corresponding program updates are required for the equipment system.

[0003] A current device system includes a Linux host, which is communicatively connected to a number of MCU slaves, each of which is responsible for a function, such as detection signal reading and signal control. Before updating the program of the MCU slave, the update program corresponding to each MCU slave is first written into the Linux host for storage. When the MCU slave needs to be updated, all MCU update programs stored in the Linux host are distributed to each MCU slave, and then the MCU slave parses the received MCU update program and finds the MCU update program corresponding to itself, and then processes the found MCU update program, thereby realizing the program update of each MCU slave.

[0004] In the process of implementing the present application, it is found that the above technology has at least the following problems: when the Linux host distributes the MCU update program, all the MCU update programs are synchronously distributed to each MCU slave. After the MCU slave receives all the MCU update programs, it parses all the MCU update programs to find the MCU update program corresponding to itself. In this process, it is easy for the parsing to fail, or the MCU update program that does not correspond to itself is parsed, which leads to the failure of the MCU slave program update, and then leads to a low success rate of the device system program update. Summary of the invention

[0005] In order to improve the program update success rate of the device system, the present application provides an MCU program update method, system, device and storage medium.

[0006] In a first aspect, the present application provides an MCU program update method, which adopts the following technical solution:

[0007] A method for updating an MCU program, comprising:

[0008] Get the update request information and device attribute information sent by the MCU slave;

[0009] Calculate the current hash value of the update program corresponding to the MCU slave in the preset update program data table according to the update request information, and determine whether the current hash value is consistent with the original hash value corresponding to the update program;

[0010] If not, calculating a first device attribute hash value corresponding to the device attribute information, processing the update program data table according to the first device attribute hash value, and obtaining the update program corresponding to the first device attribute hash value;

[0011] The update program is sent to the corresponding MCU slave for program update.

[0012] By adopting the above technical scheme, an original hash value corresponding to the update program of each MCU slave is set in the update program data table. When the host obtains the update request information sent by the MCU slave, the current hash value of the update program of the corresponding MCU extension is immediately calculated, and then the current hash value is compared with the corresponding original hash value to see whether it is consistent. In this way, it is convenient to determine whether the update program of the corresponding MCU extension in the update program data table has been updated. If the current hash value is inconsistent with the corresponding original hash value, it means that the update program of the corresponding MCU extension has been updated. Then, the update program of the corresponding MCU extension is obtained from the update program data table based on the obtained device attribute information, and then the update program of the MCU extension is distributed to the corresponding MCU extension for updating. In this way, only the corresponding MCU extension update program is distributed to the corresponding MCU extension, thereby facilitating the improvement of the program update success rate of the device system.

[0013] In a specific implementation scheme, the update program data table includes at least a second device attribute hash value field, an update program package field, an original hash value field, a current hash value field, and a latest update time field.

[0014] By adopting the above technical solution and setting an update program data table in the host, it is convenient to match corresponding features for each MCU extension update program, such as the second device attribute hash value, the original hash value and the latest update time, so as to facilitate the subsequent extraction of the corresponding MCU extension update program for the corresponding MCU extension from the update program data table, thereby facilitating the improvement of the accuracy and efficiency of the MCU extension update program distributed to the MCU extension.

[0015] In a specific implementation scheme, the update program package field is used to store an update program package that corresponds one-to-one with the MCU slave, and the content of the update program package at least includes a program verification code, the update program, and an update time.

[0016] By adopting the above technical solution, by setting the program verification code and update time in addition to the update program in the update program package, it is convenient to subsequently determine whether the MCU extension update program distributed to the corresponding MCU extension is correct, so that the MCU extension can receive the correct MCU extension update program.

[0017] In a specific implementation scheme, the step of processing the update program data table according to the first device attribute hash value to obtain the update program corresponding to the first device attribute hash value includes:

[0018] Traversing the second device attribute hash values ​​in the second device attribute hash value field in the update program data table, and matching the second device attribute hash value that is consistent with the first device attribute hash value;

[0019] The update program package corresponding to the second device attribute hash value in the update program package field in the update program data table is obtained.

[0020] By adopting the above technical solution, the host first calculates the corresponding first device attribute hash value based on the acquired device attribute information, and then finds the second device attribute hash value corresponding to the first device attribute hash value in the update program data table. Since the update program data table is provided with the second device attribute hash value and the MCU extension update program corresponding to the MCU extension, after finding the second device attribute hash value in the update program data table, the corresponding MCU extension update program can be further found; this makes it easy to find the accurate MCU extension update program for the corresponding MCU extension in the update program data table; thereby improving the accuracy of the MCU extension update program distributed to the corresponding MCU extension.

[0021] In a specific implementation scheme, the step of sending the update program to the corresponding MCU slave for program update includes:

[0022] Acquire and parse the update program package to obtain the corresponding program verification code and the update program;

[0023] Determine whether the program verification code and a slave verification code preset in the corresponding MCU slave are complementary codes to each other;

[0024] If so, the update program is written into the RAM of the MCU slave, and the RAM is started to perform program update on the MCU slave.

[0025] By adopting the above technical solution, after the update program package is distributed to the corresponding MCU slave, the update program package is parsed to obtain the corresponding program verification code and update program. Further, it is determined whether the program verification code and the slave verification code preset in the MCU slave are complementary to each other. This makes it easy to identify whether the more detailed program parsed is the update program of the corresponding MCU slave. The judgment is made in a way of determining whether the codes are complementary to each other, which is convenient for ensuring the correctness of the judgment result while improving the efficiency of the judgment.

[0026] In a specific possible implementation scheme, parsing the update program package also obtains the update time; after determining that the program verification code and the slave verification code preset in the corresponding MCU slave are complementary codes, the step further includes:

[0027] Determine whether the update time is the latest update time in the latest update time field;

[0028] If so, the update program is written into the RAM of the MCU slave.

[0029] By adopting the above technical solution, on the basis of preliminary verification of the update program through the program verification code and the slave verification code disk, the update program is further judged by judging whether the update time in the update package is the latest update time, thereby facilitating the improvement of the accuracy of the judgment, thereby facilitating ensuring that the MCU slave can obtain accurate update programs.

[0030] In a second aspect, the present application provides an MCU program update system, which adopts the following technical solution:

[0031] An MCU program update system, comprising:

[0032] MCU slave information acquisition module, used to obtain update request information and device attribute information sent by the MCU slave;

[0033] A hash value judgment module is used to calculate the current hash value of the update program corresponding to the MCU slave in the preset update program data table according to the update request information, and judge whether the current hash value is consistent with the original hash value corresponding to the update program;

[0034] an update program acquisition module, configured to calculate a first device attribute hash value of the corresponding device attribute information when determining that the current hash value is inconsistent with an original hash value corresponding to the update program, and process the update program data table according to the first device attribute hash value to obtain the update program corresponding to the first device attribute hash value;

[0035] The program update module is used to send the update program to the corresponding MCU slave for program update.

[0036] By adopting the above technical scheme, an original hash value corresponding to the update program of each MCU slave is set in the update program data table. When the host obtains the update request information sent by the MCU slave, the current hash value of the update program of the corresponding MCU extension is immediately calculated, and then the current hash value is compared with the corresponding original hash value to see whether it is consistent. In this way, it is convenient to determine whether the update program of the corresponding MCU extension in the update program data table has been updated. If the current hash value is inconsistent with the corresponding original hash value, it means that the update program of the corresponding MCU extension has been updated. Then, the update program of the corresponding MCU extension is obtained from the update program data table based on the obtained device attribute information, and then the update program of the MCU extension is distributed to the corresponding MCU extension for updating. In this way, only the corresponding MCU extension update program is distributed to the corresponding MCU extension, thereby facilitating the improvement of the program update success rate of the device system.

[0037] In a third aspect, the present application provides a computer device, which adopts the following technical solution: it includes a memory and a processor, and the memory stores a computer program that can be loaded by the processor and execute any one of the above-mentioned MCU program update methods.

[0038] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution: storing a computer program that can be loaded by a processor and execute any of the above-mentioned MCU program update methods.

[0039] In summary, the present application includes at least one of the following beneficial technical effects:

[0040] It is convenient to improve the success rate of program updates of equipment systems;

[0041] It is convenient to improve the accuracy and efficiency of MCU extension update programs distributed to MCU extensions;

[0042] It is convenient to judge whether the update program distributed to the MCU slave corresponds to the MCU slave. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a schematic diagram of the composition of an equipment system in an embodiment of the present application.

[0044] Figure 2 It is a flowchart of an MCU program update method in an embodiment of the present application.

[0045] Figure 3 It is a schematic diagram of the composition of the update program data table in the embodiment of the present application.

[0046] Figure 4 It is a structural block diagram of an MCU program update system in an embodiment of the present application.

[0047] Description of reference numerals: 100, MCU slave information acquisition module; 200, hash value judgment module; 300, update program acquisition module; 400, program update module. Implementation

[0048] The following is combined with Figure 1-4 This application is described in further detail.

[0049] The present application embodiment discloses a MCU program update method, which is applied to a corresponding device system. In this example, referring to Figure 1 The device system specifically includes a Linux host, which is connected to a first MCU slave responsible for sensor signal reading, a second MCU slave responsible for semaphore control, and a third MCU slave responsible for other functions through a serial port or RS232 interface. When the device system performs a program update, the Linux host distributes a one-to-one corresponding MCU slave update program to each MCU slave, thereby performing the update. It should be noted that the corresponding MCU slave update program can only be applied to the corresponding MCU slave, and cannot be applied to other MCU slaves.

[0050] Reference Figure 2 , MCU program update methods include:

[0051] S100, obtaining update request information and device attribute information sent by the MCU slave.

[0052] After the device system is powered on, the Linux host, the first MCU slave, the second MCU slave and the third MCU slave are all in a powered-on state; after the first MCU slave, the second MCU slave and the third MCU are in a powered-on state, they immediately send update request information and device attribute information to the Linux host; wherein the update request information is used to enable the Linux host to distribute the corresponding update program to the corresponding MCU slave; the device attribute information includes the model and version information of the corresponding MCU slave, which is used for the Linux host to identify the identity of the corresponding MCU slave.

[0053] S200 , calculating the current hash value of the update program corresponding to the MCU slave in the preset update program data table according to the update request information, and determining whether the current hash value is consistent with the original hash value corresponding to the update program.

[0054] It should be noted that the Linux host has a preset update program data table, refer to Figure 3 , the update program data table is provided with a second device attribute hash value field, an update program package field, an original hash value field, a current hash value field and a latest update time field in sequence; wherein:

[0055] The second device attribute hash value field is used to store hash values ​​corresponding to the device attribute information of the first MCU slave, the second MCU slave and the third MCU in sequence, and the hash value stored in the second device attribute hash value field is recorded as the second device attribute hash value.

[0056] The update package field is used to store and update the update package sent to the corresponding MCU slave. The update package in the update package field corresponds to the first MCU slave, the second MCU slave and the third MCU in sequence. In addition, it should be added that the content in the update package includes the program verification code, update program and update time corresponding to the corresponding MCU slave. Among them, when it is necessary to update the program of a certain MCU slave, the staff can update the update program in the update package corresponding to the MCU slave before the device system is powered on.

[0057] The original hash value field is used to store the original hash value of the update program corresponding to the corresponding MCU slave. The original hash value is calculated by the Linux host before the device system is powered on and is pre-stored in the original hash value field.

[0058] The current hash value field is used to store the current hash value of the update program in the corresponding update program package calculated by the Linux host after the device system is powered on.

[0059] It should be noted that when all MCU slaves that need to update the program complete the program update, the Linux host first clears all the original hash values ​​in the original hash value field, and then cuts the current hash value in the current hash value field to the position of the corresponding original hash value in the original hash value field.

[0060] The latest update time field is used to store the time when the staff last updated the update program, and the time stored in the latest update time field is combined into the latest update time; it should be noted that the latest update time newly entered into the latest update time field will overwrite the previous latest update time; and, after entering the latest update time in the latest update time field, the Linux host will synchronize the latest update time with the more detailed time in each update program package in the update program table.

[0061] After power-on, the device system needs to first determine whether each MCU slave needs to perform a program update. To this end, in implementation, each MCU slave immediately sends a corresponding update request message to the Linux host after power-on. The Linux host calculates the hash value of the update program in the corresponding update program package based on the update request information of the corresponding MCU slave, obtains the current hash value, and records the current hash value in the current hash value field in the update program data table; further, the Linux host determines whether the current hash value is consistent with the original hash value corresponding to the original hash value field; if it is determined that the current hash value is consistent with the original hash value corresponding to the original hash value field, it means that the update program in the corresponding update program package has not been updated before the device system is powered on, which means that the corresponding MCU slave does not need to perform a program update; if it is determined that the current hash value is inconsistent with the original hash value corresponding to the original hash value field, it means that the update program in the corresponding update program package has been updated before the device system is powered on, which means that the corresponding MCU slave needs to perform a program update.

[0062] S300: If not, calculate the first device attribute hash value of the corresponding device attribute information, process the update program data table according to the first device attribute hash value, and obtain the update program corresponding to the first device attribute hash value.

[0063] S301. Calculate a hash value of device attribute information of an MCU slave device that needs to perform a program update, and record it as a first device attribute hash value.

[0064] Through step S100, the Linux host has obtained the device attribute information of each MCU slave; then, when it is determined that the current hash value is inconsistent with the original hash value corresponding to the original hash value field, the Linux host next obtains the device attribute information corresponding to the current hash value that is inconsistent with the original hash value from the obtained device attribute information, and calculates its hash value to obtain the first device attribute hash value.

[0065] In implementation, the step of processing the update program data table according to the first device attribute hash value to obtain the update program corresponding to the first device attribute hash value specifically includes:

[0066] S302, traversing the second device attribute hash value in the second device attribute hash value field in the update program data table, and matching the second device attribute hash value that is consistent with the first device attribute hash value;

[0067] When one or more first device attribute hash values ​​are obtained through step S301, the Linux host matches a second device attribute hash value consistent with the first device attribute hash value from the second device attribute hash value field by traversing the second device attribute hash value field in the update program data table.

[0068] S303: Obtain the update package corresponding to the second device attribute hash value in the update package field in the update program data table.

[0069] Continue to refer to Figure 3 , the second device attribute hash value and the update program package in the same row correspond to each other and correspond to the same MCU slave; after the Linux host matches one or more second device attribute hash values ​​through step S302, it further determines the update program package in the update program package field corresponding to each second device attribute hash value; the determined update program package is also the update program package in which the internal update program is updated before the device system is powered on.

[0070] S400, sending the update program to the corresponding MCU slave to perform program update.

[0071] Specifically, S400 includes the following sub-steps:

[0072] S401, obtaining and parsing an update program package to obtain a corresponding program verification code and an update program.

[0073] After determining one or more update packages corresponding to the second device attribute hash value through step S303, the Linux host sends each update package to the corresponding MCU slave through the serial port or RS232 interface. Compared with the prior art of distributing all update programs to each MCU slave at the same time, the accuracy and efficiency of distributing the update program to the corresponding MCU slave can be greatly improved.

[0074] After receiving the corresponding update program package, the MCU slave parses the received update program package to obtain the corresponding program verification code, update program and update time.

[0075] It should be noted that the update package distributed to the MCU slave may not correspond to the MCU slave due to problems with the distribution program. In order to prevent the update package distributed to the MCU slave from not corresponding to the MCU slave, it is necessary to first verify the legitimacy of the update package distributed to the MCU slave, and then use the verified update package to update the MCU slave program. Specifically, the following two verification methods are used for legitimacy verification:

[0076] S402, determining whether the program verification code and a slave verification code preset in the corresponding MCU slave are complementary codes to each other.

[0077] It should be noted that each MCU slave is preset with a corresponding slave verification code, and the slave verification code and the program verification code in the update program package corresponding to the MCU slave are complementary codes to each other.

[0078] In implementation, after parsing the program verification code in the update program package corresponding to the MCU slave through step S401, the MCU slave further determines whether the program verification code is complementary to the slave verification code preset therein, thereby obtaining a first judgment result; there are two types of first judgment results: first, the parsed program verification code is complementary to the slave verification code preset in the MCU slave; second, the parsed program verification code is not complementary to the slave verification code preset in the MCU slave.

[0079] S403: Determine whether the update time is the latest update time in the latest update time field.

[0080] While determining whether the program verification code and the slave verification code are complementary to each other through step S402, the MCU slave also obtains the latest update time from the update program data table, and then determines whether the update time parsed from the update program package is consistent with the latest update time, to obtain a second judgment result. The second judgment result has two situations: first, the update time parsed from the update program package is consistent with the latest update time; second, the update time parsed from the update program package is inconsistent with the latest update time.

[0081] S404: If both are true, then write the update program into the RAM of the MCU slave, and start the RAM to update the program of the MCU slave.

[0082] If the first judgment result obtained by the MCU slave is that the parsed program verification code and the slave verification code preset in the MCU slave are complementary to each other, and the second judgment result is that the update time parsed from the update program package is consistent with the latest update time, then it means that the corresponding update package has passed the legitimacy verification; otherwise, it fails.

[0083] When the update program package passes the legality verification, the MCU slave sends the update program parsed from the update program package to its RAM, and then drives the RAM to execute the update program, thereby realizing the program update of the MCU slave.

[0084] The MCU slave that has completed the program update continues to work with the Linux host. When the device system is powered off, the updated program is automatically lost from the RAM of the MCU slave.

[0085] Figure 1 FIG. 1 is a flow chart of a method for updating an MCU program in one embodiment. It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but the steps are not necessarily executed in the order indicated by the arrows; unless otherwise specified in this document, there is no strict order restriction for the execution of the steps, and the steps may be executed in other orders; and Figure 1At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0086] The present application also discloses an MCU program update system. Figure 4 , the MCU program update system includes:

[0087] The MCU slave information acquisition module 100 is used to acquire update request information and device attribute information sent by the MCU slave.

[0088] The hash value judgment module 200 is used to calculate the current hash value of the update program corresponding to the MCU slave in the preset update program data table according to the update request information, and judge whether the current hash value is consistent with the original hash value corresponding to the update program.

[0089] The update program acquisition module 300 is used to calculate the first device attribute hash value of the corresponding device attribute information when determining that the current hash value is inconsistent with the original hash value corresponding to the update program, and process the update program data table according to the first device attribute hash value to obtain the update program corresponding to the first device attribute hash value.

[0090] The program update module 400 is used to send the update program to the corresponding MCU slave for program update.

[0091] This embodiment also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned MCU program update method. The steps of the MCU program update method here can be the steps of the MCU program update method in each of the above-mentioned embodiments.

[0092] The present embodiment also discloses a computer-readable storage medium, which stores a computer program that can be loaded by a processor and executed by a method for updating an MCU program as described above. The computer-readable storage medium includes, for example, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0093] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present disclosure can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided by the present disclosure may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided by the present disclosure may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc., but are not limited to this.

[0094] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0095] The above-described embodiments only express several implementation methods of the present disclosure, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present disclosure, and these all belong to the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the attached claims.

Claims

1. A method for updating an MCU program, characterized in that: include: Get the update request information and device attribute information sent by the MCU slave; Calculate the current hash value of the update program corresponding to the MCU slave in the preset update program data table according to the update request information, and determine whether the current hash value is consistent with the original hash value corresponding to the update program; If not, calculating a first device attribute hash value corresponding to the device attribute information, processing the update program data table according to the first device attribute hash value, and obtaining the update program corresponding to the first device attribute hash value; Sending the update program to the corresponding MCU slave for program update; The update program data table at least includes a second device attribute hash value field, an update program package field, an original hash value field, a current hash value field, and a latest update time field; The update program package field is used to store the update program package corresponding to the MCU slave in a one-to-one manner, and the content of the update program package at least includes a program verification code, the update program, and an update time; The step of sending the update program to the corresponding MCU slave for program update comprises: Acquire and parse the update program package to obtain the corresponding program verification code and the update program; Determine whether the program verification code and a slave verification code preset in the corresponding MCU slave are complementary codes to each other; If yes, then write the update program into the RAM of the MCU slave, and start the RAM to update the program of the MCU slave; The update time is also obtained by parsing the update program package; after determining that the program verification code and the slave verification code preset in the corresponding MCU slave are complementary codes, the step further includes: determining whether the update time is the latest update time in the latest update time field; if so, writing the update program into the RAM of the MCU slave; The calculating of the first device attribute hash value of the device attribute information corresponding to the device attribute information, processing the update program data table according to the first device attribute hash value, and obtaining the update program corresponding to the first device attribute hash value includes: Calculate the hash value of the device attribute information of the MCU slave device that needs to be updated, and record it as the first device attribute hash value; Traversing the second device attribute hash value in the second device attribute hash value field in the update program data table, and matching the second device attribute hash value that is consistent with the first device attribute hash value; An update package corresponding to the second device attribute hash value in an update package field in the update data table is obtained.

2. An MCU program update system, characterized in that: include: An MCU slave information acquisition module (100), used for acquiring update request information and device attribute information sent by the MCU slave; A hash value judgment module (200) is used to calculate the current hash value of the update program corresponding to the MCU slave in the preset update program data table according to the update request information, and judge whether the current hash value is consistent with the original hash value corresponding to the update program; An update program acquisition module (300) is used to calculate a first device attribute hash value of the corresponding device attribute information when determining that the current hash value is inconsistent with an original hash value corresponding to the update program, and to process the update program data table according to the first device attribute hash value to obtain the update program corresponding to the first device attribute hash value; A program update module (400), used for sending the update program to the corresponding MCU slave for program update; The update program data table at least includes a second device attribute hash value field, an update program package field, an original hash value field, a current hash value field, and a latest update time field; The update program package field is used to store the update program package corresponding to the MCU slave in a one-to-one manner, and the content of the update program package at least includes a program verification code, the update program, and an update time; The step of sending the update program to the corresponding MCU slave for program update includes: Acquire and parse the update program package to obtain the corresponding program verification code and the update program; Determine whether the program verification code and a slave verification code preset in the corresponding MCU slave are complementary codes to each other; If yes, then write the update program into the RAM of the MCU slave, and start the RAM to update the program of the MCU slave; Parsing the update program package also obtains the update time; after determining that the program verification code and the slave verification code preset in the corresponding MCU slave are complementary codes, it also includes: determining whether the update time is the latest update time in the latest update time field; if so, writing the update program into the RAM of the MCU slave; The calculating of the first device attribute hash value of the device attribute information corresponding to the device attribute information, processing the update program data table according to the first device attribute hash value, and obtaining the update program corresponding to the first device attribute hash value includes: Calculate the hash value of the device attribute information of the MCU slave device that needs to be updated, and record it as the first device attribute hash value; Traversing the second device attribute hash value in the second device attribute hash value field in the update program data table, and matching the second device attribute hash value that is consistent with the first device attribute hash value; An update package corresponding to the second device attribute hash value in an update package field in the update data table is obtained.

3. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes an MCU program updating method as described in claim 1.

4. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes an MCU program updating method as claimed in claim 1.