Verification method and device of program package, electronic equipment and storage medium

By analyzing the package verification request and obtaining configuration information in different environments, consistency and validity verification are performed, and the problem of difficulty in ensuring accuracy of massive package update verification is solved, and automated verification is achieved, which improves efficiency and accuracy.

CN119718885APending Publication Date: 2025-03-28TRAVELSKY TECHNOLOGY LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411782626.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

During the application system upgrade process, the update verification of massive packages is difficult to ensure accuracy and requires a lot of human resources.

Method used

By parsing the package verification request, the system identification of the application system is obtained, and the package configuration information in the test environment and production environment is obtained based on the identification. Perform consistency checksum validity checksum to generate a package verification packet.

Benefits of technology

It realizes full automatic verification of application system packages, improves verification efficiency and accuracy, and reduces human resources investment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718885A_ABST
    Figure CN119718885A_ABST
Patent Text Reader

Abstract

The invention discloses a program package verification method and device, electronic equipment and a storage medium, and relates to the field of system security, the verification method is applied to a program package verification system, and the verification method comprises the following steps: determining a system identifier through a program package verification request; obtaining configuration information of the program package based on the system identifier; performing consistency verification on the program package of the application system based on the configuration information to obtain a consistency verification result; obtaining a process starting time point and a program package updating time point of the program package, and performing validity verification on the program package based on the process starting time point and the program package updating time point to obtain a validity verification result; and generating a program package verification message based on the consistency verification result and the validity verification result of all the program packages of the application system. According to the method and the device, the technical problem that in the related technology, when massive program packages are updated in the application upgrading process, the accuracy of a verification result is difficult to guarantee through a manual sampling verification mode is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of system security, and in particular to a program package verification method and device, electronic equipment and storage medium. Background Art

[0002] Computer application systems may have many functions introduced into the same package, and because the package may have vulnerabilities or need to add other business requirements, it needs to be upgraded. With the continuous development of computer technology and the increasing demand for computer application systems, the number of users is increasing, and the number of servers is also gradually increasing. It is very common for an application system to require dozens or even hundreds of servers.

[0003] The current system upgrade process is: the operation and maintenance personnel log in to the production server, stop the application service to be upgraded, log in to the test server, and transfer the test program package to be updated to the production server (depending on the specific operating environment and network restrictions, it may be transferred through several Linux or Windows servers in the middle). After the transfer is completed, the upgraded application service is finally started.

[0004] In the related art, after the application system is upgraded, the updated program packages are often verified by manual sampling or full inspection. When it involves the inspection of massive program packages, it is difficult to ensure the accuracy of the verification results, and a lot of human resources will be wasted.

[0005] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0006] The embodiments of the present invention provide a method and device for verifying a program package, an electronic device, and a storage medium, so as to at least solve the technical problem in the related art that, during an application upgrade process, when a large number of program packages are updated, it is difficult to ensure the accuracy of the verification results through manual sampling and verification.

[0007] According to one aspect of an embodiment of the present invention, a program package verification method is provided, which is applied to a program package verification system, and the program package verification method includes: parsing a received program package verification request to determine the system identifier of an application system to be verified; obtaining configuration information of all the program packages corresponding to the application system based on the system identifier of the application system, wherein the configuration information of the program package includes the configuration information of the program package in a test environment and the configuration information of the program package in a production environment; performing a consistency check on the program package of the application system based on the configuration information of the program package in the test environment and the configuration information of the program package in the production environment to obtain a consistency check result; when the consistency check result indicates that the program package has passed the consistency check, obtaining a process start time point and a package update time point of the program package in the production environment, and performing a validity check on the program package based on the process start time point and the package update time point to obtain a validity check result; and generating a package verification message based on the consistency check result and the validity check result of all the program packages of the application system.

[0008] Optionally, a consistency check is performed on the program package of the application system based on the configuration information of the program package under the test environment and the configuration information of the program package under the production environment, and the step of obtaining the consistency check result includes: comparing the hash code in the configuration information of the program package under the test environment with the hash code in the configuration information of the program package under the production environment to obtain a first comparison result; and obtaining the consistency check result based on the first comparison result.

[0009] Optionally, after obtaining the consistency check result, it also includes: when the consistency check result indicates that any of the program packages has failed the consistency check, obtaining the path information, IP address information and identification information corresponding to the program package that has failed the consistency check; constructing a consistency check failure message based on the path information, IP address information and identification information corresponding to all program packages that have failed the consistency check, and sending the consistency check failure message to the operation and maintenance terminal.

[0010] Optionally, the step of performing validity verification on the program package based on the process start time point and the program package update time point to obtain the validity verification result includes: comparing the process start time point and the program package update time point of the program package in the production environment to obtain a second comparison result; when the second comparison result indicates that the process start time point is later than the program package update time point, determining that the program package passes the validity verification, obtaining a validity verification success result of the program package, and obtaining the validity verification result based on the validity verification success result; or, when the second comparison result indicates that the process start time point is earlier than the program package update time point, it is true that the program package fails the validity verification, obtaining a validity verification failure result of the program package, and obtaining the validity verification result based on the validity verification failure result.

