Application program processing method, device and system

By generating upgrade and fallback patch files on the upper computer end of the train on-board control unit and implementing these functions in the microcontroller or DSP, the problem of long program update time and lack of fallback mechanism in the existing technology is solved, and efficient and safe program updates and fallbacks are achieved.

CN119536766APending Publication Date: 2025-02-28CHINA STATE RAILWAY GRP CO LTD +4
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411530233.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In the prior art, the program update time of the train on-board control unit is long and lacks a safe and reliable fallback mechanism, which makes it impossible to go back to the previous version when the update is abnormal.

Method used

By generating upgrade patch files and fallback patch files on the upper computer side, differential algorithms and compression algorithms are used to reduce data transmission, and the upgrade and fallback functions are implemented in microcontrollers or DSPs to ensure the security and reliability of program fallback.

Benefits of technology

It reduces the time for program updates, improves update efficiency, and while saving storage space, it ensures the security and reliability of program fallback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536766A_ABST
    Figure CN119536766A_ABST
Patent Text Reader

Abstract

The invention provides an application program processing method, device and system, and relates to the technical field of software, in particular to the field of program version updating and backspacing. The application program processing method is executed at an upper computer end and comprises the steps that a historical version file and a new version file of an application program are obtained, and an upgrade patch file and a rollback patch file are generated according to the historical version file and the new version file; determining a check code of the historical version file, and sending the check code to a lower computer; receiving a check result of the check code from the lower computer, determining a processing instruction for the application program according to the check result, and sending the processing instruction to the lower computer; wherein a current version file of the application program is stored in the lower computer, and the verification result is used for indicating whether the current version file is consistent with the historical version file or not; and sending at least one of the upgrade patch file, the rollback patch file and the new version file to the lower computer according to the processing instruction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of software technology, and in particular to the field of program version update and rollback. Specifically, it relates to an application processing method, device and system. Background Art

[0002] The existing train on-board control unit electronic control device is composed of multiple boards, and the internal communication is mainly based on CAN bus. The control device program update is to communicate with the designated single board through the on-board diagnostic instrument, transmit the data to the microcontroller or DSP, and then the bootloader program of the microcontroller or DSP writes the data into the internal FLASH to complete the program update.

[0003] However, this method has the problems of large program data volume and limited transmission speed, which leads to a long time for single-board program update; after a set of programs is updated, there is no safe and reliable rollback mechanism, and when the update program is abnormal, it is impossible to trace back to the previous version. Summary of the invention

[0004] In view of at least one problem existing in the prior art, the present application provides an application processing method, device and system, which can reduce the amount of data transmission and solve the problem of low update efficiency of single-chip microcomputer or DSP. At the same time, a mechanism for program rollback of single-chip microcomputer or DSP is provided, which saves storage space while ensuring the security and reliability of program rollback.

[0005] According to a first aspect of the present application, there is provided an application processing method, which is executed on a host computer, and includes:

[0006] Obtaining a historical version file and a new version file of the application, and generating an upgrade patch file and a rollback patch file according to the historical version file and the new version file;

[0007] Determine the verification code of the historical version file, and send the verification code to the lower computer;

[0008] Receive the verification result of the verification code from the lower computer, and determine the processing instruction for the application according to the verification result, and send the processing instruction to the lower computer; wherein the lower computer stores the current version file of the application, and the verification result is used to indicate whether the current version file is consistent with the historical version file;

[0009] According to the processing instruction, at least one of the upgrade patch file, the rollback patch file and the new version file is sent to the lower computer.

[0010] In some optional methods of this embodiment, generating an upgrade patch file and a rollback patch file according to the historical version file and the new version file includes:

[0011] Determine the difference information between the new version file and the historical version file based on a differential algorithm;

[0012] Using the historical version file as a first initial file and the new version file as a first target file, and determining the upgrade patch file based on the difference information and the compression algorithm;

[0013] The new version file is used as a second initial file and the historical version file is used as a second target file, and the rollback patch file is determined based on the difference information and the compression algorithm.

[0014] In some optional aspects of this embodiment, determining the verification code of the historical version file includes:

[0015] Determine a verification address of the historical version file, where the verification address is used to indicate a starting position of a data range for verifying the historical version file;

[0016] Determine a checksum length of the historical version file, wherein the checksum length is used to indicate the length of a data range for checking the historical version file;

