A program package verification method, system, computer device and storage medium

By calculating the program packages in the vehicle-side system upgrade in blocks, the problem of increased verification time and high interrupt frequency during the upgrade process is solved, and a more efficient upgrade process and a better user experience is achieved.

CN114840231BActive Publication Date: 2025-02-25CHONGQING JINKANG NEW ENERGY VEHICLE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210364673.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-07
Publication Date
2025-02-25
Estimated Expiration
2042-04-07

AI Technical Summary

Technical Problem

During the vehicle-side system upgrade process, the verification time of the validity and security of the program package gradually increases, and interrupts or abnormalities are prone to occur during the verification process, resulting in an extension of the upgrade time.

Method used

By splitting the original package into a verification package and a continuous variable block, verifying the validity of the verification package, and restoring the verification based on the information of the continuous variable block, the block verification of the original package is realized.

Benefits of technology

It reduces the possibility of interruption or abnormality during the verification process, improves the verification efficiency of the program package, reduces the upgrade time of the vehicle-side system, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114840231B_ABST
    Figure CN114840231B_ABST
Patent Text Reader

Abstract

The present application relates to a verification method, system, computer equipment and storage medium for a program package. It includes: splitting the original program package to obtain a program package to be verified and a continuous variable block; verifying the validity of the program package to be verified to obtain a first verification result, comparing the first verification result with a first reference value, and determining whether the program package to be verified has passed the verification; obtaining continuous variable information, and restoring the continuous variable block according to the continuous variable information to obtain a restored result; verifying the validity of the restored result to obtain a second verification result, comparing the second verification result with a second reference value, and determining whether the restored result has passed the verification, if so, the original program package has passed the verification, if not, the original program package has not passed the verification. This method can realize the block verification of the original program package, reduce the phenomenon of interruption or abnormality during the verification process, improve the verification efficiency of the program package, and reduce the upgrade time of the vehicle-side system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of vehicle-side system upgrades, and in particular to a program package verification method, system, computer device, and storage medium. Background Art

[0002] As the functions of vehicle-side systems become more and more complex and diversified, the program packages of their upgrade files are also getting larger and larger. Therefore, the upgrade of vehicle-side systems is becoming more and more important and cumbersome. Usually, before upgrading the vehicle-side system, it is necessary to verify the performance of the program packages of the upgrade files, such as reliability, availability, maintainability and safety. Among them, the verification time of the effectiveness and safety of the program package gradually increases in the upgrade time of the entire program, and interruptions or exceptions may occur during the verification process, which reduces the verification efficiency of the program package, thereby lengthening the upgrade time of the vehicle-side system. Summary of the invention

[0003] Based on this, a program package verification method, system, computer device and storage medium are provided to improve the verification efficiency of the program package.

[0004] In one aspect, a method for verifying a program package is provided, the method comprising:

[0005] Split the original program package to obtain the program package to be verified and the continuous variable block;

[0006] Verifying the validity of the program package to be verified to obtain a first verification result, obtaining a first reference value in the program package to be verified, comparing the first verification result with the first reference value, and determining whether the first verification result is equal to the first reference value,

[0007] If yes, it is determined that the program package to be verified has passed the verification;

[0008] If not, it is determined that the program package to be verified has not passed the verification, and the verification is terminated;

[0009] Acquiring continuous variable information of the continuous variable block, and restoring the continuous variable block according to the continuous variable information to obtain a restoration result;

[0010] Verifying the validity of the restored result to obtain a second verification result, obtaining a second reference value in the continuous variable block, comparing the second verification result with the second reference value, and determining whether the second verification result is equal to the second reference value;

[0011] If yes, it is determined that the recovery result passes the verification and the original program package passes the verification;

[0012] If not, it is determined that the recovery result has not passed the verification and the original program package has not passed the verification.

[0013] In one embodiment, verifying the validity of the program package to be verified includes:

[0014] Identify the decomposition points of the program package to be verified according to the functional continuity, and decompose the program package to be verified according to the decomposition points to obtain at least one program segment;

[0015] Generate verification information corresponding to the program segment, wherein the verification information includes program segment information and validity information, generate an index table based on at least one of the verification information, and verify the validity of the index table by obtaining a first information summary value of the index table.

[0016] In one embodiment, before splitting the original program package to obtain the program package to be verified and the continuous variable block, the method further includes:

[0017] The first identifier in the original program package is searched, and the first identifier is translated to obtain a second identifier, wherein the second identifier is used to assist in obtaining the first reference value in the program package to be verified.

