Multi-machine data updating method and device, electronic equipment and storage medium

Through the collaborative architecture of terminal equipment and upper computers, centralized processing and distribution of down-level computer code update data packets is realized, solving the problems of inefficiency and error-prone traditional update methods, and improving update efficiency and reliability.

CN119806588AInactive Publication Date: 2025-04-11SHENZHEN JINGCUN TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411943132.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the field of industrial automation and intelligent device control, traditional lower-level computer code update methods are inefficient, which can easily lead to human operation errors and increase system maintenance costs and difficulty.

Method used

By introducing a collaborative architecture between terminal devices and host computers, centralized acquisition, processing and distribution of update data packets are realized. The terminal device obtains the code file to be updated, performs standardization and encryption processing, generates update data packets, and sends them to the general flash memory unit of multiple lower computers simultaneously through the upper computer. The lower computer will decrypt and update after receiving it.

Benefits of technology

It improves the efficiency of downtime computer updates, reduces manual operation time and workload, and reduces the risk of human errors caused by multiple repeated operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806588A_ABST
    Figure CN119806588A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-machine data updating method and device, electronic equipment and a storage medium. The method comprises the steps that terminal equipment is controlled to obtain a to-be-updated first code file; controlling the terminal equipment again to standardize and encrypt the first code file to obtain an updated data packet; the terminal equipment is controlled to send the update data packet to the upper computer; controlling the upper computer to obtain a lower computer identifier which needs to be subjected to code updating; re-controlling the upper computer to simultaneously send the update data packet to the universal flash memory storage units of a plurality of corresponding lower computers through a preset serial port according to the lower computer identifiers; after the lower computer completes data downloading from the upper computer, the lower computer is controlled to read a universal flash memory storage unit of the lower computer to obtain an updated data packet; controlling the lower computer to decrypt the update data packet to obtain a second code file; and controlling the lower computer to perform updating processing according to the second code file. The updating efficiency of the lower computer can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data transmission, and in particular to a multi-machine data updating method, device, electronic equipment and storage medium. Background Art

[0002] In the fields of industrial automation, intelligent equipment control, etc., the system operation of multiple slave computers is often involved. When the code of the slave computer needs to be updated, the traditional method is to connect the slave computer to the computer one by one through the serial port, which has obvious defects. For example, in a system with a large number of slave computers, if the code of all slave computers is to be updated, the operator needs to spend a lot of time and energy to connect the slave computer to the computer one by one and transmit the update code, which is not only inefficient, but also easy to cause errors in the update process due to human operation errors, which increases the cost and difficulty of system maintenance and seriously affects the normal operation and upgrade efficiency of the entire system. Summary of the invention

[0003] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention provides a multi-machine data update method, device, electronic device and storage medium, which can improve the update efficiency of the lower machine.

[0004] In a first aspect, the present application provides a multi-machine data updating method, comprising:

[0005] Controlling the terminal device to obtain the first code file to be updated;

[0006] controlling the terminal device to perform standardization and encryption processing on the first code file again to obtain an update data packet;

[0007] Controlling the terminal device to send the update data packet to the host computer;

[0008] Control the upper computer to obtain the identifier of the lower computer that needs to update the code;

[0009] Controlling the upper computer again to send the update data packet to the corresponding universal flash memory storage units of the plurality of lower computers through a preset serial port according to the lower computer identifier;

[0010] When the lower computer completes data downloading from the upper computer, controlling the lower computer to read its own universal flash memory storage unit to obtain the update data packet;

[0011] Controlling the lower computer to decrypt the update data packet to obtain a second code file;

[0012] Control the lower computer to perform update processing according to the second code file.