[0011] Optionally, before receiving the package verification request, the method further includes: receiving a configuration update message, and parsing the configuration update message to obtain a target package of the configuration information to be updated and a target server to which the target package belongs; verifying the target server and the target package to obtain a verification result, wherein verifying the target server and the target package includes: verifying the connectivity of the target server, verifying the IP address of the target server, and verifying the configuration information of the target package; and updating the configuration information of the target package based on the update operation information indicated by the configuration update message and the verification result.

[0012] Optionally, the configuration information of the program package under the test environment includes at least: a hash code of the program package under the test environment, path information of the program package under the test environment, IP address information of the program package under the test environment, and identification information of the program package under the test environment.

[0013] Optionally, the configuration information of the program package in the production environment includes at least: a hash code of the program package in the production environment, path information of the program package in the production environment, IP address information of the program package in the production environment, and identification information of the program package in the production environment.

[0014] According to another aspect of an embodiment of the present invention, there is also provided a program package verification device, which is applied to a program package verification system, and the program package verification device includes: a parsing unit, which is used to parse a received program package verification request and determine a system identifier of an application system to be verified; an acquisition unit, which is used to acquire configuration information of all the program packages corresponding to the application system based on the system identifier of the application system, wherein the configuration information of the program package includes configuration information of the program package in a test environment and configuration information of the program package in a production environment; a first verification unit, which is used to perform a consistency check on the program package of the application system based on the configuration information of the program package in the test environment and the configuration information of the program package in the production environment to obtain a consistency check result; a second verification unit, which is used to obtain a process start time point and a package update time point of the program package in the production environment when the consistency check result indicates that the program package has passed the consistency check, and perform a validity check on the program package based on the process start time point and the package update time point to obtain a validity check result; a generation unit, which is used to generate a package verification message based on the consistency check result and the validity check result of all the program packages of the application system.

[0015] Optionally, the first verification unit includes: a first comparison module, used to compare the hash code in the configuration information of the program package in the test environment with the hash code in the configuration information of the program package in the production environment to obtain a first comparison result; and a first acquisition module, used to obtain the consistency verification result based on the first comparison result.

[0016] Optionally, the verification device for the program package also includes: a second acquisition module, used to obtain the path information, IP address information and identification information corresponding to the program package that failed the consistency check when the consistency check result indicates that any of the program packages failed the consistency check; a first construction module, used to construct a consistency check failure message based on the path information, IP address information and identification information corresponding to all program packages that failed the consistency check, and send the consistency check failure message to the operation and maintenance terminal.

[0017] Optionally, the second verification unit includes: a second comparison module, used to compare the process start time point of the program package in the production environment with the program package update time point to obtain a second comparison result; a first determination module, used to determine that the program package has passed the validity check when the second comparison result indicates that the process start time point is later than the program package update time point, obtain a validity check success result of the program package, and obtain the validity check result based on the validity check success result; a second determination module, used to determine that the program package has not passed the validity check when the second comparison result indicates that the process start time point is earlier than the program package update time point, obtain a validity check failure result of the program package, and obtain the validity check result based on the validity check failure result.

[0018] Optionally, the verification device for the program package also includes: a first receiving module, used to receive a configuration update message, and parse the configuration update message to obtain a target program package of the configuration information to be updated and a target server to which the target program package belongs; a first verification module, used to verify the target server and the target program package to obtain a verification result, wherein verifying the target server and the target program package includes: verifying the connectivity of the target server, verifying the IP address of the target server, and verifying the configuration information of the target program package; a first update module, used to update the configuration information of the target program package based on the update operation information indicated by the configuration update message and the verification result.

[0019] Optionally, the configuration information of the program package under the test environment includes at least: a hash code of the program package under the test environment, path information of the program package under the test environment, IP address information of the program package under the test environment, and identification information of the program package under the test environment.

[0020] Optionally, the configuration information of the program package in the production environment includes at least: a hash code of the program package in the production environment, path information of the program package in the production environment, IP address information of the program package in the production environment, and identification information of the program package in the production environment.

[0021] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned program package verification methods.

[0022] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the above-mentioned program package verification methods.

[0023] In the present application, the following steps are performed: first, the received package verification request is parsed to determine the system identifier of the application system to be verified, and the configuration information of all program packages corresponding to the application system is obtained based on the system identifier of the application system, wherein the configuration information of the program package includes the configuration information of the program package in the test environment and the configuration information of the program package in the production environment; then, based on the configuration information of the program package in the test environment and the configuration information of the program package in the production environment, a consistency check is performed on the program package of the application system to obtain a consistency check result; and when the consistency check result indicates that the program package passes the consistency check, the process start time point and the package update time point of the program package in the production environment are obtained, and the validity of the program package is checked based on the process start time point and the package update time point to obtain a validity check result; finally, based on the consistency check results and validity check results of all program packages of the application system, a package verification message is generated.

[0024] In the present application, when verifying the program package when upgrading the application system, the configuration information of the program package in different environments is obtained through the program package verification request, and the consistency check is performed on the program package based on the comparison of the configuration information. If the consistency check passes, the validity check of the program package is automatically triggered, and the program package update time and the start time of the process corresponding to the program package are obtained. The validity of the program package is verified based on the comparison of the update time and the start time, so that the program package can be verified automatically, the verification efficiency and the accuracy of the verification results are improved, and the technical problem in the related technology that when a large number of program packages are updated during the application upgrade process, it is difficult to ensure the accuracy of the verification results through manual sampling and verification. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0026] Figure 1 is a flow chart of an optional method for verifying a program package according to an embodiment of the present invention;