[0018] In one embodiment, obtaining the first reference value in the program package to be verified includes:

[0019] Move the first reference value to the end position of the program package to be verified, and add the second identifier to the end position of the program package to be verified;

[0020] The end position of the program package to be verified is located according to the second identifier, and the first reference value is obtained from the end position of the program package to be verified.

[0021] In one embodiment, it also includes:

[0022] Restoring the second identifier to obtain a restoration result, verifying the restoration result to obtain a third verification result, and verifying the first identifier to obtain a fourth verification result;

[0023] Compare the third verification result with the fourth verification result to determine whether the third verification result is the same as the fourth verification result;

[0024] If yes, the restoration is successful;

[0025] If not, the restore fails.

[0026] In one embodiment, the recovering the continuous variable block according to the continuous variable information to obtain the recovery result includes:

[0027] Obtain the position information of splitting the continuous variable block, the length information of the continuous variable block and the variable value in the continuous variable information, determine the starting address and the ending address of restoring the continuous variable block according to the position information and the length information, and shift the variable value to between the starting address and the ending address.

[0028] In one embodiment, the verifying the validity of the recovery result includes:

[0029] The validity of the recovery result is verified by obtaining the second information digest value of the recovery result.

[0030] In another aspect, a program package verification system is provided, the system comprising:

[0031] A preprocessing module, which is used to split the original program package to obtain a program package to be verified and a continuous variable block;

[0032] a first verification module, the first verification module being used to verify the validity of the program package to be verified, obtain a first verification result, obtain a first reference value in the program package to be verified, compare the first verification result with the first reference value, and determine whether the first verification result is equal to the first reference value;

[0033] If yes, it is determined that the program package to be verified has passed the verification;

[0034] If not, it is determined that the program package to be verified has not passed the verification, and the verification is terminated;

[0035] A recovery module, the recovery module is used to obtain continuous variable information of the continuous variable block, and restore the continuous variable block according to the continuous variable information to obtain a recovery result;

[0036] A second verification module, the second verification module is used to verify the validity of the recovery result, obtain a second verification result, obtain a second reference value in the continuous variable block, compare the second verification result with the second reference value, and determine whether the second verification result is equal to the second reference value;

[0037] If yes, it is determined that the recovery result passes the verification and the original program package passes the verification;

[0038] If not, it is determined that the recovery result has not passed the verification and the original program package has not passed the verification.

[0039] In another aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:

[0040] Split the original program package to obtain the program package to be verified and the continuous variable block;

[0041] Verifying the validity of the program package to be verified to obtain a first verification result, obtaining a first reference value in the program package to be verified, comparing the first verification result with the first reference value, and determining whether the first verification result is equal to the first reference value,

[0042] If yes, it is determined that the program package to be verified has passed the verification;

[0043] If not, it is determined that the program package to be verified has not passed the verification, and the verification is terminated;

[0044] Acquiring continuous variable information of the continuous variable block, and restoring the continuous variable block according to the continuous variable information to obtain a restoration result;

[0045] Verifying the validity of the restored result to obtain a second verification result, obtaining a second reference value in the continuous variable block, comparing the second verification result with the second reference value, and determining whether the second verification result is equal to the second reference value;

[0046] If yes, it is determined that the recovery result passes the verification and the original program package passes the verification;

[0047] If not, it is determined that the recovery result has not passed the verification and the original program package has not passed the verification.

[0048] In another aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0049] Split the original program package to obtain the program package to be verified and the continuous variable block;

[0050] Verifying the validity of the program package to be verified to obtain a first verification result, obtaining a first reference value in the program package to be verified, comparing the first verification result with the first reference value, and determining whether the first verification result is equal to the first reference value,

[0051] If yes, it is determined that the program package to be verified has passed the verification;

[0052] If not, it is determined that the program package to be verified has not passed the verification, and the verification is terminated;

[0053] Acquiring continuous variable information of the continuous variable block, and restoring the continuous variable block according to the continuous variable information to obtain a restoration result;

[0054] Verifying the validity of the restored result to obtain a second verification result, obtaining a second reference value in the continuous variable block, comparing the second verification result with the second reference value, and determining whether the second verification result is equal to the second reference value;

[0055] If yes, it is determined that the recovery result passes the verification and the original program package passes the verification;

[0056] If not, it is determined that the recovery result has not passed the verification and the original program package has not passed the verification.

