WO2021169124A1 - Method and apparatus for installing software package to target host, and computer device - Google Patents

Method and apparatus for installing software package to target host, and computer device Download PDF

Info

Publication number
WO2021169124A1
WO2021169124A1 PCT/CN2020/099444 CN2020099444W WO2021169124A1 WO 2021169124 A1 WO2021169124 A1 WO 2021169124A1 CN 2020099444 W CN2020099444 W CN 2020099444W WO 2021169124 A1 WO2021169124 A1 WO 2021169124A1
Authority
WO
WIPO (PCT)
Prior art keywords
software package
target host
synchronization
package
subtask
Prior art date
Application number
PCT/CN2020/099444
Other languages
French (fr)
Chinese (zh)
Inventor
唐甜
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021169124A1 publication Critical patent/WO2021169124A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Definitions

  • This application relates to the technical field of software package installation and the field of blockchain technology, and in particular to a method, device and computer equipment for installing a software package to a target host.
  • the purpose of this application is to provide a method, device and computer equipment for installing a software package to a target host, which are used to solve the technical problem of low efficiency when synchronizing the software package to the target host in the prior art.
  • this application provides a method for installing a software package to a target host.
  • the execution body of the method for installing a software package to a target host is a software package management platform, and the method includes: receiving the software package to be synchronized and the parameters of the target host; verifying the software package according to a preset verification rule; When the verification is passed, the synchronization path is determined according to the parameters of the target host, where the synchronization path is the path from the software package management platform to the server of the target host; according to the package name of the software package and the parameters of the target host, the required installation software package of the target host is generated Configuration information; synchronize the software package to the server of the target host via the synchronization path; send the configuration information to the operation and maintenance management platform of the target host, where the operation and maintenance management platform is used to install the software package on the server of the target host according to the configuration information To the target host.
  • the present application also provides a computer device, the computer device including: a memory, a processor, and computer readable instructions stored in the memory and running on the processor, wherein the processor executes
  • the program implements the following steps: receiving the software package to be synchronized and the parameters of the target host; verifying the software package according to the preset verification rules; when the verification passes, the synchronization path is determined according to the parameters of the target host, where the synchronization
  • the path is the path from the software package management platform to the server of the target host; the configuration information required by the target host to install the software package is generated according to the package name of the software package and the parameters of the target host; the software package is synchronized to the server of the target host via the synchronization path;
  • the configuration information is sent to the operation and maintenance management platform of the target host, where the operation and maintenance management platform is used to install the software package on the server of the target host to the target host according to the configuration information.
  • the present application also provides a computer-readable storage medium on which computer-readable instructions are stored.
  • the computer-readable instructions When the computer-readable instructions are executed by the processor, the following steps are implemented: receiving the software package to be synchronized and The parameters of the target host; the software package is verified according to the preset verification rules; when the verification passes, the synchronization path is determined according to the parameters of the target host, where the synchronization path is the path from the software package management platform to the server of the target host Path; generate the configuration information required by the target host to install the software package according to the package name of the software package and the parameters of the target host; synchronize the software package to the server of the target host via the synchronization path; send the configuration information to the operation and maintenance management platform of the target host, The operation and maintenance management platform is used to install the software package on the server of the target host to the target host according to the configuration information.
  • the present application provides an apparatus for installing a software package to a target host.
  • the device for installing the software package to the target host is set on the software package management platform, and the device includes: a receiving module for receiving the software package to be synchronized and the parameters of the target host; The verification rules are verified; the determining module is used to determine the synchronization path according to the parameters of the target host when the verification is passed, where the synchronization path is the path from the software package management platform to the server of the target host; the processing module is used to According to the package name of the software package and the parameters of the target host, the configuration information required by the target host to install the software package is generated; the synchronization module is used to synchronize the software package to the server of the target host via the synchronization path; the sending module is used to send the configuration information to The operation and maintenance management platform of the target host, wherein the operation and maintenance management platform is used to install the software package on the server of the target host to the target host according to the configuration information.
  • the method, device and computer equipment for installing a software package to a target host provide a unified software package receiving interface entry, receive the software package uploaded by the user and the parameters of the target host, and automatically verify the software package uploaded by the user.
  • the synchronization path of the software package to the server of the target host is determined, so that the software package is synchronized to the server of the target host via the synchronization path; on the other hand, the target is generated
  • the host installs some configuration information required by the software package, and sends the configuration information to the operation and maintenance management platform of the target host, so that the operation and maintenance management platform can install the software package on the server of the target host to the target host according to the configuration information, thereby For users, users only need to upload the software package to the software package management platform, and the software package management platform will automatically install the software package to the corresponding host.
  • the operation is simple, manpower is liberated, and a lot of time is saved. Furthermore, during the synchronization process, the digital fingerprints of the software package files are compared in each synchronization step, and synchronization is performed only when they are consistent. The user can quickly understand the status of the software package through the real-time synchronization log provided by the software package management platform, and then easily locate the installation process The problem occurred in.
  • FIG. 1 is a flowchart of a method for installing a software package to a target host according to Embodiment 1 of the application;
  • FIG. 2 is a flowchart of a method for installing a software package to a target host according to Embodiment 2 of the application;
  • FIG. 3 is a schematic diagram of installing the software package to the target host provided by the third embodiment of the application.
  • FIG. 4 is a block diagram of installing the software package to the target host device according to the fourth embodiment of the application.
  • FIG. 5 is a hardware structure diagram of a computer device provided in Embodiment 5 of this application.
  • This application provides a method, device, computer equipment, and computer-readable storage medium for installing a software package to a target host.
  • a method for installing a software package to a target host is implemented based on a software package management platform, specifically ,
  • the software package management platform provides a unified software package receiving entrance to receive the software package to be synchronized and related parameters of the target host uploaded by the user, and verify the software package according to the preset verification rules to ensure the software to be synchronized
  • the package is legal and compliant.
  • the synchronization path is determined according to the parameters of the target host, that is, the path from the software package management platform to the server of the target host is determined, and then the software package is synchronized to the target host through the synchronization path.
  • the server of the target host generates the configuration information required by the target host to install the software package according to the package name of the software package and the parameters of the target host, and then sends the configuration information to the operation and maintenance management platform of the target host to make the operation and maintenance management platform
  • the software package on the server of the target host can be installed to the target host according to the configuration information to realize automatic synchronization and installation of the software package, so that the software package can be synchronized to the target host and installed quickly and effectively.
  • the embodiment of the present application provides a method for installing a software package to a target host.
  • the execution subject of the method is a software package management platform.
  • the software package management platform is located on an office network and is provided with network security isolation and cloud servers between the target host and the office network.
  • Several intermediate devices such as bastion machines, springboards, public cloud servers, proprietary cloud servers, and/or internal cloud servers, etc.
  • the software package management platform provides the user with a unified software package receiving entrance. The user only needs to upload the software package to be synchronized and the parameters of the selected and/or input target host, and the software package management platform can automatically complete the software package. Synchronization and installation.
  • the software package to be synchronized in this application can be stored in the blockchain. Specifically, FIG.
  • FIG. 1 is a flowchart of a method for installing a software package to a target host provided in Embodiment 1 of the application. As shown in FIG. 1, the method for installing a software package to a target host provided in this embodiment includes the following steps S101 to Step S106.
  • Step S101 Receive the software package to be synchronized and the parameters of the target host.
  • the software package management platform includes a front end for interacting with users and a back end for data processing.
  • the front-end provides an interactive interface. On the interactive interface, an entry to receive the software package to be synchronized uploaded by the user and the parameter selection and/or input window of the target host are set. The parameters are submitted to the software package management platform.
  • Step S102 The software package is verified according to a preset verification rule.
  • the software package management platform presets verification rules to verify the software package uploaded by the user. When the verification passes, the software package upload is successful, and the following step S103 is executed. When the verification fails, the software package upload fails. At the same time, the front-end output can prompt the relevant information of the upload failure.
  • the package name specification may include: the information items of the package name, the data format or structure of each item of information, etc.
  • the package name of the software package to be uploaded is compared according to the package name specification to verify the software Whether the package name of the package complies with the preset package name specification.
  • the environmental information contained in the package name can specifically be the information identifying the test environment or the information identifying the production environment.
  • the software package management platform presets the corresponding relationship between the parameters of the target host and the environmental information, which can be determined by the received parameters of the target host Environmental information of the target host.
  • the environment information in the package name is parsed, and then the environment information of the target host is obtained according to the parameters of the target host, and the two are compared. If both are information identifying the test environment or both are information identifying the production environment , The environment information contained in the package name of the software package is the same as the environment information of the target host.
  • the host type contained in the package name can specifically be information identifying different host types.
  • the software package management platform presets the corresponding relationship between the parameters of the target host and the host type of the target host. In this step, the host type in the package name is resolved. , And then obtain the host type of the target host according to the parameters of the target host, and compare the two. If they are the same host type, the host type contained in the package name of the software package is the same as the host type of the target host.
  • the package name contains the system version information, which identifies the installation package version.
  • the software package management platform presets the corresponding relationship between the parameters of the target host and the system version requirements.
  • the system version information in the package name is parsed according to the target host The parameters of to determine the system version requirements, and then use the system version requirements to compare with the package name of the software package to be uploaded to verify whether the system version information contained in the software package package name meets the system version requirements.
  • Step S103 When the verification is passed, the synchronization path is determined according to the parameters of the target host.
  • the synchronization path is the path from the software package management platform to the server of the target host.
  • the software package management platform presets paths to the servers of multiple target hosts. After the target host receives the installation package acquisition instruction issued by the server of the target host, the target host obtains the installation package from the server.
  • the path preset by the software package management platform to the servers of multiple target hosts can reflect the node relationship through a mesh or tree structure.
  • the parameters of the target host reflect the node relationship.
  • the target The parameters of the host include information such as the host name.
  • the synchronization path can be determined by matching the corresponding node in the mesh or tree structure.
  • Step S104 Generate configuration information required by the target host to install the software package according to the package name of the software package and the parameters of the target host.
  • part of the configuration information required to install the software package can be defined in the package name of the software package, and part of it can be used as the parameters of the target host selected by the user, so that the target host is generated according to the package name of the software package and the parameters of the target host.
  • the configuration information required to install the software package can be obtained; alternatively, the corresponding relationship between the configuration parameters required to install the software package, the package name of the software package, and the parameters of the target host can be stored on the software package management platform, thereby The package name and the parameters of the target host can find matching configuration information in the corresponding relationship.
  • Step S105 Synchronize the software package to the server of the target host via the synchronization path.
  • the synchronization path may include multiple nodes, the software package management platform is the start node of the synchronization path, the server of the target host is the end node of the synchronization path, and the intermediate device between the software package management platform and the server of the target host is the synchronization path If there is at least one intermediate device, the process of synchronizing to the server of the target host via the synchronization path includes at least two synchronization steps. Each synchronization step is used to synchronize the software package from the upstream device to the adjacent downstream device, Among them, the start node is only an upstream device, the end node is only a downstream device, and the intermediate node can be an upstream device or a downstream device.
  • Each node on the synchronization path that can be used as an upstream device is preset with a preset script that synchronizes the local software package to the adjacent downstream device.
  • Each synchronization step specifically includes: the software package management platform calls the script execution function to execute on the upstream device When the preset script is executed, the local software package of the upstream device is synchronized to the downstream device. All the synchronization steps included in the synchronization path are executed to complete the step S105.
  • the synchronization step further includes: obtaining process information and execution results of the script execution function executing the preset script, and then writing the process information and execution results into the synchronization log, where each synchronization step is executed in real time.
  • the execution result is written into the synchronization log, so that during the synchronization process, the user can view the synchronization log in real time to understand the real-time dynamics of the installation package. If an error occurs in the synchronization link, the user can locate the error message and solve it immediately through the real-time synchronization log.
  • the method further includes the following steps: calculating the digital fingerprint of the software package to obtain the original fingerprint.
  • the preset script when executed, for the software package in the upstream device that will be synchronized with the downstream device, calculate the digital fingerprint of the software package to obtain the verification fingerprint, and then compare whether the verification fingerprint is consistent with the digital fingerprint, and When the verification fingerprint is consistent with the original fingerprint, the software package of the upstream device is synchronized to the downstream device. If they are inconsistent, a message indicating that the fingerprint is inconsistent will be output and synchronization will be interrupted.
  • the digital fingerprint may be an MD5 value, or may also be other digital fingerprints, which is not limited in this application.
  • Step S106 Send the configuration information to the operation and maintenance management platform of the target host.
  • the operation and maintenance management platform and the software package management platform are on the same office network.
  • the software package management platform can control the target host, but cannot transmit the installation package to the target host.
  • the operation and maintenance management platform delivers to the server of the target host according to the configuration information.
  • the server For the command to install the software package, the server then sends the command to obtain the software package to the target host, and the target host obtains the software package from the server for installation, thus realizing the installation of the software package to the target host.
  • a unified software package receiving interface entry is provided, the software package uploaded by the user and the parameters of the target host are received, and the software package uploaded by the user is automatically verified to ensure the software package
  • the verification is passed, on the one hand, the synchronization path of the software package to the server of the target host is determined, so that the software package is synchronized to the server of the target host through the synchronization path; on the other hand, the target host is generated to install the software Package and send the configuration information to the operation and maintenance management platform of the target host, so that the operation and maintenance management platform can install the software package on the server of the target host to the target host according to the configuration information.
  • FIG. 2 is a flowchart of the method for installing a software package to a target host provided in the second embodiment of the application. As shown in FIG. 2, the method for installing a software package to the target host provided in the second embodiment includes the following step S201 Go to step S210.
  • Step S201 Receive the software package to be synchronized and the parameters of the target host.
  • Step S202 The software package is verified according to a preset verification rule.
  • step S203 when the verification is passed, the following step S203 is executed, and when the verification is not passed, the following step S211 is executed.
  • Step S203 When the verification is passed, the synchronization path is determined according to the parameters of the target host.
  • the synchronization path is the path from the software package management platform to the server of the target host.
  • Step S204 Establish a synchronization task.
  • the synchronization task includes subtasks that correspond to the synchronization steps one-to-one and are set in sequence. Each time a subtask is started, a synchronization step is executed, and each subtask is started sequentially to complete the synchronization task.
  • Step S205 Start a subtask.
  • the first subtask is started, and each subsequent subtask will start the next after one subtask is successfully executed.
  • a synchronization step is executed, that is, the script execution function is called to execute the preset script on the upstream device.
  • the preset script is executed, the local software package of the upstream device is synchronized to the downstream device, and the script execution is obtained at the same time.
  • the function executes the process information and execution result of the preset script, and then writes the process information and execution result into the synchronization log, where the execution result includes execution success and execution failure.
  • Step S206 Mark the status of the subtask according to the execution result.
  • step S207 When the status of the subtask is successful execution, the following step S207 is executed, and when the status of the subtask is execution failed, the following step S208 is executed.
  • Step S207 Determine whether the current subtask is the last subtask included in the synchronization task.
  • the subtask identifier can be set for each subtask. In this step, it is determined whether the task identifier of the current subtask is the same as the task identifier of the last subtask. If they are the same, the current subtask is the last subtask included in the synchronization task. Task.
  • step S209 is executed, and if the current subtask is not the last subtask included in the synchronization task, return to step S205 to start the next subtask.
  • Step S208 Interrupt the synchronization task, output a prompt message indicating that the execution of the subtask has failed, and provide a log viewing control, and display the synchronization log in response to the operation of the log viewing control.
  • the software package management platform provides an interrupt interactive interface on which the log viewing control is set.
  • the software package management platform obtains and displays it in response to the operation of the log viewing control The current synchronization log.
  • a breakpoint resuming control is provided, for example, a list showing synchronization tasks is provided, the list includes multiple synchronization tasks, corresponding to the interrupted synchronization task, a breakpoint resuming control is set
  • the software package management platform will restart the subtask whose execution status is failed in response to the operation of the breakpoint to continue the control.
  • Step S209 Generate configuration information required by the target host to install the software package according to the package name of the software package and the parameters of the target host, and send the configuration information to the operation and maintenance management platform of the target host.
  • the last subtask in the synchronization task is executed successfully, indicating that the software package has been synchronized to the server of the target host.
  • the configuration information is sent to the operation and maintenance management platform of the target host, and the operation and maintenance management platform is used for Install the software package on the server of the target host to the target host according to the configuration information.
  • Step S210 Output a prompt message indicating that the verification failed.
  • this step is executed when the verification fails, so that the user can deal with it in time.
  • the process of synchronizing the software package is implemented based on the task, and the subtasks are set for each synchronization step, and the execution result can be formed during the execution of each subtask.
  • the subtask is executed successfully, the next subtask is started, and the synchronization task is finally completed.
  • the subtask execution fails, the user can query the synchronization log, and can continue to do interrupted synchronization tasks. .
  • the third embodiment of the present application provides a method for preferably installing a software package to a target host.
  • Some steps of the method for installing a software package to the target host correspond to the steps in the above-mentioned embodiment. This part of the steps are described in this embodiment. It will not be repeated, and for details, please refer to the above-mentioned embodiment.
  • the installation surround PRM (Red Hat Package Manager) package is a schematic diagram of installing the software package to the target host provided in the third embodiment of the application.
  • the method of installing the software package to the target host provided in the third embodiment includes the following A step of:
  • the software package management platform After the user uploads the prepared RPM package to the software package management platform, the software package management platform receives the RPM package and the parameters of the target host. The platform verifies the RPM package according to the set rules, and uploads it after it passes, otherwise uploads fail. At the same time, the platform calculates the MD5 value of the RPM package, and records the package name, host type, system version, MD5 value, version information, release, rpm package description, etc. of the RPM package in the database.
  • the software package management platform provides a synchronization button. The user clicks the synchronization button.
  • the software package management platform uses the rsync algorithm to synchronize the RPM packages in parallel to the configured public cloud, private cloud, and internal cloud and other YUM servers (Yellow dog Updater Modified).
  • the software package management platform when it is synchronized from the software package management platform to the YUM server in the cloud, or from the YUM server in the cloud to the YUM server in the availability zone, the software package management platform will call the script execution function to execute the preset Script to compare the MD5 value of the RPM package. If it is consistent with the initial MD5 value of the RPM package, it will be synchronized, otherwise an alarm notification will be issued.
  • the execution process and execution results of the script execution function are written into the synchronization log.
  • the user can view the synchronization log in real time to understand the real-time dynamics of the RPM package. If there is an error in the synchronization link, the user can use the real-time log Immediately locate the error message and solve it, and if there is a failure during the synchronization process, support the user to continue with the breakpoint. Specifically, if there is a failed task, the software package management platform will obtain from the database at which step the task failed, and continue to execute the task according to the user's instruction.
  • the method of installing the software package to the target host is adopted to provide a unified web interface entry, which can carry out the life cycle management of the RPM package; when uploading the RPM package, the verification mechanism of the RPM package is added, and uploading is prohibited if it does not meet the specifications ;
  • the MD5 value of the RPM package file will be verified, and if it is consistent with the initial MD5 value of the file, it will be synchronized, otherwise it will not be synchronized and an alarm notification will be issued. It can support batch synchronization of multiple RPM packages, saving a lot of time.
  • the synchronization log of the RPM package can be displayed in real time, and the synchronization progress of the RPM package can be viewed. The log can easily locate the problems that occurred during the synchronization process, and the system supports the breakpoint resume function.
  • FIG. 4 is a block diagram of installing the software package to the target host device according to the fourth embodiment of the application. As shown in FIG. 4, the device includes: a receiving module 401, a verification module 402, a determining module 403, a processing module 404, and a synchronization module 405 And sending module 406.
  • the receiving module 401 is used to receive the software package to be synchronized and the parameters of the target host; the verification module 402 is used to verify the software package according to the preset verification rules; the determining module 403 is used to, when the verification passes, The synchronization path is determined according to the parameters of the target host, where the synchronization path is the path from the software package management platform to the server of the target host; the processing module 404 is used to generate the target host installation software package according to the package name of the software package and the parameters of the target host.
  • the synchronization module 405 is used to synchronize the software package to the server of the target host via the synchronization path; the sending module 406 is used to send the configuration information to the operation and maintenance management platform of the target host, wherein the operation and maintenance management platform is used to configure The information installs the software package on the server of the target host to the target host.
  • the synchronization module 405 performs at least two synchronization steps when synchronizing the software package to the server of the target host via the synchronization path.
  • the synchronization step is used to synchronize the software package from the upstream device to the neighboring server.
  • the synchronization step includes: calling a script execution function to execute a preset script on the upstream device, wherein when the preset script is executed, the software package on the upstream device is synchronized to the downstream device.
  • the synchronization step further includes: acquiring process information and execution results of the script execution function executing the preset script; and writing the process information and execution results into the synchronization log.
  • the synchronization module 405 includes a synchronization task establishment unit, a subtask start unit, a status marking unit, a synchronization task interrupt unit, an output unit, and a display unit, wherein the synchronization task establishment unit is used to establish synchronization Tasks, where the synchronization task includes subtasks that correspond to the synchronization steps one-to-one and are set in sequence.
  • the subtask start unit is used to start a subtask; the status marking unit is used to execute according to The result marks the status of the subtask; the synchronization task interrupt unit is used to interrupt the synchronization task when the status of the subtask is execution failure; the subtask start unit is also used to start the next subtask when the status of the subtask is execution success;
  • the output unit is used for outputting the prompt information of the execution failure of the subtask and provides a log viewing control; the display unit is used for displaying the synchronization log in response to the operation of the log viewing control.
  • the synchronization module 405 is further configured to provide a breakpoint resuming control for the interrupted synchronization task, and in response to the operation of the breakpoint resuming control, the restart state is the child whose execution failed. Task.
  • the synchronization module 405 is further configured to calculate the digital fingerprint of the software package to obtain the original fingerprint when the verification is passed, and calculate the digital fingerprint of the software package of the upstream device when the preset script is executed. , Get the verification fingerprint, and when the verification fingerprint is consistent with the original fingerprint, synchronize the software package of the upstream device to the downstream device.
  • the specific steps performed include: verifying whether the package name of the software package conforms to the preset package name Specification; judge whether the environmental information contained in the package name of the software package is the same as the environmental information of the target host; judge whether the host type contained in the package name of the software package is the same as the host type of the target host; and/or judge the software package Whether the system version information contained in the package name meets the preset system version requirements.
  • This embodiment also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a cabinet server (including independent servers, or A server cluster composed of multiple servers), etc.
  • the computer device 01 of this embodiment at least includes but is not limited to: a memory 011 and a processor 012 that can be communicably connected to each other through a system bus, as shown in FIG. It should be pointed out that FIG. 5 only shows the computer device 01 having the component memory 011 and the processor 012, but it should be understood that it is not required to implement all the illustrated components, and more or less may be implemented instead. Components.
  • the memory 011 (readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), Read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disks, optical disks, etc.
  • the memory 011 may be an internal storage unit of the computer device 01, such as a hard disk or a memory of the computer device 01.
  • the memory 011 may also be an external storage device of the computer device 01, such as a plug-in hard disk equipped on the computer device 01, and a smart memory card (Smart Media Card, SMC), Secure Digital (Secure Digital, SD) card, flash memory card (Flash Card) and so on.
  • the memory 011 may also include both an internal storage unit of the computer device 01 and an external storage device thereof.
  • the memory 011 is generally used to store the operating system and various application software installed in the computer device 01, such as the program code of the device for installing the software package to the target host in the fourth embodiment.
  • the memory 011 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 012 may be a central processing unit (Central Processing Unit) in some embodiments. Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip.
  • the processor 012 is generally used to control the overall operation of the computer device 01.
  • the processor 012 is configured to run program codes or process data stored in the memory 011, such as a method of installing a software package to a target host.
  • This embodiment also provides a computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), only Readable memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, server, App application mall, etc.
  • the computer-readable storage medium can be It is volatile or non-volatile, with computer instructions stored thereon, and the computer instructions implement corresponding functions when executed by the processor.
  • the computer-readable storage medium of this embodiment is used to store an installation software package to a target host, and when executed by a processor, the method for installing a software package to the target host in the first embodiment is implemented.