[0027] Figure 2 is an architectural diagram of an optional program package verification system according to an embodiment of the present invention;

[0028] Figure 3 is a timing diagram of an optional verification process of a program package according to an embodiment of the present invention;

[0029] Figure 4 is a schematic diagram of an optional program package verification device according to an embodiment of the present invention;

[0030] Figure 5 The present invention is a hardware structure block diagram of an electronic device (or mobile device) according to a method for verifying a program package in an embodiment of the present invention. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0033] To facilitate those skilled in the art to understand the present invention, some terms or nouns involved in the embodiments of the present invention are explained below:

[0034] Remote network protocol, Secure Shell, referred to as ssh, is used to log in to a server or other computer remotely in an encrypted manner.

[0035] IP address, the full name of Internet Protocol Address, refers to the Internet Protocol address.

[0036] Secure Hash Algor ithm 512bit, referred to as SHA512, is widely used in password storage, data integrity verification, digital signature and other fields.

[0037] It should be noted that the program package verification method and device in the present application can be used in the field of system security when verifying program packages during the application upgrade process, and can also be used in any field except the field of system security when verifying program packages during the application upgrade process. The application does not limit the application field of the program package verification method and device in the present application.

[0038] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant regions, take necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0039] It should be noted that in this application, when collecting and analyzing customer information, corresponding operation entrances are provided for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.

[0040] The following embodiments of the present invention can be applied to various package verification systems / applications / devices. The present invention can remotely obtain the configuration information of the package in different environments, and verify the consistency of the package by comparing the hash code of the package in the test environment and the production environment. If the consistency check passes, the validity check of the package is automatically triggered to achieve full verification of the application system package, saving human resources and improving the accuracy of the verification results.

[0041] The present invention is described in detail below in conjunction with various embodiments.

[0042] Embodiment 1

[0043] According to an embodiment of the present invention, an embodiment of a verification method for a program package is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0044] The verification of the program package of the embodiment of the present invention is applied to the program package verification system. Figure 1is a flow chart of an optional method for verifying a program package according to an embodiment of the present invention, such as Figure 1 As shown, the verification method of the program package includes the following steps:

[0045] Step S101, parsing the received package verification request to determine the system identifier of the application system to be verified;

[0046] Step S102, acquiring configuration information of all program packages corresponding to the application system based on the system identifier of the application system, wherein the configuration information of the program packages includes configuration information of the program packages in the test environment and configuration information of the program packages in the production environment;

[0047] Step S103, based on the configuration information of the program package in the test environment and the configuration information of the program package in the production environment, a consistency check is performed on the program package of the application system to obtain a consistency check result;

[0048] Step S104, when the consistency check result indicates that the program package has passed the consistency check, obtaining the process start time point and the program package update time point in the production environment, and performing a validity check on the program package based on the process start time point and the program package update time point to obtain a validity check result;

[0049] Step S105: Generate a package verification message based on the consistency verification results and validity verification results of all program packages of the application system.

[0050] Through the above steps, the received package verification request is first parsed to determine the system identifier of the application system to be verified, and the configuration information of all program packages corresponding to the application system is obtained based on the system identifier of the application system, wherein the configuration information of the program package includes the configuration information of the program package in the test environment and the configuration information of the program package in the production environment, and then based on the configuration information of the program package in the test environment and the configuration information of the program package in the production environment, the program package of the application system is consistency-verified to obtain a consistency verification result, and when the consistency verification result indicates that the program package passes the consistency verification, the process start time point and the package update time point of the program package in the production environment are obtained, and the validity of the program package is verified based on the process start time point and the package update time point to obtain a validity verification result, and finally, based on the consistency verification results and validity verification results of all program packages of the application system, a package verification message is generated.

[0051] In this embodiment, when verifying the program package when upgrading the application system, the configuration information of the program package in different environments is obtained through the program package verification request, and the consistency of the program package is verified based on the comparison operation of the configuration information. If the consistency check passes, the validity check of the program package is automatically triggered, and the program package update time and the start time of the process corresponding to the program package are obtained. The validity of the program package is verified based on the comparison of the update time and the start time. In this way, the program package can be verified automatically, the verification efficiency and the accuracy of the verification results are improved, and the technical problem in the related technology that when a large number of program packages are updated during the application upgrade process, it is difficult to ensure the accuracy of the verification results through manual random inspection and verification.

[0052] The embodiment of the present invention is described in detail below in combination with the above steps.

[0053] It should be noted that application system upgrades are usually based on package upgrades. A package is a collection of components that make up an application system, including executable files, library files, configuration files, etc. When an application system needs to be updated, new packages are usually released, which may contain bug fixes, security updates, feature improvements, or performance optimizations.