[0013] According to the multi-machine data update method of the first aspect of the present invention, there are at least the following beneficial effects: the control terminal device first obtains the first code file to be updated, and after obtaining, the terminal device uses a specific standardization algorithm to standardize the format, structure and other aspects of the first code file, so that it conforms to the unified code specification of the system, which is convenient for subsequent transmission and processing. Then, the standardized code file is encrypted by an encryption algorithm to generate an update data packet. The terminal device sends the generated update data packet to the host computer through a network or other communication methods. After receiving the data packet, the host computer extracts the identifier of the lower computer that needs to be updated from the system information pre-stored or acquired in real time. According to the obtained identifier of the lower computer, the upper computer simultaneously sends the update data packet to the corresponding general flash memory storage unit of multiple lower computers through a preset serial communication link. When the lower computer completes data downloading from the upper computer, the lower computer reads the update data packet in its own general flash memory storage unit, and then uses the decryption algorithm corresponding to the encryption to decrypt the data packet to restore the original second code file. Finally, the lower computer updates its own programs, parameters or other relevant code parts according to the instructions and data in the second code file to complete the entire code update process. This application realizes the centralized acquisition, processing and distribution of update data packets by introducing the collaborative architecture of terminal devices and upper computers. The upper computer can communicate with multiple lower computers through serial ports at the same time and send update data packets to multiple target lower computers at one time, avoiding the cumbersome process of connecting to the lower computers one by one, greatly improving the update efficiency, reducing the time and workload of manual operation, and reducing the risk of human error caused by repeated operations.

[0014] According to some embodiments of the first aspect of the present invention, the step of controlling the terminal device again to perform standardization and encryption processing on the first code file to obtain an update data packet includes:

[0015] Sending the standard configuration format and the original encryption algorithm pre-set by the lower computer to the terminal device;

[0016] Controlling the terminal device to perform standardization processing on the first code file according to the standard configuration format to obtain a standard code file;

[0017] Controlling the terminal device to obtain a first verification value according to a standard code file and a preset verification algorithm;

[0018] The terminal device is controlled again to encrypt the standard code file and the first check value according to the original encryption algorithm to obtain an update data packet.

[0019] According to some embodiments of the first aspect of the present invention, controlling the lower computer to decrypt the update data packet to obtain a second code file includes:

[0020] Controlling the lower computer to decrypt the update data packet according to a preset original factory decryption algorithm to obtain a second check value and a second code file;

[0021] When the second check value is inconsistent with the first check value, controlling the lower computer to send a first resend instruction to the upper computer;

[0022] Controlling the upper computer to respond to the first resending instruction and resend the update data packet to the corresponding universal flash memory storage unit of the lower computer through a preset serial port;

[0023] Correspondingly, controlling the lower computer to perform update processing according to the second code file includes:

[0024] When the second check value is consistent with the first check value, the lower computer is controlled to perform update processing according to the second code file.

[0025] According to some embodiments of the first aspect of the present invention, when the second check value is inconsistent with the first check value, controlling the lower computer to send a first resend instruction to the upper computer includes:

[0026] Presetting an error accumulation bit at the lower computer;

[0027] When the second check value is inconsistent with the first check value, controlling the lower computer to send a first resend instruction to the upper computer, and updating the error accumulation bit;

[0028] After the step of controlling the upper computer to respond to the first resending instruction and resending the update data packet to the corresponding universal flash memory storage unit of the lower computer through a preset serial port, the method further includes:

[0029] When the second check value after decryption of the retransmitted update data packet is inconsistent with the first check value, and the error accumulation bit is greater than or equal to the preset first retransmission threshold, the lower computer is controlled to send an update failure status result to the terminal device through the upper computer.

[0030] According to some embodiments of the first aspect of the present invention, controlling the lower computer to perform update processing according to the second code file includes:

[0031] Control the lower computer to parse the second code file to obtain the starting address, ending address and update data information that need to be updated;

[0032] Controlling the lower computer to write the original data information within the range of the start address and the end address into a preset backup storage unit;

[0033] The lower computer is controlled again to write the updated data information between the start address and the end address.

[0034] According to some embodiments of the first aspect of the present invention, after the step of controlling the lower computer again to write the updated data information between the start address and the end address, the step further includes:

[0035] Control the lower computer to read the current data information between the start address and the end address;

[0036] Performing integrity judgment on the current data information to obtain a judgment result;

[0037] When the judgment result is abnormal, the original data information is taken out from the backup storage unit and rewritten between the start address and the end address.

[0038] According to some embodiments of the first aspect of the present invention, after the step of performing integrity judgment on the current data information to obtain a judgment result, the step further includes:

[0039] When the judgment result is normal, controlling the lower computer to send update feedback information to the terminal device through the upper computer; wherein the update feedback information includes a first identifier and a current timestamp corresponding to the lower computer;

[0040] Control the terminal device to generate a data update log according to the update feedback information.

[0041] In a second aspect, the present application also provides a multi-machine data updating device, comprising:

[0042] A first acquisition unit, used to control the terminal device to acquire a first code file to be updated;

[0043] A first processing unit, used for controlling the terminal device to perform standardization and encryption processing on the first code file again to obtain an update data packet;

[0044] A first sending unit, used to control the terminal device to send the update data packet to the host computer;

[0045] A second acquisition unit, used to control the upper computer to acquire the identifier of the lower computer that needs to perform code update;

[0046] A second sending unit is used to control the upper computer again to send the update data packet to the universal flash memory storage units of the corresponding multiple lower computers through a preset serial port according to the lower computer identifier;

[0047] A reading unit, used for controlling the lower computer to read its own universal flash memory storage unit to obtain the update data packet after the lower computer completes data download from the upper computer;

[0048] A second processing unit, used for controlling the lower computer to decrypt the update data packet to obtain a second code file;

[0049] An updating unit is used to control the lower computer to perform an updating process according to the second code file.

[0050] In a third aspect, the present application further discloses an electronic device, comprising:

[0051] at least one memory;

[0052] at least one processor;

[0053] at least one program;

[0054] The program is stored in the memory, and the processor executes at least one of the programs to implement the multi-machine data updating method as described in any one of the embodiments of the first aspect.

[0055] In a fourth aspect, the present application further discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer-executable signal, and the computer-executable signal is used to execute the multi-machine data update method as described in any embodiment of the first aspect.

[0056] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Additional aspects and advantages of the present invention will become apparent and readily understood from the following description of embodiments in conjunction with the accompanying drawings, in which:

[0058] Figure 1 A flowchart of a multi-machine data updating method provided by some embodiments of the present invention;

[0059] Figure 2 For the present invention Figure 1 Flow chart of step S120;

[0060] Figure 3 For the present invention Figure 1 Flow chart of step S170;

[0061] Figure 4 For the present invention Figure 3 Flow chart of step S320;

[0062] Figure 5 For the present invention Figure 1 Flow chart of step S180;

[0063] Figure 6 For the present invention Figure 5 Regarding the flowchart after step S530;

[0064] Figure 7 For the present invention Figure 6 The flowchart after step S620. DETAILED DESCRIPTION

[0065] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0066] In the description of the present invention, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., and orientations or positional relationships indicated are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.

[0067] In the description of the present invention, if there is a description of first and second, it is only for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0068] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.

[0069] In the fields of industrial automation, intelligent equipment control, etc., the system operation of multiple slave computers is often involved. When the code of the slave computer needs to be updated, the traditional method is to connect the slave computer to the computer one by one through the serial port, which has obvious defects. For example, in a system with a large number of slave computers, if the code of all slave computers is to be updated, the operator needs to spend a lot of time and energy to connect the slave computer to the computer one by one and transmit the update code, which is not only inefficient, but also easy to cause errors in the update process due to human operation errors, which increases the cost and difficulty of system maintenance and seriously affects the normal operation and upgrade efficiency of the entire system.

[0070] Based on this, the present application provides a multi-machine data update method, device, electronic device and storage medium to solve the above-mentioned technical problems. The technologies provided by the present application are described in detail one by one below.

[0071] First, refer to Figure 1 The present application provides a multi-machine data update method, which is mainly used to simultaneously transmit data to hundreds or thousands of slave machines to update multiple slave machines. The method may include but is not limited to the following steps:

[0072] Step S110: controlling the terminal device to obtain the first code file to be updated;

[0073] Step S120: controlling the terminal device again to perform standardization and encryption processing on the first code file to obtain an update data packet;

[0074] Step S130: Control the terminal device to send the update data packet to the host computer;

[0075] Step S140: controlling the upper computer to obtain the identifier of the lower computer that needs to perform code update;

[0076] Step S150: controlling the upper computer again to send the update data packet to the corresponding universal flash memory storage units of the plurality of lower computers through the preset serial port according to the lower computer identification;

[0077] Step S160: After the lower computer completes data downloading from the upper computer, the lower computer is controlled to read its own universal flash memory storage unit to obtain an update data packet;

[0078] Step S170: Control the lower computer to decrypt the update data packet to obtain a second code file;

[0079] Step S180: Control the lower computer to perform update processing according to the second code file.