[0057] The verification method, system, computer device and storage medium of the program package are as follows: the original program package is split into a program package to be verified and a continuous variable block; the validity of the program package to be verified is verified to obtain a first verification result, a first reference value in the program package to be verified is obtained, the first verification result is compared with the first reference value, and it is determined whether the program package to be verified passes the verification; if it passes the verification, the verification is continued; otherwise, the verification is terminated; continuous variable information of the continuous variable block is obtained, and the split continuous variable block is restored according to the continuous variable information to obtain a restored result; the validity of the restored result is verified Calculate, obtain a second verification result, obtain a second reference value in the continuous variable block, compare the second verification result with the second reference value, and judge whether the recovery result passes the verification. If it passes the verification, the original program package passes the verification, otherwise it fails the verification; by splitting the original program package, respectively verifying the validity of the program package to be verified and the continuous variable block, the block verification of the original program package is realized. Compared with the method of verifying the validity of the original program package as a whole, the possibility of interruption or abnormal phenomenon is reduced, thereby improving the verification efficiency of the program package and reducing the upgrade time of the vehicle-side system to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 A schematic diagram of a flow chart of a verification method of a program package in one embodiment;

[0059] Figure 2 A schematic diagram of a flow chart of a verification method of a program package in one embodiment;

[0060] Figure 3 A schematic diagram of a flow chart of a verification method of a program package in one embodiment;

[0061] Figure 4 A schematic diagram of a flow chart of a verification method of a program package in one embodiment;

[0062] Figure 5 is a structural block diagram of a verification system of a program package in one embodiment;

[0063] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0065] Nowadays, the functions of vehicle-side systems are becoming more and more diverse, and the program packages of their upgrade files are becoming larger and larger. Therefore, the upgrade of vehicle-side systems is also more complicated and cumbersome. Before upgrading, the vehicle-side system needs to verify the effectiveness and security of the program packages of the upgrade files. After all the performance verifications are passed, the upgrade files are started to be run to upgrade the vehicle-side system. Interruptions or abnormalities may occur during the verification process, resulting in reduced verification efficiency of the program packages and extended upgrade time of the vehicle-side system, which reduces the user experience. To this end, the present application proposes a verification method, system, computer device and storage medium for a program package, which deletes a continuous variable block in an original program package to obtain a program package to be verified, verifies the validity of the program package to be verified, and compares a first verification result with a first reference value in the program package to be verified to determine whether the program package to be verified passes the verification; if so, restores the deleted continuous variable block, and verifies the validity of the restored result, compares the second verification result with a second reference value to determine whether the restored result passes the verification, if so, the original program package passes the verification, if not, the original program package fails the verification; the use of this method can realize block-by-block verification of the original program package, reduce interruptions or anomalies during the verification process, thereby improving the verification efficiency of the program package, improving the upgrade efficiency of the vehicle-side system, and improving the user experience.

[0066] In one embodiment, Figure 1 As shown, a verification method for a program package is provided, comprising the following steps:

[0067] S1: Split the original program package to obtain the program package to be verified and the continuous variable block;

[0068] S2: Verify the validity of the program package to be verified to obtain a first verification result, obtain a first reference value in the program package to be verified, compare the first verification result with the first reference value, and determine whether the first verification result is equal to the first reference value.

[0069] S201: If yes, determine that the program package to be verified has passed the verification;

[0070] S202: If not, it is determined that the program package to be verified has not passed the verification, and the verification is terminated;

[0071] S3: Acquire continuous variable information of the continuous variable block, and restore the continuous variable block according to the continuous variable information to obtain a restoration result;

[0072] S4: verifying the validity of the restored result to obtain a second verification result, obtaining a second reference value in the continuous variable block, comparing the second verification result with the second reference value, and determining whether the second verification result is equal to the second reference value;

[0073] S401: If yes, it is determined that the recovery result passes the verification and the original program package passes the verification;

[0074] S402: If not, it is determined that the recovery result has not passed the verification and the original program package has not passed the verification.