Abstract

A method and apparatus for installing a software package to a target host, and a computer device. An execution main body of the method is a software package management platform. The method comprises: receiving a software package to be synchronized and parameters of a target host (S101); verifying the software package in accordance with a preset verification rule (S102); when the verification is passed, determining a synchronization path according to the parameters of the target host (S103), wherein the synchronization path is a path from the software package management platform to a server of the target host; generating, according to a package name of the software package and the parameters of the target host, configuration information required for installing the software package by the target host (S104); synchronizing the software package to the server of the target host via the synchronization path (S105); and sending the configuration information to an operation and maintenance management platform of the target host (S106), wherein the operation and maintenance management platform is used for installing the software package on the server of the target host to the target host according to the configuration information. The method can improve the efficiency of installing the software package to the target host.

Description

安装软件包至目标主机的方法、装置和计算机设备Method, device and computer equipment for installing software package to target host
相关申请的交叉引用Cross-references to related applications
本申请要求于2020年2月25日提交中国专利局、申请号为CN 202010116137.9,发明名称为“安装软件包至目标主机的方法、装置和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on February 25, 2020, the application number is CN 202010116137.9, and the invention title is "Method, Apparatus and Computer Equipment for Installing Software Package to Target Host", and its entire contents Incorporated in this application by reference.
技术领域Technical field
本申请涉及软件包安装的技术领域和区块链技术领域,尤其涉及一种安装软件包至目标主机的方法、装置和计算机设备。This application relates to the technical field of software package installation and the field of blockchain technology, and in particular to a method, device and computer equipment for installing a software package to a target host.
背景技术Background technique
传统软件安装或软件升级时,开发人员打包制作软件包后,需要部署人员手动将软件包上传到目标主机并安装,但随着云计算和分布式的兴起,以及企业安全意识的提高,办公网与目标主机之间往往设置有网络安全隔离以及云服务器等若干中间设备,且安装包需要同步到多个目标主机,发明人发现,这时,再采用传统的方式上传安装包,就需要人工手动逐步依次同步到每个中间设备,最终同步到多个目标主机,期间需要部署人员做大量重复的工作,耗费大量时间和人力,且效率低。In traditional software installation or software upgrade, after the developer has packaged and produced the software package, the deployer needs to manually upload the software package to the target host and install it. However, with the rise of cloud computing and distributed, and the improvement of corporate security awareness, Several intermediate devices such as network security isolation and cloud servers are often set up with the target host, and the installation package needs to be synchronized to multiple target hosts. The inventor found that at this time, uploading the installation package in the traditional way requires manual manual Synchronize to each intermediate device step by step, and finally to multiple target hosts. During this period, deployment personnel are required to do a lot of repetitive work, which consumes a lot of time and manpower, and is inefficient.
因此,提供一种安装软件包至目标主机的方法、装置和计算机设备,实现软件包的自动同步和安装,以快速有效的将软件包同步至目标主机并实现安装,成为本领域亟需解决的技术问题。Therefore, to provide a method, device and computer equipment for installing a software package to a target host to realize automatic synchronization and installation of the software package, so as to quickly and effectively synchronize the software package to the target host and realize the installation, which has become an urgent need in this field. technical problem.
发明内容Summary of the invention
本申请的目的是提供一种安装软件包至目标主机的方法、装置和计算机设备,用于解决现有技术中将软件包同步至目标主机时效率低的技术问题。The purpose of this application is to provide a method, device and computer equipment for installing a software package to a target host, which are used to solve the technical problem of low efficiency when synchronizing the software package to the target host in the prior art.
一方面,为实现上述目的,本申请提供了一种安装软件包至目标主机的方法。On the one hand, in order to achieve the above objective, this application provides a method for installing a software package to a target host.
该安装软件包至目标主机的方法的执行主体为软件包管理平台,该方法包括:接收待同步的软件包和目标主机的参数;对软件包按照预设的校验规则进行校验;当校验通过时,根据目标主机的参数确定同步路径,其中,同步路径为由软件包管理平台到达目标主机的服务器的路径;根据软件包的包名和目标主机的参数生成目标主机安装软件包所需的配置信息;将软件包经由同步路径同步至目标主机的服务器;将配置信息发送至目标主机的运维管理平台,其中,运维管理平台用于根据配置信息将目标主机的服务器上的软件包安装至目标主机。The execution body of the method for installing a software package to a target host is a software package management platform, and the method includes: receiving the software package to be synchronized and the parameters of the target host; verifying the software package according to a preset verification rule; When the verification is passed, the synchronization path is determined according to the parameters of the target host, where the synchronization path is the path from the software package management platform to the server of the target host; according to the package name of the software package and the parameters of the target host, the required installation software package of the target host is generated Configuration information; synchronize the software package to the server of the target host via the synchronization path; send the configuration information to the operation and maintenance management platform of the target host, where the operation and maintenance management platform is used to install the software package on the server of the target host according to the configuration information To the target host.
又一方面,为实现上述目的,本申请还提供一种计算机设备,该计算机设备包括:存储器、处理器以及存储在存储器上并可在处理器上运行的计算机可读指令,其中,处理器执行程序时实现以下步骤:接收待同步的软件包和目标主机的参数;对软件包按照预设的校验规则进行校验;当校验通过时,根据目标主机的参数确定同步路径,其中,同步路径为由软件包管理平台到达目标主机的服务器的路径;根据软件包的包名和目标主机的参数生成目标主机安装软件包所需的配置信息;将软件包经由同步路径同步至目标主机的服务器;将配置信息发送至目标主机的运维管理平台,其中,运维管理平台用于根据配置信息将目标主机的服务器上的软件包安装至目标主机。In another aspect, in order to achieve the above object, the present application also provides a computer device, the computer device including: a memory, a processor, and computer readable instructions stored in the memory and running on the processor, wherein the processor executes The program implements the following steps: receiving the software package to be synchronized and the parameters of the target host; verifying the software package according to the preset verification rules; when the verification passes, the synchronization path is determined according to the parameters of the target host, where the synchronization The path is the path from the software package management platform to the server of the target host; the configuration information required by the target host to install the software package is generated according to the package name of the software package and the parameters of the target host; the software package is synchronized to the server of the target host via the synchronization path; The configuration information is sent to the operation and maintenance management platform of the target host, where the operation and maintenance management platform is used to install the software package on the server of the target host to the target host according to the configuration information.
又一方面,为实现上述目的,本申请还提供计算机可读存储介质,其上存储有计算机可读指令,其中,计算机可读指令被处理器执行时实现以下步骤:接收待同步的软件包和目标主机的参数;对软件包按照预设的校验规则进行校验;当校验通过时,根据目标主机的参数确定同步路径,其中,同步路径为由软件包管理平台到达目标主机的服务器的路径;根据软件包的包名和目标主机的参数生成目标主机安装软件包所需的配置信息;将软件包经由同步路径同步至目标主机的服务器;将配置信息发送至目标主机的运维管理平台,其中,运维管理平台用于根据配置信息将目标主机的服务器上的软件包安装至目标主机。In another aspect, in order to achieve the above object, the present application also provides a computer-readable storage medium on which computer-readable instructions are stored. When the computer-readable instructions are executed by the processor, the following steps are implemented: receiving the software package to be synchronized and The parameters of the target host; the software package is verified according to the preset verification rules; when the verification passes, the synchronization path is determined according to the parameters of the target host, where the synchronization path is the path from the software package management platform to the server of the target host Path; generate the configuration information required by the target host to install the software package according to the package name of the software package and the parameters of the target host; synchronize the software package to the server of the target host via the synchronization path; send the configuration information to the operation and maintenance management platform of the target host, The operation and maintenance management platform is used to install the software package on the server of the target host to the target host according to the configuration information.
又一方面,为实现上述目的,本申请提供了一种安装软件包至目标主机的装置。In another aspect, in order to achieve the above objective, the present application provides an apparatus for installing a software package to a target host.
该安装软件包至目标主机的装置设置于软件包管理平台,该装置包括:接收模块,用于接收待同步的软件包和目标主机的参数;校验模块,用于对软件包按照预设的校验规则进行校验;确定模块,用于当校验通过时,根据目标主机的参数确定同步路径,其中,同步路径为由软件包管理平台到达目标主机的服务器的路径;处理模块,用于根据软件包的包名和目标主机的参数生成目标主机安装软件包所需的配置信息;同步模块,用于将软件包经由同步路径同步至目标主机的服务器;发送模块,用于将配置信息发送至目标主机的运维管理平台,其中,运维管理平台用于根据配置信息将目标主机的服务器上的软件包安装至目标主机。The device for installing the software package to the target host is set on the software package management platform, and the device includes: a receiving module for receiving the software package to be synchronized and the parameters of the target host; The verification rules are verified; the determining module is used to determine the synchronization path according to the parameters of the target host when the verification is passed, where the synchronization path is the path from the software package management platform to the server of the target host; the processing module is used to According to the package name of the software package and the parameters of the target host, the configuration information required by the target host to install the software package is generated; the synchronization module is used to synchronize the software package to the server of the target host via the synchronization path; the sending module is used to send the configuration information to The operation and maintenance management platform of the target host, wherein the operation and maintenance management platform is used to install the software package on the server of the target host to the target host according to the configuration information.
本申请提供的安装软件包至目标主机的方法、装置和计算机设备,提供统一的软件包接收界面入口,接收用户上传的软件包和目标主机的参数,对用户上传的软件包进行自动校验,保证软件包的合法性,在校验通过时,一方面,确定出软件包到达目标主机的服务器的同步路径,从而将软件包经由该同步路径同步至目标主机的服务器;另一方面,生成目标主机安装软件包所需的一些配置信息,并将这些配置信息发送至目标主机的运维管理平台,使得运维管理平台能够根据配置信息将目标主机的服务器上的软件包安装至目标主机,从而对于用户来说,用户只需要将软件包上传至软件包管理平台,软件包管理平台即会自动将软件包安装到相应的主机,操作简单,解放了人力,节省了大量时间。进一步,同步过程中,在每一个同步步骤中对比软件包文件的数字指纹,一致才进行同步,用户通过软件包管理平台提供的实时同步日志可快速了解软件包的状态,进而可轻松定位安装过程中发生的问题。The method, device and computer equipment for installing a software package to a target host provided in this application provide a unified software package receiving interface entry, receive the software package uploaded by the user and the parameters of the target host, and automatically verify the software package uploaded by the user. To ensure the legitimacy of the software package, when the verification is passed, on the one hand, the synchronization path of the software package to the server of the target host is determined, so that the software package is synchronized to the server of the target host via the synchronization path; on the other hand, the target is generated The host installs some configuration information required by the software package, and sends the configuration information to the operation and maintenance management platform of the target host, so that the operation and maintenance management platform can install the software package on the server of the target host to the target host according to the configuration information, thereby For users, users only need to upload the software package to the software package management platform, and the software package management platform will automatically install the software package to the corresponding host. The operation is simple, manpower is liberated, and a lot of time is saved. Furthermore, during the synchronization process, the digital fingerprints of the software package files are compared in each synchronization step, and synchronization is performed only when they are consistent. The user can quickly understand the status of the software package through the real-time synchronization log provided by the software package management platform, and then easily locate the installation process The problem occurred in.
附图说明Description of the drawings
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:By reading the detailed description of the preferred embodiments below, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only used for the purpose of illustrating the preferred embodiments, and are not considered as a limitation to the application. Also, throughout the drawings, the same reference symbols are used to denote the same components. In the attached picture:
图1为本申请实施例一提供的安装软件包至目标主机的方法的流程图;FIG. 1 is a flowchart of a method for installing a software package to a target host according to Embodiment 1 of the application;
图2为本申请实施例二提供的安装软件包至目标主机的方法的流程图;2 is a flowchart of a method for installing a software package to a target host according to Embodiment 2 of the application;
图3为本申请实施例三提供的安装软件包至目标主机的示意图;FIG. 3 is a schematic diagram of installing the software package to the target host provided by the third embodiment of the application; FIG.
图4为本申请实施例四提供的安装软件包至目标主机装置的框图;FIG. 4 is a block diagram of installing the software package to the target host device according to the fourth embodiment of the application;
图5为本申请实施例五提供的计算机设备的硬件结构图。FIG. 5 is a hardware structure diagram of a computer device provided in Embodiment 5 of this application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions, and advantages of this application clearer and clearer, the following further describes the application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the application, and are not used to limit the application. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
本申请提供了一种安装软件包至目标主机的方法、装置、计算机设备和计算机可读存储介质,在本申请中,基于一种软件包管理平台实现安装软件包至目标主机的方法,具体地,软件包管理平台提供统一的软件包接收入口,以接收用户上传的待同步的软件包以及目标主机的相关参数等,对软件包按照预设的校验规则进行校验,保证待同步的软件包合法合规,对于校验通过的软件包,一方面,根据目标主机的参数确定同步路径,也即确定由软件包管理平台到达目标主机的服务器的路径,然后将软件包经由同步路径同步至目标主机的服务器,另一方面,根据软件包的包名和目标主机的参数生成目标主机安装软件包所需的配置信息,然后将配置信息发送至目标主机的运维管理平台,使得运维管理平台能够根据配置信息将目标主机的服务器上的软件包安装至目标主机,实现软件包的自动同步和安装,从而能够快速有效的将软件包同步至目标主机并实现安装。This application provides a method, device, computer equipment, and computer-readable storage medium for installing a software package to a target host. In this application, a method for installing a software package to a target host is implemented based on a software package management platform, specifically , The software package management platform provides a unified software package receiving entrance to receive the software package to be synchronized and related parameters of the target host uploaded by the user, and verify the software package according to the preset verification rules to ensure the software to be synchronized The package is legal and compliant. For software packages that pass the verification, on the one hand, the synchronization path is determined according to the parameters of the target host, that is, the path from the software package management platform to the server of the target host is determined, and then the software package is synchronized to the target host through the synchronization path. The server of the target host, on the other hand, generates the configuration information required by the target host to install the software package according to the package name of the software package and the parameters of the target host, and then sends the configuration information to the operation and maintenance management platform of the target host to make the operation and maintenance management platform The software package on the server of the target host can be installed to the target host according to the configuration information to realize automatic synchronization and installation of the software package, so that the software package can be synchronized to the target host and installed quickly and effectively.
关于本申请提供的安装软件包至目标主机的方法、装置、计算机设备和计算机可读存储介质的具体实施例,将在下文中进行详细的描述。Specific embodiments of the method, apparatus, computer equipment, and computer-readable storage medium for installing a software package to a target host provided by this application will be described in detail below.
实施例一Example one
本申请实施例提供了一种安装软件包至目标主机的方法,该方法的执行主体为软件包管理平台,该软件包管理平台位于办公网,与目标主机之间设置有网络安全隔离以及云服务器等若干中间设备,例如若干堡垒机、跳板机、公有云服务器、专有云服务器和/或内部云服务器等。通过该方法,软件包管理平台向用户提供的统一的软件包接收入口,用户只需上传待同步的软件包以及选定和/或输入目标主机的参数,软件包管理平台即可自动完成软件包的同步和安装。本申请中的待同步的软件包可以存储在区块链中。具体地,图1为本申请实施例一提供的安装软件包至目标主机的方法的流程图,如图1所示,该实施例提供的安装软件包至目标主机的方法包括如下的步骤S101至步骤S106。The embodiment of the present application provides a method for installing a software package to a target host. The execution subject of the method is a software package management platform. The software package management platform is located on an office network and is provided with network security isolation and cloud servers between the target host and the office network. Several intermediate devices, such as bastion machines, springboards, public cloud servers, proprietary cloud servers, and/or internal cloud servers, etc. Through this method, the software package management platform provides the user with a unified software package receiving entrance. The user only needs to upload the software package to be synchronized and the parameters of the selected and/or input target host, and the software package management platform can automatically complete the software package. Synchronization and installation. The software package to be synchronized in this application can be stored in the blockchain. Specifically, FIG. 1 is a flowchart of a method for installing a software package to a target host provided in Embodiment 1 of the application. As shown in FIG. 1, the method for installing a software package to a target host provided in this embodiment includes the following steps S101 to Step S106.
步骤S101:接收待同步的软件包和目标主机的参数。Step S101: Receive the software package to be synchronized and the parameters of the target host.
可选地,软件包管理平台包括与用户交互的前端和进行数据处理的后端。前端提供一交互界面,交互界面上设置接收用户上传的待同步的软件包的入口以及目标主机的参数选择和/或输入窗口,用户能够通过该交互界面,将待同步的软件包和目标主机的参数提交至软件包管理平台。Optionally, the software package management platform includes a front end for interacting with users and a back end for data processing. The front-end provides an interactive interface. On the interactive interface, an entry to receive the software package to be synchronized uploaded by the user and the parameter selection and/or input window of the target host are set. The parameters are submitted to the software package management platform.
步骤S102:对软件包按照预设的校验规则进行校验。Step S102: The software package is verified according to a preset verification rule.
软件包管理平台预置校验规则,以对用户上传的软件包进行校验,当校验通过时,软件包上传成功,执行下述步骤S103,当校验不通过时,软件包上传失败,同时可通过前端输出提示上传失败的相关信息。The software package management platform presets verification rules to verify the software package uploaded by the user. When the verification passes, the software package upload is successful, and the following step S103 is executed. When the verification fails, the software package upload fails. At the same time, the front-end output can prompt the relevant information of the upload failure.
可选地,对软件包按照预设的校验规则进行校验时,可包括以下步骤中的至少之一:Optionally, when the software package is verified according to a preset verification rule, at least one of the following steps may be included:
1、校验软件包的包名是否符合预设的包名规范。1. Check whether the package name of the software package conforms to the preset package name specification.
例如,包名规范可包括:包名的信息项、每项信息的数据格式或结构等要求,在该步骤中,按照包名规范对待上传的软件包的包名进行比对,以校验软件包的包名是否符合预设的包名规范。For example, the package name specification may include: the information items of the package name, the data format or structure of each item of information, etc. In this step, the package name of the software package to be uploaded is compared according to the package name specification to verify the software Whether the package name of the package complies with the preset package name specification.
2、判断软件包的包名中所包含的环境信息与目标主机的环境信息是否相同。2. Determine whether the environmental information contained in the package name of the software package is the same as the environmental information of the target host.
包名中包含的环境信息具体可以为标识测试环境的信息或标识生产环境的信息,软件包管理平台预置目标主机的参数与环境信息的对应关系,通过接收到的目标主机的参数可确定出目标主机的环境信息。在该步骤中,解析包名中的环境信息,再根据目标主机的参数获取目标主机的环境信息,并将二者进行比对,若均为标识测试环境的信息或均为标识生产环境的信息时,则为软件包的包名中所包含的环境信息与目标主机的环境信息相同。The environmental information contained in the package name can specifically be the information identifying the test environment or the information identifying the production environment. The software package management platform presets the corresponding relationship between the parameters of the target host and the environmental information, which can be determined by the received parameters of the target host Environmental information of the target host. In this step, the environment information in the package name is parsed, and then the environment information of the target host is obtained according to the parameters of the target host, and the two are compared. If both are information identifying the test environment or both are information identifying the production environment , The environment information contained in the package name of the software package is the same as the environment information of the target host.
3、判断述软件包的包名中所包含的主机类型与目标主机的主机类型是否相同。3. Determine whether the host type contained in the package name of the software package is the same as the host type of the target host.
包名中包含的主机类型具体可以为标识不同种主机类型的信息,软件包管理平台预置目标主机的参数与目标主机的主机类型的对应关系,在该步骤中,解析包名中的主机类型,再根据目标主机的参数获取目标主机的主机类型,并将二者进行比对,若为同一种主机类型,则为软件包的包名中所包含的主机类型与目标主机的主机类型相同。The host type contained in the package name can specifically be information identifying different host types. The software package management platform presets the corresponding relationship between the parameters of the target host and the host type of the target host. In this step, the host type in the package name is resolved. , And then obtain the host type of the target host according to the parameters of the target host, and compare the two. If they are the same host type, the host type contained in the package name of the software package is the same as the host type of the target host.
4、判断软件包的包名中所包含的系统版本信息是否满足预设的系统版本要求。4. Determine whether the system version information contained in the package name of the software package meets the preset system version requirements.
包名中包含系统版本信息,标识安装包版本的高低,软件包管理平台预置目标主机的参数与系统版要求的对应关系,在该步骤中,解析包名中的系统版本信息,按照目标主机的参数确定系统版本要求,再使用系统版本要求与待上传的软件包的包名进行比对,以校验软件包包名中包含的系统版本信息是否符合系统版本要求。The package name contains the system version information, which identifies the installation package version. The software package management platform presets the corresponding relationship between the parameters of the target host and the system version requirements. In this step, the system version information in the package name is parsed according to the target host The parameters of to determine the system version requirements, and then use the system version requirements to compare with the package name of the software package to be uploaded to verify whether the system version information contained in the software package package name meets the system version requirements.
其中,对软件包进行校验时,若包括多个校验项,则当所有校验项均通过时,表征对软件包的校验成功,当任一校验项没有通过时,表征对软件包的校验失败。Among them, when verifying the software package, if multiple verification items are included, when all the verification items pass, it means that the verification of the software package is successful, and when any verification item fails, it means that the software is verified successfully. The package verification failed.
步骤S103:当校验通过时,根据目标主机的参数确定同步路径。Step S103: When the verification is passed, the synchronization path is determined according to the parameters of the target host.
其中,同步路径为由软件包管理平台到达目标主机的服务器的路径。可选地,软件包管理平台预置至多个目标主机的服务器的路径,其中,目标主机接收到目标主机的服务器下发的安装包获取指令后,目标主机向该服务器获取安装包。软件包管理平台预置至多个目标主机的服务器的路径可通过网状或树状结构体现节点关系,其中,在网状或树状结构中,以目标主机的参数体现节点关系,具体地,目标主机的参数包括主机名称等信息。根据目标主机的参数,在网状或树状结构中匹配到对应的节点,即可确定出同步路径。Among them, the synchronization path is the path from the software package management platform to the server of the target host. Optionally, the software package management platform presets paths to the servers of multiple target hosts. After the target host receives the installation package acquisition instruction issued by the server of the target host, the target host obtains the installation package from the server. The path preset by the software package management platform to the servers of multiple target hosts can reflect the node relationship through a mesh or tree structure. In the mesh or tree structure, the parameters of the target host reflect the node relationship. Specifically, the target The parameters of the host include information such as the host name. According to the parameters of the target host, the synchronization path can be determined by matching the corresponding node in the mesh or tree structure.
步骤S104:根据软件包的包名和目标主机的参数生成目标主机安装软件包所需的配置信息。Step S104: Generate configuration information required by the target host to install the software package according to the package name of the software package and the parameters of the target host.
具体地,可将安装软件包所需的配置信息一部分定义在软件包的包名中,一部分作为需要用户选定的目标主机的参数,从而根据软件包的包名和目标主机的参数生成目标主机即可得到安装软件包所需的配置信息;或者,可在软件包管理平台存储安装软件包所需的配置参数与软件包的包名、以及与目标主机的参数的对应关系,从而根据软件包的包名和目标主机的参数在该对应关系中能够查找出相匹配的配置信息。Specifically, part of the configuration information required to install the software package can be defined in the package name of the software package, and part of it can be used as the parameters of the target host selected by the user, so that the target host is generated according to the package name of the software package and the parameters of the target host. The configuration information required to install the software package can be obtained; alternatively, the corresponding relationship between the configuration parameters required to install the software package, the package name of the software package, and the parameters of the target host can be stored on the software package management platform, thereby The package name and the parameters of the target host can find matching configuration information in the corresponding relationship.
步骤S105:将软件包经由同步路径同步至目标主机的服务器。Step S105: Synchronize the software package to the server of the target host via the synchronization path.
其中,同步路径可包括多个节点,软件包管理平台为同步路径的起始节点,目标主机的服务器为同步路径的终了节点,软件包管理平台与目标主机的服务器之间的中间设备为同步路径的中间节点,该中间设备至少为一个,则经由同步路径同步至目标主机的服务器的过程包括至少两个同步步骤,每个同步步骤用于将软件包由上游设备同步至相邻的下游设备,其中,起始节点仅为上游设备,终了节点仅为下游设备,中间节点可以为上游设备也可以为下游设备。Among them, the synchronization path may include multiple nodes, the software package management platform is the start node of the synchronization path, the server of the target host is the end node of the synchronization path, and the intermediate device between the software package management platform and the server of the target host is the synchronization path If there is at least one intermediate device, the process of synchronizing to the server of the target host via the synchronization path includes at least two synchronization steps. Each synchronization step is used to synchronize the software package from the upstream device to the adjacent downstream device, Among them, the start node is only an upstream device, the end node is only a downstream device, and the intermediate node can be an upstream device or a downstream device.
同步路径上可以作为上游设备的每个节点上,均预置将本地软件包同步至相邻下游设备的预置脚本,每个同步步骤具体包括:软件包管理平台调用脚本执行函数执行上游设备上的预置脚本,从而该预置脚本被执行时,将上游设备本地的软件包同步至下游设备。执行同步路径包括的所有同步步骤,即完成该步骤S105。Each node on the synchronization path that can be used as an upstream device is preset with a preset script that synchronizes the local software package to the adjacent downstream device. Each synchronization step specifically includes: the software package management platform calls the script execution function to execute on the upstream device When the preset script is executed, the local software package of the upstream device is synchronized to the downstream device. All the synchronization steps included in the synchronization path are executed to complete the step S105.
进一步地,同步步骤还包括:获取脚本执行函数执行预置脚本的过程信息和执行结果,然后将过程信息和执行结果写入同步日志,其中,执行每个同步步骤时,均实时将过程信息和执行结果写入同步日志,从而在同步过程中,用户可实时查看同步日志,了解安装包的实时动态,若同步环节中出现错误,用户可通过实时的同步日志马上定位到错误信息并解决。Further, the synchronization step further includes: obtaining process information and execution results of the script execution function executing the preset script, and then writing the process information and execution results into the synchronization log, where each synchronization step is executed in real time. The execution result is written into the synchronization log, so that during the synchronization process, the user can view the synchronization log in real time to understand the real-time dynamics of the installation package. If an error occurs in the synchronization link, the user can locate the error message and solve it immediately through the real-time synchronization log.
可选地,当校验通过时,该方法还包括如下的步骤:计算软件包的数字指纹,得到原始指纹。对应的,预置脚本被执行时,针对上游设备中将要向下游设备同步的软件包,计算该软件包的数字指纹,得到校验指纹,然后比对校验指纹与数字指纹是否一致,并在校验指纹和原始指纹一致时,再将上游设备的软件包同步至下游设备,如果不一致,则输出提示指纹不一致的信息,中断同步。具体地,数字指纹可以为MD5值,或者也可以为其他数字指纹,本申请对此并不进行限定。通过对竖直指纹的校验,能够提升同步过程中的安全性。Optionally, when the verification is passed, the method further includes the following steps: calculating the digital fingerprint of the software package to obtain the original fingerprint. Correspondingly, when the preset script is executed, for the software package in the upstream device that will be synchronized with the downstream device, calculate the digital fingerprint of the software package to obtain the verification fingerprint, and then compare whether the verification fingerprint is consistent with the digital fingerprint, and When the verification fingerprint is consistent with the original fingerprint, the software package of the upstream device is synchronized to the downstream device. If they are inconsistent, a message indicating that the fingerprint is inconsistent will be output and synchronization will be interrupted. Specifically, the digital fingerprint may be an MD5 value, or may also be other digital fingerprints, which is not limited in this application. Through the verification of the vertical fingerprint, the security in the synchronization process can be improved.
步骤S106:将配置信息发送至目标主机的运维管理平台。Step S106: Send the configuration information to the operation and maintenance management platform of the target host.
其中,运维管理平台与软件包管理平台同处于办公网,软件包管理平台可对目标主机进行控制,但不可向目标主机传输安装包,运维管理平台根据配置信息向目标主机的服务器下发安装软件包的命令,服务器再向目标主机发送获取软件包的命令,目标主机向服务器获取软件包进行安装,实现了将软件包安装至目标主机。Among them, the operation and maintenance management platform and the software package management platform are on the same office network. The software package management platform can control the target host, but cannot transmit the installation package to the target host. The operation and maintenance management platform delivers to the server of the target host according to the configuration information. For the command to install the software package, the server then sends the command to obtain the software package to the target host, and the target host obtains the software package from the server for installation, thus realizing the installation of the software package to the target host.
采用该实施例提供的安装软件包至目标主机的方法,提供统一的软件包接收界面入口,接收用户上传的软件包和目标主机的参数,对用户上传的软件包进行自动校验,保证软件包的合法性,在校验通过时,一方面,确定出软件包到达目标主机的服务器的同步路径,从而将软件包经由该同步路径同步至目标主机的服务器;另一方面,生成目标主机安装软件包所需的一些配置信息,并将这些配置信息发送至目标主机的运维管理平台,使得运维管理平台能够根据配置信息将目标主机的服务器上的软件包安装至目标主机,从而对于用户来说,用户只需要将软件包上传至软件包管理平台,软件包管理平台即会自动将软件包安装到相应的主机,操作简单,解放了人力,节省了大量时间。进一步,同步过程中,在每一个同步步骤中对比软件包文件的数字指纹,一致才进行同步,用户通过软件包管理平台提供的实时同步日志可快速了解软件包的状态,进而可轻松定位安装过程中发生的问题。Using the method of installing software packages to the target host provided in this embodiment, a unified software package receiving interface entry is provided, the software package uploaded by the user and the parameters of the target host are received, and the software package uploaded by the user is automatically verified to ensure the software package When the verification is passed, on the one hand, the synchronization path of the software package to the server of the target host is determined, so that the software package is synchronized to the server of the target host through the synchronization path; on the other hand, the target host is generated to install the software Package and send the configuration information to the operation and maintenance management platform of the target host, so that the operation and maintenance management platform can install the software package on the server of the target host to the target host according to the configuration information. In other words, users only need to upload the software package to the software package management platform, and the software package management platform will automatically install the software package to the corresponding host. The operation is simple, manpower is liberated, and a lot of time is saved. Furthermore, during the synchronization process, the digital fingerprints of the software package files are compared in each synchronization step, and synchronization is performed only when they are consistent. The user can quickly understand the status of the software package through the real-time synchronization log provided by the software package management platform, and then easily locate the installation process The problem occurred in.
实施例二Example two
本申请实施例二提供了一种优选地安装软件包至目标主机的方法,该安装软件包至目标主机的方法的部分步骤与上述实施例一中的步骤对应相同,这部分步骤在该实施例中不再赘述,具体可参考上述实施例一。具体地,图2为本申请实施例二提供的安装软件包至目标主机的方法的流程图,如图2所示,该实施例二提供的安装软件包至目标主机的方法包括如下的步骤S201至步骤S210。The second embodiment of the present application provides a method for preferably installing a software package to a target host. The steps of the method for installing the software package to the target host are the same as those in the above-mentioned embodiment 1, which are described in this embodiment. It will not be repeated here, and for details, please refer to the first embodiment above. Specifically, FIG. 2 is a flowchart of the method for installing a software package to a target host provided in the second embodiment of the application. As shown in FIG. 2, the method for installing a software package to the target host provided in the second embodiment includes the following step S201 Go to step S210.
步骤S201:接收待同步的软件包和目标主机的参数。Step S201: Receive the software package to be synchronized and the parameters of the target host.
步骤S202:对软件包按照预设的校验规则进行校验。Step S202: The software package is verified according to a preset verification rule.
其中,当校验通过时,执行下述步骤S203,当校验不通过时,执行下述步骤S211。Wherein, when the verification is passed, the following step S203 is executed, and when the verification is not passed, the following step S211 is executed.
步骤S203:当校验通过时,根据目标主机的参数确定同步路径。Step S203: When the verification is passed, the synchronization path is determined according to the parameters of the target host.
其中,同步路径为由软件包管理平台到达目标主机的服务器的路径。Among them, the synchronization path is the path from the software package management platform to the server of the target host.
步骤S204:建立同步任务。Step S204: Establish a synchronization task.
其中,针对每次接收到的待同步的软件包,建立一个同步任务。同步任务包括与同步步骤一一对应且按顺序设置的子任务,每启动一个子任务,执行一个同步步骤,顺序启动各个子任务,即可完成同步任务。Among them, for each received software package to be synchronized, a synchronization task is established. The synchronization task includes subtasks that correspond to the synchronization steps one-to-one and are set in sequence. Each time a subtask is started, a synchronization step is executed, and each subtask is started sequentially to complete the synchronization task.
步骤S205:启动一个子任务。Step S205: Start a subtask.
其中,同步任务建立后,启动首个子任务,后续各个子任务均会在一个子任务执行成功后,启动下一个。Among them, after the synchronization task is established, the first subtask is started, and each subsequent subtask will start the next after one subtask is successfully executed.
一个子任务启动后,执行一个同步步骤,也即调用脚本执行函数执行上游设备上的预置脚本,该预置脚本被执行时,将上游设备本地的软件包同步至下游设备,同时获取脚本执行函数执行预置脚本的过程信息和执行结果,然后将过程信息和执行结果写入同步日志,其中,执行结果包括执行成功和执行失败。After a subtask is started, a synchronization step is executed, that is, the script execution function is called to execute the preset script on the upstream device. When the preset script is executed, the local software package of the upstream device is synchronized to the downstream device, and the script execution is obtained at the same time. The function executes the process information and execution result of the preset script, and then writes the process information and execution result into the synchronization log, where the execution result includes execution success and execution failure.
步骤S206:根据执行结果标记子任务的状态。Step S206: Mark the status of the subtask according to the execution result.
当子任务的状态为执行成功时,执行下述步骤S207,当子任务的状态为执行失败时,执行下述步骤S208。When the status of the subtask is successful execution, the following step S207 is executed, and when the status of the subtask is execution failed, the following step S208 is executed.
步骤S207:判断当前子任务是否为同步任务包括的最后一个子任务。Step S207: Determine whether the current subtask is the last subtask included in the synchronization task.
其中,可对各个子任务设置子任务标识,在该步骤中,判断当前子任务的任务标识与最后一个子任务的任务标识是否相同,若相同,则当前子任务为同步任务包括的最后一个子任务。Among them, the subtask identifier can be set for each subtask. In this step, it is determined whether the task identifier of the current subtask is the same as the task identifier of the last subtask. If they are the same, the current subtask is the last subtask included in the synchronization task. Task.
具体地,若当前子任务是同步任务包括的最后一个子任务,执行下述步骤S209,若当前子任务不是同步任务包括的最后一个子任务,返回步骤S205,启动下一个子任务。Specifically, if the current subtask is the last subtask included in the synchronization task, the following step S209 is executed, and if the current subtask is not the last subtask included in the synchronization task, return to step S205 to start the next subtask.
步骤S208:中断同步任务,输出子任务执行失败的提示信息,并提供日志查看控件,响应于对日志查看控件的操作,显示同步日志。Step S208: Interrupt the synchronization task, output a prompt message indicating that the execution of the subtask has failed, and provide a log viewing control, and display the synchronization log in response to the operation of the log viewing control.
若子任务执行失败,则软件包管理平台提供一中断交互界面,在该界面上设置日志查看控件,当用户点击该日志查看控件时,软件包管理平台响应于对日志查看控件的操作,获取并显示当前的同步日志。If the execution of the subtask fails, the software package management platform provides an interrupt interactive interface on which the log viewing control is set. When the user clicks the log viewing control, the software package management platform obtains and displays it in response to the operation of the log viewing control The current synchronization log.
此外,可选地,针对中断的同步任务,提供断点续做控件,例如,提供一个显示同步任务的列表,该列表中包括多个同步任务,对应中断的同步任务,设置断点续做控件,当用户点击该断点续做控件时,软件包管理平台响应于对断点续做控件的操作,重新启动状态为执行失败的子任务。In addition, optionally, for interrupted synchronization tasks, a breakpoint resuming control is provided, for example, a list showing synchronization tasks is provided, the list includes multiple synchronization tasks, corresponding to the interrupted synchronization task, a breakpoint resuming control is set When the user clicks on the breakpoint to continue the control, the software package management platform will restart the subtask whose execution status is failed in response to the operation of the breakpoint to continue the control.
步骤S209:根据软件包的包名和目标主机的参数生成目标主机安装软件包所需的配置信息,将配置信息发送至目标主机的运维管理平台。Step S209: Generate configuration information required by the target host to install the software package according to the package name of the software package and the parameters of the target host, and send the configuration information to the operation and maintenance management platform of the target host.
其中,同步任务中的最后一个子任务执行成功,说明已将软件包同步至目标主机的服务器,则在该步骤中,将配置信息发送至目标主机的运维管理平台,运维管理平台用于根据配置信息将目标主机的服务器上的软件包安装至目标主机。Among them, the last subtask in the synchronization task is executed successfully, indicating that the software package has been synchronized to the server of the target host. In this step, the configuration information is sent to the operation and maintenance management platform of the target host, and the operation and maintenance management platform is used for Install the software package on the server of the target host to the target host according to the configuration information.
步骤S210:输出校验失败的提示信息。Step S210: Output a prompt message indicating that the verification failed.
在对软件包按照预设的校验规则进行校验时,校验不通过时,执行该步骤,以使用户能够及时处理。When the software package is verified according to the preset verification rules, this step is executed when the verification fails, so that the user can deal with it in time.
采用该实施例提供的安装软件包至目标主机的方法,基于任务的方式实现同步软件包的过程,对饮给每个同步步骤设置子任务,在每个子任务执行的过程中,能够形成执行结果的反馈,进而形成同步日志,当子任务执行成功时,启动下一个子任务,最终完成同步任务,当子任务执行失败,用户能够查询同步日志,并且能够对中断的同步任务进行断点续做。Using the method of installing the software package to the target host provided in this embodiment, the process of synchronizing the software package is implemented based on the task, and the subtasks are set for each synchronization step, and the execution result can be formed during the execution of each subtask. When the subtask is executed successfully, the next subtask is started, and the synchronization task is finally completed. When the subtask execution fails, the user can query the synchronization log, and can continue to do interrupted synchronization tasks. .
实施例三Example three
本申请实施例三提供了一种优选地安装软件包至目标主机的方法,该安装软件包至目标主机的方法的部分步骤与上述实施例中的步骤对应相同,这部分步骤在该实施例中不再赘述,具体可参考上述实施例。在该实施例中,安装包围PRM(Red Hat Package Manager)包,具体地,图3为本申请实施例三提供的安装软件包至目标主机的示意图,如图3所示,该实施例三提供的安装软件包至目标主机的方法包括如下的步骤:The third embodiment of the present application provides a method for preferably installing a software package to a target host. Some steps of the method for installing a software package to the target host correspond to the steps in the above-mentioned embodiment. This part of the steps are described in this embodiment. It will not be repeated, and for details, please refer to the above-mentioned embodiment. In this embodiment, the installation surround PRM (Red Hat Package Manager) package. Specifically, FIG. 3 is a schematic diagram of installing the software package to the target host provided in the third embodiment of the application. As shown in FIG. 3, the method of installing the software package to the target host provided in the third embodiment includes the following A step of:
用户将制作好的RPM包上传至软件包管理平台后,软件包管理平台接收到RPM包以及目标主机的参数,平台按照设置好的规则,对RPM包进行校验,通过后则上传,否则上传失败。同时,平台计算RPM包的MD5值,将RPM包的包名、所属主机类型、系统版本、MD5值、版本信息、release,rpm包说明等等记录到数据库中。After the user uploads the prepared RPM package to the software package management platform, the software package management platform receives the RPM package and the parameters of the target host. The platform verifies the RPM package according to the set rules, and uploads it after it passes, otherwise uploads fail. At the same time, the platform calculates the MD5 value of the RPM package, and records the package name, host type, system version, MD5 value, version information, release, rpm package description, etc. of the RPM package in the database.
软件包管理平台提供同步按钮,用户点击同步按钮,软件包管理平台采用rsync算法将RPM包先并行同步到已配置好的公有云、专有云以及内部云等YUM服务器(Yellow dog Updater Modified SERVER),再从各朵云的YUM服务器并行同步到各可用区的YUM服务器(以及目标主机的服务器),例如:从公有云的YUM服务器同步到公有云ECA、ECB、SCA、HKA、HKB、SGA等不同可用区的YUM服务器,同步成功后,读取数据库中的信息,将RPM包的相关信息作为配置信息同步到各朵云的运维管理平台,方便其监管和部署。其中,RPM包在同步的过程中,当从软件包管理平台同步到云的YUM服务器,或者从云的YUM服务器同步到可用区的YUM服务器时,软件包管理平台都会调用脚本执行函数执行预置脚本,以对比RPM包的MD5值,若与RPM包的初始MD5值一致则同步,否则会发出告警通知。The software package management platform provides a synchronization button. The user clicks the synchronization button. The software package management platform uses the rsync algorithm to synchronize the RPM packages in parallel to the configured public cloud, private cloud, and internal cloud and other YUM servers (Yellow dog Updater Modified). SERVER), and then synchronize from the YUM server in each cloud to the YUM server in each availability zone (and the server of the target host) in parallel, for example: from the YUM server in the public cloud to the public cloud ECA, ECB, SCA, HKA, HKB, SGA and other YUM servers in different availability zones, after successful synchronization, read the information in the database, and synchronize the relevant information of the RPM package as configuration information to the operation and maintenance management platform of each cloud to facilitate its supervision and deployment. Among them, during the synchronization of the RPM package, when it is synchronized from the software package management platform to the YUM server in the cloud, or from the YUM server in the cloud to the YUM server in the availability zone, the software package management platform will call the script execution function to execute the preset Script to compare the MD5 value of the RPM package. If it is consistent with the initial MD5 value of the RPM package, it will be synchronized, otherwise an alarm notification will be issued.
此外,RPM包在同步过程中,将脚本执行函数的执行过程和执行结果写入同步日志,用户可实时查看同步日志,了解RPM包的实时动态,若同步环节中出现错误,用户可通过实时日志马上定位到错误信息并解决,且若是同步过程中有失败环节,支持用户进行断点续做。具体地,若有失败的任务,软件包管理平台会从数据库中获取到该任务在哪一步骤失败,从而按照用户的指令继续往下执行任务。In addition, during the synchronization process of the RPM package, the execution process and execution results of the script execution function are written into the synchronization log. The user can view the synchronization log in real time to understand the real-time dynamics of the RPM package. If there is an error in the synchronization link, the user can use the real-time log Immediately locate the error message and solve it, and if there is a failure during the synchronization process, support the user to continue with the breakpoint. Specifically, if there is a failed task, the software package management platform will obtain from the database at which step the task failed, and continue to execute the task according to the user's instruction.
采用该实施例提供的安装软件包至目标主机的方法,提供统一的web界面入口,可以进行RPM包的生命周期管理;上传RPM包时,增加RPM包的校验机制,不符合规范的禁止上传;在同步RPM包的过程中,会校验RPM包文件的MD5值,若与文件的初始MD5值一致则同步,否则不会同步且会发出告警通知。可支持多个RPM包的批量同步操作,节省大量时间。可以实时显示RPM包的同步日志,查看RPM包的同步进度。通过日志可轻松定位同步过程中发生的问题,且系统支持断点续做功能。The method of installing the software package to the target host provided in this embodiment is adopted to provide a unified web interface entry, which can carry out the life cycle management of the RPM package; when uploading the RPM package, the verification mechanism of the RPM package is added, and uploading is prohibited if it does not meet the specifications ; During the process of synchronizing the RPM package, the MD5 value of the RPM package file will be verified, and if it is consistent with the initial MD5 value of the file, it will be synchronized, otherwise it will not be synchronized and an alarm notification will be issued. It can support batch synchronization of multiple RPM packages, saving a lot of time. The synchronization log of the RPM package can be displayed in real time, and the synchronization progress of the RPM package can be viewed. The log can easily locate the problems that occurred during the synchronization process, and the system supports the breakpoint resume function.
实施例四Example four
对应于上述实施例一,本申请实施例四提供了一种安装软件包至目标主机的装置,该装置设置于软件包管理平台,相关技术特征和技术效果可参考上述实施例一。图4为本申请实施例四提供的安装软件包至目标主机装置的框图,如图4所示,该装置包括:接收模块401、校验模块402、确定模块403、处理模块404、同步模块405和发送模块406。Corresponding to the first embodiment above, the fourth embodiment of the present application provides a device for installing a software package to a target host. The device is set on a software package management platform. For related technical features and technical effects, please refer to the first embodiment. FIG. 4 is a block diagram of installing the software package to the target host device according to the fourth embodiment of the application. As shown in FIG. 4, the device includes: a receiving module 401, a verification module 402, a determining module 403, a processing module 404, and a synchronization module 405 And sending module 406.
其中,接收模块401用于接收待同步的软件包和目标主机的参数;校验模块402用于对软件包按照预设的校验规则进行校验;确定模块403用于当校验通过时,根据目标主机的参数确定同步路径,其中,同步路径为由软件包管理平台到达目标主机的服务器的路径;处理模块404用于根据软件包的包名和目标主机的参数生成目标主机安装软件包所需的配置信息;同步模块405用于将软件包经由同步路径同步至目标主机的服务器;发送模块406用于将配置信息发送至目标主机的运维管理平台,其中,运维管理平台用于根据配置信息将目标主机的服务器上的软件包安装至目标主机。Among them, the receiving module 401 is used to receive the software package to be synchronized and the parameters of the target host; the verification module 402 is used to verify the software package according to the preset verification rules; the determining module 403 is used to, when the verification passes, The synchronization path is determined according to the parameters of the target host, where the synchronization path is the path from the software package management platform to the server of the target host; the processing module 404 is used to generate the target host installation software package according to the package name of the software package and the parameters of the target host The synchronization module 405 is used to synchronize the software package to the server of the target host via the synchronization path; the sending module 406 is used to send the configuration information to the operation and maintenance management platform of the target host, wherein the operation and maintenance management platform is used to configure The information installs the software package on the server of the target host to the target host.
可选地,在一种实施例中,同步模块405在将软件包经由同步路径同步至目标主机的服务器时,至少执行两个同步步骤,同步步骤用于将软件包由上游设备同步至相邻的下游设备,同步步骤包括:调用脚本执行函数执行上游设备上的预置脚本,其中,预置脚本被执行时,将上游设备上的软件包同步至下游设备。Optionally, in an embodiment, the synchronization module 405 performs at least two synchronization steps when synchronizing the software package to the server of the target host via the synchronization path. The synchronization step is used to synchronize the software package from the upstream device to the neighboring server. In the downstream device, the synchronization step includes: calling a script execution function to execute a preset script on the upstream device, wherein when the preset script is executed, the software package on the upstream device is synchronized to the downstream device.
可选地,在一种实施例中,同步步骤还包括:获取脚本执行函数执行预置脚本的过程信息和执行结果;以及将过程信息和执行结果写入同步日志。Optionally, in an embodiment, the synchronization step further includes: acquiring process information and execution results of the script execution function executing the preset script; and writing the process information and execution results into the synchronization log.
可选地,在一种实施例中,同步模块405包括同步任务建立单元、子任务启动单元、状态标记单元、同步任务中断单元、输出单元和显示单元,其中,同步任务建立单元用于建立同步任务,其中,同步任务包括与同步步骤一一对应且按顺序设置的子任务,每启动一个子任务,执行一个同步步骤;子任务启动单元用于启动一个子任务;状态标记单元用于根据执行结果标记子任务的状态;同步任务中断单元用于当子任务的状态为执行失败时,中断同步任务;子任务启动单元还用于当子任务的状态为执行成功时,启动下一个子任务;输出单元用于输出子任务执行失败的提示信息,并提供日志查看控件;显示单元用于响应于对日志查看控件的操作,显示同步日志。Optionally, in an embodiment, the synchronization module 405 includes a synchronization task establishment unit, a subtask start unit, a status marking unit, a synchronization task interrupt unit, an output unit, and a display unit, wherein the synchronization task establishment unit is used to establish synchronization Tasks, where the synchronization task includes subtasks that correspond to the synchronization steps one-to-one and are set in sequence. Each time a subtask is started, a synchronization step is executed; the subtask start unit is used to start a subtask; the status marking unit is used to execute according to The result marks the status of the subtask; the synchronization task interrupt unit is used to interrupt the synchronization task when the status of the subtask is execution failure; the subtask start unit is also used to start the next subtask when the status of the subtask is execution success; The output unit is used for outputting the prompt information of the execution failure of the subtask and provides a log viewing control; the display unit is used for displaying the synchronization log in response to the operation of the log viewing control.
可选地,在一种实施例中,同步模块405还用于针对中断的同步任务,提供断点续做控件,并响应于对断点续做控件的操作,重新启动状态为执行失败的子任务。Optionally, in an embodiment, the synchronization module 405 is further configured to provide a breakpoint resuming control for the interrupted synchronization task, and in response to the operation of the breakpoint resuming control, the restart state is the child whose execution failed. Task.
可选地,在一种实施例中,同步模块405还用于当校验通过时,计算软件包的数字指纹,得到原始指纹,预置脚本被执行时,计算上游设备的软件包的数字指纹,得到校验指纹,并在校验指纹和原始指纹一致时,将上游设备的软件包同步至下游设备。Optionally, in an embodiment, the synchronization module 405 is further configured to calculate the digital fingerprint of the software package to obtain the original fingerprint when the verification is passed, and calculate the digital fingerprint of the software package of the upstream device when the preset script is executed. , Get the verification fingerprint, and when the verification fingerprint is consistent with the original fingerprint, synchronize the software package of the upstream device to the downstream device.
可选地,在一种实施例中,校验模块402对软件包按照预设的校验规则进行校验时,具体执行的步骤包括:校验软件包的包名是否符合预设的包名规范;判断软件包的包名中所包含的环境信息与目标主机的环境信息是否相同;判断软件包的包名中所包含的主机类型与目标主机的主机类型是否相同;和/或判断软件包的包名中所包含的系统版本信息是否满足预设的系统版本要求。Optionally, in an embodiment, when the verification module 402 verifies the software package according to a preset verification rule, the specific steps performed include: verifying whether the package name of the software package conforms to the preset package name Specification; judge whether the environmental information contained in the package name of the software package is the same as the environmental information of the target host; judge whether the host type contained in the package name of the software package is the same as the host type of the target host; and/or judge the software package Whether the system version information contained in the package name meets the preset system version requirements.
实施例五Example five
本实施例还提供一种计算机设备,如可以执行程序的智能手机、平板电脑、笔记本电脑、台式计算机、机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者多个服务器所组成的服务器集群)等。如图5所示,本实施例的计算机设备01至少包括但不限于:可通过系统总线相互通信连接的存储器011、处理器012,如图5所示。需要指出的是,图5仅示出了具有组件存储器011和处理器012的计算机设备01,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。This embodiment also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a cabinet server (including independent servers, or A server cluster composed of multiple servers), etc. As shown in FIG. 5, the computer device 01 of this embodiment at least includes but is not limited to: a memory 011 and a processor 012 that can be communicably connected to each other through a system bus, as shown in FIG. It should be pointed out that FIG. 5 only shows the computer device 01 having the component memory 011 and the processor 012, but it should be understood that it is not required to implement all the illustrated components, and more or less may be implemented instead. Components.
本实施例中,存储器011(即可读存储介质)包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器011可以是计算机设备01的内部存储单元,例如该计算机设备01的硬盘或内存。在另一些实施例中,存储器011也可以是计算机设备01的外部存储设备,例如该计算机设备01上配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。当然,存储器011还可以既包括计算机设备01的内部存储单元也包括其外部存储设备。本实施例中,存储器011通常用于存储安装于计算机设备01的操作系统和各类应用软件,例如实施例四的安装软件包至目标主机的装置的程序代码等。此外,存储器011还可以用于暂时地存储已经输出或者将要输出的各类数据。In this embodiment, the memory 011 (readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), Read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disks, optical disks, etc. In some embodiments, the memory 011 may be an internal storage unit of the computer device 01, such as a hard disk or a memory of the computer device 01. In other embodiments, the memory 011 may also be an external storage device of the computer device 01, such as a plug-in hard disk equipped on the computer device 01, and a smart memory card (Smart Media Card, SMC), Secure Digital (Secure Digital, SD) card, flash memory card (Flash Card) and so on. Of course, the memory 011 may also include both an internal storage unit of the computer device 01 and an external storage device thereof. In this embodiment, the memory 011 is generally used to store the operating system and various application software installed in the computer device 01, such as the program code of the device for installing the software package to the target host in the fourth embodiment. In addition, the memory 011 can also be used to temporarily store various types of data that have been output or will be output.
处理器012在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器012通常用于控制计算机设备01的总体操作。本实施例中,处理器012用于运行存储器011中存储的程序代码或者处理数据,例如安装软件包至目标主机的方法等。The processor 012 may be a central processing unit (Central Processing Unit) in some embodiments. Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 012 is generally used to control the overall operation of the computer device 01. In this embodiment, the processor 012 is configured to run program codes or process data stored in the memory 011, such as a method of installing a software package to a target host.
实施例六Example Six
本实施例还提供一种计算机可读存储介质,如闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘、服务器、App应用商城等等,该计算机可读存储介质可以为易失性的,也可以是非易失性的,其上存储有计算机指令,计算机指令被处理器执行时实现相应功能。本实施例的计算机可读存储介质用于存储安装软件包至目标主机的装置,被处理器执行时实现实施例一的安装软件包至目标主机的方法。This embodiment also provides a computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), only Readable memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, server, App application mall, etc., the computer-readable storage medium can be It is volatile or non-volatile, with computer instructions stored thereon, and the computer instructions implement corresponding functions when executed by the processor. The computer-readable storage medium of this embodiment is used to store an installation software package to a target host, and when executed by a processor, the method for installing a software package to the target host in the first embodiment is implemented.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that in this article, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, It also includes other elements that are not explicitly listed, or elements inherent to the process, method, article, or device. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, article, or device that includes the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the foregoing embodiments of the present application are for description only, and do not represent the superiority or inferiority of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。Through the description of the above implementation manners, those skilled in the art can clearly understand that the above-mentioned embodiment method can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is better.的实施方式。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only the preferred embodiments of the application, and do not limit the scope of the patent for this application. Any equivalent structure or equivalent process transformation made using the content of the description and drawings of the application, or directly or indirectly applied to other related technical fields , The same reason is included in the scope of patent protection of this application.

