A system upgrade checking method, device, equipment and storage medium
Patent Information
- Application Number
- CN202210870950.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-22
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2042-07-22
AI Technical Summary
但这样的方式程序无法添加附加的信息,因此会导致校验和发生变化,与原来编译的程序校验和不符等问题
[0041]本申请先获取系统升级对应的升级程序,作为第一程序,在所述第一程序末尾添加编译信息,其中,所述编译信息包括附加编译信息和补偿编译信息,配置所述附加编译信息和所述补偿编译信息互为补码,将配置后的第一程序作为第二程序,分别计算第一程序的校验和与第二程序的校验和,若所述第一程序的校验和与所述第二程序的校验和相同,确定系统升级校验成功,能够在升级程序中添加一些附带的编译信息,而不影响升级程序的校验和,不同机器或工程师编译出来的升级程序时校验和是一致的,不同的时间程序编译出的程序最后2Byte(即checksum)也是一致的,与此同时还可追踪升级程序是从哪台机器或哪个工程师编程出来的。除此之外,本申请还具备三个优点:一是不影响原有的整个软件功能开发、测试、程序核对、发放和烧录等流程;二是改方式追加的数据可以做到不同方案和产品的统一,大大地降低了后续获取数据的难度;三是方便扩展,可以在程序编译完成后再根据需求扩展和更改需要的数据。
Smart Images