[0017] Determine the verification code of the historical version file based on the verification address and the verification length;

[0018] After determining the verification code of the historical version file, the method further includes:

[0019] The verification address and the verification length are sent to the lower computer.

[0020] In some optional manners of this embodiment, determining the processing instruction for the application according to the verification result includes:

[0021] In response to the verification result indicating that the current version file is inconsistent with the historical version file, determining that the processing instruction for the application is a full update instruction;

[0022] In response to the verification result indicating that the current version file is consistent with the historical version file, determining that the processing instruction for the application is a differential update instruction.

[0023] In some optional aspects of this embodiment, sending at least one of the upgrade patch file, the rollback patch file, and the new version file to the lower computer according to the processing instruction includes:

[0024] In response to the processing instruction being the full update, sending the new version file to the lower computer;

[0025] In response to the processing instruction being the differential update, the upgrade patch file and the rollback patch file are sent to the lower computer.

[0026] According to a second aspect of the present application, there is also provided an application processing device, which is deployed on a host computer, and includes:

[0027] The patch generation module is configured to obtain the historical version file and the new version file of the application program, and generate the upgrade patch file and the rollback patch file according to the historical version file and the new version file;

[0028] A verification code sending module is configured to determine the verification code of the historical version file and send the verification code to the lower computer;

[0029] a processing instruction determination module, configured to receive a verification result of the verification code from the lower computer, and determine a processing instruction for the application program according to the verification result, wherein the lower computer stores a current version file of the application program, and the verification result is used to indicate whether the current version file is consistent with the historical version file;

[0030] The file sending module is configured to send at least one of the upgrade patch file, the rollback patch file and the new version file to the lower computer according to the processing instruction.

[0031] According to a third aspect of the present application, there is also provided an application processing method, which is executed on a lower computer, and the lower computer stores a current version file of the application, including:

[0032] Receive a check code, a check address, and a check length from a host computer, and determine a check value of the current version file according to the check address and the check length;

[0033] Determine the verification result of the verification code according to the verification value, and send the verification result to the host computer, wherein the verification result is used to indicate whether the current version file is consistent with the historical version file;

[0034] Receive a processing instruction from a host computer, and perform a differential update operation or a full update operation on the application.

[0035] In some optional manners of this embodiment, determining a verification result of the verification code according to the verification value includes:

[0036] Comparing the verification value with the verification code;

[0037] In response to the verification value being the same as the verification code, it is determined that the current version file is consistent with the historical version file; in response to the verification value being different from the verification code, it is determined that the current version file is inconsistent with the historical version file.

[0038] In some optional manners of this embodiment, the processing instruction includes a full update instruction and a differential update instruction, and performing a differential update operation or a full update operation on the application includes:

[0039] In response to the processing instruction being the full update instruction, performing a full update operation on the application program;

[0040] In response to the processing instruction being the differential update instruction, a differential update operation is performed on the application.

[0041] In some optional aspects of this embodiment, the steps of the full update operation include:

[0042] Receiving a new version file from the host computer;

[0043] Based on the new version file, the current version file is updated so that the current version file is upgraded to the new version file, and the new version file is written into the first storage space.

[0044] In some optional aspects of this embodiment, the step of the differential update operation includes:

[0045] Receiving an upgrade patch file and a rollback patch file from the host computer, and writing the upgrade patch file into the second storage space, and writing the rollback patch file into the third storage space;

[0046] Reading the upgrade patch file from the second storage space, upgrading the current version file to a new version file using a restoration algorithm and the upgrade patch file, and writing the new version file into the first storage space;

[0047] A rollback flag is set for the new version file, and the rollback flag is written into the fourth storage space.

[0048] In some optional manners of this embodiment, after writing the rollback flag into the fourth storage space, the differential update operation further includes:

[0049] Jump from the bootloader to said application;

[0050] The application performs a functional test on the new version file, and if the test succeeds, erases the rollback flag of the fourth storage space; if the test fails, jumps from the application to the boot loader and performs a rollback operation on the new version file.

[0051] In some optional aspects of this embodiment, the step of the rollback operation includes:

[0052] The rollback patch file is read from the third storage space, the new version file is rolled back to the current version file using a restoration algorithm and the rollback patch file, and the current version file is written into the first storage space.

[0053] According to a fourth aspect of the present application, there is also provided an application processing device, which is deployed on a lower computer, and the lower computer stores a current version file of the application, including:

[0054] A check value determination module is configured to receive a check code, a check address and a check length from a host computer, and determine a check value of the current version file according to the check address and the check length;

[0055] A verification result determination module is configured to determine a verification result of the verification code according to the verification value, and send the verification result to the host computer, wherein the verification result is used to indicate whether the current version file is consistent with the historical version file;

[0056] The application processing module is configured to receive a processing instruction from a host computer and perform a differential update operation or a full update operation on the application.

[0057] According to the fifth aspect of the present application, an application processing system is also provided, including a host computer and a slave computer, wherein the host computer is configured to execute the application processing method described in the first aspect; and the slave computer is configured to execute the application processing method described in the third aspect.

[0058] According to the sixth aspect of the present application, there is also provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the application processing method described in the first aspect or the application processing method described in the third aspect are implemented.

[0059] According to the seventh aspect of the present application, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the application processing method described in the first aspect or the application processing method described in the third aspect are implemented.

[0060] According to the eighth aspect of the present application, a computer program product is also provided, including a computer program / instruction, which, when executed by a processor, implements the steps of the application processing method described in the first aspect or the application processing method described in the third aspect.

[0061] The present application provides an application processing method, device and system, which obtains upgrade patch files and rollback patch files by using a new program and an existing program on a host computer according to the bsdiff difference algorithm and the QuickLZ compression algorithm. The host computer downloads the two patch files to a single-chip microcomputer or DSP through a universal diagnostic protocol. The implementation of the upgrade and rollback functions of the program in the single-chip microcomputer or DSP can reduce the amount of data transmission and solve the problem of low update efficiency of the single-chip microcomputer or DSP. At the same time, a mechanism for program rollback of a single-chip microcomputer or DSP is provided to ensure the security and reliability of program rollback while saving storage space. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0063] Figure 1 One of the flowcharts of the application processing method executed on the host computer according to the embodiment of the present application;

[0064] Figure 2 This is a second flowchart of the application processing method executed on the host computer according to an embodiment of the present application;

[0065] Figure 3 One of the flowcharts of the application processing method executed on the lower computer according to the embodiment of the present application;

[0066] Figure 4 is a schematic diagram of a storage space according to an embodiment of the present application;

[0067] Figure 5 This is a second flowchart of the application processing method executed on the lower computer according to an embodiment of the present application;

[0068] Figure 6 It is a structural diagram of an application processing device deployed on a host computer according to an embodiment of the present application;

[0069] Figure 7 It is a structural diagram of an application processing device deployed on a lower computer according to an embodiment of the present application;

[0070] Figure 8 is a schematic diagram of the structure of an application processing system according to an embodiment of the present application;

[0071] Fig. 9 A block diagram of an electronic device for implementing an application processing method according to an embodiment of the present application. DETAILED DESCRIPTION

[0072] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0073] An embodiment of the present application provides an application processing method, which is executed on a host computer, such as Figure 1 Shown include:

[0074] Step 10: Obtain the historical version file and the new version file of the application, and generate an upgrade patch file and a rollback patch file based on the historical version file and the new version file.

[0075] In this application, it should be understood that for an application, it is constantly updated according to actual needs, so there will be historical version files and new version files; based on the historical version files and the new version files, combined with the differential algorithm and the compression algorithm, the upgrade patch file and the rollback patch file can be determined, wherein the upgrade patch file is used to upgrade the historical version file to the new version; the rollback patch file is used to roll back the new version file to the historical version. Compared with the traditional update strategy, this application proposes a safe and reliable rollback mechanism, which occupies less storage space and solves the problem of abnormality after program update and inability to roll back the version.

[0076] In some optional methods of this embodiment, generating an upgrade patch file and a rollback patch file according to the historical version file and the new version file includes:

[0077] Determine the difference information between the new version file and the historical version file based on a differential algorithm;

[0078] Using the historical version file as a first initial file and the new version file as a first target file, and determining the upgrade patch file based on the difference information and the compression algorithm;

[0079] The new version file is used as a second initial file and the historical version file is used as a second target file, and the rollback patch file is determined based on the difference information and the compression algorithm.

[0080] Step 20: Determine the verification code of the historical version file and send the verification code to the lower computer.

[0081] In some optional aspects of this embodiment, determining the verification code of the historical version file includes:

[0082] Determine a verification address of the historical version file, where the verification address is used to indicate a starting position of a data range for verifying the historical version file;

[0083] Determine a checksum length of the historical version file, wherein the checksum length is used to indicate the length of a data range for checking the historical version file;

[0084] Determine the verification code of the historical version file based on the verification address and the verification length;

[0085] After determining the verification code of the historical version file, the method further includes:

[0086] The verification address and the verification length are sent to the lower computer.

[0087] Step 30, receiving the verification result of the verification code from the lower computer, and determining the processing instructions for the application based on the verification result, and sending the processing instructions to the lower computer; wherein, the lower computer stores the current version file of the application, and the verification result is used to indicate whether the current version file is consistent with the historical version file.

[0088] In some optional manners of this embodiment, determining the processing instruction for the application according to the verification result includes:

[0089] In response to the verification result indicating that the current version file is inconsistent with the historical version file, determining that the processing instruction for the application is a full update instruction;

[0090] In response to the verification result indicating that the current version file is consistent with the historical version file, determining that the processing instruction for the application is a differential update instruction.

[0091] Step 40: According to the processing instruction, at least one of the upgrade patch file, the rollback patch file and the new version file is sent to the lower computer.

[0092] In some optional aspects of this embodiment, sending at least one of the upgrade patch file, the rollback patch file, and the new version file to the lower computer according to the processing instruction includes:

[0093] In response to the processing instruction being the full update, sending the new version file to the lower computer;

[0094] In response to the processing instruction being the differential update, the upgrade patch file and the rollback patch file are sent to the lower computer.

[0095] The traditional update strategy is to transfer the complete program file to the single-chip microcomputer or DSP through the bootloader for program update. Due to the large size of the program file and the limited transmission speed, the program update efficiency is low. Under normal circumstances, the difference between the existing program and the updated program is small. Therefore, the present invention proposes a program update method using a differential algorithm and a compression algorithm. This method can generate an upgrade patch file based on the amount of updated code, which greatly reduces the amount of data transmitted by the update program. Compared with the traditional update strategy, the efficiency of program updates is greatly improved. At the same time, the present invention proposes a safe and reliable rollback mechanism, which occupies little storage space and solves the problem of abnormalities after program updates and inability to roll back versions.

[0096] In a specific example, if Figure 2 As shown, S11-S16 are the above-mentioned upper computer (ie, client) process, which is as follows:

[0097] S11, generate upgrade package and rollback package, calculate checksum. The new program file new.hex generates binary file new.bin (i.e. new version file), and then calculates with the existing program old.bin file (i.e. historical version file) according to the difference algorithm and compression algorithm, and writes the program address and other information into the package header to generate the upgrade patch file patch.bin file and the rollback patch file rollback.bin, and calculate the checksum of the old.bin file at the same time.

[0098] S12, send verification code. The client interacts with the server bootloader, downloads the upgrade patch file and the rollback patch file to the MCU or DSP through the CAN bus, and sends the verification code, verification address, verification length and other information at the same time, waiting for the server to complete the reception.

[0099] S13, receiving the verification result. The client determines whether the verification is passed according to the verification result. If the verification fails, it means that the MCU or DSP program is inconsistent with the existing program calculated by the client, and differential update cannot be performed. At this time, a full update is performed; if the verification passes, it means that the MCU or DSP program is consistent with the existing program calculated by the client, and differential update can be performed.

[0100] S14, perform full update. At this time, the upper computer sends the full update data new.bin (new version file) to the lower computer, and the lower computer performs full update according to the process.

[0101] S15, send the upgrade package and rollback package. The upper computer will send the upgrade package patch.bin, the rollback package rollback.bin and the flashing address, and wait for the lower computer to complete receiving.

[0102] S16, upgrade completed. Wait for the lower computer to send an upgrade completion instruction.

[0103] According to another embodiment of the present application, there is also provided an application processing method, which is executed on a lower computer, and the lower computer stores a current version file of the application, such as Figure 3 As shown, including:

[0104] Step 01, receiving a check code, a check address and a check length from a host computer, and determining a check value of the current version file according to the check address and the check length.

[0105] Step 02: Determine a verification result of the verification code according to the verification value, and send the verification result to a host computer, wherein the verification result is used to indicate whether the current version file is consistent with the historical version file.

[0106] In some optional manners of this embodiment, determining a verification result of the verification code according to the verification value includes:

[0107] Comparing the verification value with the verification code;

[0108] In response to the verification value being the same as the verification code, it is determined that the current version file is consistent with the historical version file; in response to the verification value being different from the verification code, it is determined that the current version file is inconsistent with the historical version file.

[0109] Step 03: Receive a processing instruction from the host computer and perform a differential update operation or a full update operation on the application.

[0110] In some optional manners of this embodiment, the processing instruction includes a full update instruction and a differential update instruction, and performing a differential update operation or a full update operation on the application includes:

[0111] In response to the processing instruction being the full update instruction, performing a full update operation on the application program;

[0112] In response to the processing instruction being the differential update instruction, a differential update operation is performed on the application.

[0113] In some optional aspects of this embodiment, the steps of the full update operation include:

[0114] Receiving a new version file from the host computer;

[0115] Based on the new version file, the current version file is updated so that the current version file is upgraded to the new version file, and the new version file is written into the first storage space.

[0116] In some optional aspects of this embodiment, the step of the differential update operation includes:

[0117] Receiving an upgrade patch file and a rollback patch file from the host computer, and writing the upgrade patch file into the second storage space, and writing the rollback patch file into the third storage space;

[0118] Reading the upgrade patch file from the second storage space, upgrading the current version file to a new version file using a restoration algorithm and the upgrade patch file, and writing the new version file into the first storage space;

[0119] A rollback flag is set for the new version file, and the rollback flag is written into the fourth storage space.

[0120] In some optional manners of this embodiment, after writing the rollback flag into the fourth storage space, the differential update operation further includes:

[0121] Jump from the bootloader to said application;

[0122] The application performs a functional test on the new version file, and if the test succeeds, erases the rollback flag of the fourth storage space; if the test fails, jumps from the application to the boot loader and performs a rollback operation on the new version file.

[0123] In some optional aspects of this embodiment, the step of the rollback operation includes:

[0124] The rollback patch file is read from the third storage space, the new version file is rolled back to the current version file using the restoration algorithm and the rollback patch file, and the current version file is written into the first storage space. Figure 4 As shown (i.e. ADDR1 to ADDR4).

[0125] In a specific example, if Figure 5 As shown, S21-S30 is the process of the lower computer (i.e., the server), and the specific process is as follows:

[0126] S21, driver initialization. The lower computer initializes the clock, CAN, FLASH and other drivers.

[0127] S22, receiving the check code. The lower computer receives the check code and other information, and calculates the check value according to the check address and check length.

[0128] S23, perform verification. Compare the calculated verification value with the verification code. If the verification value is consistent with the verification code, the verification is passed, the result is sent to the upper computer, and the lower computer enters the differential update step; if the verification value is inconsistent with the verification code, the verification fails, the result is sent to the upper computer, and the lower computer enters the full update step.

[0129] S24, perform full update. The lower computer receives the full update package and writes the data into the program address indicated by ADDR1.

[0130] S25, receiving the upgrade package and the rollback package. The lower computer receives the upgrade package and the rollback package, and writes the data into ADDR2 and ADDR3 respectively, wherein ADDR2 is the upgrade package (the storage address or storage space where the upgrade patch file is located); ADDR3 is the rollback package (the storage address or storage space where the rollback patch file is located).

[0131] S26, execute program update. The lower machine bootloader uses the bsdiff restoration algorithm and the upgrade package stored in ADDR2 to restore the upgrade data new.bin, write the upgrade data to the flash address specified by ADDR1, and write the rollback flag bit to ADDR4, and the bootloader jumps to the application.

[0132] S27, application function check. The application detects the fallback flag and tests the upgrade function. If the test succeeds, the fallback flag in ADDR4 is erased. If the test fails, the MCU or DSP is reset and jumps back to the bootloader.

[0133] S28, if the function check fails, the rollback function is executed. The program detects the rollback flag in the bootloader. If the rollback flag is detected, the rollback program old.bin is restored using the bsdiff restoration algorithm and the rollback package stored in ADDR3, and the rollback data is written to the flash address specified in ADDR1.

[0134] S29, upgrade completed. The program update is completed.

[0135] S30, rollback is completed. The program erases the rollback flag bit of the ADDR4 address, and the program jumps from the bootloader to the application program, and the rollback is successful.