[0080] In step S110 to step S180, the control terminal device first obtains the first code file to be updated. After obtaining, the terminal device uses a specific standardization algorithm to standardize the format, structure and other aspects of the first code file so that it conforms to the unified code specification of the system and is convenient for subsequent transmission and processing. Then, the standardized code file is encrypted using an encryption algorithm to generate an update data packet. The terminal device sends the generated update data packet to the host computer through a network or other communication methods. After receiving the data packet, the host computer extracts the identifier of the lower computer that needs to be updated from the system information pre-stored or acquired in real time. According to the obtained identifier of the lower computer, the upper computer simultaneously sends the update data packet to the corresponding general flash memory storage unit of multiple lower computers through a preset serial communication link. When the lower computer completes data downloading from the upper computer, the lower computer reads the update data packet in its own general flash memory storage unit, and then uses the decryption algorithm corresponding to the encryption to decrypt the data packet to restore the original second code file. Finally, the lower computer updates its own programs, parameters or other relevant code parts according to the instructions and data in the second code file to complete the entire code update process. This application realizes the centralized acquisition, processing and distribution of update data packets by introducing the collaborative architecture of terminal devices and upper computers. The upper computer can communicate with multiple lower computers through serial ports at the same time and send update data packets to multiple target lower computers at one time, avoiding the cumbersome process of connecting to the lower computers one by one, greatly improving the update efficiency, reducing the time and workload of manual operation, and reducing the risk of human error caused by repeated operations.

[0081] It should be noted that the first code file of step S110 can be derived from the newly developed or optimized program code of the development team. The lower computer identification in step S140 can be the unique identification number, IP address or custom identification of the lower computer under a specific system architecture. The upper computer uses these identifications to accurately locate the lower computer that needs to update the code to ensure the accuracy of the update operation. The universal flash storage unit in step S150 is the UFS (Universal Flash Storage) storage unit of the lower computer. The universal flash storage unit provides a temporary storage location for the update data packet. After the upper computer sends the update data packet to the lower computer, it is first stored in the universal flash storage unit and waits for subsequent decryption and update processing. This is like a data buffer, ensuring that the data has a stable storage space between transmission and processing to avoid data loss or confusion.

[0082] Reference Figure 2 It is understandable that step S120 may include but is not limited to the following steps:

[0083] Step S210: sending the standard configuration format and the original encryption algorithm preset by the lower computer to the terminal device;

[0084] Step S220: Control the terminal device to perform standardization processing on the first code file according to the standard configuration format to obtain a standard code file;

[0085] Step S230: Control the terminal device to obtain a first verification value according to the standard code file and a preset verification algorithm;

[0086] Step S240: controlling the terminal device again to encrypt the standard code file and the first check value according to the original encryption algorithm to obtain an update data packet.

[0087] In step S210 to step S240, first, the lower computer transmits its pre-set standard configuration format and original encryption algorithm to the terminal device. These standard configuration formats and original encryption algorithms are formulated by the lower computer manufacturer based on factors such as its hardware characteristics, system architecture and security requirements, and are intended to ensure the compatibility and security of the code on different lower computers. After the terminal device receives the standard configuration format, the first code file obtained is standardized according to this format, so that the first code file can be perfectly adapted to the operating environment of the lower computer, and finally a standard code file that meets the requirements of the lower computer is obtained. Then, the terminal device calculates the standard code file using a preset verification algorithm to obtain a first verification value. These verification algorithms can be CRC algorithms, MD5 algorithms, etc., which are not limited in this application. Finally, the terminal device encrypts the standard code file and the first verification value according to the received original encryption algorithm.

[0088] In the above steps, the code is standardized by using the standard configuration format pre-set by the lower computer, ensuring that the updated code can run accurately on different lower computers, avoiding problems such as update failure or abnormal operation due to incompatible code formats, and improving the stability and reliability of the entire system. At the same time, the standard code file and checksum value are encrypted using the original encryption algorithm, which greatly enhances the security of the data. During the data transmission process, even if the data packet is illegally intercepted, due to the encryption protection, it is difficult for the attacker to obtain the key information therein, effectively preventing security issues such as code theft, malicious tampering, and sensitive information leakage, and ensuring the information security of the system.

[0089] Reference Figure 3 It is understood that, in step S170, the following steps may be included but not limited to:

[0090] Step S310: Control the lower computer to decrypt the update data packet according to a preset original factory decryption algorithm to obtain a second check value and a second code file;