[0054] It should be noted that package verification is also an important part of application update and upgrade. Package verification can timely discover problems and quickly solve them before the updated application system executes business. When updating a large number of packages, the update may fail due to various reasons. For example, in the process of copying from the test server to the production server, many problems may cause the package transmission failure, such as transmission instruction input errors: instruction errors, parameter errors, file path errors, file name errors, server address errors, user name errors, password errors, etc., or network problems, such as network fluctuations or sudden abnormalities that cause package transmission abnormalities, failures or incompleteness. In order to ensure the high availability of the application system, the system can still process user requests normally after some servers go down. The application server usually runs on multiple nodes (multiple servers run the same service). However, if some server packages are successfully updated and some packages fail to be updated, the application system is directly started without verifying and processing the failed packages in time. Finally, when executing a large number of businesses, some requests will be found to be abnormal, resulting in the failure of the application system upgrade.

[0055] It should be noted that the package verification in the embodiment of the present invention includes package consistency verification and package validity verification. The consistency verification can verify whether the package is updated successfully, and the validity verification can verify whether the package is effective, thereby ensuring the successful upgrade of the application system.

[0056] Optionally, before receiving the package verification request, the method further includes: receiving a configuration update message, and parsing the configuration update message to obtain a target package of the configuration information to be updated and a target server to which the target package belongs; verifying the target server and the target package to obtain a verification result, wherein verifying the target server and the target package includes: verifying the connectivity of the target server, verifying the IP address of the target server, and verifying the configuration information of the target package; and updating the configuration information of the target package based on the update operation information indicated in the configuration update message and the verification result.

[0057] It should be noted that the implementation subject of the embodiment of the present invention is a verification system for a program package, which can manage the configuration information of the program package. The user terminal accesses the front-end configuration page of the verification system, and the front-end configuration page calls the background application. The background application reads the test environment stored in the application database or configuration file and the existing program package configuration information on the corresponding production environment. When the configuration of the program package needs to be modified, the system receives the configuration update message transmitted by the front-end page, and parses the configuration update message to obtain the target program package of the configuration information to be updated and the target server to which the target program package belongs. First, the target server and the target program package are verified. If the verification passes, the relevant configuration stored in the database or configuration file is modified.

[0058] Specifically, verifying the target server includes: verifying the connectivity of the target server to ensure that the target server where the program package is located can be successfully connected, then verifying the IP address of the target server, and verifying the configuration information of the target program package, such as the program package path.

[0059] Step S101, parsing the received package verification request to determine the system identifier of the application system to be verified.

[0060] It should be noted that when the application system is upgraded, after the operation and maintenance end completes the package upload, it will select the application system that needs to be verified from the front-end page, and initiate a package verification request for package consistency and validity verification. The request message is transmitted to the verification system background, which will parse the package verification request and determine the system ID of the application system to be verified.

[0061] Step S102: acquiring configuration information of all program packages corresponding to the application system based on the system identification of the application system.

[0062] It should be noted that after determining the application system to be verified, all corresponding program packages in the background configuration database or configuration file are extracted according to the system identifier of the application system to be verified. For each program package, the configuration information of the program package in different environments can be remotely accessed in turn through ssh or other remote access methods, including the configuration information of the program package in the test environment and the configuration information of the program package in the production environment.

[0063] Optionally, the configuration information of the program package under the test environment includes at least: a hash code of the program package under the test environment, path information of the program package under the test environment, IP address information of the program package under the test environment, and identification information of the program package under the test environment.

[0064] It should be noted that the configuration information of the program package under the test environment can be: the hash code of the program package under the test environment, the path information of the program package under the test environment, the IP address information of the program package under the test environment, and the identification information of the program package under the test environment. The hash code of the program package is unique, and the hash code can be used as the target of consistency verification to perform consistency verification on the program package.

[0065] Optionally, the configuration information of the program package in the production environment includes at least: a hash code of the program package in the production environment, path information of the program package in the production environment, IP address information of the program package in the production environment, and identification information of the program package in the production environment.

[0066] It should be noted that, similar to the test environment, the package configuration information in the production environment may include: the hash code of the package in the production environment, the path information of the package in the production environment, the IP address information of the package in the production environment, and the identification information of the package in the production environment.

[0067] Step S103 , based on the configuration information of the program package in the test environment and the configuration information of the program package in the production environment, a consistency check is performed on the program package of the application system to obtain a consistency check result.

[0068] Optionally, a consistency check is performed on the program package of the application system based on the configuration information of the program package under the test environment and the configuration information of the program package under the production environment, and the step of obtaining the consistency check result includes: comparing the hash code in the configuration information of the program package under the test environment with the hash code in the configuration information of the program package under the production environment to obtain a first comparison result; and obtaining a consistency check result based on the first comparison result.

[0069] It should be noted that the embodiment of the present invention realizes consistency verification of the program package by comparing the hash code of the program package in the test environment with the hash code of the production environment. The hash code of each program package is unique. If the hash code of the program package in the test environment is the same as that in the production environment, it indicates that the program package in the test environment is completely copied to the production environment, that is, the program package update is completed and the consistency verification of the program package is passed.

[0070] Optionally, after obtaining the consistency check result, it also includes: when the consistency check result indicates that any program package has failed the consistency check, obtaining the path information, IP address information and identification information corresponding to the program package that has failed the consistency check; constructing a consistency check failure message based on the path information, IP address information and identification information corresponding to all program packages that have failed the consistency check, and sending the consistency check failure message to the operation and maintenance terminal.