[0136] So far, the present application provides an application processing method, which obtains an upgrade patch file and a rollback patch file by using a new program and an existing program by a host computer according to the bsdiff difference algorithm and the QuickLZ compression algorithm. The host computer downloads the two patch files to the single-chip microcomputer or DSP through a universal diagnostic protocol. The implementation of the upgrade and rollback functions of the program in the single-chip microcomputer or DSP can reduce the amount of data transmission and solve the problem of low update efficiency of the single-chip microcomputer or DSP. At the same time, a mechanism for program rollback of a single-chip microcomputer or DSP is provided to ensure the security and reliability of program rollback while saving storage space.

[0137] According to another embodiment of the present application, an application processing device is also provided, which is deployed on a host computer, such as Figure 6 As shown, including:

[0138] The patch generation module 601 is configured to obtain the historical version file and the new version file of the application, and generate an upgrade patch file and a rollback patch file according to the historical version file and the new version file;

[0139] The verification code sending module 602 is configured to determine the verification code of the historical version file and send the verification code to the lower computer;

[0140] The processing instruction determination module 603 is configured to receive the verification result of the verification code from the lower computer, and determine the processing instruction for the application according to the verification result, wherein the lower computer stores the current version file of the application, and the verification result is used to indicate whether the current version file is consistent with the historical version file;

[0141] The file sending module 604 is configured to send at least one of the upgrade patch file, the rollback patch file and the new version file to the lower computer according to the processing instruction.

[0142] In some optional aspects of this embodiment, the patch generation module is further configured to:

[0143] Determine the difference information between the new version file and the historical version file based on a differential algorithm;

[0144] Using the historical version file as a first initial file and the new version file as a first target file, and determining the upgrade patch file based on the difference information and the compression algorithm;

[0145] The new version file is used as a second initial file and the historical version file is used as a second target file, and the rollback patch file is determined based on the difference information and the compression algorithm.

[0146] In some optional aspects of this embodiment, the verification code sending module includes a verification code determining unit, and the verification code determining unit is configured to:

[0147] Determine a verification address of the historical version file, where the verification address is used to indicate a starting position of a data range for verifying the historical version file;

[0148] Determine a checksum length of the historical version file, wherein the checksum length is used to indicate the length of a data range for checking the historical version file;

[0149] Determine the verification code of the historical version file based on the verification address and the verification length;

[0150] After determining the verification code of the historical version file, the method further includes:

[0151] The verification address and the verification length are sent to the lower computer.

[0152] In some optional aspects of this embodiment, the processing instruction determination module is further configured to:

[0153] In response to the verification result indicating that the current version file is inconsistent with the historical version file, determining that the processing instruction for the application is a full update instruction;

[0154] In response to the verification result indicating that the current version file is consistent with the historical version file, determining that the processing instruction for the application is a differential update instruction.

[0155] In some optional aspects of this embodiment, the file sending module is further configured as follows:

[0156] In response to the processing instruction being the full update, sending the new version file to the lower computer;

[0157] In response to the processing instruction being the differential update, the upgrade patch file and the rollback patch file are sent to the lower computer.

[0158] According to another embodiment of the present application, there is also provided an application processing device, which is deployed on a lower computer, and the lower computer stores the current version file of the application, such as Figure 7 As shown, including:

[0159] The check value determination module 701 is configured to receive a check code, a check address and a check length from a host computer, and determine the check value of the current version file according to the check address and the check length;

[0160] The verification result determination module 702 is configured to determine the verification result of the verification code according to the verification value, and send the verification result to the host computer, wherein the verification result is used to indicate whether the current version file is consistent with the historical version file;

[0161] The application processing module 703 is configured to receive a processing instruction from the host computer and perform a differential update operation or a full update operation on the application.

[0162] In some optional aspects of this embodiment, the verification result determination module is further configured to:

[0163] Comparing the verification value with the verification code;

[0164] In response to the verification value being the same as the verification code, it is determined that the current version file is consistent with the historical version file; in response to the verification value being different from the verification code, it is determined that the current version file is inconsistent with the historical version file.

[0165] In some optional aspects of this embodiment, the processing instruction includes a full update instruction and a differential update instruction, and the application processing module is further configured to:

[0166] In response to the processing instruction being the full update instruction, performing a full update operation on the application program;

[0167] In response to the processing instruction being the differential update instruction, a differential update operation is performed on the application.

[0168] In some optional aspects of this embodiment, the steps of the full update operation include:

[0169] Receiving a new version file from the host computer;

[0170] Based on the new version file, the current version file is updated so that the current version file is upgraded to the new version file, and the new version file is written into the first storage space.

[0171] In some optional aspects of this embodiment, the step of the differential update operation includes:

[0172] Receiving an upgrade patch file and a rollback patch file from the host computer, and writing the upgrade patch file into the second storage space, and writing the rollback patch file into the third storage space;

[0173] Reading the upgrade patch file from the second storage space, upgrading the current version file to a new version file using a restoration algorithm and the upgrade patch file, and writing the new version file into the first storage space;

[0174] A rollback flag is set for the new version file, and the rollback flag is written into the fourth storage space.

[0175] In some optional manners of this embodiment, after writing the rollback flag into the fourth storage space, the differential update operation further includes:

[0176] Jump from the bootloader to said application;

[0177] The application performs a functional test on the new version file, and if the test succeeds, erases the rollback flag of the fourth storage space; if the test fails, jumps from the application to the boot loader and performs a rollback operation on the new version file.

[0178] In some optional aspects of this embodiment, the step of the rollback operation includes:

[0179] The rollback patch file is read from the third storage space, the new version file is rolled back to the current version file using a restoration algorithm and the rollback patch file, and the current version file is written into the first storage space.

[0180] According to another embodiment of the present application, Figure 8 As shown, an application processing system is also provided, including a host computer and a slave computer, wherein the host computer is configured to execute the application processing method described in the first aspect; and the slave computer is configured to execute the application processing method described in the third aspect.

[0181] It should be noted that the acquisition, storage, use and processing of data in the technical solution of this application are in compliance with the relevant provisions of laws and regulations.

[0182] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0183] An electronic device comprises: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the steps of an application processing method of the aforementioned embodiment.

[0184] A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the steps of an application processing method of the aforementioned embodiment.

[0185] A computer program product includes a computer program / instruction, which implements an application processing method of the above embodiment when the computer program / instruction is executed by a processor.

[0186] Fig. 9 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0187] like Fig. 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0188] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0189] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as an application processing method.

[0190] For example, in some embodiments, an application processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of an application processing method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform an application processing method in any other suitable manner (e.g., by means of firmware).

[0191] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0192] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0193] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0194] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0195] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0196] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0197] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of this disclosure can be achieved, and this document is not limited here.

[0198] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. An application processing method, executed on a host computer, characterized in that: include: Obtaining a historical version file and a new version file of the application, and generating an upgrade patch file and a rollback patch file according to the historical version file and the new version file; Determine the verification code of the historical version file, and send the verification code to the lower computer; Receive the verification result of the verification code from the lower computer, and determine the processing instruction for the application according to the verification result, and send the processing instruction to the lower computer; wherein the lower computer stores the current version file of the application, and the verification result is used to indicate whether the current version file is consistent with the historical version file; According to the processing instruction, at least one of the upgrade patch file, the rollback patch file and the new version file is sent to the lower computer.

2. The method according to claim 1, characterized in that The step of generating an upgrade patch file and a rollback patch file according to the historical version file and the new version file includes: Determine the difference information between the new version file and the historical version file based on a differential algorithm; Using the historical version file as a first initial file and the new version file as a first target file, and determining the upgrade patch file based on the difference information and the compression algorithm; The new version file is used as a second initial file and the historical version file is used as a second target file, and the rollback patch file is determined based on the difference information and the compression algorithm.

3. The method according to claim 1, characterized in that The step of determining the verification code of the historical version file includes: Determine a verification address of the historical version file, where the verification address is used to indicate a starting position of a data range for verifying the historical version file; Determine a checksum length of the historical version file, wherein the checksum length is used to indicate the length of a data range for checking the historical version file; Determine the verification code of the historical version file based on the verification address and the verification length; After determining the verification code of the historical version file, the method further includes: The verification address and the verification length are sent to the lower computer.

4. The method according to claim 1, characterized in that Determining a processing instruction for the application according to the verification result includes: In response to the verification result indicating that the current version file is inconsistent with the historical version file, determining that the processing instruction for the application is a full update instruction; In response to the verification result indicating that the current version file is consistent with the historical version file, determining that the processing instruction for the application is a differential update instruction.