[0075] In the verification method of the above-mentioned program package, the original program package is split into the continuous variable block and the program package to be verified; the validity of the program package to be verified is verified to obtain a first verification result, a first reference value in the program package to be verified is obtained, the first verification result is compared with the first reference value to determine whether the program package to be verified passes the verification, if so, the validity of the continuous variable block is continued to be verified, if not, the verification is terminated and the original program package fails the verification; continuous variable information is obtained, and according to the continuous variable information, the split continuous variable block is restored to obtain a restored result; the validity of the restored result is verified to obtain a second verification result, the second verification result is compared with the obtained second reference value to determine whether the restored result passes the verification, if so, the original program package passes the verification, if not, the original program package fails the verification. The original program package is split, the validity of the program package to be verified is verified, and after the verification is passed, the continuous variable block is restored, and the validity of the restored result is verified. After the restored result is verified, it is determined that the original program package has passed the verification; if the program package to be verified does not pass the verification, the verification is terminated, and there is no need to perform subsequent steps of restoring the continuous variable block and verifying the restored result; if the program package to be verified passes the verification, but the restored result does not pass the verification, then the original program package has not passed the verification, that is, when the verification of the program package to be verified and the continuous variable block are both passed, it is determined that the validity of the original program package has passed the verification. This method implements block verification of the original program package. Compared with verifying the validity of the original program package as a whole, it reduces the possibility of interruption or abnormality, thereby improving the verification efficiency of the program package, reducing the upgrade time of the vehicle-side system to a certain extent, and improving the user experience.

[0076] Preferably, in some embodiments, Figure 2 As shown, the verification of the validity of the program package to be verified includes:

[0077] S21: Identify decomposition points of the program package to be verified according to functional continuity, and decompose the program package to be verified according to the decomposition points to obtain at least one program segment.

[0078] It should be noted that when the program package to be verified is executed, multiple sub-functions can be realized. In order to ensure the integrity of each function, the decomposition points in the program package to be verified are identified according to the functional continuity, and the program package to be verified is decomposed according to the decomposition points to obtain at least one program segment, so that the functions realized by adjacent program segments are continuous and the functions realized by each program segment are also complete.

[0079] S22: Generate verification information corresponding to the program segment, wherein the verification information includes program segment information and validity information, generate an index table according to at least one of the verification information, and verify the validity of the index table by obtaining a first information summary value of the index table.

[0080] The program package to be verified is reconstructed into at least one program segment, and verification information corresponding to the program segment is generated, wherein the verification information includes program segment information and validity information. An index table is generated according to the verification information corresponding to each program segment, and the validity of the index table is verified, thereby implementing segmented verification of the program package to be verified, further reducing interruptions or anomalies during the verification process, improving the efficiency of program package verification, reducing the time used for vehicle-side system upgrades, and providing a better user experience.

[0081] It should be noted that, in this embodiment, the validity of the index table is verified by a message digest (MD) algorithm, and the output result is a message digest value of fixed length. Specifically, the fifth generation message digest algorithm (MD5) is used, wherein the validity information includes MD5 verification information, and the validity of the index table is verified by obtaining the first message digest value of the index table, and the first message digest value is used as the first verification result, and the first verification result is compared with the first reference value officially released. If the first verification result is the same as the first reference value, the index table passes the verification, that is, the program package to be verified passes the verification. Since the message digest algorithm has the following advantages: different input information will have different output results, the output result will change with the change of the input information, and when the input information changes slightly, its output result will be completely different; only forward calculation can be performed, and the input information cannot be recovered from the calculation result, and even information related to the input information cannot be found; therefore, by obtaining the first message digest value of the index table to verify its validity, the first verification result has a high degree of reliability, and the verification process is also safe.

[0082] Preferably, in some implementation modes, before splitting the original program package to obtain the program package to be verified and the continuous variable block, the step further includes:

[0083] S101: Searching for a first identifier in the original program package, translating the first identifier to obtain a second identifier, wherein the second identifier is used to assist in obtaining the first reference value in the program package to be verified.

[0084] Preferably, in some embodiments, Figure 3 As shown, the obtaining of the first reference value in the program package to be verified includes:

[0085] S23: moving the first reference value to the end position of the program package to be verified, and adding the second identifier to the end position of the program package to be verified;

[0086] S24: According to the second identifier, locate the end position of the program package to be verified, and obtain the first reference value from the end position of the program package to be verified.

[0087] It should be noted that, since there may be a data segment with the same byte information as the first identifier in the continuous variable block, in order to prevent the first identifier from being split out, the first identifier is searched for according to the data structure of the program package to be verified, and the first identifier is translated to obtain the second identifier. Translation is a data processing method that can translate source code into another source code. For example, the first identifier is 0xA5A5, and the first identifier is translated to obtain the second identifier, and the second identifier is 0x0101.