[0071] It should be noted that if the hash codes of one or more packages are inconsistent between the test environment and the production environment, all packages with inconsistent hash codes will be selected, and a consistency check failure message will be constructed based on their corresponding path information, IP address information, and identification information. The consistency check failure message will be sent to the operation and maintenance terminal, and the operation and maintenance terminal will check the packages that failed to update.

[0072] Step S104, when the consistency check result indicates that the program package has passed the consistency check, obtain the process start time point and the program package update time point in the production environment, and perform validity check on the program package based on the process start time point and the program package update time point to obtain the validity check result.

[0073] It should be noted that when all packages pass the consistency check, the package validity check is automatically triggered. The validity check is used to verify the effectiveness of the package. By comparing the process start time corresponding to the package in the production environment with the update time of the package, it is determined whether the package passes the validity check based on the comparison result.

[0074] Optionally, the validity of the program package is checked based on the process start time point and the program package update time point, and the step of obtaining the validity check result includes: comparing the process start time point and the program package update time point in the production environment to obtain a second comparison result; when the second comparison result indicates that the process start time point is later than the program package update time point, determining that the program package has passed the validity check, obtaining a successful result of the validity check of the program package, and obtaining the validity check result based on the successful result of the validity check; or, when the second comparison result indicates that the process start time point is earlier than the program package update time point, it is true that the program package has not passed the validity check, obtaining a failed result of the validity check of the program package, and obtaining the validity check result based on the failed result of the validity check.

[0075] It should be noted that when performing validity verification, the process startup time point corresponding to the program package in the production environment is compared with the update time point of the program package. If the comparison result indicates that the process startup time point is later than the program package update time point, it means that the effectiveness of the program package in the production environment is normal, thereby realizing the validity verification of the program package.

[0076] Step S105: Generate a package verification message based on the consistency verification results and validity verification results of all program packages of the application system.

[0077] Finally, based on the effectiveness of the package in the production environment, that is, the validity check result and the consistency of the hash code of the package in the production environment and the test environment, that is, the consistency check result, a package verification message is constructed and returned to the front-end page for display. The message format can be json or other agreed formats.

[0078] The front-end page sets up a display interface according to the package consistency check result. After each comparison of a group of packages, the consistency check result of this group of packages is displayed on the interface, and the result is "passed" or "failed".

[0079] Another optional specific implementation is described in detail below.

[0080] Figure 2 is an architecture diagram of an optional program package verification system according to an embodiment of the present invention, such as Figure 2 As shown, the verification system of the program package in the embodiment of the present invention includes a configuration front-end and display component, and an inspection system background, and the inspection system background includes a configuration management component, a program package collection component, and a program package consistency and effectiveness inspection component.

[0081] The specific functions of the configuration front-end and display components include: querying, adding, deleting, and modifying the test environment and production environment package configuration; saving the configuration, including verifying the input configuration before saving, such as whether the server can be connected, whether the target file exists, etc.; starting the package consistency and effectiveness check; and displaying the results of the package consistency and effectiveness check.

[0082] Under normal circumstances, the user accesses the front-end website (configure the front-end and display components) page and selects the application system to be accessed. The front-end website displays the permissions and calls the back-end application (configuration management component). The back-end application (configuration management component) reads the existing package configuration information on the test environment and the corresponding production environment stored in the back-end application database or configuration file. The back-end application (configuration management component) returns the configuration information to the front-end website (configure the front-end and display components). The front-end website (configure the front-end and display components) displays the configuration information returned by the back-end application (configuration management component) on the front-end website page.

[0083] The configuration management component is used to input the configuration information such as the path of the package that has passed the test of the application system to be checked, the server information where it is located, the production package path information, etc. into the configuration and store them in the form of configuration files or databases.

[0084] The configuration information in the configuration management component is divided into the first level according to the system name. There are multiple configurations under each system. Each configuration includes: test environment package configuration and corresponding production environment package configuration. These two information blocks form a pair of configurations. The test environment package configuration includes: the IP address of the server where the test environment package is located, user name, password and other login information, as well as the path and package name of the target package of the test environment. The corresponding production environment package configuration includes: the IP address of the server where the production environment package is located, user name, password and other login information, as well as the path and package name of the target package of the test environment.

[0085] The package collection component is used to download the tested packages and the upgraded packages of the production environment application to the specified directory configured by the operation and maintenance server according to the configuration information.

[0086] The package consistency and effectiveness check component is used to verify the consistency and effectiveness of the package through consistency comparison technologies such as SHA512, and select one or more comparison methods according to needs, and return the consistency and effectiveness check results to the front-end page and record the log based on the verification results.

[0087] The verification method of the program package is applied to the verification system of the above program package. Figure 3 is a timing diagram of an optional verification process of a program package according to an embodiment of the present invention, such as Figure 3As shown in the figure, the verification process of the package includes:

[0088] By managing the package server and path configuration information through "Configure front-end and display components", you can add, modify, and delete the package path and other configurations of the test environment and production environment.

[0089] The background modifies the background package server and path and other configuration information through the "Configuration Management Component", specifically including: checking whether the server where the target package configured by the front end is located can be connected. If not, the following message is returned to the front end: server connection timeout; if the background "Configuration Management Component" is able to connect to the server where the target package is located, the background checks whether the target package exists according to the configured target package path. If the target package does not exist, the following message is returned to the front end: the target package does not exist, please check whether the package path is correct; after the background "Configuration Management Component" receives the configuration management message from the "Configuration Front End and Display Component", it performs corresponding management operations on the database or configuration file where the configuration is located.