Figure CN117473486B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of system security technology, and more specifically, to a verification method, apparatus, device, and storage medium for system upgrades. Background Technology
[0002] In recent years, the version number of the upgrade program in embedded systems has been set as the upgrade checksum, which is 16 bits long. That is, the upgrade file is incremented in 8-bit units from the beginning until the end of the upgrade file. The last 16 bits of data are retained as the upgrade program's checksum.
[0003] However, this verification method can detect program tampering caused by modifications to certain data or bits within the program. But this method cannot add additional information to the program, which can lead to changes in the checksum and discrepancies with the original compiled program's checksum. Summary of the Invention
[0004] Based on the above-mentioned technical problems, the present invention aims to add compilation information to the end of the upgrade program corresponding to the system upgrade. The compilation information includes additional compilation information and compensation compilation information, which are complements of each other, to ensure that the verification of the upgrade program corresponding to the system upgrade remains unchanged, thereby enabling the system upgrade to pass the verification.
[0005] The first aspect of this invention provides a system upgrade verification method, the method comprising:
[0006] Obtain the upgrade program corresponding to the system upgrade and use it as the first program;
[0007] Add compilation information to the end of the first program, wherein the compilation information includes additional compilation information and compensation compilation information;
[0008] The additional compilation information and the compensation compilation information are configured to be complements of each other, and the configured first program is used as the second program.
[0009] Calculate the checksums of the first procedure and the second procedure respectively;
[0010] If the checksum of the first program is the same as the checksum of the second program, the system upgrade verification is successful.
[0011] In some embodiments of the present invention, the configuration of the additional compilation information and the compensation compilation information as complements of each other includes:
[0012] The content of the additional compilation information is determined, wherein the content of the additional compilation information includes at least the compilation server, compilation engineer, and compilation date of the upgrade program;
[0013] Convert the additional compilation information following the determined content into hexadecimal data;
[0014] Set the compensation compilation information to the complement of the hexadecimal data corresponding to the additional compilation information after conversion.
[0015] In some embodiments of the present invention, after setting the compensation compilation information as the complement of the hexadecimal data corresponding to the converted additional compilation information, the method further includes: appending the compensation compilation information to the end of the hexadecimal data corresponding to the converted additional compilation information.
[0016] In some embodiments of the present invention, calculating the checksum of the first procedure includes:
[0017] The first program is broken down into multiple byte numbers, and the numbers corresponding to all bytes are summed using their binary complements.
[0018] The 16-bit result obtained by performing binary one's complement summation is used as the checksum of the first program.
[0019] In some embodiments of the present invention, both the first program and the second program are stored in binary form.
[0020] In some embodiments of the present invention, the method further includes setting the checksum of the first program to the upgrade version number corresponding to the system upgrade.
[0021] In some embodiments of the present invention, the method further includes: if the checksum of the first program is different from the checksum of the second program, determining that the system cannot be upgraded and recompiling the first program and the second program.
[0022] A second aspect of the present invention provides a verification device for system upgrades, the device comprising:
[0023] The acquisition module is used to acquire the upgrade program corresponding to the system upgrade, and to use the upgrade program corresponding to the system upgrade as the first program.
[0024] An add module is used to add compilation information to the end of the first program, wherein the compilation information includes additional compilation information and compensation compilation information;
[0025] The configuration module is used to configure the additional compilation information and the compensation compilation information to be complements of each other, and to use the configured first program as the second program.
[0026] The calculation module is used to calculate the checksum of the first program and the checksum of the second program, respectively.
[0027] The verification module is used to determine that the system upgrade verification is successful if the verification sum of the first program is the same as that of the second program.
[0028] A third aspect of the present invention provides a computer device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when executed by the processor, the computer-readable instructions cause the processor to perform the following steps:
[0029] Obtain the upgrade program corresponding to the system upgrade and use it as the first program;
[0030] Add compilation information to the end of the first program, wherein the compilation information includes additional compilation information and compensation compilation information;
[0031] The additional compilation information and the compensation compilation information are configured to be complements of each other, and the configured first program is used as the second program.
[0032] Calculate the checksums of the first procedure and the second procedure respectively;
[0033] If the checksum of the first program is the same as the checksum of the second program, the system upgrade verification is successful.
[0034] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0035] Obtain the upgrade program corresponding to the system upgrade and use it as the first program;
[0036] Add compilation information to the end of the first program, wherein the compilation information includes additional compilation information and compensation compilation information;
[0037] The additional compilation information and the compensation compilation information are configured to be complements of each other, and the configured first program is used as the second program.
[0038] Calculate the checksums of the first procedure and the second procedure respectively;
[0039] If the checksum of the first program is the same as the checksum of the second program, the system upgrade verification is successful.
[0040] The technical solutions provided in this application embodiment have at least the following technical effects or advantages:
[0041] This application first obtains the upgrade program corresponding to the system upgrade as the first program. Compilation information is added to the end of the first program, including supplementary compilation information and compensating compilation information. The supplementary compilation information and the compensating compilation information are configured to be complements of each other. The configured first program is then used as the second program. The checksums of the first program and the second program are calculated respectively. If the checksums of the first program and the second program are the same, the system upgrade verification is successful. Additional compilation information can be added to the upgrade program without affecting its checksum. The checksums of upgrade programs compiled by different machines or engineers are consistent, and the last 2 bytes (i.e., checksums) of programs compiled at different times are also consistent. Simultaneously, it can trace which machine or engineer the upgrade program was written from. In addition, this application has three advantages: First, it does not affect the original software function development, testing, program verification, distribution, and burning processes; second, the data added in this way can be unified across different solutions and products, greatly reducing the difficulty of subsequent data acquisition; and third, it is easy to expand, allowing for expansion and modification of required data after program compilation.
[0042] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description
[0043] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0044] Figure 1 A schematic diagram illustrating the steps of a system upgrade verification method in an exemplary embodiment of this application is shown.
[0045] Figure 2 This illustration shows a schematic diagram of adding additional compilation information and compensating compilation information to the upgrade procedure in an exemplary embodiment of this application;
[0046] Figure 3 A schematic diagram illustrating the splitting of compensation compilation information in an exemplary embodiment of this application is shown;
[0047] Figure 4 A comparative diagram of the first and second procedures in an exemplary embodiment of this application is shown;
[0048] Figure 5 A schematic diagram of the structure of a system upgrade verification device in an exemplary embodiment of this application is shown;
[0049] Figure 6 This illustration shows a schematic diagram of the structure of a computer device provided in an exemplary embodiment of this application. Detailed Implementation
[0050] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application. It will be apparent to those skilled in the art that this application can be implemented without one or more of these details. In other instances, some technical features well-known in the art have not been described to avoid confusion with this application.
[0051] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of the stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or combinations thereof.
[0052] Exemplary embodiments according to this application will now be described in more detail with reference to the accompanying drawings. However, these exemplary embodiments may be implemented in many different forms and should not be construed as being limited to the embodiments set forth herein. The drawings are not drawn to scale, and some details may be enlarged and omitted for clarity. The shapes of the various regions and layers shown in the figures, as well as their relative sizes and positional relationships, are merely exemplary and may deviate from reality due to manufacturing tolerances or technical limitations. Furthermore, those skilled in the art can design regions / layers with different shapes, sizes, and relative positions as needed.
[0053] The following is in conjunction with the instruction manual appendix. Figure 1 -Appendix Figure 6 Several embodiments are given to describe exemplary implementations according to this application. It should be noted that the following application scenarios are shown only to facilitate understanding of the spirit and principles of this application, and the implementations of this application are not limited in any way. Rather, the implementations of this application can be applied to any applicable scenario.
[0054] Example 1:
[0055] This embodiment provides a verification method for system upgrades, such as... Figure 1 As shown, the method includes:
[0056] S1. Obtain the upgrade program corresponding to the system upgrade and use it as the first program;
[0057] S2. Add compilation information to the end of the first program, wherein the compilation information includes additional compilation information and compensation compilation information;
[0058] S3. Configure the additional compilation information and the compensation compilation information to be complements of each other, and use the configured first program as the second program.
[0059] S4. Calculate the checksum of the first program and the checksum of the second program respectively;
[0060] S5. If the checksum of the first program is the same as the checksum of the second program, the system upgrade verification is successful.
[0061] In one specific implementation, configuring the additional compilation information and the compensation compilation information as complements of each other includes: determining the content of the additional compilation information, wherein the content of the additional compilation information includes at least the compilation server, compilation engineer, and compilation date of the upgrade program; converting the determined additional compilation information into hexadecimal data; and setting the compensation compilation information as the complement of the hexadecimal data corresponding to the converted additional compilation information.
[0062] In one specific implementation, after setting the compensation compilation information as the complement of the hexadecimal data corresponding to the converted additional compilation information, the method further includes: appending the compensation compilation information to the end of the hexadecimal data corresponding to the converted additional compilation information.
[0063] In one specific implementation, calculating the checksum of the first program includes: splitting the first program into multiple byte numbers, performing a binary one's complement summation on the numbers corresponding to all bytes, and using the 16-bit result obtained from the binary one's complement summation as the checksum of the first program.
[0064] In one specific implementation, both the first program and the second program are stored in binary form.
[0065] In one specific implementation, the method further includes setting the checksum of the first program to the upgrade version number corresponding to the system upgrade.
[0066] In one specific implementation, the method further includes: if the checksum of the first program is different from the checksum of the second program, determining that the system cannot be upgraded and recompiling the first program and the second program.
[0067] This application allows adding supplementary compilation information to the upgrade program without affecting its checksum. The checksum remains consistent across upgrade programs compiled by different machines or engineers, and it also allows tracking of which machine or engineer developed the upgrade program. Furthermore, this application offers three advantages: First, it does not disrupt the existing software development, testing, program verification, distribution, and flashing processes; second, the added data can be standardized across different solutions and products, significantly reducing the difficulty of subsequent data acquisition; and third, it facilitates expansion, allowing for the addition and modification of necessary data after program compilation.
[0068] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention.
[0069] Example 2:
[0070] This embodiment provides a verification method for system upgrades, and the specific steps are described in detail below.
[0071] The first step is to obtain the upgrade program corresponding to the system upgrade, which will be the first program to use.
[0072] Embedded devices typically need to be upgraded at preset intervals. The upgrade package is the upgrade program corresponding to the system upgrade, also known as the new firmware version. Embedded devices are generally upgraded online. The device obtains the new firmware version from the server, verifies its correctness and integrity, and then flashes it into the FLASH memory. The new program runs in memory to complete the system update, and then the device automatically restarts to switch to the new firmware version.
[0073] The second step is to add compilation information to the end of the first program, wherein the compilation information includes additional compilation information and compensation compilation information.
[0074] like Figure 2 As shown, the first part is the additional compilation data, which is the information we need to add to the upgrade program, stored in binary form. For example, we need to add information such as the compilation server, the engineer who compiled the program, and the compilation time for future maintenance, statistics, or traceability functions, as shown in Table 1.
[0075] Table 1. Example of Additional Compilation Information
[0076]
[0077] The third step is to configure the additional compilation information and the compensation compilation information to be complements of each other, and to use the configured first program as the second program.
[0078] In a preferred embodiment, configuring the supplementary compilation information and the compensating compilation information to be complements of each other includes: determining the content of the supplementary compilation information, wherein, as shown in Table 1, the content of the supplementary compilation information includes at least the compilation server, compilation engineer, and compilation date of the upgrade program; converting the determined supplementary compilation information into hexadecimal data; and setting the compensating compilation information as the complement of the hexadecimal data corresponding to the converted supplementary compilation information. Here, the sum of the supplementary compilation information appended in the first part and the compensating compilation information in the second part is 0x0000, so as not to affect the checksum of the original program. The checksum of the first part is B, and the checksum of the second part is 0x10000-B=C. Moreover, in order to make the specific data of the second part as short as possible, it is padded with 0xFF. If the final value is less than 0xFF, it is padded with a specific value, that is: C=0xFF*n+D (a value less than 0xFF).
[0079] Based on the values in Table 1, the server name data is as follows:
[0080] 0x53+0x45+0x56+0x30+0x31=0x14f;
[0081] Engineer Name Data:
[0082] 0x78+0x69+0x61+0x6f+0x6d+0x69+0x6e+0x67=0x35c;
[0083] Compilation time data:
[0084] 0x32+0x30+0x31+0x37+0x2d+0x30+0x38+0x2d+0x31+0x30=0x1ed;
[0085] The sum of the first part of the data, i.e., B, is 0x14f + 0x35c + 0x1ed = 0x698.
[0086] The sum of the data in the second part, i.e., C, is 0x10000 - 0x698 = 0xf968
[0087] like Figure 3 As shown, the second part of the data can be divided into 8-bit units, which can be divided into 0xf9 0xFF and 0x68, i.e., C = 0xFF * 249 + 0x68.
[0088] The fourth step is to calculate the checksum of the first program and the checksum of the second program respectively.
[0089] In a preferred embodiment, calculating the checksum of the first program includes: splitting the first program into multiple byte numbers, performing a binary one's complement sum on the numbers corresponding to all bytes, and using the 16-bit result obtained from the binary one's complement sum as the checksum of the first program. Both the first and second programs are stored in binary form, and the checksum of the first program is set to the upgrade version number corresponding to the system upgrade. Thus, when the original upgrade program is appended with the above data, the 16-bit checksum is consistent with the original checksum data, while also including the information we need to add as shown in Table 1, such as... Figure 4 As shown, the left side, merge.bin, is the original upgrade program, i.e., the first program, while the right side, merge_new.bin, is the program with added compilation information, i.e., the second program. This compilation information includes additional compilation information and compensating compilation information. For example... Figure 4 As shown, numbers 53 to 30 represent additional compilation information, which in turn indicate the compilation server, compilation engineer, and compilation date; numbers from the first FF to the last 68 represent compensatory compilation information.
[0090] Fifth step: If the checksum of the first program is the same as the checksum of the second program, the system upgrade verification is confirmed to be successful.
[0091] The security of system upgrades is verified by comparing checksums. If the checksums of the first and second programs are the same, the system upgrade is considered successful. In addition, the system upgrade also uses a key to perform security checks. Understandably, if the checksums of the first and second programs are different, the system upgrade is deemed unsuccessful, and both programs are recompiled.
[0092] This application first obtains the upgrade program corresponding to the system upgrade as the first program. Compilation information is added to the end of the first program, including supplementary compilation information and compensating compilation information. The supplementary compilation information and the compensating compilation information are configured to be complements of each other. The configured first program is then used as the second program. The checksums of the first program and the second program are calculated respectively. If the checksums of the first program and the second program are the same, the system upgrade verification is successful. Additional compilation information can be added to the upgrade program without affecting its checksum. The checksums of upgrade programs compiled by different machines or engineers are consistent, and the last 2 bytes (i.e., checksums) of programs compiled at different times are also consistent. Simultaneously, it can trace which machine or engineer the upgrade program was written from. In addition, this application has three advantages: First, it does not affect the original software function development, testing, program verification, distribution, and burning processes; second, the data added in this way can be unified across different solutions and products, greatly reducing the difficulty of subsequent data acquisition; and third, it is easy to expand, allowing for expansion and modification of required data after program compilation.
[0093] Example 3:
[0094] This embodiment provides a verification device for system upgrades, such as... Figure 5 As shown, the device is used to perform the system upgrade verification method provided in any of the above embodiments, and the device includes:
[0095] The acquisition module is used to acquire the upgrade program corresponding to the system upgrade, and to use the upgrade program corresponding to the system upgrade as the first program.
[0096] An add module is used to add compilation information to the end of the first program, wherein the compilation information includes additional compilation information and compensation compilation information;
[0097] The configuration module is used to configure the additional compilation information and the compensation compilation information to be complements of each other, and to use the configured first program as the second program.
[0098] The calculation module is used to calculate the checksum of the first program and the checksum of the second program, respectively.
[0099] The verification module is used to determine that the system upgrade verification is successful if the verification sum of the first program is the same as that of the second program.
[0100] It should be understood that the device also includes related supporting hardware, which is not specifically limited. The above general description and the following detailed description are exemplary and explanatory only, and do not limit the invention.
[0101] It should also be emphasized that the system provided in this application embodiment can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. Basic AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operating / interactive systems, and mechatronics. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0102] Please refer to the following. Figure 6 This illustrates a schematic diagram of a computer device provided by some embodiments of this application. For example... Figure 6 As shown, the computer device 2 includes: a processor 200, a memory 201, a bus 202, and a communication interface 203. The processor 200, the communication interface 203, and the memory 201 are connected via the bus 202. The memory 201 stores a computer program that can run on the processor 200. When the processor 200 runs the computer program, it executes the system upgrade verification method provided in any of the foregoing embodiments of this application.
[0103] The memory 201 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 203 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network.
[0104] Bus 202 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The memory 201 is used to store programs. After receiving an execution instruction, the processor 200 executes the program. The system upgrade verification method disclosed in any of the foregoing embodiments of this application can be applied to the processor 200, or implemented by the processor 200.
[0105] The processor 200 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 200 or by instructions in software form. The processor 200 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 201. The processor 200 reads the information in memory 201 and, in conjunction with its hardware, completes the steps of the above method.
[0106] This application also provides a computer-readable storage medium corresponding to the system upgrade verification method provided in the foregoing embodiments, which stores a computer program that, when executed by a processor, performs the system upgrade verification method provided in any of the foregoing embodiments.
[0107] In addition, examples of the computer-readable storage medium may include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media, which will not be described in detail here.
[0108] The computer-readable storage medium provided in the above embodiments of this application and the quantum key distribution channel allocation method in the space division multiplexing optical network provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.
[0109] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the system upgrade verification method provided in any of the foregoing embodiments, including: obtaining an upgrade program corresponding to the system upgrade as a first program; adding compilation information to the end of the first program, wherein the compilation information includes additional compilation information and compensation compilation information; configuring the additional compilation information and the compensation compilation information to be complements of each other, and using the configured first program as a second program; calculating the checksum of the first program and the checksum of the second program respectively; and determining that the system upgrade verification is successful if the checksum of the first program is the same as the checksum of the second program.
[0110] It should be noted that the algorithms and displays provided herein are not inherently related to any particular computer, virtual device, or other equipment. Various general-purpose devices can also be used in conjunction with the teachings herein. The required structure for constructing such devices is obvious from the above description. Furthermore, this application is not directed to any particular programming language. It should be understood that the content of this application described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of this application. Numerous specific details are set forth in the specification provided herein. However, it is to be understood that embodiments of this application can be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0111] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed herein and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed herein may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0112] The various component embodiments of this application can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the virtual machine creation apparatus according to embodiments of this application. This application can also be implemented as a device or apparatus program for performing part or all of the methods described herein. The program implementing this application can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
[0113] The above description is merely a preferred embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A verification method for system upgrades, characterized in that, The method includes: Obtain the upgrade program corresponding to the system upgrade and use it as the first program; Add compilation information to the end of the first program, wherein the compilation information includes additional compilation information and compensation compilation information; The additional compilation information and the compensation compilation information are configured to be complements of each other, and the configured first program is used as the second program. Calculate the checksums of the first procedure and the second procedure respectively; If the checksum of the first program is the same as the checksum of the second program, the system upgrade verification is successful. The configuration of the additional compilation information and the compensation compilation information being complements of each other includes: The content of the additional compilation information is determined, wherein the content of the additional compilation information includes at least the compilation server, compilation engineer, and compilation date of the upgrade program; Convert the additional compilation information following the determined content into hexadecimal data; Set the compensation compilation information to the complement of the hexadecimal data corresponding to the additional compilation information after conversion.
2. The system upgrade verification method according to claim 1, characterized in that, After setting the compensation compilation information to the complement of the hexadecimal data corresponding to the converted additional compilation information, the method further includes: appending the compensation compilation information to the end of the hexadecimal data corresponding to the converted additional compilation information.
3. The system upgrade verification method according to claim 1, characterized in that, The calculation of the checksum of the first procedure includes: The first program is broken down into multiple byte numbers, and the numbers corresponding to all bytes are summed using their binary complements. The 16-bit result obtained by performing binary one's complement summation is used as the checksum of the first program.
4. The system upgrade verification method according to claim 3, characterized in that, Both the first and second programs are stored in binary form.
5. The system upgrade verification method according to claim 3, characterized in that, The method further includes setting the checksum of the first program to the upgrade version number corresponding to the system upgrade.
6. The system upgrade verification method according to claim 1, characterized in that, The method further includes: if the checksum of the first program is different from the checksum of the second program, determining that the system cannot be upgraded and recompiling the first program and the second program.
7. A verification device for system upgrades, characterized in that, The device includes: The acquisition module is used to acquire the upgrade program corresponding to the system upgrade, and to use the upgrade program corresponding to the system upgrade as the first program. An add module is used to add compilation information to the end of the first program, wherein the compilation information includes additional compilation information and compensation compilation information; The configuration module is used to configure the additional compilation information and the compensation compilation information to be complements of each other, and to use the configured first program as the second program. The calculation module is used to calculate the checksum of the first program and the checksum of the second program, respectively. The verification module is used to determine that the system upgrade verification is successful if the verification sum of the first program is the same as the verification sum of the second program. The configuration of the additional compilation information and the compensation compilation information being complements of each other includes: The content of the additional compilation information is determined, wherein the content of the additional compilation information includes at least the compilation server, compilation engineer, and compilation date of the upgrade program; Convert the additional compilation information following the determined content into hexadecimal data; Set the compensation compilation information to the complement of the hexadecimal data corresponding to the additional compilation information after conversion.
8. A computer device, comprising a memory and a processor, characterized in that, The memory stores computer-readable instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Tamper-proof program file generation method and device upgrading method
CN111459496A
Interactive IAP upgrading method
CN112579130A