[0088] The second identifier is used to assist in obtaining the first reference value in the program package to be verified. Specifically, the first reference value in the program package to be verified is moved to the end position. When verifying the validity of the program package to be verified, it is effectively avoided to verify the first reference value as a data segment in the program package to be verified, thereby affecting the first verification result. In order to increase the rate of obtaining the first reference value, the second identifier is added to the end position of the program package to be verified, so that the end position of the program package to be verified can be quickly located according to the second identifier, thereby obtaining the first reference value, further improving the verification efficiency of the program package to be verified.

[0089] Preferably, in some embodiments, Figure 4 As shown, the method also includes:

[0090] S51: restore the second identifier to obtain a restoration result, verify the restoration result to obtain a third verification result, and verify the first identifier to obtain a fourth verification result;

[0091] S52: Compare the third verification result with the fourth verification result to determine whether the third verification result is the same as the fourth verification result;

[0092] S53: If yes, restoration is successful;

[0093] S54: If not, the restoration fails.

[0094] It should be noted that after the program package to be verified and the recovery result are verified, the second identifier needs to be restored to the first identifier, and the information digest values ​​of the restored result and the first identifier are obtained respectively, and the corresponding information digest values ​​are used as the third verification result and the fourth verification result, and the third verification result is compared with the fourth verification result. When the third verification result is the same as the fourth verification result, it is determined that the restoration is successful; if the second identifier is different from the fourth identifier, it is determined that the second identifier fails to be restored to the first identifier. In some embodiments, the restoration result can also be directly compared with the first identifier. If the restoration result is exactly the same as the first identifier, it is determined that the restoration is successful, otherwise, it is determined that the restoration fails. When the bytes of the identifier are relatively long, considering the accuracy of the verification result and the efficiency of the verification, based on the advantages of the MD5 algorithm, it is possible to select the information digest values ​​of the first identifier and the second identifier for verification.

[0095] Preferably, in some implementation modes, the step of restoring the continuous variable block according to the continuous variable information to obtain a restoration result includes:

[0096] S31: Obtain the position information of splitting the continuous variable block, the length information of the continuous variable block and the variable value in the continuous variable information, determine the starting address and the ending address of restoring the continuous variable block according to the position information and the length information, and shift the variable value to between the starting address and the ending address.

[0097] According to the position information and the length information, determine the starting address and the ending address for restoring the continuous variable block; move the variable value between the starting address and the ending address; the above two steps can adopt a variety of timing control methods, such as a serial timing control method or a parallel timing control method; if the serial timing control method is adopted, the starting address and the ending address to be restored can be determined first, and then the variable value can be moved; if the parallel timing control method is adopted, the above two steps are carried out in parallel; in this embodiment, from the perspective of improving verification efficiency, a parallel timing control method is adopted.

[0098] Preferably, in some implementation modes, the verifying the validity of the recovery result includes:

[0099] S41: Verify the validity of the recovery result by obtaining a second information digest value of the recovery result.

[0100] In this embodiment, the validity of the recovery result is verified by obtaining the second information digest value of the recovery result, and the second information digest value is used as the second verification result. The second verification result is compared with the obtained second reference value. If the second verification result is the same as the second reference value, the recovery result passes the verification, that is, the continuous variable block is recovered successfully; otherwise, the continuous variable block recovery fails.

[0101] Preferably, the first verification result, the second verification result, the third verification result and the fourth verification result obtained by the above verification can be transposed respectively to output verification values, and the verification values ​​can be stored at the end position of the original program package, thereby encrypting each verification result and improving security.

[0102] It should be understood that although Figure 1-4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-4 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0103] In one embodiment, Figure 5 As shown, a verification system for a program package is provided, comprising: a preprocessing module, a first verification module, a recovery module, and a second verification module, wherein:

[0104] A preprocessing module, which is used to split the original program package to obtain a program package to be verified and a continuous variable block;

[0105] a first verification module, the first verification module being used to verify the validity of the program package to be verified, obtain a first verification result, obtain a first reference value in the program package to be verified, compare the first verification result with the first reference value, and determine whether the first verification result is equal to the first reference value;

[0106] If yes, it is determined that the program package to be verified has passed the verification;

[0107] If not, it is determined that the program package to be verified has not passed the verification, and the verification is terminated;

[0108] A recovery module, the recovery module is used to obtain continuous variable information of the continuous variable block, and restore the continuous variable block according to the continuous variable information to obtain a recovery result;