[0090] The operation and maintenance personnel select the package to be checked from "Configure front-end and display components" and click the button to initiate "Package consistency and effectiveness check".

[0091] The background "package consistency and effectiveness check component" remotely obtains the hash codes of the test environment package and the production environment package through ssh or other methods.

[0092] The background "Package Consistency and Validity Check Component" determines the consistency of the test environment package and the production environment package based on the hash code.

[0093] The background "Package Consistency and Validity Check Component" finds that the hash codes of the package test environment and the production environment are inconsistent. The assembly test environment package and the production environment package are inconsistent. The result message is returned to the front-end "Configure Front-end and Display Component", and the subsequent "Package Validity Verification" is skipped.

[0094] If the background "Package Consistency and Validity Check Component" determines that the hash codes in the package test environment and the production environment are consistent, the package validity check is automatically triggered, and the package update time is remotely obtained through ssh or other methods.

[0095] The background "Package Consistency and Validity Check Component" checks the process start time of the production environment package, and determines the validity of the package based on the package update time and the package process start time. If the process start time is later than the update time, it indicates that the package is in normal validity and the package passes the validity check. If the process start time is earlier than the update time, it indicates that the package is abnormal and the package validity check fails.

[0096] The background "package consistency and effectiveness check component" assembles the check result message according to the effectiveness status and returns it to the "configuration front-end and display component".

[0097] "Configure front-end and display components" initiates the display of package consistency and validity verification results.

[0098] In an embodiment of the present invention, configuration information of program packages in different environments can be remotely obtained, and the consistency of the program packages can be verified by comparing the hash codes of the program packages in the test environment and the production environment. If the consistency check passes, the validity check of the program package is automatically triggered to achieve full verification of the application system program package, saving human resources and improving the accuracy of the verification results.

[0099] The following is a detailed description in conjunction with another embodiment.

[0100] Embodiment 2

[0101] A program package verification device provided in this embodiment includes multiple implementation units, each implementation unit corresponds to each implementation step in the above-mentioned embodiment 1. Its specific implementation methods and beneficial effects can refer to the above-mentioned method embodiments and will not be repeated here.

[0102] Figure 4 is a schematic diagram of an optional program package verification device according to an embodiment of the present invention, such as Figure 4 As shown, the verification device of the program package may include: a parsing unit 41, an acquisition unit 42, a first verification unit 43, a second verification unit 44, and a generation unit 45, wherein:

[0103] The parsing unit 41 is used to parse the received package verification request and determine the system identifier of the application system to be verified;

[0104] An acquisition unit 42, configured to acquire configuration information of all program packages corresponding to the application system based on the system identifier of the application system, wherein the configuration information of the program packages includes configuration information of the program packages in the test environment and configuration information of the program packages in the production environment;

[0105] A first verification unit 43 is used to perform consistency verification on the program package of the application system based on the configuration information of the program package in the test environment and the configuration information of the program package in the production environment to obtain a consistency verification result;

[0106] A second verification unit 44 is used to obtain a process start time point and a package update time point of the program package in a production environment when the consistency verification result indicates that the program package has passed the consistency verification, and perform a validity verification on the program package based on the process start time point and the package update time point to obtain a validity verification result;

[0107] The generating unit 45 is used to generate a program package verification message based on the consistency verification results and validity verification results of all program packages of the application system.

[0108] The verification device of the above-mentioned program package parses the received program package verification request through the parsing unit 41 to determine the system identification of the application system to be verified; obtains the configuration information of all program packages corresponding to the application system based on the system identification of the application system through the acquisition unit 42, wherein the configuration information of the program package includes the configuration information of the program package under the test environment and the configuration information of the program package under the production environment; performs consistency verification on the program package of the application system based on the configuration information of the program package under the test environment and the configuration information of the program package under the production environment through the first verification unit 43 to obtain the consistency verification result; obtains the process start time point and the package update time point of the program package in the production environment through the second verification unit 44 when the consistency verification result indicates that the program package has passed the consistency verification, and performs validity verification on the program package based on the process start time point and the package update time point to obtain the validity verification result; generates a package verification message based on the consistency verification results and validity verification results of all program packages of the application system through the generation unit 45.

[0109] In this embodiment, when verifying the program package when upgrading the application system, the configuration information of the program package in different environments is obtained through the program package verification request, and the consistency check is performed on the program package based on the comparison of the configuration information. If the consistency check passes, the validity check of the program package is automatically triggered, and the program package update time and the start time of the process corresponding to the program package are obtained. The validity of the program package is verified based on the comparison of the update time and the start time, so that the program package can be verified automatically, the verification efficiency and the accuracy of the verification results are improved, and the technical problem in the related technology that when a large number of program packages are updated during the application upgrade process, it is difficult to ensure the accuracy of the verification results through manual random inspection and verification.

[0110] Optionally, the first verification unit 43 includes: a first comparison module, used to compare the hash code in the configuration information of the program package in the test environment with the hash code in the configuration information of the program package in the production environment to obtain a first comparison result; a first acquisition module, used to obtain a consistency verification result based on the first comparison result.