Claims (20)

  1. 一种安装软件包至目标主机的方法,其中,所述方法的执行主体为软件包管理平台,所述方法包括: A method for installing a software package to a target host, wherein the execution subject of the method is a software package management platform, and the method includes:
    接收待同步的软件包和目标主机的参数;Receive the parameters of the software package to be synchronized and the target host;
    对所述软件包按照预设的校验规则进行校验;Verifying the software package according to a preset verification rule;
    当校验通过时,根据所述目标主机的参数确定同步路径,其中,所述同步路径为由所述软件包管理平台到达所述目标主机的服务器的路径;When the verification is passed, a synchronization path is determined according to the parameters of the target host, where the synchronization path is a path from the software package management platform to the server of the target host;
    根据所述软件包的包名和所述目标主机的参数生成所述目标主机安装所述软件包所需的配置信息;Generating configuration information required by the target host to install the software package according to the package name of the software package and the parameters of the target host;
    将所述软件包经由所述同步路径同步至所述目标主机的服务器; Synchronizing the software package to the server of the target host via the synchronization path;
    将所述配置信息发送至所述目标主机的运维管理平台,其中,所述运维管理平台用于根据所述配置信息将所述目标主机的服务器上的软件包安装至所述目标主机。The configuration information is sent to the operation and maintenance management platform of the target host, where the operation and maintenance management platform is configured to install the software package on the server of the target host to the target host according to the configuration information.
  2. 根据权利要求1所述的安装软件包至目标主机的方法,其中,将所述软件包经由所述同步路径同步至所述目标主机的服务器的过程包括至少两个同步步骤,所述同步步骤用于将所述软件包由上游设备同步至相邻的下游设备,所述同步步骤包括: The method for installing a software package to a target host according to claim 1, wherein the process of synchronizing the software package to the server of the target host via the synchronization path includes at least two synchronization steps, and the synchronization step uses To synchronize the software package from an upstream device to an adjacent downstream device, the synchronization step includes:
    调用脚本执行函数执行所述上游设备上的预置脚本,其中,所述预置脚本被执行时,将所述上游设备上的所述软件包同步至所述下游设备。The script execution function is called to execute the preset script on the upstream device, where when the preset script is executed, the software package on the upstream device is synchronized to the downstream device.
  3. 根据权利要求2所述的安装软件包至目标主机的方法,其中,所述同步步骤还包括: The method for installing a software package to a target host according to claim 2, wherein the synchronization step further comprises:
    获取所述脚本执行函数执行预置脚本的过程信息和执行结果;以及Acquiring process information and execution results of the script execution function executing the preset script; and
    将所述过程信息和执行结果写入同步日志。The process information and execution result are written into the synchronization log.
  4. 根据权利要求3所述的安装软件包至目标主机的方法,其中,将所述软件包经由所述同步路径同步至所述目标主机的服务器的步骤包括: 4. The method for installing a software package to a target host according to claim 3, wherein the step of synchronizing the software package to the server of the target host via the synchronization path comprises:
    建立同步任务,其中,所述同步任务包括与所述同步步骤一一对应且按顺序设置的子任务,每启动一个所述子任务,执行一个所述同步步骤;Establish a synchronization task, wherein the synchronization task includes subtasks that correspond to the synchronization steps one-to-one and are set in sequence, and each time a subtask is started, one synchronization step is executed;
    启动一个所述子任务;Start one of the subtasks;
    根据所述执行结果标记所述子任务的状态;Mark the status of the subtask according to the execution result;
    当所述子任务的状态为执行成功时,启动下一个所述子任务;When the status of the subtask is successful execution, start the next subtask;
    当所述子任务的状态为执行失败时,中断所述同步任务;When the status of the subtask is execution failure, interrupt the synchronization task;
    输出所述子任务执行失败的提示信息,并提供日志查看控件;Output the prompt message of the execution failure of the subtask, and provide log viewing control;
    响应于对所述日志查看控件的操作,显示所述同步日志。In response to the operation of the log viewing control, the synchronization log is displayed.
  5. 根据权利要求4所述的安装软件包至目标主机的方法,其中,所述方法还包括: The method for installing a software package to a target host according to claim 4, wherein the method further comprises:
    针对中断的所述同步任务,提供断点续做控件;For the interrupted synchronization task, provide breakpoint resume control;
    响应于对所述断点续做控件的操作,重新启动状态为执行失败的所述子任务。In response to the operation of continuing the control on the breakpoint, the subtask whose execution status is failed is restarted.
  6. 根据权利要求2所述的安装软件包至目标主机的方法,其中, The method for installing a software package to a target host according to claim 2, wherein:
    所述方法还包括: 当校验通过时,计算所述软件包的数字指纹,得到原始指纹;The method further includes: when the verification is passed, calculating the digital fingerprint of the software package to obtain the original fingerprint;
    所述预置脚本被执行时,计算所述上游设备的所述软件包的数字指纹,得到校验指纹,并在所述校验指纹和所述原始指纹一致时,将所述上游设备的所述软件包同步至所述下游设备。When the preset script is executed, the digital fingerprint of the software package of the upstream device is calculated to obtain a verification fingerprint, and when the verification fingerprint is consistent with the original fingerprint, all the upstream device's The software package is synchronized to the downstream device.
  7. 根据权利要求1所述的安装软件包至目标主机的方法,其中,对所述软件包按照预设的校验规则进行校验的步骤包括: The method for installing a software package to a target host according to claim 1, wherein the step of verifying the software package according to a preset verification rule comprises:
    校验所述软件包的包名是否符合预设的包名规范;Verifying whether the package name of the software package meets the preset package name specification;
    判断所述软件包的包名中所包含的环境信息与所述目标主机的环境信息是否相同;Judging whether the environmental information contained in the package name of the software package is the same as the environmental information of the target host;
    判断所述软件包的包名中所包含的主机类型与所述目标主机的主机类型是否相同;和/或Determine whether the host type contained in the package name of the software package is the same as the host type of the target host; and/or
    判断所述软件包的包名中所包含的系统版本信息是否满足预设的系统版本要求。It is determined whether the system version information contained in the package name of the software package meets the preset system version requirement.
  8. 一种计算机设备,所述计算机设备包括:存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机可读指令,其中,所述处理器执行所述程序时实现以下步骤:A computer device comprising: a memory, a processor, and computer-readable instructions stored on the memory and capable of running on the processor, wherein the processor executes the following when the program is executed step:
    接收待同步的软件包和目标主机的参数;Receive the parameters of the software package to be synchronized and the target host;
    对所述软件包按照预设的校验规则进行校验;Verifying the software package according to a preset verification rule;
    当校验通过时,根据所述目标主机的参数确定同步路径,其中,所述同步路径为由所述软件包管理平台到达所述目标主机的服务器的路径;When the verification is passed, a synchronization path is determined according to the parameters of the target host, where the synchronization path is a path from the software package management platform to the server of the target host;
    根据所述软件包的包名和所述目标主机的参数生成所述目标主机安装所述软件包所需的配置信息;Generating configuration information required by the target host to install the software package according to the package name of the software package and the parameters of the target host;
    将所述软件包经由所述同步路径同步至所述目标主机的服务器; Synchronizing the software package to the server of the target host via the synchronization path;
    将所述配置信息发送至所述目标主机的运维管理平台,其中,所述运维管理平台用于根据所述配置信息将所述目标主机的服务器上的软件包安装至所述目标主机。The configuration information is sent to the operation and maintenance management platform of the target host, where the operation and maintenance management platform is configured to install the software package on the server of the target host to the target host according to the configuration information.
  9. 根据权利要求8所述的计算机设备,其中,所述处理器执行所述程序时, The computer device according to claim 8, wherein when the processor executes the program,
    将所述软件包经由所述同步路径同步至所述目标主机的服务器的过程包括至少两个同步步骤,所述同步步骤用于将所述软件包由上游设备同步至相邻的下游设备,所述同步步骤包括:The process of synchronizing the software package to the server of the target host via the synchronization path includes at least two synchronization steps. The synchronization step is used to synchronize the software package from an upstream device to an adjacent downstream device. The synchronization steps include:
    调用脚本执行函数执行所述上游设备上的预置脚本,其中,所述预置脚本被执行时,将所述上游设备上的所述软件包同步至所述下游设备。The script execution function is called to execute the preset script on the upstream device, where when the preset script is executed, the software package on the upstream device is synchronized to the downstream device.
  10. 根据权利要求9所述的计算机设备,其中,所述处理器执行所述程序时, The computer device according to claim 9, wherein when the processor executes the program,
    所述同步步骤还包括:The synchronization step further includes:
    获取所述脚本执行函数执行预置脚本的过程信息和执行结果;以及Acquiring process information and execution results of the script execution function executing the preset script; and
    将所述过程信息和执行结果写入同步日志。The process information and execution result are written into the synchronization log.
  11. 根据权利要求10所述的计算机设备,其中,所述处理器执行所述程序时, The computer device according to claim 10, wherein when the processor executes the program,
    将所述软件包经由所述同步路径同步至所述目标主机的服务器的步骤包括:The step of synchronizing the software package to the server of the target host via the synchronization path includes:
    建立同步任务,其中,所述同步任务包括与所述同步步骤一一对应且按顺序设置的子任务,每启动一个所述子任务,执行一个所述同步步骤;Establish a synchronization task, wherein the synchronization task includes subtasks that correspond to the synchronization steps one-to-one and are set in sequence, and each time a subtask is started, one synchronization step is executed;
    启动一个所述子任务;Start one of the subtasks;
    根据所述执行结果标记所述子任务的状态;Mark the status of the subtask according to the execution result;
    当所述子任务的状态为执行成功时,启动下一个所述子任务;When the status of the subtask is successful execution, start the next subtask;
    当所述子任务的状态为执行失败时,中断所述同步任务;When the status of the subtask is execution failure, interrupt the synchronization task;
    输出所述子任务执行失败的提示信息,并提供日志查看控件;Output the prompt message of the execution failure of the subtask, and provide log viewing control;
    响应于对所述日志查看控件的操作,显示所述同步日志。In response to the operation of the log viewing control, the synchronization log is displayed.
  12. 根据权利要求11所述的计算机设备,其中,所述处理器执行所述程序时,还实现以下步骤: The computer device according to claim 11, wherein when the processor executes the program, the following steps are further implemented:
    针对中断的所述同步任务,提供断点续做控件;For the interrupted synchronization task, provide breakpoint resume control;
    响应于对所述断点续做控件的操作,重新启动状态为执行失败的所述子任务。In response to the operation of continuing the control on the breakpoint, the subtask whose execution status is failed is restarted.
  13. 根据权利要求9所述的计算机设备,其中,所述处理器执行所述程序时,还实现以下步骤: The computer device according to claim 9, wherein when the processor executes the program, the following steps are further implemented:
    当校验通过时,计算所述软件包的数字指纹,得到原始指纹;When the verification is passed, the digital fingerprint of the software package is calculated to obtain the original fingerprint;
    所述预置脚本被执行时,计算所述上游设备的所述软件包的数字指纹,得到校验指纹,并在所述校验指纹和所述原始指纹一致时,将所述上游设备的所述软件包同步至所述下游设备。When the preset script is executed, the digital fingerprint of the software package of the upstream device is calculated to obtain a verification fingerprint, and when the verification fingerprint is consistent with the original fingerprint, all the upstream device's The software package is synchronized to the downstream device.
  14. 根据权利要求8所述的计算机设备,其中,对所述软件包按照预设的校验规则进行校验的步骤包括: 8. The computer device according to claim 8, wherein the step of verifying the software package according to a preset verification rule comprises:
    校验所述软件包的包名是否符合预设的包名规范;Verifying whether the package name of the software package meets the preset package name specification;
    判断所述软件包的包名中所包含的环境信息与所述目标主机的环境信息是否相同;Judging whether the environmental information contained in the package name of the software package is the same as the environmental information of the target host;
    判断所述软件包的包名中所包含的主机类型与所述目标主机的主机类型是否相同;和/或Determine whether the host type contained in the package name of the software package is the same as the host type of the target host; and/or
    判断所述软件包的包名中所包含的系统版本信息是否满足预设的系统版本要求。It is determined whether the system version information contained in the package name of the software package meets the preset system version requirement.
  15. 一种计算机可读存储介质,其上存储有计算机可读指令,其中,所述计算机可读指令被处理器执行时实现以下步骤:A computer-readable storage medium having computer-readable instructions stored thereon, wherein, when the computer-readable instructions are executed by a processor, the following steps are implemented:
    接收待同步的软件包和目标主机的参数;Receive the parameters of the software package to be synchronized and the target host;
    对所述软件包按照预设的校验规则进行校验;Verifying the software package according to a preset verification rule;
    当校验通过时,根据所述目标主机的参数确定同步路径,其中,所述同步路径为由所述软件包管理平台到达所述目标主机的服务器的路径;When the verification is passed, a synchronization path is determined according to the parameters of the target host, where the synchronization path is a path from the software package management platform to the server of the target host;
    根据所述软件包的包名和所述目标主机的参数生成所述目标主机安装所述软件包所需的配置信息;Generating configuration information required by the target host to install the software package according to the package name of the software package and the parameters of the target host;
    将所述软件包经由所述同步路径同步至所述目标主机的服务器; Synchronizing the software package to the server of the target host via the synchronization path;
    将所述配置信息发送至所述目标主机的运维管理平台,其中,所述运维管理平台用于根据所述配置信息将所述目标主机的服务器上的软件包安装至所述目标主机。The configuration information is sent to the operation and maintenance management platform of the target host, where the operation and maintenance management platform is configured to install the software package on the server of the target host to the target host according to the configuration information.
  16. 根据权利要求15所述的计算机可读存储介质,其中,所述计算机可读指令被处理器执行时,将所述软件包经由所述同步路径同步至所述目标主机的服务器的过程包括至少两个同步步骤,所述同步步骤用于将所述软件包由上游设备同步至相邻的下游设备,所述同步步骤包括: The computer-readable storage medium according to claim 15, wherein when the computer-readable instructions are executed by a processor, the process of synchronizing the software package to the server of the target host via the synchronization path includes at least two A synchronization step, the synchronization step is used to synchronize the software package from an upstream device to an adjacent downstream device, and the synchronization step includes:
    调用脚本执行函数执行所述上游设备上的预置脚本,其中,所述预置脚本被执行时,将所述上游设备上的所述软件包同步至所述下游设备。The script execution function is called to execute the preset script on the upstream device, where when the preset script is executed, the software package on the upstream device is synchronized to the downstream device.
  17. 根据权利要求16所述的计算机可读存储介质,其中,所述计算机可读指令被处理器执行时, The computer-readable storage medium according to claim 16, wherein when the computer-readable instructions are executed by a processor,
    所述同步步骤还包括:The synchronization step further includes:
    获取所述脚本执行函数执行预置脚本的过程信息和执行结果;以及Acquiring process information and execution results of the script execution function executing the preset script; and
    将所述过程信息和执行结果写入同步日志。The process information and execution result are written into the synchronization log.
  18. 根据权利要求17所述的计算机可读存储介质,其中,所述计算机可读指令被处理器执行时, The computer-readable storage medium according to claim 17, wherein when the computer-readable instructions are executed by a processor,
    将所述软件包经由所述同步路径同步至所述目标主机的服务器的步骤包括:The step of synchronizing the software package to the server of the target host via the synchronization path includes:
    建立同步任务,其中,所述同步任务包括与所述同步步骤一一对应且按顺序设置的子任务,每启动一个所述子任务,执行一个所述同步步骤;Establish a synchronization task, wherein the synchronization task includes subtasks that correspond to the synchronization steps one-to-one and are set in sequence, and each time a subtask is started, one synchronization step is executed;
    启动一个所述子任务;Start one of the subtasks;
    根据所述执行结果标记所述子任务的状态;Mark the status of the subtask according to the execution result;
    当所述子任务的状态为执行成功时,启动下一个所述子任务;When the status of the subtask is successful execution, start the next subtask;
    当所述子任务的状态为执行失败时,中断所述同步任务;When the status of the subtask is execution failure, interrupt the synchronization task;
    输出所述子任务执行失败的提示信息,并提供日志查看控件;Output the prompt message of the execution failure of the subtask, and provide log viewing control;
    响应于对所述日志查看控件的操作,显示所述同步日志。In response to the operation of the log viewing control, the synchronization log is displayed.
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述计算机可读指令被处理器执行时,还实现以下步骤: The computer-readable storage medium according to claim 18, wherein when the computer-readable instructions are executed by the processor, the following steps are further implemented:
    针对中断的所述同步任务,提供断点续做控件;For the interrupted synchronization task, provide breakpoint resume control;
    响应于对所述断点续做控件的操作,重新启动状态为执行失败的所述子任务。In response to the operation of continuing the control on the breakpoint, the subtask whose execution status is failed is restarted.
  20. 一种安装软件包至目标主机的装置,其中,所述装置设置于软件包管理平台,所述装置包括: A device for installing a software package to a target host, wherein the device is set on a software package management platform, and the device includes:
    接收模块,用于接收待同步的软件包和目标主机的参数;The receiving module is used to receive the parameters of the software package to be synchronized and the target host;
    校验模块,用于对所述软件包按照预设的校验规则进行校验;The verification module is used to verify the software package according to a preset verification rule;
    确定模块,用于当校验通过时,根据所述目标主机的参数确定同步路径,其中,所述同步路径为由所述软件包管理平台到达所述目标主机的服务器的路径;The determining module is configured to determine a synchronization path according to the parameters of the target host when the verification is passed, where the synchronization path is a path from the software package management platform to the server of the target host;
    处理模块,用于根据所述软件包的包名和所述目标主机的参数生成所述目标主机安装所述软件包所需的配置信息;A processing module, configured to generate configuration information required by the target host to install the software package according to the package name of the software package and the parameters of the target host;
    同步模块,用于将所述软件包经由所述同步路径同步至所述目标主机的服务器; A synchronization module, configured to synchronize the software package to the server of the target host via the synchronization path;
    发送模块,用于将所述配置信息发送至所述目标主机的运维管理平台,其中,所述运维管理平台用于根据所述配置信息将所述目标主机的服务器上的软件包安装至所述目标主机。The sending module is configured to send the configuration information to the operation and maintenance management platform of the target host, wherein the operation and maintenance management platform is used to install the software package on the server of the target host to the The target host.