[0109] A second verification module, the second verification module is used to verify the validity of the recovery result, obtain a second verification result, obtain a second reference value in the continuous variable block, compare the second verification result with the second reference value, and determine whether the second verification result is equal to the second reference value;

[0110] If yes, it is determined that the recovery result passes the verification and the original program package passes the verification;

[0111] If not, it is determined that the recovery result has not passed the verification and the original program package has not passed the verification.

[0112] In the verification system of the above-mentioned program package, the original program package is split by the preprocessing module, the validity of the program package to be verified is verified, the continuous variable block is restored after the verification, and the validity of the restored result is verified. After the restored result is verified, it is determined that the validity verification of the original program package has passed; if the program package to be verified does not pass the verification, the verification is terminated, and there is no need to perform subsequent steps of restoring the continuous variable block and verifying the restored result; if the program package to be verified passes the verification, but the restored result does not pass the verification, the original program package does not pass the verification, that is, the validity of the original program package is determined to have passed the verification only when the verification of the program package to be verified and the continuous variable block are both passed. This system implements block verification of the original program package. Compared with verifying the validity of the original program package as a whole, it reduces the possibility of interruption or abnormality, thereby improving the verification efficiency of the program package, reducing the upgrade time of the vehicle-side system to a certain extent, and improving the user experience.

[0113] Preferably, in some implementation modes, the first verification module verifies the validity of the program package to be verified, including:

[0114] Identify the decomposition points of the program package to be verified according to the functional continuity, and decompose the program package to be verified according to the decomposition points to obtain at least one program segment;

[0115] Generate verification information corresponding to the program segment, wherein the verification information includes program segment information and validity information, generate an index table based on at least one of the verification information, and verify the validity of the index table by obtaining a first information summary value of the index table.

[0116] Preferably, in some embodiments, Figure 5As shown, the preprocessing module splits the original program package to obtain the program package to be verified and the continuous variable block, and also includes a translation module.

[0117] The translation module is used to search for a first identifier in the original program package, and translate the first identifier to obtain a second identifier, wherein the second identifier is used to assist in obtaining the first reference value in the program package to be verified.

[0118] Preferably, in some implementation modes, the first verification module obtains the first reference value in the program package to be verified, including:

[0119] Move the first reference value to the end position of the program package to be verified, and add the second identifier to the end position of the program package to be verified;

[0120] The end position of the program package to be verified is located according to the second identifier, and the first reference value is obtained from the end position of the program package to be verified.

[0121] Preferably, in some embodiments, the recovery module is further used for:

[0122] Restoring the second identifier to obtain a restoration result, verifying the restoration result to obtain a third verification result, and verifying the first identifier to obtain a fourth verification result;

[0123] Compare the third verification result with the fourth verification result to determine whether the third verification result is the same as the fourth verification result;

[0124] If yes, the restoration is successful;

[0125] If not, the restore fails.

[0126] Preferably, in some implementation modes, the recovery module recovers the continuous variable block according to the continuous variable information, and obtaining the recovery result includes:

[0127] Obtain the position information of splitting the continuous variable block, the length information of the continuous variable block and the variable value in the continuous variable information, determine the starting address and the ending address of restoring the continuous variable block according to the position information and the length information, and shift the variable value to between the starting address and the ending address.

[0128] Preferably, in some implementation modes, the second verification module verifies the validity of the recovery result including:

[0129] The validity of the recovery result is verified by obtaining the second information digest value of the recovery result.

[0130] For the specific definition of the verification system of the program package, please refer to the definition of the verification method of the program package above, which will not be repeated here. Each module in the verification system of the above program package can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0131] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for verifying a program package system is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0132] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0133] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0134] S1: Split the original program package to obtain the program package to be verified and the continuous variable block;

[0135] S2: Verify the validity of the program package to be verified to obtain a first verification result, obtain a first reference value in the program package to be verified, compare the first verification result with the first reference value, and determine whether the first verification result is equal to the first reference value.

[0136] S201: If yes, determine that the program package to be verified has passed the verification;

[0137] S202: If not, it is determined that the program package to be verified has not passed the verification, and the verification is terminated;

[0138] S3: Acquire continuous variable information of the continuous variable block, and restore the continuous variable block according to the continuous variable information to obtain a restoration result;

[0139] S4: verifying the validity of the restored result to obtain a second verification result, obtaining a second reference value in the continuous variable block, comparing the second verification result with the second reference value, and determining whether the second verification result is equal to the second reference value;