[0111] Optionally, the verification device for the program package also includes: a second acquisition module, which is used to obtain the path information, IP address information and identification information corresponding to the program package that failed the consistency check when the consistency check result indicates that any program package has failed the consistency check; a first construction module, which is used to construct a consistency check failure message based on the path information, IP address information and identification information corresponding to all program packages that have failed the consistency check, and send the consistency check failure message to the operation and maintenance terminal.

[0112] Optionally, the second verification unit 44 includes: a second comparison module, which is used to compare the process start time point and the package update time point of the program package in the production environment to obtain a second comparison result; a first determination module, which is used to determine that the program package has passed the validity check when the second comparison result indicates that the process start time point is later than the package update time point, and obtain a validity check success result of the program package, and obtain a validity check result based on the validity check success result; a second determination module, which is used to determine that the program package has not passed the validity check when the second comparison result indicates that the process start time point is earlier than the package update time point, and obtain a validity check failure result of the program package, and obtain a validity check result based on the validity check failure result.

[0113] Optionally, the verification device for the program package also includes: a first receiving module, used to receive a configuration update message, and parse the configuration update message to obtain a target program package of the configuration information to be updated and a target server to which the target program package belongs; a first verification module, used to verify the target server and the target program package to obtain a verification result, wherein the verification of the target server and the target program package includes: verifying the connectivity of the target server, verifying the IP address of the target server, and verifying the configuration information of the target program package; a first update module, used to update the configuration information of the target program package based on the update operation information indicated by the configuration update message and the verification result.

[0114] Optionally, the configuration information of the program package under the test environment includes at least: a hash code of the program package under the test environment, path information of the program package under the test environment, IP address information of the program package under the test environment, and identification information of the program package under the test environment.

[0115] Optionally, the configuration information of the program package in the production environment includes at least: a hash code of the program package in the production environment, path information of the program package in the production environment, IP address information of the program package in the production environment, and identification information of the program package in the production environment.

[0116] The verification device of the above-mentioned program package may also include a processor and a memory. The above-mentioned parsing unit 41, acquisition unit 42, first verification unit 43, second verification unit 44, generation unit 45, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.

[0117] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set to check the program package during the application upgrade process by adjusting kernel parameters.

[0118] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (fl ash RAM), and the memory includes at least one storage chip.

[0119] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium including a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned program package verification methods.

[0120] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement any one of the above-mentioned program package verification methods.

[0121] According to another aspect of an embodiment of the present invention, a computer program product is provided. The computer program product includes a computer program, wherein when the computer program is executed by a processor, any one of the above-mentioned verification methods for a program package is implemented.

[0122] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having the following method steps: parsing a received package verification request to determine the system identification of the application system to be verified; obtaining configuration information of all program packages corresponding to the application system based on the system identification of the application system, wherein the configuration information of the program package includes the configuration information of the program package in the test environment and the configuration information of the program package in the production environment; performing a consistency check on the program package of the application system based on the configuration information of the program package in the test environment and the configuration information of the program package in the production environment to obtain a consistency check result; when the consistency check result indicates that the program package has passed the consistency check, obtaining a process start time point and a package update time point of the program package in the production environment, and performing a validity check on the program package based on the process start time point and the package update time point to obtain a validity check result; generating a package verification message based on the consistency check results and the validity check results of all program packages of the application system.

[0123] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that initializes the following method steps: performing a consistency check on the program package of the application system based on the configuration information of the program package in the test environment and the configuration information of the program package in the production environment, and the step of obtaining the consistency check result includes: comparing the hash code in the configuration information of the program package in the test environment with the hash code in the configuration information of the program package in the production environment to obtain a first comparison result; and obtaining a consistency check result based on the first comparison result.

[0124] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that is initialized with the following method steps: after obtaining the consistency check result, it also includes: when the consistency check result indicates that any program package has not passed the consistency check, obtaining the path information, IP address information and identification information corresponding to the program package that has not passed the consistency check; constructing a consistency check failure message based on the path information, IP address information and identification information corresponding to all program packages that have not passed the consistency check, and sending the consistency check failure message to the operation and maintenance terminal.

[0125] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that is initialized with the following method steps: performing validity verification on a program package based on a process startup time point and a program package update time point, and the step of obtaining a validity verification result includes: comparing the process startup time point and the program package update time point of the program package in a production environment to obtain a second comparison result; when the second comparison result indicates that the process startup time point is later than the program package update time point, determining that the program package passes the validity verification, obtaining a successful validity verification result of the program package, and obtaining a validity verification result based on the successful validity verification result; or, when the second comparison result indicates that the process startup time point is earlier than the program package update time point, the program package does not pass the validity verification, obtaining a failed validity verification result of the program package, and obtaining a validity verification result based on the failed validity verification result.

[0126] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that is initialized with the following method steps: before receiving a package verification request, it also includes: receiving a configuration update message, and parsing the configuration update message to obtain a target package of configuration information to be updated and a target server to which the target package belongs; verifying the target server and the target package to obtain a verification result, wherein verifying the target server and the target package includes: verifying the connectivity of the target server, verifying the IP address of the target server, and verifying the configuration information of the target package; and updating the configuration information of the target package based on the update operation information indicated by the configuration update message and the verification result.