PCT/CN2020/099444 2020-02-25 2020-06-30 Method and apparatus for installing software package to target host, and computer device WO2021169124A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010116137.9 2020-02-25
CN202010116137.9A CN111338656B (en) 2020-02-25 2020-02-25 Method and device for installing software package to target host and computer equipment

Publications (1)

Publication Number Publication Date
WO2021169124A1 true WO2021169124A1 (en) 2021-09-02

Family

ID=71183643

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/099444 WO2021169124A1 (en) 2020-02-25 2020-06-30 Method and apparatus for installing software package to target host, and computer device

Country Status (2)

Country Link
CN (1) CN111338656B (en)
WO (1) WO2021169124A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111338656B (en) * 2020-02-25 2023-12-15 平安科技(深圳)有限公司 Method and device for installing software package to target host and computer equipment
CN112286531B (en) * 2020-09-21 2023-07-04 麒麟软件有限公司 Method for realizing switching of RPM (revolutions per minute) package management tool into DPKG (digital per gram) package management tool in Redhat system release
CN113434156A (en) * 2021-06-29 2021-09-24 青岛海尔科技有限公司 Automatic database deployment method and device, storage medium and electronic device
CN113535270B (en) * 2021-07-23 2022-12-13 建信金融科技有限责任公司 Software starting method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090007096A1 (en) * 2007-06-28 2009-01-01 Microsoft Corporation Secure Software Deployments
CN102195978A (en) * 2011-04-26 2011-09-21 深圳市共济科技有限公司 Software distribution deployment method and system
CN102437938A (en) * 2012-01-09 2012-05-02 北京邮电大学 Large-scale network monitoring oriented virtual deployment system and method
CN103577235A (en) * 2013-11-14 2014-02-12 中安消技术有限公司 Software deploying method, deploying server, computer to be deployed and system
CN104360878A (en) * 2014-10-29 2015-02-18 中国建设银行股份有限公司 Method and device for deploying application software
CN111338656A (en) * 2020-02-25 2020-06-26 平安科技(深圳)有限公司 Method and device for installing software package to target host and computer equipment

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6510466B1 (en) * 1998-12-14 2003-01-21 International Business Machines Corporation Methods, systems and computer program products for centralized management of application programs on a network
NO314867B1 (en) * 2001-03-13 2003-06-02 Ericsson Telefon Ab L M Procedure for optimizing software distribution in large communications networks
CN102136942B (en) * 2010-12-31 2014-06-25 华为技术有限公司 Method and device for downloading software
CN104639614A (en) * 2015-01-05 2015-05-20 广州杰赛科技股份有限公司 Software distributing method, system and server
CN104699799A (en) * 2015-03-19 2015-06-10 神华集团有限责任公司 Data transmission method based on cross system
CN105049504B (en) * 2015-07-09 2019-03-05 国云科技股份有限公司 A kind of big data transfer transmission is synchronous and storage method
CN108234607B (en) * 2017-12-18 2020-06-05 上海中畅数据技术有限公司 File distribution method and system based on micro-service architecture mode
CN108509203B (en) * 2018-03-13 2021-05-28 腾讯科技(深圳)有限公司 Software cross-cloud deployment method, computer equipment and storage medium
CN108776604A (en) * 2018-05-23 2018-11-09 网易(杭州)网络有限公司 The execution method and system of goal task
CN109995653B (en) * 2019-04-15 2021-07-09 深圳市迅雷网络技术有限公司 Cross-node data transmission method, device and system and readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090007096A1 (en) * 2007-06-28 2009-01-01 Microsoft Corporation Secure Software Deployments
CN102195978A (en) * 2011-04-26 2011-09-21 深圳市共济科技有限公司 Software distribution deployment method and system
CN102437938A (en) * 2012-01-09 2012-05-02 北京邮电大学 Large-scale network monitoring oriented virtual deployment system and method
CN103577235A (en) * 2013-11-14 2014-02-12 中安消技术有限公司 Software deploying method, deploying server, computer to be deployed and system
CN104360878A (en) * 2014-10-29 2015-02-18 中国建设银行股份有限公司 Method and device for deploying application software
CN111338656A (en) * 2020-02-25 2020-06-26 平安科技(深圳)有限公司 Method and device for installing software package to target host and computer equipment