[0091] Step S320: When the second check value is inconsistent with the first check value, control the lower computer to send a first resend instruction to the upper computer;

[0092] Step S330: Control the upper computer to respond to the first resending instruction and resend the update data packet to the universal flash memory storage unit of the corresponding lower computer through the preset serial port.

[0093] Correspondingly, in step S180, the following steps may be included but not limited to:

[0094] Step S340: When the second check value is consistent with the first check value, the lower computer is controlled to perform update processing according to the second code file.

[0095] In step S310 to step S340, when the lower computer reads the update data packet from the universal flash memory storage unit, it will first use the preset original factory decryption algorithm to decrypt it. The original factory decryption algorithm is an algorithm corresponding to the original factory encryption algorithm mentioned in step S210, which can accurately restore the data before encryption, including the second check value and the second code file. After the decryption is completed, the lower computer will immediately compare the received second check value with the first check value generated in the terminal device and encrypted and transmitted with the data packet. If it is found that the second check value is inconsistent with the first check value, this indicates that the data may have errors, loss or tampering during the transmission process. At this time, the lower computer will automatically send a first resend instruction to the upper computer to notify the upper computer to resend the update data packet. After receiving the first resend instruction, the upper computer will respond quickly and send the update data packet to the corresponding lower computer's universal flash memory storage unit again through the preset serial port to ensure that the lower computer can obtain complete and correct data. Only when the second check value is consistent with the first check value, the lower computer will confirm the integrity and accuracy of the data, and then perform update processing according to the second code file.

[0096] Through the comparison mechanism of the check value, errors that occur during data transmission can be discovered and corrected in a timely manner, ensuring that the code file received by the lower computer is completely consistent with the one sent by the terminal device, avoiding update failures, system failures or abnormal behaviors caused by data errors, and greatly improving the success rate and reliability of code updates. At the same time, when the lower computer detects data inconsistency, it automatically sends a resend instruction to the upper computer, and the upper computer can respond quickly and resend the data packet, which not only reduces the workload of manual troubleshooting and solving data transmission problems, but also improves the efficiency and timeliness of the update process, allowing the system to return to normal operation or complete the update task more quickly.

[0097] Reference Figure 4It is understandable that, in step S320, the following steps may be included but not limited to:

[0098] Step S410: Preset the error accumulation bit at the lower computer;

[0099] Step S420: When the second check value is inconsistent with the first check value, the lower computer is controlled to send a first resend instruction to the upper computer, and the error accumulation bit is updated;

[0100] Correspondingly, after step S330, the method further includes:

[0101] Step S430: When the second check value after decryption of the retransmitted update data packet is inconsistent with the first check value, and the error accumulation bit is greater than or equal to the preset first retransmission threshold, the lower computer is controlled to send the update failure status result to the terminal device through the upper computer.

[0102] In step S410 to step S430, first, an error accumulation bit is pre-set inside each lower computer, and the bit is used to record the number of times the update data packet is retransmitted, and the initial value is set to 0. When verifying the update data packet, if it is found that the second verification value is inconsistent with the first verification value, the lower computer will immediately send the first retransmission instruction to the upper computer, and at the same time update its own error accumulation bit to increase its value by 1. After receiving the first retransmission instruction, the upper computer will resend the update data packet to the universal flash memory storage unit of the corresponding lower computer through the preset serial port. The lower computer decrypts the re-received update data packet again, and obtains a new second verification value to compare with the first verification value. If there is still inconsistency after this comparison, the lower computer will check the value of the error accumulation bit again. When it is found that the error accumulation bit is greater than or equal to the preset first retransmission threshold (for example, set to 5 times, indicating that the data is still incorrect after 5 retransmission attempts), the lower computer will start a specific communication process, and send the update failure status result to the terminal device that originally sent the code file through the upper computer, informing the terminal device that the update operation of the current lower computer has failed and the problem has not been resolved after multiple retransmission attempts.

[0103] In the above steps, by setting the error accumulation bit and the first retransmission threshold, the system can avoid the situation where the lower computer requests the upper computer to resend the update data packet indefinitely when continuous errors occur in data transmission, thereby preventing the waste of system resources and time due to the retransmission operation falling into an infinite loop, and ensuring that the entire update process can be carried out within a reasonable time and resource consumption range.

[0104] Reference Figure 5 It is understood that, in step S180, the following steps may be included but not limited to:

[0105] Step S510: Control the lower computer to parse the second code file to obtain the start address, end address and update data information that need to be updated;

[0106] Step S520: Control the lower computer to write the original data information within the range of the start address and the end address into a preset backup storage unit;

[0107] Step S530: Control the lower computer again to write the updated data information between the start address and the end address.

[0108] In step S510 to step S530, when it is confirmed that the second check value is consistent with the first check value, the lower computer first parses the second code file to extract the starting address, the end address and the update data information that need to be updated. Then, the lower computer writes the original data information within the range of the starting address and the end address completely into the preset backup storage unit. This backup storage unit can be a storage area specially reserved inside the lower computer, which is used to temporarily save the original data that may need to be rolled back or referenced during the update process. By backing up the original data, it is ensured that when an abnormal situation occurs in the update, the data recovery operation can be carried out based on evidence to ensure that the basic operating functions of the lower computer are not damaged. After completing the backup, the lower computer starts the write operation again, and the update data information parsed from the second code file is accurately written to the storage area between the starting address and the end address.

[0109] In the above steps, by backing up the original data information to the preset backup storage unit, a reliable safety line is provided for the update operation. Once an unexpected situation occurs during the update process, such as update data errors, sudden system power outages, etc., the lower computer can use the backup data to quickly restore to the state before the update, avoiding system crashes or data loss due to update failures, effectively ensuring the integrity and security of the lower computer data and reducing the risk of update operations.

[0110] Reference Figure 6 It is understandable that after step S530, the following steps may also be included but not limited to:

[0111] Step S610: Control the lower computer to read the current data information between the start address and the end address;

[0112] Step S620: Perform integrity check on the current data information to obtain a check result;

[0113] Step S630: When the judgment result is abnormal, the original data information is taken out from the backup storage unit and rewritten between the start address and the end address.

[0114] In step S610 to step S630, after completing the operation of writing the update data information between the start address and the end address, the lower computer immediately starts a read operation to read the current data information from the start address just updated to the end address. After reading the current data information, the lower computer uses a preset integrity judgment algorithm to check it. This integrity judgment algorithm can be based on a variety of methods such as a checksum, hash value, specific format rules, or logical consistency of the data to determine whether the data is complete, accurate, and meets the expected update results. For example, the checksum of the current data is calculated and compared with the expected checksum. If the two do not match, it is determined that there is a problem with the data integrity. When the result of the integrity judgment is abnormal, the lower computer immediately takes out the original data information previously backed up from the preset backup storage unit. Then, according to the established write rules and address mapping, the original data information is rewritten between the start address and the end address to restore to the state before the update operation, ensuring that the lower computer can continue to operate stably and avoid system failures caused by data errors caused by updates. In this way, the probability of abnormal system behavior and failure caused by update data problems can be reduced.

[0115] Reference Figure 7 It is understandable that after step S620, the following steps may also be included but not limited to:

[0116] Step S710: When the judgment result is normal, control the lower computer to send update feedback information to the terminal device through the upper computer; wherein the update feedback information includes the first identifier and the current timestamp of the corresponding lower computer;

[0117] Step S720: Control the terminal device to generate a data update log according to the update feedback information.

[0118] In step S710 to step S720, when the lower computer completes the integrity judgment of the current data information between the starting address and the ending address, and the judgment result obtained is normal, the feedback process will be started. The lower computer sends the update feedback information containing the first identifier and the current timestamp to the upper computer through the communication link between the upper computer. After receiving the update feedback information from the lower computer, the upper computer will parse and verify it according to the established communication protocol to ensure the integrity and accuracy of the information, and then forward it to the terminal device. After receiving the update feedback information forwarded by the upper computer, the terminal device will integrate and record this information according to the preset log generation rules and format to generate a detailed data update log. In addition to the first identifier and timestamp of the lower computer, the data update log may also include information such as the updated code version number, the updated content summary, and the key step record in the update process, so as to conduct a comprehensive and detailed tracing and analysis of the entire update process.

[0119] In a second aspect, the present application also provides a multi-machine data updating device, comprising:

[0120] A first acquisition unit, used to control the terminal device to acquire a first code file to be updated;

[0121] A first processing unit, used for controlling the terminal device to perform standardization and encryption processing on the first code file again to obtain an update data packet;