[0140] S401: If yes, it is determined that the recovery result passes the verification and the original program package passes the verification;

[0141] S402: If not, it is determined that the recovery result has not passed the verification and the original program package has not passed the verification.

[0142] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0143] S21: Identify decomposition points of the program package to be verified according to functional continuity, and decompose the program package to be verified according to the decomposition points to obtain at least one program segment.

[0144] S22: Generate verification information corresponding to the program segment, wherein the verification information includes program segment information and validity information, generate an index table according to at least one of the verification information, and verify the validity of the index table by obtaining a first information summary value of the index table.

[0145] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0146] S101: Searching for a first identifier in the original program package, translating the first identifier to obtain a second identifier, wherein the second identifier is used to assist in obtaining the first reference value in the program package to be verified.

[0147] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0148] S23: moving the first reference value to the end position of the program package to be verified, and adding the second identifier to the end position of the program package to be verified;

[0149] S24: According to the second identifier, locate the end position of the program package to be verified, and obtain the first reference value from the end position of the program package to be verified.

[0150] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0151] S51: restore the second identifier to obtain a restoration result, verify the restoration result to obtain a third verification result, and verify the first identifier to obtain a fourth verification result;

[0152] S52: Compare the third verification result with the fourth verification result to determine whether the third verification result is the same as the fourth verification result;

[0153] S53: If yes, restoration is successful;

[0154] S54: If not, the restoration fails.

[0155] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0156] S31: Obtain the position information of splitting the continuous variable block, the length information of the continuous variable block and the variable value in the continuous variable information, determine the starting address and the ending address of restoring the continuous variable block according to the position information and the length information, and shift the variable value to between the starting address and the ending address.

[0157] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0158] S41: Verify the validity of the recovery result by obtaining a second information digest value of the recovery result.

[0159] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0160] S1: Split the original program package to obtain the program package to be verified and the continuous variable block;

[0161] S2: Verify the validity of the program package to be verified to obtain a first verification result, obtain a first reference value in the program package to be verified, compare the first verification result with the first reference value, and determine whether the first verification result is equal to the first reference value.

[0162] S201: If yes, determine that the program package to be verified has passed the verification;

[0163] S202: If not, it is determined that the program package to be verified has not passed the verification, and the verification is terminated;

[0164] S3: Acquire continuous variable information of the continuous variable block, and restore the continuous variable block according to the continuous variable information to obtain a restoration result;

[0165] S4: verifying the validity of the restored result to obtain a second verification result, obtaining a second reference value in the continuous variable block, comparing the second verification result with the second reference value, and determining whether the second verification result is equal to the second reference value;

[0166] S401: If yes, it is determined that the recovery result passes the verification and the original program package passes the verification;

[0167] S402: If not, it is determined that the recovery result has not passed the verification and the original program package has not passed the verification.

[0168] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0169] S21: identifying decomposition points of the program package to be verified according to the functional continuity, and decomposing the program package to be verified according to the decomposition points to obtain at least one program segment;

[0170] S22: Generate verification information corresponding to the program segment, wherein the verification information includes program segment information and validity information, generate an index table according to at least one of the verification information, and verify the validity of the index table by obtaining a first information summary value of the index table.

[0171] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0172] S101: Searching for a first identifier in the original program package, translating the first identifier to obtain a second identifier, wherein the second identifier is used to assist in obtaining the first reference value in the program package to be verified.

[0173] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0174] S23: moving the first reference value to the end position of the program package to be verified, and adding the second identifier to the end position of the program package to be verified;

[0175] S24: According to the second identifier, locate the end position of the program package to be verified, and obtain the first reference value from the end position of the program package to be verified.

[0176] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0177] S51: restore the second identifier to obtain a restoration result, verify the restoration result to obtain a third verification result, and verify the first identifier to obtain a fourth verification result;

[0178] S52: Compare the third verification result with the fourth verification result to determine whether the third verification result is the same as the fourth verification result;

[0179] S53: If yes, restoration is successful;

[0180] S54: If not, the restoration fails.

[0181] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0182] S31: Obtain the position information of splitting the continuous variable block, the length information of the continuous variable block and the variable value in the continuous variable information, determine the starting address and the ending address of restoring the continuous variable block according to the position information and the length information, and shift the variable value to between the starting address and the ending address.

[0183] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0184] S41: Verify the validity of the recovery result by obtaining a second information digest value of the recovery result.