Also Published As

Publication number Publication date
CN111338656B (en) 2023-12-15
CN111338656A (en) 2020-06-26

Similar Documents

Publication Publication Date Title
US9386079B2 (en) Method and system of virtual desktop infrastructure deployment studio
WO2021169124A1 (en) Method and apparatus for installing software package to target host, and computer device
US10127057B2 (en) Method and apparatus for dynamically implementing application function
US9710259B2 (en) System and method for customizing a deployment plan for a multi-tier application in a cloud infrastructure
US10148731B2 (en) Methods, systems, and computer readable media for on-boarding virtualized network function (VNF) packages in a network functions virtualization (NFV) system
CN102736978B (en) A kind of method and device detecting the installment state of application program
EP3387528B1 (en) Updating dependent services
US8972963B2 (en) End-to-end patch automation and integration
US6871223B2 (en) System and method for agent reporting in to server
WO2020024419A1 (en) Testing method for service scenario, electronic device and readable storage medium
WO2020224238A1 (en) Blockchain node depolyment method, device and equipment, and storage medium
WO2018000607A1 (en) Method and electronic apparatus for identifying test case failure causes
CN110995473A (en) Service node control method and related equipment
CN111698283B (en) Management and control method, device, equipment and storage medium of distributed cluster host
CN112714158A (en) Transaction processing method, relay network, cross-link gateway, system, medium, and device
CN113448862A (en) Software version testing method and device and computer equipment
CN110727575B (en) Information processing method, system, device and storage medium
KR102194974B1 (en) System for monitoring and controling electric power system for process verification
CN109933351A (en) A kind of method and apparatus of reparation and upgrading linux system
US20230359741A1 (en) Trusted boot method and apparatus, electronic device, and readable storage medium
CN114996955A (en) Target range environment construction method and device for cloud-originated chaotic engineering experiment
CN110727945B (en) Virus scanning method, device and computer readable medium
CN114143308A (en) File uploading information processing method and device, computer equipment and storage medium
CN111459525A (en) Application update data processing system, application update data processing method, storage medium, and computer
CN113360172B (en) Application deployment method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20921881

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20921881

Country of ref document: EP

Kind code of ref document: A1