[0122] A first sending unit, used to control the terminal device to send the update data packet to the host computer;

[0123] The second acquisition unit is used to control the upper computer to acquire the identifier of the lower computer that needs to update the code;

[0124] The second sending unit is used to control the upper computer again to send the update data packet to the corresponding universal flash memory storage units of multiple lower computers through the preset serial port according to the lower computer identification;

[0125] The reading unit is used to control the lower computer to read its own universal flash memory storage unit to obtain an update data packet after the lower computer completes data download from the upper computer;

[0126] The second processing unit is used to control the lower computer to decrypt the update data packet to obtain a second code file;

[0127] The updating unit is used to control the lower computer to perform updating processing according to the second code file.

[0128] The specific implementation of the multi-machine data updating device is substantially the same as the specific implementation of the multi-machine data updating method described above, and will not be described in detail herein.

[0129] In a third aspect, the present application also provides an electronic device, comprising: at least one memory, at least one processor and at least one program, the program is stored in the memory, and the processor executes one or more programs to implement the above-mentioned multi-machine data update method.

[0130] In the electronic device, it is used to control the terminal device to first obtain the first code file to be updated. After obtaining, the terminal device uses a specific standardization algorithm to standardize the format, structure and other aspects of the first code file so that it conforms to the unified code specification of the system and is convenient for subsequent transmission and processing. Then, the standardized code file is encrypted by an encryption algorithm to generate an update data packet. The terminal device sends the generated update data packet to the host computer through a network or other communication methods. After receiving the data packet, the host computer extracts the identifier of the lower computer that needs to be updated from the system information pre-stored or acquired in real time. According to the obtained identifier of the lower computer, the upper computer simultaneously sends the update data packet to the universal flash memory storage unit of the corresponding multiple lower computers through a preset serial communication link. When the lower computer completes data downloading from the upper computer, the lower computer reads the update data packet in its own universal flash memory storage unit, and then uses the decryption algorithm corresponding to the encryption to decrypt the data packet to restore the original second code file. Finally, the lower computer updates its own program, parameters or other related code parts according to the instructions and data in the second code file to complete the entire code update process. This application realizes the centralized acquisition, processing and distribution of update data packets by introducing a collaborative architecture of terminal devices and host computers. The host computer can simultaneously communicate with multiple slave computers via serial ports and send update data packets to multiple target slave computers at one time, thus avoiding the tedious process of connecting to the slave computers one by one. This greatly improves the update efficiency, reduces the time and workload of manual operations, and reduces the risk of human errors caused by repeated operations.

[0131] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function; the data storage area may store relevant data of the above-mentioned multi-machine data update method, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processing module via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0132] One or more signals are stored in a memory, and when executed by one or more processors, the multi-machine data updating method in any of the above method embodiments is executed.

[0133] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program is executed by one or more processors, enabling the one or more processors to execute the multi-machine data update method in the above method embodiment.

[0134] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0135] Through the description of the above embodiments, it will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed methods above can be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, and the computer-readable medium can include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as a computer-readable signal, a data structure, a program module or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media generally embodies computer readable signals, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0136] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0137] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0138] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0139] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0140] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0141] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the present application is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the relevant technical field without departing from the purpose of the present application.

Claims

1. A multi-machine data updating method, characterized in that: include: Controlling the terminal device to obtain the first code file to be updated; controlling the terminal device to perform standardization and encryption processing on the first code file again to obtain an update data packet; Controlling the terminal device to send the update data packet to the host computer; Control the upper computer to obtain the identifier of the lower computer that needs to update the code; Controlling the upper computer again to send the update data packet to the corresponding universal flash memory storage units of the plurality of lower computers through a preset serial port according to the lower computer identifier; When the lower computer completes data downloading from the upper computer, controlling the lower computer to read its own universal flash memory storage unit to obtain the update data packet; Controlling the lower computer to decrypt the update data packet to obtain a second code file; Control the lower computer to perform update processing according to the second code file.

2. The multi-machine data updating method according to claim 1, characterized in that: The step of controlling the terminal device again to perform standardization and encryption processing on the first code file to obtain an update data packet includes: Sending the standard configuration format and the original encryption algorithm pre-set by the lower computer to the terminal device; Controlling the terminal device to perform standardization processing on the first code file according to the standard configuration format to obtain a standard code file; Controlling the terminal device to obtain a first verification value according to a standard code file and a preset verification algorithm; The terminal device is controlled again to encrypt the standard code file and the first check value according to the original encryption algorithm to obtain an update data packet.