[0185] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

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

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

Claims

1. A method for verifying a program package, characterized in that: include: The original program package is split to obtain a program package to be verified and a continuous variable block, and the continuous variable block is deleted; Verifying the validity of the program package to be verified to obtain a first verification result, obtaining a first reference value in the program package to be verified, comparing the first verification result with the first reference value, and determining whether the first verification result is equal to the first reference value, If yes, it is determined that the program package to be verified has passed the verification; If not, it is determined that the program package to be verified has not passed the verification, and the verification is terminated; Acquire continuous variable information of the continuous variable block, the continuous variable information including position information of splitting the continuous variable block, length information of the continuous variable block and variable value; restore the continuous variable block according to the continuous variable information to obtain a restoration result; Verifying the validity of the restored result to obtain a second verification result, obtaining a second reference value in the continuous variable block, comparing the second verification result with the second reference value, and determining whether the second verification result is equal to the second reference value; If yes, it is determined that the recovery result passes the verification and the original program package passes the verification; If not, it is determined that the recovery result has not passed the verification and the original program package has not passed the verification.

2. The program package verification method according to claim 1, characterized in that: The verifying the validity of the program package to be verified includes: Identify the decomposition points of the program package to be verified according to the functional continuity, and decompose the program package to be verified according to the decomposition points to obtain at least one program segment; Generate verification information corresponding to the program segment, wherein the verification information includes program segment information and validity information, generate an index table based on at least one of the verification information, and verify the validity of the index table by obtaining a first information summary value of the index table.

3. The program package verification method according to claim 1, characterized in that: The method of splitting the original program package to obtain the program package to be verified and the continuous variable block also includes: The first identifier in the original program package is searched, and the first identifier is translated to obtain a second identifier, wherein the second identifier is used to assist in obtaining the first reference value in the program package to be verified.

4. The program package verification method according to claim 3, characterized in that: The obtaining of the first reference value in the program package to be verified comprises: Move the first reference value to the end position of the program package to be verified, and add the second identifier to the end position of the program package to be verified; The end position of the program package to be verified is located according to the second identifier, and the first reference value is obtained from the end position of the program package to be verified.

5. The program package verification method according to claim 3, characterized in that: Also includes: Restoring the second identifier to obtain a restoration result, verifying the restoration result to obtain a third verification result, and verifying the first identifier to obtain a fourth verification result; Compare the third verification result with the fourth verification result to determine whether the third verification result is the same as the fourth verification result; If so, the restoration is successful; If not, the restore fails.

6. The program package verification method according to claim 1, characterized in that: The step of restoring the continuous variable block according to the continuous variable information to obtain a restoration result includes: Obtain the position information of splitting the continuous variable block, the length information of the continuous variable block and the variable value in the continuous variable information, determine the starting address and the ending address of restoring the continuous variable block according to the position information and the length information, and shift the variable value to between the starting address and the ending address.

7. The program package verification method according to claim 1, characterized in that: The verifying the validity of the recovery result includes: The validity of the recovery result is verified by obtaining the second information digest value of the recovery result.

8. A program package verification system, characterized in that: include: A preprocessing module, the preprocessing module is used to split the original program package to obtain the program package to be verified and the continuous variable block, and delete the continuous variable block; a first verification module, the first verification module being used to verify the validity of the program package to be verified, obtain a first verification result, obtain a first reference value in the program package to be verified, compare the first verification result with the first reference value, and determine whether the first verification result is equal to the first reference value; If yes, it is determined that the program package to be verified has passed the verification; If not, it is determined that the program package to be verified has not passed the verification, and the verification is terminated; A recovery module, the recovery module is used to obtain continuous variable information of the continuous variable block, the continuous variable information includes position information of splitting the continuous variable block, length information of the continuous variable block and variable value; restore the continuous variable block according to the continuous variable information to obtain a recovery result; A second verification module, the second verification module is used to verify the validity of the recovery result, obtain a second verification result, obtain a second reference value in the continuous variable block, compare the second verification result with the second reference value, and determine whether the second verification result is equal to the second reference value; If yes, it is determined that the recovery result passes the verification and the original program package passes the verification; If not, it is determined that the recovery result has not passed the verification and the original program package has not passed the verification.

9. A computer 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 steps of the verification method of the program package according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the verification method of the program package in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Systems and methods for computer device authentication

    CN101114326A

  • Software updating method and device and storage medium

    CN110032383A