[0127] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing an initialization program having the following method steps: the configuration information of the program package under the test environment includes at least: the hash code of the program package under the test environment, the path information of the program package under the test environment, the IP address information of the program package under the test environment, and the identification information of the program package under the test environment.

[0128] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing an initialization program having the following method steps: the configuration information of the program package in the production environment includes at least: the hash code of the program package in the production environment, the path information of the program package in the production environment, the IP address information of the program package in the production environment, and the identification information of the program package in the production environment.

[0129] Figure 5 1 is a hardware structure block diagram of an electronic device (or mobile device) according to a method for verifying a program package in an embodiment of the present invention. Figure 5 As shown, the electronic device may include one or more ( Figure 5502a, 502b, ..., 502n are used to illustrate) processor 502 (processor 502 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), memory 504 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 5 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 5 More or fewer components as shown, or with Figure 5 Different configurations are shown.

[0130] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0131] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

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

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

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

[0135] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0136] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for verifying a program package, characterized in that: Applied to a program package verification system, the program package verification method includes: Parsing the received package verification request to determine the system identifier of the application system to be verified; Acquire configuration information of all the program packages corresponding to the application system based on the system identifier of the application system, wherein the configuration information of the program packages includes configuration information of the program packages in a test environment and configuration information of the program packages in a production environment; Based on the configuration information of the program package in the test environment and the configuration information of the program package in the production environment, performing a consistency check on the program package of the application system to obtain a consistency check result; When the consistency check result indicates that the program package has passed the consistency check, obtaining a process start time point and a program package update time point of the program package in a production environment, and performing a validity check on the program package based on the process start time point and the program package update time point to obtain a validity check result; A program package verification message is generated based on the consistency verification results and the validity verification results of all the program packages of the application system.

2. The verification method according to claim 1, characterized in that: The step of performing consistency check on the program package of the application system based on the configuration information of the program package in the test environment and the configuration information of the program package in the production environment to obtain the consistency check result comprises: Compare the hash code in the configuration information of the program package in the test environment with the hash code in the configuration information of the program package in the production environment to obtain a first comparison result; The consistency check result is obtained based on the first comparison result.

3. The verification method according to claim 1, characterized in that: After obtaining the consistency check result, it also includes: When the consistency check result indicates that any of the program packages has failed the consistency check, obtaining path information, IP address information, and identification information corresponding to the program package that has failed the consistency check; A consistency check failure message is constructed based on the path information, the IP address information and the identification information corresponding to all program packages that have not passed the consistency check, and the consistency check failure message is sent to the operation and maintenance terminal.

4. The verification method according to claim 1, characterized in that: The step of performing validity verification on the program package based on the process start time point and the program package update time point to obtain the validity verification result comprises: Comparing the process start time point of the program package in the production environment with the program package update time point to obtain a second comparison result; If the second comparison result indicates that the process start time is later than the program package update time, determining that the program package passes the validity check, obtaining a validity check success result of the program package, and obtaining the validity check result based on the validity check success result; or When the second comparison result indicates that the process start time point is earlier than the program package update time point, the program package does not pass the validity check, and a validity check failure result of the program package is obtained, and the validity check result is obtained based on the validity check failure result.

5. The verification method according to claim 1, characterized in that: Before receiving the package verification request, it also includes: Receiving a configuration update message, and parsing the configuration update message to obtain a target program package of configuration information to be updated and a target server to which the target program package belongs; Verifying the target server and the target program package to obtain a verification result, wherein the verification of the target server and the target program package includes: verifying the connectivity of the target server, verifying the IP address of the target server, and verifying the configuration information of the target program package; The configuration information of the target program package is updated based on the update operation information indicated by the configuration update message and the verification result.

6. The verification method according to claim 1, characterized in that: The configuration information of the program package under the test environment includes at least: a hash code of the program package under the test environment, path information of the program package under the test environment, IP address information of the program package under the test environment, and identification information of the program package under the test environment.

7. The verification method according to claim 1, characterized in that: The configuration information of the program package in the production environment includes at least: a hash code of the program package in the production environment, path information of the program package in the production environment, IP address information of the program package in the production environment, and identification information of the program package in the production environment.

8. A program package verification device, characterized in that: Applied to a program package verification system, the program package verification device comprises: A parsing unit, used to parse the received package verification request and determine the system identifier of the application system to be verified; an acquisition unit, configured to acquire configuration information of all the program packages corresponding to the application system based on the system identifier of the application system, wherein the configuration information of the program packages includes configuration information of the program packages in a test environment and configuration information of the program packages in a production environment; A first verification unit, configured to perform a consistency check on the program package of the application system based on the configuration information of the program package in the test environment and the configuration information of the program package in the production environment to obtain a consistency check result; A second verification unit is used to obtain a process start time point and a package update time point of the program package in a production environment when the consistency verification result indicates that the program package has passed the consistency verification, and perform a validity verification on the program package based on the process start time point and the program package update time point to obtain a validity verification result; A generating unit is used to generate a package verification message based on the consistency verification results and the validity verification results of all the program packages of the application system.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the program package verification method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the program package verification method described in any one of claims 1 to 7.