3. The multi-machine data updating method according to claim 2, characterized in that: The controlling the lower computer to decrypt the update data packet to obtain a second code file includes: Controlling the lower computer to decrypt the update data packet according to a preset original factory decryption algorithm to obtain a second check value and a second code file; When the second check value is inconsistent with the first check value, controlling the lower computer to send a first resend instruction to the upper computer; Controlling the upper computer to respond to the first resending instruction and resend the update data packet to the corresponding universal flash memory storage unit of the lower computer through a preset serial port; Correspondingly, controlling the lower computer to perform update processing according to the second code file includes: When the second check value is consistent with the first check value, the lower computer is controlled to perform update processing according to the second code file.

4. The multi-machine data updating method according to claim 3, characterized in that: When the second check value is inconsistent with the first check value, controlling the lower computer to send a first resend instruction to the upper computer includes: Presetting an error accumulation bit at the lower computer; When the second check value is inconsistent with the first check value, controlling the lower computer to send a first resend instruction to the upper computer, and updating the error accumulation bit; Correspondingly, after the step of controlling the upper computer to respond to the first resending instruction and resending the update data packet to the corresponding universal flash memory storage unit of the lower computer through a preset serial port, the method further includes: When the second check value after decryption of the retransmitted update data packet is inconsistent with the first check value, and the error accumulation bit is greater than or equal to the preset first retransmission threshold, the lower computer is controlled to send an update failure status result to the terminal device through the upper computer.

5. The multi-machine data updating method according to claim 1, characterized in that: The controlling the lower computer to perform update processing according to the second code file includes: Control the lower computer to parse the second code file to obtain the starting address, ending address and update data information that need to be updated; Controlling the lower computer to write the original data information within the range of the start address and the end address into a preset backup storage unit; The lower computer is controlled again to write the updated data information between the start address and the end address.

6. The multi-machine data updating method according to claim 5, characterized in that: After the step of controlling the lower computer again to write the updated data information between the start address and the end address, the method further includes: Control the lower computer to read the current data information between the start address and the end address; Performing integrity judgment on the current data information to obtain a judgment result; When the judgment result is abnormal, the original data information is taken out from the backup storage unit and rewritten between the start address and the end address.

7. The multi-machine data updating method according to claim 6, characterized in that: After the step of judging the integrity of the current data information and obtaining the judgment result, the method further includes: When the judgment result is normal, controlling the lower computer to send update feedback information to the terminal device through the upper computer; wherein the update feedback information includes a first identifier and a current timestamp corresponding to the lower computer; Control the terminal device to generate a data update log according to the update feedback information.

8. A multi-machine data updating device, characterized in that: include: A first acquisition unit, used to control the terminal device to acquire a first code file to be updated; A first processing unit, used for controlling the terminal device to perform standardization and encryption processing on the first code file again to obtain an update data packet; A first sending unit, used to control the terminal device to send the update data packet to the host computer; A second acquisition unit, used to control the upper computer to acquire the identifier of the lower computer that needs to perform code update; A second sending unit is used to control the upper computer again to send the update data packet to the universal flash memory storage units of the corresponding multiple lower computers through a preset serial port according to the lower computer identifier; A reading unit, used for controlling the lower computer to read its own universal flash memory storage unit to obtain the update data packet after the lower computer completes data download from the upper computer; A second processing unit, used for controlling the lower computer to decrypt the update data packet to obtain a second code file; An updating unit is used to control the lower computer to perform an updating process according to the second code file.

9. An electronic device, characterized in that: include: at least one memory; at least one processor; at least one program; The programs are stored in the memory, and the processor executes at least one of the programs to implement the multi-machine data updating method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer-executable signal, and the computer-executable signal is used to execute the multi-machine data updating method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data decryption processing method and device and data encryption processing method and device

    CN110636081A

  • OTA upgrading method and system based on protocol conversion

    CN112822199A

  • Multi-slave data updating method, system and device and storage medium

    CN113242169A

  • Serial port upgrading method and system for multiple MCU slave stations

    CN114281392A

  • Voltage conversion chip upgrading method and device, electronic equipment and storage medium

    CN117075949A