5. The method according to claim 4, characterized in that The step of sending at least one of the upgrade patch file, the rollback patch file, and the new version file to the lower computer according to the processing instruction includes: In response to the processing instruction being the full update, sending the new version file to the lower computer; In response to the processing instruction being the differential update, the upgrade patch file and the rollback patch file are sent to the lower computer.

6. An application processing device, deployed on a host computer, characterized in that: include: The patch generation module is configured to obtain the historical version file and the new version file of the application program, and generate the upgrade patch file and the rollback patch file according to the historical version file and the new version file; A verification code sending module is configured to determine the verification code of the historical version file and send the verification code to the lower computer; a processing instruction determination module, configured to receive a verification result of the verification code from the lower computer, and determine a processing instruction for the application program according to the verification result, wherein the lower computer stores a current version file of the application program, and the verification result is used to indicate whether the current version file is consistent with the historical version file; The file sending module is configured to send at least one of the upgrade patch file, the rollback patch file and the new version file to the lower computer according to the processing instruction.

7. A method for processing an application program, executed on a lower computer, wherein the lower computer stores a current version file of the application program, characterized in that: include: Receive a check code, a check address, and a check length from a host computer, and determine a check value of the current version file according to the check address and the check length; Determine the verification result of the verification code according to the verification value, and send the verification result to the host computer, wherein the verification result is used to indicate whether the current version file is consistent with the historical version file; Receive a processing instruction from a host computer, and perform a differential update operation or a full update operation on the application.

8. The method according to claim 7, characterized in that Determining a verification result of the verification code according to the verification value includes: Comparing the verification value with the verification code; In response to the verification value being the same as the verification code, it is determined that the current version file is consistent with the historical version file; in response to the verification value being different from the verification code, it is determined that the current version file is inconsistent with the historical version file.

9. The method according to claim 7, characterized in that: The processing instruction includes a full update instruction and a differential update instruction, and performing a differential update operation or a full update operation on the application includes: In response to the processing instruction being the full update instruction, performing a full update operation on the application program; In response to the processing instruction being the differential update instruction, a differential update operation is performed on the application.

10. The method according to claim 9, characterized in that The steps of the full update operation include: Receiving a new version file from the host computer; Based on the new version file, the current version file is updated so that the current version file is upgraded to the new version file, and the new version file is written into the first storage space.

11. The method according to claim 9, characterized in that The steps of the differential update operation include: Receiving an upgrade patch file and a rollback patch file from the host computer, and writing the upgrade patch file into the second storage space, and writing the rollback patch file into the third storage space; Reading the upgrade patch file from the second storage space, upgrading the current version file to a new version file using a restoration algorithm and the upgrade patch file, and writing the new version file into the first storage space; A rollback flag is set for the new version file, and the rollback flag is written into the fourth storage space.

12. The method according to claim 11, characterized in that After writing the fallback flag into the fourth storage space, the differential update operation further includes: Jump from the bootloader to said application; The application performs a functional test on the new version file, and if the test succeeds, erases the rollback flag of the fourth storage space; if the test fails, jumps from the application to the boot loader and performs a rollback operation on the new version file.

13. The method according to claim 12, characterized in that The steps of the rollback operation include: The rollback patch file is read from the third storage space, the new version file is rolled back to the current version file using a restoration algorithm and the rollback patch file, and the current version file is written into the first storage space.

14. An application processing device, deployed on a lower computer, wherein the lower computer stores a current version file of the application, characterized in that: include: A check value determination module is configured to receive a check code, a check address and a check length from a host computer, and determine a check value of the current version file according to the check address and the check length; A verification result determination module is configured to determine a verification result of the verification code according to the verification value, and send the verification result to the host computer, wherein the verification result is used to indicate whether the current version file is consistent with the historical version file; The application processing module is configured to receive a processing instruction from a host computer and perform a differential update operation or a full update operation on the application.

15. An application processing system, comprising a host computer and a slave computer, characterized in that: The host computer is configured to execute the application processing method according to any one of claims 1 to 5; The lower computer is configured to execute the application processing method according to any one of claims 7 to 13.

16. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the processor implements the steps of the application processing method according to any one of claims 1 to 5 or the steps of the application processing method according to any one of claims 7 to 13.

17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the steps of the application processing method described in any one of claims 1 to 5 or the steps of the application processing method described in any one of claims 7 to 13.

18. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the application processing method described in any one of claims 1 to 5 or the steps of the application processing method described in any one of claims 7 to 13 are implemented.