WO2019034095A1 - Software processing method and apparatus, electronic device and computer-readable storage medium - Google Patents
Software processing method and apparatus, electronic device and computer-readable storage medium Download PDFInfo
- Publication number
- WO2019034095A1 WO2019034095A1 PCT/CN2018/100731 CN2018100731W WO2019034095A1 WO 2019034095 A1 WO2019034095 A1 WO 2019034095A1 CN 2018100731 W CN2018100731 W CN 2018100731W WO 2019034095 A1 WO2019034095 A1 WO 2019034095A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- target
- software
- updated
- server
- version number
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
Definitions
- the present application relates to the field of software update technologies, and in particular, to a software processing method, apparatus, electronic device, and computer readable storage medium.
- Software online refers to replacing the lower version of the software with a higher version of the software, that is, the software is a software update process.
- the running environment refers to the environment in which the service line runs and the software in the server. It is assumed that the operating environment of the service line B1 is composed of the server 1 to the server 10, and the version of the target software C in the server 1 to the server 10 is V2.0.
- the service line is upgraded from B1 to B2, the operating environment needs to be changed to: The version of target software C is V2.1. Then, for the software C in the server 1 to the server 10, updating from the version V2.0 to the V2.1 is the online process of the software.
- the existing software online processing method has the disadvantage of being difficult to synchronize.
- An object of the present application is to provide a software processing method, apparatus, electronic device, and computer readable storage medium, which can efficiently implement online synchronization of target software in multiple servers.
- an embodiment of the present application provides a software processing method, where the method includes:
- the target software package to be updated is determined from the pre-stored software package to be updated, wherein the target software package to be updated is: the software package to be updated with the target identifier;
- the target software meets the update condition according to the target version number and the pre-recorded historical version number corresponding to the target identifier, where the history version number is: the software package corresponding to the target identifier and currently installed in the server version number;
- sending the target to be updated software package to the automated operation and maintenance component so that the automated operation and maintenance component determines at least one target of the installed target software according to the pre-stated installation relationship between the software and the server after receiving the target to be updated software.
- the server updates the target software in the at least one target server when it detects that the predetermined update condition is met.
- the scheduled update conditions include:
- the data transfer rate between the automated operation and maintenance component and the at least one target server reaches a predetermined rate threshold; and/or,
- the current running load of at least one target server is lower than a predetermined load value.
- the method further includes:
- the processing instruction is a rollback operation instruction, obtaining a specified version number for the target software included in the rollback operation instruction;
- the automated operation and maintenance component is a saltstack component, an ansible component, or a puppet component.
- determining whether the target software meets the update condition according to the target version number and the pre-recorded historical version number corresponding to the target identifier including:
- the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and when detecting that the predetermined update condition is met, The target software in at least one target server is updated, including:
- the automated operation and maintenance component After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And when it is detected that the predetermined update condition is met, the target software in the at least one target server is updated according to the target software package to be updated and the first installation configuration file.
- the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and when detecting that the predetermined update condition is met, The target software in at least one target server is updated, including:
- the automated operation and maintenance component After receiving the target to be updated software, the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and according to the target to be updated after detecting the predetermined update condition is met. And the second installation configuration file of the preset storage, the target software in the at least one target server is updated, wherein the second installation configuration file is: a file generated according to the target storage address, and the target storage address is an automatic operation and maintenance component. Stores the address used by the target package to be updated.
- the first installation configuration file records: a preset storage address for storing the target to be updated package and a communication address of the at least one target server.
- the automated operation and maintenance component stores the target to be updated software package according to the pre-stored first installation configuration file, and determines the installed target software according to the pre-stated installation relationship between the software and the server.
- At least one target server and when detecting that the predetermined update condition is met, and updating the target software in the at least one target server according to the target software package to be updated and the first installation configuration file, including:
- the automated operation and maintenance component After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And detecting, when the predetermined update condition is met, sending the preset storage address of the target software package to be updated to the at least one target server according to the communication address of the at least one target server recorded in the first installation configuration file, so that the at least one target The server acquires the target to be updated software package according to the obtained preset storage address, and updates the target software in the at least one target server by using the target to be updated software package.
- processing instructions for the software including:
- the embodiment of the present application provides a software processing apparatus, where the apparatus includes:
- a first obtaining module configured to obtain a processing instruction for the software, where the processing instruction carries a target identifier of the target software to be processed
- a first determining module configured to determine, from a pre-stored software package to be updated, a target software package to be updated, when the processing instruction is an online operation instruction, wherein the target software package to be updated is: the software to be updated with the target identifier package;
- a second determining module configured to determine a target version number of the target software package to be updated
- the determining module is configured to determine, according to the target version number and the pre-recorded historical version number corresponding to the target identifier, whether the target software meets the update condition, where the historical version number is: the target identifier corresponding to the target identifier and currently installed in the server The version number of the package;
- the update module is configured to send the target to be updated software package to the automatic operation and maintenance component if the judgment result of the determination module is yes, so that after the automatic operation and maintenance component receives the target to be updated software, according to the pre-statistical software and
- the installation relationship of the server determines at least one target server on which the target software is installed, and updates the target software in the at least one target server when detecting that the predetermined update condition is met.
- the predetermined update conditions include:
- the data transfer rate between the automated operation and maintenance component and the at least one target server reaches a predetermined rate threshold; and/or,
- the current running load of at least one target server is lower than a predetermined load value.
- the device further includes:
- An obtaining module configured to: when determining that the processing instruction is a rollback operation instruction, obtain a specified version number for the target software included in the rollback operation instruction;
- a second obtaining module configured to obtain a software package corresponding to the specified version number
- the processing module is configured to send the software package corresponding to the specified version number to the automatic operation and maintenance component, so that the automated operation and maintenance component receives the software package corresponding to the specified version number, and determines the installation relationship between the software and the server according to the pre-stated software. At least one target server of the target software is installed, and when it is detected that the predetermined rollback condition is met, the target software in the at least one target server is replaced by the software package corresponding to the specified version number.
- the automated operation and maintenance component is a saltstack component, an ansible component, or a puppet component.
- the determining module includes:
- a first determining submodule configured to determine a highest historical version number in a pre-recorded historical version number corresponding to the target identifier
- a judging sub-module configured to determine whether the target version number is higher than a highest historical version number
- a second determining submodule configured to determine that the target software meets the update condition if the judgment result of the submodule is yes
- the third determining submodule is configured to determine that the target software does not meet the update condition if the judgment result of the submodule is negative.
- the update module is specifically used to:
- the automated operation and maintenance component After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And when it is detected that the predetermined update condition is met, the target software in the at least one target server is updated according to the target software package to be updated and the first installation configuration file.
- the update module is specifically used to:
- the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and according to the target to be updated after detecting the predetermined update condition is met.
- the package and the pre-stored second installation configuration file update the target software in the at least one target server, wherein the second installation configuration file is: a file generated according to the target storage address, and the target storage address is an automatic operation and maintenance component storage. The address used by the target package to be updated.
- the first installation configuration file records at least: a preset storage address for storing the target to be updated package and a communication address of the at least one target server.
- the update module is specifically used to:
- the automated operation and maintenance component After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And detecting, when the predetermined update condition is met, sending the preset storage address of the target software package to be updated to the at least one target server according to the communication address of the at least one target server recorded in the first installation configuration file, so that the at least one target The server acquires the target to be updated software package according to the obtained preset storage address, and updates the target software in the at least one target server by using the target to be updated software package.
- the module is obtained, specifically for:
- an embodiment of the present application provides an electronic device, where the electronic device includes:
- a memory for storing a computer program
- the processor when used to execute a program stored on the memory, implements the steps of the software processing method described above.
- an embodiment of the present application provides a computer readable storage medium, where a computer program is stored in a computer readable storage medium, and the software processing method is implemented when the computer program is executed by a processor.
- an embodiment of the present application provides a computer program product comprising instructions that, when run on a computer, cause the computer to execute the software processing method.
- an embodiment of the present application provides a computer program that, when run on a computer, causes the computer to execute the software processing method.
- the terminal device may determine the target to be updated software package and the target to be updated software package from the software package to be updated when obtaining the software online operation instruction.
- the target version number; and in the case that the target version number meets the update condition, the target to be updated package is sent to the automated operation and maintenance component, so that the automated operation and maintenance component meets the target condition of the at least one target server when the update condition is met.
- Update This process can realize the on-line processing of the target software in at least one target server, and improve the efficiency of the software going online.
- FIG. 1 is a schematic diagram of a first process of a software processing method according to an embodiment of the present disclosure
- FIG. 2 is a second schematic flowchart of a software processing method according to an embodiment of the present application.
- FIG. 3 is a schematic diagram of a third process of a software processing method according to an embodiment of the present disclosure.
- FIG. 4 is a schematic diagram of a first structure of a software processing apparatus according to an embodiment of the present disclosure
- FIG. 5 is a schematic diagram of a second structure of a software processing apparatus according to an embodiment of the present disclosure.
- FIG. 6 is a schematic diagram of a third structure of a software processing apparatus according to an embodiment of the present disclosure.
- FIG. 7 is a schematic diagram of a first structure of an electronic device according to an embodiment of the present disclosure.
- FIG. 8 is a schematic diagram of a second structure of an electronic device according to an embodiment of the present disclosure.
- the embodiment of the present application provides a software processing method, device, electronic device, and computer readable storage medium, which are described in detail below.
- the execution body of a software processing method provided by the embodiment of the present application may be a software processing device.
- the software processing device can be run in the terminal device, so that the administrator can use the terminal device to perform software online, which is reasonable.
- FIG. 1 is a schematic flowchart of a software processing method according to an embodiment of the present disclosure, where the method includes the following steps:
- obtaining the processing instruction of the software may include: obtaining a processing instruction for the software from a preset integrated tool.
- the preset integrated tool is set in the terminal device, and the integrated tool can provide a human-computer interaction interface.
- icons of various different functions may be respectively set correspondingly, so that the administrator implements the clicked icon on the software by clicking an icon corresponding to a certain software.
- Corresponding function For example, the “online” icon corresponds to the software online function, the “rollback” icon corresponds to the software rollback function, the “software uninstall” icon corresponds to the software download function, and so on.
- an icon of a different function can be set for all software, and a function corresponding to the clicked icon can be realized by the manager clicking an icon.
- the preset integrated tool can be jenkins.
- Jenkins is an open source software project designed to provide an open, easy-to-use software platform that is a continuous integration tool developed in Java to monitor continuous repetitive work. Specific functions can include: continuous software release/testing of projects, monitoring of external call execution.
- Jenkins can provide a human-computer interaction interface for obtaining software processing instructions, which the terminal device then obtains from Jenkins. Exemplarily, the human-computer interaction interface provided by Jenkins has icons of various functions, one or more icons for the user to issue processing instructions to the software, such as an "online” button, a "rollback” button, and the like.
- the software processing method in the embodiment of the present application may be implemented by using a script.
- the script has a function of realizing a human-computer interaction interface, that is, the software processing device as an execution subject can be a script program.
- the management personnel can issue processing instructions for the software through the human-computer interaction interface provided by the software processing device, so that the software processing device obtains the processing instruction.
- the form of the human-computer interaction interface provided by the software processing device may refer to the human-computer interaction interface provided by the preset integrated tool, and details are not described herein.
- the processing instruction obtained in S101 carries the target identifier of the target software to be processed. It can be understood that there may be multiple kinds of software to be processed.
- the target identifier of the target software to be processed is also carried in the processing instruction.
- the target identifier has a one-to-one correspondence with the target software.
- Table 1 includes the correspondence between the target software and the target identifier.
- the processing instruction includes the target identifier A00, because the identifier A00 is the target identifier of the chat software A, it indicates that the pending instruction is made for the chat software A;
- the processing instruction includes the target identifier B02, because the identifier B02 is the target identifier of the shopping software B, so that the pending instruction is made for the shopping software B;
- the processing instruction includes the target identifier C01, because the identifier C01 is the target identifier of the payment software C, it indicates that the pending The instructions are made for payment software C.
- the terminal device can determine what type of instruction the processing instruction is.
- the target software package to be updated is determined from the pre-stored software package to be updated.
- a storage area for storing the software package to be updated is preset in the terminal device, and the software package to be updated in the storage area is a pre-stored software package to be updated, and the software package to be updated may include multiple Software package to be updated.
- the software package to be updated with the target identifier may be obtained according to the target identifier included in the processing instruction in step S101, and the obtained software package to be updated is determined as the target software to be updated.
- the software package identified by the software in the software package as the target identifier may be determined as the target software package to be updated.
- the pre-stored software package to be updated includes: the software package X to be updated, the software package Y to be updated, and the software package Z to be updated, and the software identifiers are: A00, B02, and C01;
- the software identifier A00 of the software package to be updated is the same as the target identifier A00, so that the software package X to be updated is the target software package to be updated;
- the target identifier carried in the processing instruction is B02 Since the software identifier B02 of the software package to be updated Y is the same as the target identifier B02, it is determined that the software package Y to be updated is the target software package to be updated; when the target identifier carried in the processing instruction is C01, the software package Z to be updated
- the software identifier C01 is the same as the target identifier C01, so it is determined that the software package Z to be updated is the target software package to be updated.
- the software package can include the version number of the software.
- the terminal device After determining the target software package to be updated, the terminal device can determine whether it is necessary to update the target software package to be updated to the server. The processing idea can first determine the target version number of the target software package to be updated.
- the target version number of the target software package to be updated may be determined from the name of the target software package to be updated.
- the name of the target package to be updated is: liaotian.V2.0.exe, then it can be determined that the version number of the target to be updated package is V2.0.
- the terminal device may obtain the target version number in the attribute by viewing the attribute of the target software package to be updated.
- the target to be updated software package is the software package X to be updated, and the terminal device can obtain the target version number directly from the attribute of the software package X to be updated: V2.5.
- the target version number of the target software package to be updated in the embodiment of the present application is only exemplary, and the target version number may also be obtained through other preset information fields of the target software package to be updated, which is not specifically limited in this embodiment of the present application. .
- S104 Determine, according to the target version number and the pre-recorded historical version number corresponding to the target identifier, whether the target software meets the update condition, and if yes, execute S105.
- the version number of all historically installed software packages of the target software is pre-recorded in the terminal device, and the version numbers of all installed software packages form a historical version number.
- the target software has a target identifier, all historical version numbers of the target software correspond to the target identifier of the target software.
- the target software is chat software A
- the target identifier is A00
- the historical version numbers corresponding to A00 are: V1.3, V1.5, V1.8, V1.9, V2.0, V2.1 , V2.2, V2.3, V2.4.
- FIG. 2 is a second schematic flowchart of a software processing method according to an embodiment of the present disclosure, which may include steps: S201, S202, S203, and S204. among them,
- the historical version number is: the version number of the software package corresponding to the target identifier and installed in the server.
- the version number V1.3 corresponding to the target identifier A00 indicates that the chat software A in the server has installed the software package with the version number V1.3, and the software includes the target identifier A00.
- the historical version number corresponding to the target identifier A00 is pre-recorded in the terminal device: V1.3, V1.5, V1.8, V1.9, V2.0, V2.1, V2.2, V2. 3, V2.4, according to the software naming rules: the V2.x series version is higher than the V1.x series version, so the highest V2.4 in the V2.x series version is the highest historical version number.
- the version number of the software will have different naming rules, and the highest version number can be found by naming rules.
- the software version is: V02.00.01. Assume that the large version number is 02.00 and the 01 is a small version number. When the large version number is the same, the larger version number is the same, the larger the smaller version number is, the higher the version is.
- the version number of V02.00.03 among the three version numbers V02.00.01, V02.00.02, and V02.00.03 is the highest.
- the version number can also be named by time. If it is named by time, the version number closest to the current time is the highest version number.
- the historical version number corresponding to the target identifier A00 is pre-recorded in the terminal device: V2016.03.20, V2016.08.01, V2017.02.01; V2016.03.20 indicates the software package for updating the target software on March 20, 2016. ;V2016.08.01 represents the software package for updating the target software on August 1, 2016; V2017.02.01 represents the software package for updating the target software on February 1, 2017; the closest to the current date is: 2017.02.01, Therefore, V2017.02.01 is the highest historical version number. Therefore, the highest version number can be obtained as long as the naming rule is set, and the embodiment of the present application does not specifically limit it.
- the obtained target version number is compared with the highest historical version number obtained in S201, and it is determined whether the target version number is higher than the highest historical version number.
- the highest historical version number of the chat software A is V2.4
- the target version number of the software package to be updated is V2.5.
- the target version number is determined to be higher than the highest historical version number.
- S203 is executed; the highest historical version number of the chat software A is V2.6, and the target version number of the software package to be updated is V2.5.
- the target version number is determined not to be higher than the highest history. Version number, execute S204.
- the highest historical version number of the chat software A is V2.4
- the target version number of the software package to be updated is V2.5, because the target version number is higher than the highest historical version number, indicating the target corresponding to the target version number.
- the version of the package to be updated is higher than the version of the package that was installed before, so it is determined that the target software meets the updated conditions.
- the highest historical version number of the chat software A is V2.6
- the target version number of the software package to be updated is V2.5. Because the target version number is not higher than the highest historical version number, it indicates that the target version number corresponds to The target to be updated package is the same as the one installed in history. Therefore, for the target software, the update is the same version of the replacement or even the version of the rewind. It does not have the meaning of the software update, so the target software is not determined. Meet the updated conditions.
- S105 Send the target to be updated software package to the automatic operation and maintenance component, so that after receiving the target to be updated software, the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And updating the target software in the at least one target server when detecting that the predetermined update condition is met.
- the terminal device in the case that the target software meets the update condition, sends the target software package to be updated to the automatic operation and maintenance component.
- the automated operation and maintenance component can be any one of a saltstack component, an ansible component, or a puppet component.
- the automated operation and maintenance component can be a general term for an automated operation and maintenance tool that can connect and control multiple servers. It has the characteristics of easy deployment, operation in a few minutes, scalability, and easy Manage tens of thousands of servers, fast enough, and seconds of communication between servers.
- the target software can be installed in those servers.
- the target software is chat software A
- the target server is obtained according to the information: server 1 to server 10.
- the number of the target servers in the embodiments of the present application is merely exemplary and does not specifically limit the embodiments of the present application.
- an update condition can be set, and when it is detected that the predetermined update condition is met, the target software in the at least one target server is updated, otherwise it is not updated.
- the predetermined update condition may be that a data transmission rate between the automated operation and maintenance component and the at least one target server reaches a predetermined rate threshold. It can be understood that when the data transmission rate between the automatic operation and maintenance component and any one of the target servers is too low, the target software to be updated and the transmission of the update command are affected, so the update effect is affected.
- the rate threshold may be set. If the set rate threshold is 1 M/s, when the real-time data transmission rate is less than 1 M/s, the update operation is not performed to avoid the transmission failure due to the transmission rate being too low, thereby causing the transmission to fail. This software update failed.
- a process may occur during the processing of the update, thereby causing an interruption of the update operation.
- the current running load of at least one target server is determined to be lower than a predetermined load value. Specifically, the load value may be set to 60%.
- the load value of the server is greater than 60%, the update action is not performed; otherwise, the update action is performed; to further improve the success rate of the target software update.
- the saltstack component adopts a brand-new infrastructure management method, which runs faster and generally runs in a few minutes. It has good scalability and is easy to manage tens of thousands of servers; and it is fast enough to achieve Second level communication with the server.
- Ansible is an emerging automation operation and maintenance component. Based on Python development, it combines the advantages of many operation and maintenance tools, and can realize functions such as batch system configuration, batch program deployment, and batch operation instructions.
- Puppet is a centralized configuration management system for Linux, Unix, and Windows platforms. It uses its own puppet description language to manage configuration files, software packages, system services, etc. Puppet uses a C/S star structure and can be combined with one or Several servers interact.
- the saltstack component, the ansible component or the puppet component can be used as an automated operation and maintenance component. They can communicate with one server at the same time, or communicate with multiple servers at the same time.
- the dimension component can update the target software to multiple servers at the same time to achieve the purpose of concurrent processing. Exemplarily, if there are 20 servers communicating with the automated operation and maintenance component, the automated operation and maintenance component can send the received target to be updated package to the 20 servers to perform target software on the 20 servers. Update.
- Parallel processing is used to update the target software to at least one target server, which can further improve the efficiency of the target software update; and can prevent these target servers from having different code differences.
- the terminal device may determine the target to-be-updated software package and the target version number of the target to-be-updated software package from the software package to be updated when obtaining the software online operation instruction; and determine the target version. If the number meets the update condition, the target to be updated package is sent to the automated operation and maintenance component, so that the automated operation and maintenance component updates the target software in the at least one target server when the update condition is met. This process can realize the on-line processing of the target software in at least one target server, and improve the efficiency of the software going online.
- the automated operation and maintenance component is based on the pre-stored first installation.
- the configuration file storage target to be updated according to the pre-stated software installation relationship with the server, determining at least one target server of the installed target software, and when detecting the compliance with the predetermined update condition, according to the target to be updated package and the first Install a configuration file to update the target software in at least one target server.
- the automated operation and maintenance component needs to be stored after receiving the target software package to be updated. Specifically, it may be stored in the terminal device or may be stored in other storage devices.
- the target software package to be updated may be stored in a fixed storage area of the device in the terminal, or may be stored in a storage device connected to the device in the terminal, such as an external hard disk storage device.
- a storage address may be preset in the first installation configuration file, and the automatic operation and maintenance component may obtain the preset storage address to store the software package to be updated.
- the preset storage address in the first installation configuration file is: F: ⁇ chat software A ⁇ March 2017, then the automated operation and maintenance component stores the received target to be updated package to “F: ⁇ chat”. In software A ⁇ March 2017, the automated operation and maintenance component then updates the target software in at least one target server according to the specific execution steps in the first installation configuration file.
- the first installation configuration file includes specific steps for the automated operation and maintenance component to communicate with at least one target server. Specifically, after storing the target software package to be updated, the automatic operation and maintenance component sends the target software package to be updated to each target server, and sends a software update instruction to each target server, and each target server obtains the software update instruction. The target software is updated directly using the target to be updated package.
- the automatic operation and maintenance component receives the After the target software is to be updated, the target to be updated package is stored according to the pre-stored first installation configuration file, and at least one target server to which the target software is installed is determined according to the pre-stated installation relationship between the software and the server. And when it is detected that the predetermined update condition is met, the preset storage address of the target software package to be updated is sent to the at least one target server according to the communication address of the at least one target server recorded in the first installation configuration file.
- the at least one target server may acquire the target to be updated software package according to the acquired preset storage address, and update the target software in the at least one target server by using the target to be updated software package.
- the automated operation and maintenance component sends the storage address of the storage target to be updated to each target server according to the communication address, and each target server can obtain the target to be updated software package.
- This process makes it possible for the target to be updated in all target servers to have no code difference; and the target server can be further improved by the pre-stored first installation configuration file and the update processing of the target software package to be updated. The efficiency of the target software update.
- the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And when it is detected that the predetermined update condition is met, the target software in the at least one target server is updated according to the target software package to be updated and the second installation configuration file stored in advance.
- the second installation configuration file is: a file generated according to the target storage address, and the target storage address is an address used by the automatic operation and maintenance component to store the target to be updated.
- the terminal device sends the target software package to be updated to the automatic operation and maintenance component, and the automatic operation and maintenance component obtains the target software package to be updated, and the storage address is the target storage address, and then generates the first storage address according to the target storage address.
- Second install the configuration file Specifically, the target storage address can be directly used as the content included in the second installation configuration file.
- the second installation configuration file can also contain the communication address of the target server.
- the automated operation and maintenance component can send the target storage address to the target server 1 to the target server 10 through the communication address of the target server, and the target server 1 to the target server 10 obtain the target to be updated software package from the automated operation and maintenance component according to the target storage address.
- the target server 1 to the target server 10 then perform update processing on the target software using the target to-be-updated software package.
- Each target server can obtain the target software package to be updated at the same time, so that the software package of the target software in the target server does not have a code difference; and the second installation can be generated according to the target address of the target software package to be updated.
- the update processing of the configuration file and the target software package to be updated can further improve the efficiency of the target software update in the server.
- FIG. 3 is a third schematic flowchart of the software processing method according to the embodiment of the present application. The following steps are added to the embodiment shown in FIG. 1 :
- the specified version number may also be obtained from the rollback operation instruction.
- the specified version number included in the rollback instruction obtained by the terminal device is V2.1
- the current version number of the target software running in the server is V2.5
- the purpose of the rollback is to move the target software from the current The V2.5 version is rolled back to the V2.1 version.
- the specified version number included in the rollback instruction obtained by the terminal device is V2.2
- the current version number of the target software running in the server is V2.6. The purpose of this rollback is to remove the target software from the current V2.6 version. Roll back to version V2.2.
- the terminal device saves the target to be updated software package corresponding to the online operation, so the historical installation software package of the target software is saved in the terminal device.
- the terminal device obtains the specified version number, the software package corresponding to the specified version number is obtained from the historical installation package.
- the historical installation packages stored in the terminal device are: software package x1, software package x2, software package x3, and software package x4, and the corresponding version numbers are: V2.1, V2.2, and V2.3. V2.4; in the case of the specified version number V2.1, the software package corresponding to V2.1 is: software package x1; in the case of the specified version number V2.2, the software corresponding to V2.2 is obtained.
- the package is: package x2.
- S108 Send the software package corresponding to the specified version number to the automatic operation and maintenance component, so that the automated operation and maintenance component determines the installed target according to the pre-stated installation relationship between the software and the server after receiving the software package corresponding to the specified version number.
- At least one target server of the software and when detecting that the predetermined rollback condition is met, replacing the target software in the at least one target server with the software package corresponding to the specified version number.
- the terminal device can send the software package x1 to the automated operation and maintenance component.
- the automated operation and maintenance component can directly send to at least one target server of the target software to be updated, and each target server will replace the currently installed target software by installing the software package x1.
- the terminal device may send the software package x1 to the automatic operation and maintenance component, and the automatic operation and maintenance component is configured according to the preset.
- the target server is in communication with the automated operation and maintenance component, the automated operation and maintenance component knows the communication address of the target server, and sends the storage address of the software package x1 to each target server according to the communication address.
- the server can go directly to the package x1.
- the target server will replace the currently installed target software with the installation package x1.
- the storage address of the storage package x1 and the communication address of each server may be stored in an installation configuration file, and the automatic operation and maintenance component performs communication with the target server according to the installation configuration file, thereby ensuring completion of the rollback process. .
- the terminal device may send the software package x1 to the automated operation and maintenance component.
- the automated operation and maintenance component stores the software package x1 and sends the storage address to the third installation configuration file, and the terminal device sends the software package x1 to the automated operation and maintenance component.
- the third installation configuration file may further include a communication address of the at least one target server, and the automatic operation and maintenance component executes according to the third installation configuration file: sending the storage address of the software package x1 to each target server, and each target server may Go directly to the package x1. In each target server, the server will replace the currently installed target software with the installation package x1.
- the method can automatically roll back to the command version number to implement the replacement operation of the current version of the target software, thereby improving the software rollback. effectiveness.
- the embodiment of the present application further provides a software processing apparatus.
- FIG. 4 is a schematic diagram of a first structure of a software processing apparatus according to an embodiment of the present disclosure, where the apparatus includes:
- a first obtaining module 401 configured to obtain a processing instruction for the software, where the processing instruction carries a target identifier of the target software to be processed;
- the first determining module 402 is configured to determine, from the pre-stored software package to be updated, a target software package to be updated, when the processing instruction is an online operation instruction, where the target software package to be updated is: to be updated with the target identifier.
- a second determining module 403, configured to determine a target version number of the target software package to be updated
- the determining module 404 is configured to determine, according to the target version number and the pre-recorded historical version number corresponding to the target identifier, whether the target software meets the update condition, where the historical version number is: the target identifier is corresponding and has been installed in the server.
- the update module 405 is configured to send the target software package to be updated to the automatic operation and maintenance component if the determination result of the determination module 404 is YES, so that the automatic operation and maintenance component receives the target software to be updated, according to the pre-statistic
- the installation relationship between the software and the server determines at least one target server on which the target software is installed, and updates the target software in the at least one target server when detecting that the predetermined update condition is met.
- the automated operation and maintenance component is a saltstack component, an ansible component, or a puppet component.
- the predetermined update conditions include:
- the data transfer rate between the automated operation and maintenance component and the at least one target server reaches a predetermined rate threshold; and/or,
- the current running load of at least one target server is lower than a predetermined load value.
- the update module 405 can be used to:
- the automated operation and maintenance component After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And when it is detected that the predetermined update condition is met, the target software in the at least one target server is updated according to the target software package to be updated and the first installation configuration file.
- the update module 405 can be configured to: after receiving the target to be updated software, determine, according to the pre-stated installation relationship between the software and the server, determine at least one target server of the installed target software, and detect When the predetermined update condition is met, the target software in the at least one target server is updated according to the target to be updated software package and the pre-stored second installation configuration file, where the second installation configuration file is: generated according to the target storage address.
- the file, the target storage address is the address used by the automated operation and maintenance component to store the target package to be updated.
- the first installation configuration file records: a preset storage address for storing the target software package to be updated and a communication address of the at least one target server.
- the update module 405 can be configured to: after receiving the target to be updated software, the automatic operation and maintenance component stores the target to be updated software package according to the pre-stored first installation configuration file, according to the pre-stated software and server installation relationship. Determining at least one target server of the target software installed, and transmitting a preset storage address of the target software package to be updated according to the communication address of the at least one target server recorded in the first installation configuration file when detecting the predetermined update condition is met And at least one target server, so that the at least one target server acquires the target to-be-updated software package according to the acquired preset storage address, and updates the target software in the at least one target server by using the target to-be-updated software package.
- the obtaining module 401 can be used to:
- the terminal device may determine the target to-be-updated software package and the target version number of the target to-be-updated software package from the software package to be updated when obtaining the software online operation instruction; and determine the target version. If the number meets the update condition, the target to be updated package is sent to the automated operation and maintenance component, so that the automated operation and maintenance component updates the target software in the at least one target server when the update condition is met.
- This process can realize the on-line processing of the target software in at least one target server, and improve the efficiency of the software going online.
- FIG. 5 is a schematic diagram of a second structure of a software processing apparatus according to an embodiment of the present disclosure. The following modules are added to the embodiment shown in FIG. 4:
- the obtaining module 406 is configured to: when determining that the processing instruction is a rollback operation instruction, obtain a specified version number for the target software included in the rollback operation instruction;
- a second obtaining module 407 configured to obtain a software package corresponding to the specified version number
- the processing module 408 sends the software package corresponding to the specified version number to the automatic operation and maintenance component, so that after receiving the software package corresponding to the specified version number, the automated operation and maintenance component determines that the software and the server are installed according to the pre-stated installation relationship. Installing at least one target server of the target software, and when detecting that the predetermined rollback condition is met, replacing the target software in the at least one target server with the software package corresponding to the specified version number.
- the method can automatically roll back to the instruction version number to implement the replacement operation of the current version of the target software, thereby improving the software rollback. effectiveness.
- FIG. 6 is a schematic diagram of a third structure of a software processing apparatus according to an embodiment of the present disclosure.
- the determining module 404 may include:
- the first determining submodule 601 determines the highest historical version number in the historical version number corresponding to the target identifier recorded in advance;
- a determining sub-module 602 configured to determine whether the target version number is higher than a highest historical version number
- a second determining sub-module 603, configured to determine that the target software meets the update condition if the determination result of the determining sub-module 602 is YES;
- the third determining sub-module 604 is configured to determine that the target software does not meet the update condition if the determination result of the sub-module 602 is negative.
- a schematic structural diagram of an electronic device includes: a processor 701 and a memory 702, where
- a memory 702 configured to store a computer program
- the processor 701 is configured to perform the following steps when executing the program stored on the memory:
- the target software package to be updated is determined from the pre-stored software package to be updated, wherein the target software package to be updated is: the software package to be updated with the target identifier;
- the target software meets the update condition according to the target version number and the pre-recorded historical version number corresponding to the target identifier, where the history version number is: the software package corresponding to the target identifier and currently installed in the server version number;
- sending the target to be updated software package to the automated operation and maintenance component so that the automated operation and maintenance component determines at least one target of the installed target software according to the pre-stated installation relationship between the software and the server after receiving the target to be updated software.
- the server updates the target software in the at least one target server when it detects that the predetermined update condition is met.
- the scheduled update conditions include:
- the data transfer rate between the automated operation and maintenance component and the at least one target server reaches a predetermined rate threshold; and/or,
- the current running load of at least one target server is lower than a predetermined load value.
- the method further includes:
- the processing instruction is a rollback operation instruction, obtaining a specified version number for the target software included in the rollback operation instruction;
- the automated operation and maintenance component is a saltstack component, an ansible component, or a puppet component.
- determining, according to the target version number and the pre-recorded historical version number corresponding to the target identifier, whether the target software meets the update condition including:
- the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and when detecting that the predetermined update condition is met, The target software in at least one target server is updated, including:
- the automated operation and maintenance component After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And when it is detected that the predetermined update condition is met, the target software in the at least one target server is updated according to the target software package to be updated and the first installation configuration file.
- the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and when detecting that the predetermined update condition is met, The target software in at least one target server is updated, including:
- the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and according to the target to be updated after detecting the predetermined update condition is met.
- the package and the pre-stored second installation configuration file update the target software in the at least one target server, wherein the second installation configuration file is: a file generated according to the target storage address, and the target storage address is an automatic operation and maintenance component storage. The address used by the target package to be updated.
- the first installation configuration file records: a preset storage address for storing the target to be updated package and a communication address of the at least one target server.
- the automated operation and maintenance component stores the target to be updated software package according to the pre-stored first installation configuration file, and determines the installed target software according to the pre-stated installation relationship between the software and the server. At least one target server, and when detecting that the predetermined update condition is met, updating the target software in the at least one target server according to the target software package to be updated and the first installation configuration file, including:
- the automated operation and maintenance component After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And detecting, when the predetermined update condition is met, sending the preset storage address of the target software package to be updated to the at least one target server according to the communication address of the at least one target server recorded in the first installation configuration file, so that the at least one target The server acquires the target to be updated software package according to the obtained preset storage address, and updates the target software in the at least one target server by using the target to be updated software package.
- processing instructions for the software including:
- the embodiment of the present application further provides an electronic device, as shown in FIG. 8, including a processor 801, a communication interface 802, a memory 803, and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 pass through the communication bus 804.
- a processor 801, the communication interface 802, and the memory 803 pass through the communication bus 804.
- the processor 801 is configured to implement the method steps of the software processing when the program stored on the memory 803 is executed.
- the communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus.
- PCI Peripheral Component Interconnect
- EISA Extended Industry Standard Architecture
- the communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
- the communication interface is used for communication between the above electronic device and other devices.
- the memory may include a random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.
- RAM random access memory
- NVM non-volatile memory
- the memory may also be at least one storage device located away from the aforementioned processor.
- the above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; or may be a digital signal processing (DSP), dedicated integration.
- CPU central processing unit
- NP network processor
- DSP digital signal processing
- ASIC Application Specific Integrated Circuit
- FPGA Field-Programmable Gate Array
- the embodiment of the present application further provides a computer readable storage medium.
- the computer readable storage medium stores a computer program. When the computer program is executed by the processor, the following steps are performed:
- the target software package to be updated is determined from the pre-stored software package to be updated, wherein the target software package to be updated is: the software package to be updated with the target identifier;
- the target software meets the update condition according to the target version number and the pre-recorded historical version number corresponding to the target identifier, where the history version number is: the software package corresponding to the target identifier and currently installed in the server version number;
- sending the target to be updated software package to the automated operation and maintenance component so that the automated operation and maintenance component determines at least one target of the installed target software according to the pre-stated installation relationship between the software and the server after receiving the target to be updated software.
- the server updates the target software in the at least one target server when it detects that the predetermined update condition is met.
- the scheduled update conditions include:
- the data transfer rate between the automated operation and maintenance component and the at least one target server reaches a predetermined rate threshold; and/or,
- the current running load of at least one target server is lower than a predetermined load value.
- the method further includes:
- the processing instruction is a rollback operation instruction, obtaining a specified version number for the target software included in the rollback operation instruction;
- the automated operation and maintenance component is a saltstack component, an ansible component, or a puppet component.
- determining whether the target software meets the update condition according to the target version number and the pre-recorded historical version number corresponding to the target identifier including:
- the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and when detecting that the predetermined update condition is met, The target software in at least one target server is updated, including:
- the automated operation and maintenance component After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And when it is detected that the predetermined update condition is met, the target software in the at least one target server is updated according to the target software package to be updated and the first installation configuration file.
- the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and when detecting that the predetermined update condition is met, The target software in at least one target server is updated, including:
- the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and according to the target to be updated after detecting the predetermined update condition is met.
- the package and the pre-stored second installation configuration file update the target software in the at least one target server, wherein the second installation configuration file is: a file generated according to the target storage address, and the target storage address is an automatic operation and maintenance component storage. The address used by the target package to be updated.
- the first installation configuration file records: a preset storage address for storing the target to be updated package and a communication address of the at least one target server.
- the automated operation and maintenance component stores the target to be updated software package according to the pre-stored first installation configuration file, and determines the installed target software according to the pre-stated installation relationship between the software and the server. At least one target server, and when detecting that the predetermined update condition is met, updating the target software in the at least one target server according to the target software package to be updated and the first installation configuration file, including:
- the automated operation and maintenance component After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And detecting, when the predetermined update condition is met, sending the preset storage address of the target software package to be updated to the at least one target server according to the communication address of the at least one target server recorded in the first installation configuration file, so that the at least one target The server acquires the target to be updated software package according to the obtained preset storage address, and updates the target software in the at least one target server by using the target to be updated software package.
- processing instructions for the software including:
- the embodiment of the present application further provides a computer program product comprising instructions, which when executed on a computer, cause the computer to execute the above software processing method.
- the embodiment of the present application also provides a computer program that, when run on a computer, causes the computer to execute the above software processing method.
- the various embodiments in the present specification are described in a related manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments.
- the device, the electronic device and the computer readable storage medium, the computer program product including the instructions, and the computer program embodiment are relatively similar to the method embodiment, and the description is relatively simple. Part of the description can be.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
- Information Transfer Between Computers (AREA)
Abstract
A software processing method and apparatus, an electronic device and a computer-readable storage medium. The method comprises: acquiring a processing instruction for software (S101); when it is determined that the processing instruction is an on-line operational instruction, determining, from pre-stored software packages to be updated, a target software package to be updated (S102); determining a target version number that the target software package to be updated has (S103); when target software satisfies an update condition, sending, to an automated operation and maintenance assembly, the target software package to be updated, after receiving the target software to be updated, determining, according to an installation relationship between software and servers recorded in advance, at least one target server on which the target software has been installed, and when detecting that a pre-determined update condition is satisfied, updating the target software in the at least one target server (S105). The method can realise synchronous on-line processing of target software in at least one target server.
Description
本申请要求于2017年08月16日提交中国专利局、申请号为201710701202.2、发明名称为“软件处理方法、装置、电子设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application filed on August 16, 2017, the Chinese Patent Office, the application number is 201710701202.2, and the invention is entitled "Software processing method, device, electronic device and computer readable storage medium". This is incorporated herein by reference.
本申请涉及软件更新技术领域,特别是涉及一种软件处理方法、装置、电子设备及计算机可读存储介质。The present application relates to the field of software update technologies, and in particular, to a software processing method, apparatus, electronic device, and computer readable storage medium.
软件上线是指用高版本的软件替代低版本的软件,也就是说,软件上线是一个软件更新的过程。举例而言,为实现业务线的运行,需要为业务线配置运行环境,运行环境是指业务线所运行的服务器以及服务器中的软件共同组成的环境。假设业务线B1的运行环境由服务器1至服务器10组成,且服务器1至服务器10中的目标软件C的版本均为V2.0;当业务线由B1升级至B2,运行环境同时需要变更为:目标软件C的版本为V2.1。那么对于服务器1至服务器10中的软件C来说,从版本V2.0更新至V2.1就是软件的上线过程。现有的软件上线处理方法,具有同步困难的缺点。Software online refers to replacing the lower version of the software with a higher version of the software, that is, the software is a software update process. For example, to implement the operation of the service line, you need to configure the running environment for the service line. The running environment refers to the environment in which the service line runs and the software in the server. It is assumed that the operating environment of the service line B1 is composed of the server 1 to the server 10, and the version of the target software C in the server 1 to the server 10 is V2.0. When the service line is upgraded from B1 to B2, the operating environment needs to be changed to: The version of target software C is V2.1. Then, for the software C in the server 1 to the server 10, updating from the version V2.0 to the V2.1 is the online process of the software. The existing software online processing method has the disadvantage of being difficult to synchronize.
发明内容Summary of the invention
本申请实施例的目的在于提供一种软件处理方法、装置、电子设备及计算机可读存储介质,能够高效地实现目标软件在多个服务器中同步上线。An object of the present application is to provide a software processing method, apparatus, electronic device, and computer readable storage medium, which can efficiently implement online synchronization of target software in multiple servers.
第一方面,本申请实施例提供了一种软件处理方法,该方法包括:In a first aspect, an embodiment of the present application provides a software processing method, where the method includes:
获得针对于软件的处理指令,其中,处理指令中携带有待处理的目标软件的目标标识;Obtaining a processing instruction for the software, where the processing instruction carries a target identifier of the target software to be processed;
当判断出处理指令为上线操作指令时,从预先存储的待更新软件包中确定目标待更新软件包,其中,目标待更新软件包为:具有目标标识的待更新软件包;When it is determined that the processing instruction is an online operation instruction, the target software package to be updated is determined from the pre-stored software package to be updated, wherein the target software package to be updated is: the software package to be updated with the target identifier;
确定目标待更新软件包所具有的目标版本号;Determining the target version number of the target package to be updated;
根据目标版本号和预先记录的与目标标识对应的历史版本号,判断目标软件是否符合更新条件,其中,历史版本号为:目标标识对应的并且当前已在服务器中安装过的软件包所具有的版本号;Determining whether the target software meets the update condition according to the target version number and the pre-recorded historical version number corresponding to the target identifier, where the history version number is: the software package corresponding to the target identifier and currently installed in the server version number;
如果是,发送目标待更新软件包至自动化运维组件,以使自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,对至少一个目标服务器中的目标软件进行更新。If yes, sending the target to be updated software package to the automated operation and maintenance component, so that the automated operation and maintenance component determines at least one target of the installed target software according to the pre-stated installation relationship between the software and the server after receiving the target to be updated software. The server updates the target software in the at least one target server when it detects that the predetermined update condition is met.
可选的,预定更新条件包括:Optionally, the scheduled update conditions include:
自动化运维组件与至少一个目标服务器之间的数据传输速率达到预定速率阈值;和/或,The data transfer rate between the automated operation and maintenance component and the at least one target server reaches a predetermined rate threshold; and/or,
至少一个目标服务器的当前运行负载低于预定负载值。The current running load of at least one target server is lower than a predetermined load value.
可选的,该方法还包括:Optionally, the method further includes:
当判断出处理指令为回滚操作指令时,获取回滚操作指令中包含的针对目标软件的指定版本号;When it is determined that the processing instruction is a rollback operation instruction, obtaining a specified version number for the target software included in the rollback operation instruction;
获得指定版本号对应的软件包;Obtain the software package corresponding to the specified version number;
将指定版本号对应的软件包发送至自动化运维组件,以使自动化运维组件在接收到指定版本号对应的软件包后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定回滚条件时,采用指定版本号对应的软件包对至少一个目标服务器中的目标软件进行替换。Send the software package corresponding to the specified version number to the automated operation and maintenance component, so that the automated operation and maintenance component determines the installed software of the target software according to the pre-stated installation relationship between the software and the server after receiving the software package corresponding to the specified version number. At least one target server, and when detecting that the predetermined rollback condition is met, replacing the target software in the at least one target server with the software package corresponding to the specified version number.
可选的,自动化运维组件为saltstack组件、ansible组件或puppet组件。Optionally, the automated operation and maintenance component is a saltstack component, an ansible component, or a puppet component.
可选的,根据目标版本号和预先记录的与目标标识对应的历史版本号,判断目标软件是否符合更新条件,包括:Optionally, determining whether the target software meets the update condition according to the target version number and the pre-recorded historical version number corresponding to the target identifier, including:
在预先记录的与目标标识对应的历史版本号中,确定最高历史版本号;Determining a highest historical version number in a pre-recorded historical version number corresponding to the target identifier;
判断目标版本号是否高于最高历史版本号;Determine whether the target version number is higher than the highest historical version number;
如果是,确定目标软件符合更新条件;If yes, determine that the target software meets the update criteria;
如果否,确定目标软件不符合更新条件。If no, make sure the target software does not meet the update criteria.
可选的,自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,对至少一个目标服务器中的目标软件进行更新,包括:Optionally, after receiving the target to be updated software, the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and when detecting that the predetermined update condition is met, The target software in at least one target server is updated, including:
自动化运维组件在接收到目标待更新软件后,根据预先存储的第一安装配置文件存储目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据目标待更新软件包以及第一安装配置文件,对至少一个目标服务器中的目标软件进行更新。After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And when it is detected that the predetermined update condition is met, the target software in the at least one target server is updated according to the target software package to be updated and the first installation configuration file.
可选的,自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,对至少一个目标服务器中的目标软件进行更新,包括:Optionally, after receiving the target to be updated software, the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and when detecting that the predetermined update condition is met, The target software in at least one target server is updated, including:
自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据目标待更新软件包以及预设存储的第二安装配置文件,对至少一个目标服务器中的目标软件进行更新,其中,第二安装配置文件为:根据目标存储地址所生成的文件,目标存储地址为自动化运维组件存储目标待更新软件包所利用的地址。After receiving the target to be updated software, the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and according to the target to be updated after detecting the predetermined update condition is met. And the second installation configuration file of the preset storage, the target software in the at least one target server is updated, wherein the second installation configuration file is: a file generated according to the target storage address, and the target storage address is an automatic operation and maintenance component. Stores the address used by the target package to be updated.
可选的,第一安装配置文件中记录有:用于存储目标待更新软件包的预设存储地址和至少一个目标服务器的通信地址。Optionally, the first installation configuration file records: a preset storage address for storing the target to be updated package and a communication address of the at least one target server.
可选的,自动化运维组件在接收到目标待更新软件后,根据预先存储的第一安装配置文件存储目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,并根据目标待更新软件包以及第一安装配置文件,对至少一个目标服务器中的目标软件进行更新,包括:Optionally, after receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated software package according to the pre-stored first installation configuration file, and determines the installed target software according to the pre-stated installation relationship between the software and the server. At least one target server, and when detecting that the predetermined update condition is met, and updating the target software in the at least one target server according to the target software package to be updated and the first installation configuration file, including:
自动化运维组件在接收到目标待更新软件后,根据预先存储的第一安装配置文件存储目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据第一安装配置文件中记录的至少一个目标服务器的通信地址,发送目标待更新软件包的预设存储地址至至少一个目标服务器,以使至少一个目标服务器根据所获取的预设存储地址获取目标待更新软件包,并利用目标待更新软件包对至少一个目标服务器中的目标软件进行更新。After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And detecting, when the predetermined update condition is met, sending the preset storage address of the target software package to be updated to the at least one target server according to the communication address of the at least one target server recorded in the first installation configuration file, so that the at least one target The server acquires the target to be updated software package according to the obtained preset storage address, and updates the target software in the at least one target server by using the target to be updated software package.
可选的,获得针对于软件的处理指令,包括:Optionally, obtaining processing instructions for the software, including:
从预设的集成工具中获得针对于软件的处理指令。Obtain processing instructions for the software from the preset integration tools.
第二方面,本申请实施例提供了一种软件处理装置,装置包括:In a second aspect, the embodiment of the present application provides a software processing apparatus, where the apparatus includes:
第一获得模块,用于获得针对于软件的处理指令,其中,处理指令中携带有待处理的目标软件的目标标识;a first obtaining module, configured to obtain a processing instruction for the software, where the processing instruction carries a target identifier of the target software to be processed;
第一确定模块,用于当判断出处理指令为上线操作指令时,从预先存储的待更新软件包中确定目标待更新软件包,其中,目标待更新软件包为:具有目标标识的待更新软件包;a first determining module, configured to determine, from a pre-stored software package to be updated, a target software package to be updated, when the processing instruction is an online operation instruction, wherein the target software package to be updated is: the software to be updated with the target identifier package;
第二确定模块,用于确定目标待更新软件包所具有的目标版本号;a second determining module, configured to determine a target version number of the target software package to be updated;
判断模块,用于根据目标版本号和预先记录的与目标标识对应的历史版本号,判断目标软件是否符合更新条件,其中,历史版本号为:目标标识对应的并且当前已在服务器中安装过的软件包所具有的版本号;The determining module is configured to determine, according to the target version number and the pre-recorded historical version number corresponding to the target identifier, whether the target software meets the update condition, where the historical version number is: the target identifier corresponding to the target identifier and currently installed in the server The version number of the package;
更新模块,用于在判断模块的判断结果为是的情况下,发送目标待更新软件包至自动化运维组件,以使自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,对至少一个目标服务器中的目标软件进行更新。The update module is configured to send the target to be updated software package to the automatic operation and maintenance component if the judgment result of the determination module is yes, so that after the automatic operation and maintenance component receives the target to be updated software, according to the pre-statistical software and The installation relationship of the server determines at least one target server on which the target software is installed, and updates the target software in the at least one target server when detecting that the predetermined update condition is met.
具体的,预定更新条件包括:Specifically, the predetermined update conditions include:
自动化运维组件与至少一个目标服务器之间的数据传输速率达到预定速率阈值;和/或,The data transfer rate between the automated operation and maintenance component and the at least one target server reaches a predetermined rate threshold; and/or,
至少一个目标服务器的当前运行负载低于预定负载值。The current running load of at least one target server is lower than a predetermined load value.
可选的,装置还包括:Optionally, the device further includes:
获取模块,用于当判断出处理指令为回滚操作指令时,获取回滚操作指令中包含的针对目标软件的指定版本号;An obtaining module, configured to: when determining that the processing instruction is a rollback operation instruction, obtain a specified version number for the target software included in the rollback operation instruction;
第二获得模块,用于获得指定版本号对应的软件包;a second obtaining module, configured to obtain a software package corresponding to the specified version number;
处理模块,用于将指定版本号对应的软件包发送至自动化运维组件,以使自动化运维组件在接收到指定版本号对应的软件包后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定回滚条件时,采用指定版本号对应的软件包对至少一个目标服务器中的目标软件进行替换。The processing module is configured to send the software package corresponding to the specified version number to the automatic operation and maintenance component, so that the automated operation and maintenance component receives the software package corresponding to the specified version number, and determines the installation relationship between the software and the server according to the pre-stated software. At least one target server of the target software is installed, and when it is detected that the predetermined rollback condition is met, the target software in the at least one target server is replaced by the software package corresponding to the specified version number.
可选的,自动化运维组件为saltstack组件、ansible组件或puppet组件。Optionally, the automated operation and maintenance component is a saltstack component, an ansible component, or a puppet component.
可选的,判断模块,包括:Optionally, the determining module includes:
第一确定子模块,用于在预先记录的与目标标识对应的历史版本号中,确定最高历史版本号;a first determining submodule, configured to determine a highest historical version number in a pre-recorded historical version number corresponding to the target identifier;
判断子模块,用于判断目标版本号是否高于最高历史版本号;a judging sub-module, configured to determine whether the target version number is higher than a highest historical version number;
第二确定子模块,用于在判断子模块的判断结果为是的情况下,确定目标软件符合更新条件;a second determining submodule, configured to determine that the target software meets the update condition if the judgment result of the submodule is yes;
第三确定子模块,用于在判断子模块的判断结果为否的情况下,确定目标软件不符合更新条件。The third determining submodule is configured to determine that the target software does not meet the update condition if the judgment result of the submodule is negative.
可选的,更新模块,具体用于:Optionally, the update module is specifically used to:
自动化运维组件在接收到目标待更新软件后,根据预先存储的第一安装配置文件存储目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据目标待更新软件包以及第一安装配置文件,对至少一个目标服务器中的目标软件进行更新。After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And when it is detected that the predetermined update condition is met, the target software in the at least one target server is updated according to the target software package to be updated and the first installation configuration file.
可选的,更新模块,具体用于:Optionally, the update module is specifically used to:
自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据目标待更新软件包以及预先存储的第二安装配置文件,对至少一个目标服务器中的目标软件进行更新,其中,第二安装配置文件为:根据目标存储地址所生成的文件,目标存储地址为自动化运维组件存储目标待更新软件包所利用的地址。After receiving the target to be updated software, the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and according to the target to be updated after detecting the predetermined update condition is met. The package and the pre-stored second installation configuration file update the target software in the at least one target server, wherein the second installation configuration file is: a file generated according to the target storage address, and the target storage address is an automatic operation and maintenance component storage. The address used by the target package to be updated.
可选的,第一安装配置文件中至少记录有:用于存储目标待更新软件包的预设存储地址和至少一个目标服务器的通信地址。Optionally, the first installation configuration file records at least: a preset storage address for storing the target to be updated package and a communication address of the at least one target server.
可选的,更新模块,具体用于:Optionally, the update module is specifically used to:
自动化运维组件在接收到目标待更新软件后,根据预先存储的第一安装配置文件存储目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据第一安装配置文件中记录的至少一个目标服务器的通信地址,发送目标待更新软件包的预设存储地址至至少一个目标服务器,以使至少一个目标服务器根据所获取的预设存储地址获取目标待更新软件包,并利用目标待更新软件包对至少一个目标服务器中的目标软件进行更新。After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And detecting, when the predetermined update condition is met, sending the preset storage address of the target software package to be updated to the at least one target server according to the communication address of the at least one target server recorded in the first installation configuration file, so that the at least one target The server acquires the target to be updated software package according to the obtained preset storage address, and updates the target software in the at least one target server by using the target to be updated software package.
可选的,获得模块,具体用于:Optionally, the module is obtained, specifically for:
从预设的集成工具中获得针对于软件的处理指令。Obtain processing instructions for the software from the preset integration tools.
第三方面,本申请实施例提供了一种电子设备,电子设备包括:In a third aspect, an embodiment of the present application provides an electronic device, where the electronic device includes:
处理器和存储器,其中,a processor and a memory, wherein
存储器,用于存放计算机程序;a memory for storing a computer program;
处理器,用于执行存储器上所存放的程序时,实现上述软件处理方法的步骤。The processor, when used to execute a program stored on the memory, implements the steps of the software processing method described above.
第四方面,本申请实施例提供了一种计算机可读存储介质,计算机可读存储介质内存储有计算机程序,计算机程序被处理器执行时实现上述软件处理方法。In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, where a computer program is stored in a computer readable storage medium, and the software processing method is implemented when the computer program is executed by a processor.
第五方面,本申请实施例提供了一种包含指令的计算机程序产品,当其 在计算机上运行时,使得计算机执行上述软件处理方法。In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions that, when run on a computer, cause the computer to execute the software processing method.
第六方面,本申请实施例提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述软件处理方法。In a sixth aspect, an embodiment of the present application provides a computer program that, when run on a computer, causes the computer to execute the software processing method.
本申请实施例提供的软件处理方法、装置、电子设备及计算机可读存储介质,终端设备可以在获得软件上线操作指令时,从待更新软件包中确定目标待更新软件包以及目标待更新软件包的目标版本号;并在判断目标版本号符合更新条件的情况下,发送目标待更新软件包至自动化运维组件,以使自动化运维组件在符合更新条件时对至少一个目标服务器中的目标软件进行更新。这个过程能够实现至少一个目标服务器中的目标软件同步上线处理,提高了软件上线的效率。The software processing method, the device, the electronic device and the computer readable storage medium provided by the embodiment of the present application, the terminal device may determine the target to be updated software package and the target to be updated software package from the software package to be updated when obtaining the software online operation instruction. The target version number; and in the case that the target version number meets the update condition, the target to be updated package is sent to the automated operation and maintenance component, so that the automated operation and maintenance component meets the target condition of the at least one target server when the update condition is met. Update. This process can realize the on-line processing of the target software in at least one target server, and improve the efficiency of the software going online.
为了更清楚地说明本申请实施例和现有技术的技术方案,下面对实施例和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application and the technical solutions of the prior art, the following description of the embodiments and the drawings used in the prior art will be briefly introduced. Obviously, the drawings in the following description are only Some embodiments of the application may also be used to obtain other figures from those of ordinary skill in the art without departing from the scope of the invention.
图1为本申请实施例提供的软件处理方法的第一种流程示意图;FIG. 1 is a schematic diagram of a first process of a software processing method according to an embodiment of the present disclosure;
图2为本申请实施例提供的软件处理方法的第二种流程示意图;2 is a second schematic flowchart of a software processing method according to an embodiment of the present application;
图3为本申请实施例提供的软件处理方法的第三种流程示意图;FIG. 3 is a schematic diagram of a third process of a software processing method according to an embodiment of the present disclosure;
图4为本申请实施例提供的软件处理装置的第一种结构示意图;4 is a schematic diagram of a first structure of a software processing apparatus according to an embodiment of the present disclosure;
图5为本申请实施例提供的软件处理装置的第二种结构示意图;FIG. 5 is a schematic diagram of a second structure of a software processing apparatus according to an embodiment of the present disclosure;
图6为本申请实施例提供的软件处理装置的第三种结构示意图;FIG. 6 is a schematic diagram of a third structure of a software processing apparatus according to an embodiment of the present disclosure;
图7为本申请实施例提供的电子设备的第一种结构示意图;FIG. 7 is a schematic diagram of a first structure of an electronic device according to an embodiment of the present disclosure;
图8为本申请实施例提供的电子设备的第二种结构示意图。FIG. 8 is a schematic diagram of a second structure of an electronic device according to an embodiment of the present disclosure.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
为解决现有技术问题,本申请实施例提供了一种软件处理方法、装置、电子设备及计算机可读存储介质,以下进行详细说明。To solve the prior art problem, the embodiment of the present application provides a software processing method, device, electronic device, and computer readable storage medium, which are described in detail below.
需要说明的是,本申请实施例提供的一种软件处理方法的执行主体可以为一种软件处理装置。在实际应用中,该软件处理装置可以运行于终端设备中,从而,管理人员可以利用该终端设备进行软件上线,这都是合理的。It should be noted that the execution body of a software processing method provided by the embodiment of the present application may be a software processing device. In practical applications, the software processing device can be run in the terminal device, so that the administrator can use the terminal device to perform software online, which is reasonable.
图1为本申请实施例提供的软件处理方法的一种流程示意图,方法包括步骤:FIG. 1 is a schematic flowchart of a software processing method according to an embodiment of the present disclosure, where the method includes the following steps:
S101,获得针对于软件的处理指令。S101. Obtain a processing instruction for the software.
需要说明的是,在一种实现方式中,获得软件的处理指令可以包括:从预设的集成工具中获得针对于软件的处理指令。预设的集成工具设置于终端设备中,该集成工具可以提供人机交互界面。示例性的,在该人机交互界面中,针对每一软件而言,可以分别对应设置各种不同功能的图标,以使得管理人员通过点击某软件对应的图标来对该软件实现与所点击图标对应的功能。举例而言:“上线”图标对应软件上线功能,“回滚”图标对应软件回滚功能,“软件卸载”图标对应软件下载功能,等等。当然,在该人机交互界面中,可以针对所有软件,设置不同功能的图标,通过管理人员点击某一图标来实现与所点击图标对应的功能。It should be noted that, in an implementation manner, obtaining the processing instruction of the software may include: obtaining a processing instruction for the software from a preset integrated tool. The preset integrated tool is set in the terminal device, and the integrated tool can provide a human-computer interaction interface. Exemplarily, in the human-computer interaction interface, for each software, icons of various different functions may be respectively set correspondingly, so that the administrator implements the clicked icon on the software by clicking an icon corresponding to a certain software. Corresponding function. For example, the “online” icon corresponds to the software online function, the “rollback” icon corresponds to the software rollback function, the “software uninstall” icon corresponds to the software download function, and so on. Of course, in the human-computer interaction interface, an icon of a different function can be set for all software, and a function corresponding to the clicked icon can be realized by the manager clicking an icon.
在一种实现方式中,预设的集成工具可以为jenkins。jenkins是一个开源软件项目,旨在提供一个开放易用的软件平台,它是基于Java开发的一种持续集成工具,用于监控持续重复的工作。具体的功能可以包括:持续的软件版本发布/测试项目、监控外部调用执行的工作。Jenkins可以提供一个用于获取软件处理指令的人机交互界面,然后终端设备从Jenkins获得该处理指令。示例性的,Jenkins提供的人机交互界面中有多种功能的图标,其中的一个或 者多个图标供用户下达对软件的处理指令,如“上线”按钮、“回滚”按钮等等。In one implementation, the preset integrated tool can be jenkins. Jenkins is an open source software project designed to provide an open, easy-to-use software platform that is a continuous integration tool developed in Java to monitor continuous repetitive work. Specific functions can include: continuous software release/testing of projects, monitoring of external call execution. Jenkins can provide a human-computer interaction interface for obtaining software processing instructions, which the terminal device then obtains from Jenkins. Exemplarily, the human-computer interaction interface provided by Jenkins has icons of various functions, one or more icons for the user to issue processing instructions to the software, such as an "online" button, a "rollback" button, and the like.
在另一种实现方式中,本申请实施例中的软件处理方法可以通过一个脚本来实现。脚本具有实现人机交互界面的功能,也就是说,作为执行主体的软件处理装置可以为脚本程序。这样,管理人员可以通过该软件处理装置所提供的人机交互界面来发出针对于软件的处理指令,以使软件处理装置获得该处理指令。其中,该软件处理装置所提供的人机交互界面的形式可以参照上述的预设的集成工具所提供的人机交互界面,在此不做赘述。In another implementation manner, the software processing method in the embodiment of the present application may be implemented by using a script. The script has a function of realizing a human-computer interaction interface, that is, the software processing device as an execution subject can be a script program. In this way, the management personnel can issue processing instructions for the software through the human-computer interaction interface provided by the software processing device, so that the software processing device obtains the processing instruction. The form of the human-computer interaction interface provided by the software processing device may refer to the human-computer interaction interface provided by the preset integrated tool, and details are not described herein.
具体的,S101中获得的处理指令中携带有待处理的目标软件的目标标识。可以理解的是,待处理的软件可能有多种,当获得待处理软件的处理指令时,还需要知道该处理指令是针对哪一个软件的操作;所以为了获取该处理指令所针对的具体软件,在该处理指令中还携带有待处理目标软件的目标标识。Specifically, the processing instruction obtained in S101 carries the target identifier of the target software to be processed. It can be understood that there may be multiple kinds of software to be processed. When obtaining the processing instruction of the software to be processed, it is also necessary to know which software operation the processing instruction is for; therefore, in order to obtain the specific software for which the processing instruction is directed, The target identifier of the target software to be processed is also carried in the processing instruction.
可以理解的是,目标标识与目标软件是一一对应的关系,示例性的,如表1所示,表1包含了目标软件和目标标识的对应关系。例如,当处理指令中包含目标标识A00时,因为标识A00是聊天软件A的目标标识,所以表示该待处理指令是针对聊天软件A做出的;当处理指令中包含目标标识B02时,因为标识B02是购物软件B的目标标识,所以表示该待处理指令是针对购物软件B做出的;当处理指令中包含目标标识C01时,因为标识C01是支付软件C的目标标识,所以表示该待处理指令是针对支付软件C做出的。It can be understood that the target identifier has a one-to-one correspondence with the target software. As an example, as shown in Table 1, Table 1 includes the correspondence between the target software and the target identifier. For example, when the processing instruction includes the target identifier A00, because the identifier A00 is the target identifier of the chat software A, it indicates that the pending instruction is made for the chat software A; when the processing instruction includes the target identifier B02, because the identifier B02 is the target identifier of the shopping software B, so that the pending instruction is made for the shopping software B; when the processing instruction includes the target identifier C01, because the identifier C01 is the target identifier of the payment software C, it indicates that the pending The instructions are made for payment software C.
表1Table 1
软件software | 聊天软件AChat software A | 购物软件BShopping software B | 支付软件CPayment software C |
目标标识Target identifier | A00A00 | B02B02 | C01C01 |
S102,当判断出处理指令为上线操作指令时,从预先存储的待更新软件包中确定目标待更新软件包,目标待更新软件包为:具有目标标识的待更新软件包。S102, when it is determined that the processing instruction is an online operation instruction, determining a target software package to be updated from the pre-stored software package to be updated, and the target software package to be updated is: the software package to be updated with the target identifier.
需要说明的是,终端设备在接收到处理指令以后,可以判断该处理指令是何种类型的指令。当判断出为上线操作指令时,从预先存储的待更新软件包中确定目标待更新软件包。It should be noted that after receiving the processing instruction, the terminal device can determine what type of instruction the processing instruction is. When it is determined that the online operation instruction is an online operation instruction, the target software package to be updated is determined from the pre-stored software package to be updated.
可以理解的是,终端设备中预先设置有专门用于存储待更新软件包的存储区域,该存储区域中的待更新软件包即为预先存储的待更新软件包,待更新软件包中可以包含多种软件的待更新软件包。It is to be understood that a storage area for storing the software package to be updated is preset in the terminal device, and the software package to be updated in the storage area is a pre-stored software package to be updated, and the software package to be updated may include multiple Software package to be updated.
需要说明的是,当处理指令为上线操作指令时,可以根据S101步骤中处理指令包含的目标标识,获得具有目标标识的待更新软件包,并将获得的待更新软件包确定为目标待更新软件包。具体的,可以将软件包中软件标识为目标标识的软件包确定为目标待更新软件包。It should be noted that when the processing instruction is an online operation instruction, the software package to be updated with the target identifier may be obtained according to the target identifier included in the processing instruction in step S101, and the obtained software package to be updated is determined as the target software to be updated. package. Specifically, the software package identified by the software in the software package as the target identifier may be determined as the target software package to be updated.
示例性的,预先存储的待更新软件包中包含:待更新软件包X、待更新软件包Y和待更新软件包Z,所具有的软件标识分别为:A00、B02和C01;当处理指令中携带的目标标识为A00时,由于待更新软件包X具有的软件标识A00与目标标识A00相同,所以确定待更新软件包X为目标待更新软件包;当处理指令中携带的目标标识为B02时,由于待更新软件包Y具有的软件标识B02与目标标识B02相同,所以确定待更新软件包Y为目标待更新软件包;当处理指令中携带的目标标识为C01时,由于待更新软件包Z具有的软件标识C01与目标标识C01相同,所以确定待更新软件包Z为目标待更新软件包。Exemplarily, the pre-stored software package to be updated includes: the software package X to be updated, the software package Y to be updated, and the software package Z to be updated, and the software identifiers are: A00, B02, and C01; When the target identifier of the package is A00, the software identifier A00 of the software package to be updated is the same as the target identifier A00, so that the software package X to be updated is the target software package to be updated; when the target identifier carried in the processing instruction is B02 Since the software identifier B02 of the software package to be updated Y is the same as the target identifier B02, it is determined that the software package Y to be updated is the target software package to be updated; when the target identifier carried in the processing instruction is C01, the software package Z to be updated The software identifier C01 is the same as the target identifier C01, so it is determined that the software package Z to be updated is the target software package to be updated.
S103,确定目标待更新软件包所具有的目标版本号。S103. Determine a target version number of the target software package to be updated.
可以理解的是,软件包中能够包含软件的版本号,终端设备在确定目标待更新软件包以后,为了保证上线的有效性,可以判断是否有必要将目标待更新软件包更新至服务器,基于该种处理思想,可以首先确定目标待更新软件包所具有的目标版本号。It can be understood that the software package can include the version number of the software. After determining the target software package to be updated, the terminal device can determine whether it is necessary to update the target software package to be updated to the server. The processing idea can first determine the target version number of the target software package to be updated.
在其中一种实现方式中,可以从目标待更新软件包的名称中确定目标待更新软件包所具有的目标版本号。示例性的,目标待更新软件包的名称为:liaotian.V2.0.exe,那么可以确定目标待更新软件包的版本号为V2.0。In one implementation, the target version number of the target software package to be updated may be determined from the name of the target software package to be updated. Exemplarily, the name of the target package to be updated is: liaotian.V2.0.exe, then it can be determined that the version number of the target to be updated package is V2.0.
在另一种实现方式中,终端设备可以通过查看目标待更新软件包的属性,在属性中获得目标版本号。示例性的,目标待更新软件包为待更新软件包X,终端设备可以直接从待更新软件包X的属性中获得目标版本号为:V2.5。本申请实施例中获得目标待更新软件包的目标版本号仅仅是示例性的,目标版本号也可以通过目标待更新软件包的其他预设信息栏中获得,本申请实施例 不对其进行具体限定。In another implementation manner, the terminal device may obtain the target version number in the attribute by viewing the attribute of the target software package to be updated. Exemplarily, the target to be updated software package is the software package X to be updated, and the terminal device can obtain the target version number directly from the attribute of the software package X to be updated: V2.5. The target version number of the target software package to be updated in the embodiment of the present application is only exemplary, and the target version number may also be obtained through other preset information fields of the target software package to be updated, which is not specifically limited in this embodiment of the present application. .
S104,根据目标版本号和预先记录的与目标标识对应的历史版本号,判断目标软件是否符合更新条件,如果是,执行S105。S104. Determine, according to the target version number and the pre-recorded historical version number corresponding to the target identifier, whether the target software meets the update condition, and if yes, execute S105.
可以理解的是,终端设备中预先记录有目标软件的所有历史安装过的软件包的版本号,所有已安装过的软件包的版本号形成了历史版本号。由于目标软件具有目标标识,所以目标软件的所有历史版本号均与该目标软件的目标标识相对应。示例性的,目标软件为聊天软件A,目标标识为A00,与A00相对应的历史版本号分别为:V1.3、V1.5、V1.8、V1.9、V2.0、V2.1、V2.2、V2.3、V2.4。It can be understood that the version number of all historically installed software packages of the target software is pre-recorded in the terminal device, and the version numbers of all installed software packages form a historical version number. Since the target software has a target identifier, all historical version numbers of the target software correspond to the target identifier of the target software. Exemplarily, the target software is chat software A, the target identifier is A00, and the historical version numbers corresponding to A00 are: V1.3, V1.5, V1.8, V1.9, V2.0, V2.1 , V2.2, V2.3, V2.4.
本申请实施例中,根据目标软件的目标版本号和历史版本号能够判断目标软件是否符合更新的条件。具体的,本申请实施例提供一种具体的实现方式,参见图2,图2为本申请实施例提供的软件处理方法的第二种流程示意图,可以包括步骤:S201、S202、S203、S204;其中,In the embodiment of the present application, whether the target software meets the updated condition can be determined according to the target version number and the historical version number of the target software. Specifically, the embodiment of the present application provides a specific implementation manner. Referring to FIG. 2, FIG. 2 is a second schematic flowchart of a software processing method according to an embodiment of the present disclosure, which may include steps: S201, S202, S203, and S204. among them,
S201,在预先记录的与目标标识对应的历史版本号中,确定最高历史版本号。S201. Determine a highest historical version number in a historical version number corresponding to the target identifier recorded in advance.
需要说明的是,历史版本号为:目标标识对应的并且已在服务器中安装过的软件包所具有的版本号。例如与目标标识A00对应的版本号V1.3,表示服务器中的聊天软件A安装过版本号为V1.3的软件包,且该软件包含目标标识A00。It should be noted that the historical version number is: the version number of the software package corresponding to the target identifier and installed in the server. For example, the version number V1.3 corresponding to the target identifier A00 indicates that the chat software A in the server has installed the software package with the version number V1.3, and the software includes the target identifier A00.
示例性的,终端设备中预先记录与目标标识A00对应的历史版本号为:V1.3、V1.5、V1.8、V1.9、V2.0、V2.1、V2.2、V2.3、V2.4,根据软件的命名规则:V2.x系列的版本高于V1.x系列的版本,所以V2.x系列版本中最高的V2.4即为最高历史版本号。Exemplarily, the historical version number corresponding to the target identifier A00 is pre-recorded in the terminal device: V1.3, V1.5, V1.8, V1.9, V2.0, V2.1, V2.2, V2. 3, V2.4, according to the software naming rules: the V2.x series version is higher than the V1.x series version, so the highest V2.4 in the V2.x series version is the highest historical version number.
需要说明的是,软件的版本号会有不同的命名规则,通过命名规则即可找到最高版本号。例如软件版本为:V02.00.01假设大版本号为02.00、01为小版本号,在大版本号相同的情况下比较,在大版本号相同的情况下小版本号越大则版本越高,所以V02.00.01、V02.00.02、V02.00.03三个版本号中V02.00.03的版本号为最高。It should be noted that the version number of the software will have different naming rules, and the highest version number can be found by naming rules. For example, the software version is: V02.00.01. Assume that the large version number is 02.00 and the 01 is a small version number. When the large version number is the same, the larger version number is the same, the larger the smaller version number is, the higher the version is. The version number of V02.00.03 among the three version numbers V02.00.01, V02.00.02, and V02.00.03 is the highest.
实际应用中,还可以以时间进行版本号的命名,如果以时间进行命名,那么以最接近当前时间的版本号为最高版本号。示例性的,终端设备中预先记录与目标标识A00对应的历史版本号为:V2016.03.20、V2016.08.01、V2017.02.01;V2016.03.20表示2016年3月20日对目标软件进行更新的软件包;V2016.08.01表示2016年8月1日对目标软件进行更新的软件包;V2017.02.01表示2017年2月1日对目标软件进行更新的软件包;最接近当前日期的为:2017.02.01,因此,V2017.02.01为最高历史版本号。因此,只要设定了命名规则即可获得最高版本号,本申请实施例在此不对其进行具体限定。In practical applications, the version number can also be named by time. If it is named by time, the version number closest to the current time is the highest version number. Exemplarily, the historical version number corresponding to the target identifier A00 is pre-recorded in the terminal device: V2016.03.20, V2016.08.01, V2017.02.01; V2016.03.20 indicates the software package for updating the target software on March 20, 2016. ;V2016.08.01 represents the software package for updating the target software on August 1, 2016; V2017.02.01 represents the software package for updating the target software on February 1, 2017; the closest to the current date is: 2017.02.01, Therefore, V2017.02.01 is the highest historical version number. Therefore, the highest version number can be obtained as long as the naming rule is set, and the embodiment of the present application does not specifically limit it.
S202,判断目标版本号是否高于最高历史版本号;如果是,执行S203;如果否,执行S204。S202. Determine whether the target version number is higher than the highest historical version number; if yes, execute S203; if no, execute S204.
本申请实施例中,将获得的目标版本号与S201中获取的最高历史版本号进行比较,并判断目标版本号是否高于最高历史版本号。示例性的,聊天软件A的最高历史版本号为V2.4,以及待更新软件包的目标版本号为V2.5,根据前述软件版本的比较规则,则判断目标版本号高于最高历史版本号,执行S203;在聊天软件A的最高历史版本号为V2.6,以及待更新软件包的目标版本号为V2.5,根据前述软件版本的比较规则,则判断目标版本号不高于最高历史版本号,执行S204。In the embodiment of the present application, the obtained target version number is compared with the highest historical version number obtained in S201, and it is determined whether the target version number is higher than the highest historical version number. Exemplarily, the highest historical version number of the chat software A is V2.4, and the target version number of the software package to be updated is V2.5. According to the comparison rule of the foregoing software version, the target version number is determined to be higher than the highest historical version number. S203 is executed; the highest historical version number of the chat software A is V2.6, and the target version number of the software package to be updated is V2.5. According to the comparison rule of the foregoing software version, the target version number is determined not to be higher than the highest history. Version number, execute S204.
S203,确定目标软件符合更新条件。S203. Determine that the target software meets the update condition.
可以理解的是,聊天软件A的最高历史版本号为V2.4、待更新软件包的目标版本号为V2.5,因为目标版本号高于最高历史版本号,则表示目标版本号对应的目标待更新软件包的版本高于以往任何一次安装过的软件包的版本,所以确定目标软件符合更新的条件。It can be understood that the highest historical version number of the chat software A is V2.4, and the target version number of the software package to be updated is V2.5, because the target version number is higher than the highest historical version number, indicating the target corresponding to the target version number. The version of the package to be updated is higher than the version of the package that was installed before, so it is determined that the target software meets the updated conditions.
S204,确定目标软件不符合更新条件。S204. Determine that the target software does not meet the update condition.
可以理解的是,聊天软件A的最高历史版本号为V2.6、待更新软件包的目标版本号为V2.5,因为目标版本号不高于最高历史版本号,则表示目标版本号对应的目标待更新软件包与某一次历史安装过的软件包的相同,所以对于目标软件来说此次更新是一次版本相同的替换甚至是版本的倒退,不具备软件更新的意义,所以确定目标软件不符合更新的条件。It can be understood that the highest historical version number of the chat software A is V2.6, and the target version number of the software package to be updated is V2.5. Because the target version number is not higher than the highest historical version number, it indicates that the target version number corresponds to The target to be updated package is the same as the one installed in history. Therefore, for the target software, the update is the same version of the replacement or even the version of the rewind. It does not have the meaning of the software update, so the target software is not determined. Meet the updated conditions.
应用本申请图2所示的实施例,通过在判断目标版本号高于历史版本号的情况下,确定目标软件符合更新条件;否则,不符合更新条件。能够简单且快捷的确定目标待更新软件包是否可以用来更新目标软件,且可以防止人员误将低版本的待更新软件包用来更新目标软件引起的操作错误。Applying the embodiment shown in FIG. 2 of the present application, by determining that the target version number is higher than the historical version number, it is determined that the target software meets the update condition; otherwise, the update condition is not met. It can be simple and quick to determine whether the target to be updated software package can be used to update the target software, and can prevent personnel from mistakenly using the lower version of the software package to be updated to update the operation error caused by the target software.
S105,发送目标待更新软件包至自动化运维组件,以使自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,对至少一个目标服务器中的目标软件进行更新。S105: Send the target to be updated software package to the automatic operation and maintenance component, so that after receiving the target to be updated software, the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And updating the target software in the at least one target server when detecting that the predetermined update condition is met.
本申请实施例中,在确认目标软件符合更新条件的情况下,终端设备将目标待更新软件包发送至自动化运维组件。具体的,自动化运维组件可以为:saltstack组件、ansible组件或puppet组件中的任意一种。In the embodiment of the present application, in the case that the target software meets the update condition, the terminal device sends the target software package to be updated to the automatic operation and maintenance component. Specifically, the automated operation and maintenance component can be any one of a saltstack component, an ansible component, or a puppet component.
需要说明的是,自动化运维组件可以是一种能够连接并控制多台服务器的自动化运维工具的统称,具有的特点是:部署轻松,在几分钟内可运行起来,扩展性好,很容易管理上万台服务器,速度够快,服务器之间秒级通讯。It should be noted that the automated operation and maintenance component can be a general term for an automated operation and maintenance tool that can connect and control multiple servers. It has the characteristics of easy deployment, operation in a few minutes, scalability, and easy Manage tens of thousands of servers, fast enough, and seconds of communication between servers.
可以理解的是,自动化运维组件中预先统计了服务器与其安装了软件的具体信息,所以根据这些信息可以得到在那些服务器中安装了目标软件。示例性的,目标软件为聊天软件A,根据信息获得目标服务器为:服务器1至服务器10。本申请实施例中目标服务器的数量仅仅是示例性的,不构成对本申请实施例的具体限定。It can be understood that the specific information of the server and the software installed therein is pre-stated in the automatic operation and maintenance component, so according to the information, the target software can be installed in those servers. Exemplarily, the target software is chat software A, and the target server is obtained according to the information: server 1 to server 10. The number of the target servers in the embodiments of the present application is merely exemplary and does not specifically limit the embodiments of the present application.
另外,可以理解的是,软件更新需要不仅消耗自动化运维组件与服务器之间的宽带资源,还要消耗他们自身的硬件和软件资源。基于此,可以设定更新条件,当检测到符合预定更新条件时,才对至少一个目标服务器中的目标软件进行更新,否则不予更新。In addition, it can be understood that software updates need to consume not only the broadband resources between the automated operation and maintenance components and the server, but also their own hardware and software resources. Based on this, an update condition can be set, and when it is detected that the predetermined update condition is met, the target software in the at least one target server is updated, otherwise it is not updated.
在本申请的一个实施例中,预定更新条件可以为:自动化运维组件与至少一个目标服务器之间的数据传输速率达到预定速率阈值。可以理解的是,当自动化运维组件与任意一个目标服务器之间的数据传输速率过低的时候,会影响目标待更新软件包以及更新命令的发送,所以会影响更新效果。具体的,可以设定速率阈值,假如设定的速率阈值为1M/s,当检测到实时的数据 传输速率小于1M/s,不进行更新动作,以避免传输速率过低造成传输失败,进而导致此次软件更新失败。In an embodiment of the present application, the predetermined update condition may be that a data transmission rate between the automated operation and maintenance component and the at least one target server reaches a predetermined rate threshold. It can be understood that when the data transmission rate between the automatic operation and maintenance component and any one of the target servers is too low, the target software to be updated and the transmission of the update command are affected, so the update effect is affected. Specifically, the rate threshold may be set. If the set rate threshold is 1 M/s, when the real-time data transmission rate is less than 1 M/s, the update operation is not performed to avoid the transmission failure due to the transmission rate being too low, thereby causing the transmission to fail. This software update failed.
在本申请的另一种实现方式中,当某个目标服务器的负载过大的时候,其处理更新的过程中可能会产生宕机,由此产生更新动作中断,为了避免这种情况,可以设定至少一个目标服务器的当前运行负载低于预定负载值。具体的,负载值可以设为60%,当服务器的负载值大于60%时,不进行更新动作;否则进行更新动作;以进一步提高目标软件更新的成功率。In another implementation manner of the present application, when the load of a certain target server is too large, a process may occur during the processing of the update, thereby causing an interruption of the update operation. To avoid this situation, it may be set. The current running load of at least one target server is determined to be lower than a predetermined load value. Specifically, the load value may be set to 60%. When the load value of the server is greater than 60%, the update action is not performed; otherwise, the update action is performed; to further improve the success rate of the target software update.
需要说明的是,saltstack组件采用一种全新的基础设施管理方式,运行速度较快,一般在几分钟内可运行起来;扩展性好,很容易管理上万台服务器;且速度够快,能实现跟服务器之间的秒级通讯。ansible是新出现的自动化运维组件,基于Python开发,集合了众多运维工具的优点,可以实现批量系统配置、批量程序部署、批量运行指令等功能。puppet是一种Linux、Unix、windows平台的集中配置管理系统,使用自有的puppet描述语言,可管理配置文件、软件包、系统服务等,puppet采用C/S星状的结构,可以和一个或几个服务器交互。It should be noted that the saltstack component adopts a brand-new infrastructure management method, which runs faster and generally runs in a few minutes. It has good scalability and is easy to manage tens of thousands of servers; and it is fast enough to achieve Second level communication with the server. Ansible is an emerging automation operation and maintenance component. Based on Python development, it combines the advantages of many operation and maintenance tools, and can realize functions such as batch system configuration, batch program deployment, and batch operation instructions. Puppet is a centralized configuration management system for Linux, Unix, and Windows platforms. It uses its own puppet description language to manage configuration files, software packages, system services, etc. Puppet uses a C/S star structure and can be combined with one or Several servers interact.
从上述自动化运维组件的特点可以得到,saltstack组件、ansible组件或puppet组件都可以作为自动化运维组件,它们既可以同时与一个服务器进行通信,也可以同时与多个服务器进行通信,所以自动化运维组件可以同时对多个服务器进行目标软件的更新处理,达到并发处理的目的。示例性的,与自动化运维组件通信的服务器为20个,那么自动化运维组件可以将接收到的目标待更新软件包发送至这20个服务器中,以对这20个服务器中的目标软件进行更新。From the characteristics of the above-mentioned automated operation and maintenance components, the saltstack component, the ansible component or the puppet component can be used as an automated operation and maintenance component. They can communicate with one server at the same time, or communicate with multiple servers at the same time. The dimension component can update the target software to multiple servers at the same time to achieve the purpose of concurrent processing. Exemplarily, if there are 20 servers communicating with the automated operation and maintenance component, the automated operation and maintenance component can send the received target to be updated package to the 20 servers to perform target software on the 20 servers. Update.
采用并行处理方式,对至少一个目标服务器进行目标软件的更新处理,可以进一步提高目标软件更新的效率;且能够使得这些目标服务器不会出现代码有差异的情况。Parallel processing is used to update the target software to at least one target server, which can further improve the efficiency of the target software update; and can prevent these target servers from having different code differences.
应用本申请图1所示的实施例,终端设备可以在获得软件上线操作指令时,从待更新软件包中确定目标待更新软件包以及目标待更新软件包的目标版本号;并在判断目标版本号符合更新条件的情况下,发送目标待更新软件包至自动化运维组件,以使自动化运维组件在符合更新条件时对至少一个目 标服务器中的目标软件进行更新。这个过程能够实现至少一个目标服务器中的目标软件同步上线处理,提高了软件上线的效率。Applying the embodiment shown in FIG. 1 , the terminal device may determine the target to-be-updated software package and the target version number of the target to-be-updated software package from the software package to be updated when obtaining the software online operation instruction; and determine the target version. If the number meets the update condition, the target to be updated package is sent to the automated operation and maintenance component, so that the automated operation and maintenance component updates the target software in the at least one target server when the update condition is met. This process can realize the on-line processing of the target software in at least one target server, and improve the efficiency of the software going online.
为了进一步的提高自动化运维组件对至少一个目标服务器中的目标软件的更新处理效率,在一种具体实现方式中,自动化运维组件在接收到目标待更新软件后,根据预先存储的第一安装配置文件存储目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据目标待更新软件包以及第一安装配置文件,对至少一个目标服务器中的目标软件进行更新。In order to further improve the update processing efficiency of the automatic operation and maintenance component to the target software in the at least one target server, in a specific implementation manner, after receiving the target to be updated software, the automated operation and maintenance component is based on the pre-stored first installation. The configuration file storage target to be updated, according to the pre-stated software installation relationship with the server, determining at least one target server of the installed target software, and when detecting the compliance with the predetermined update condition, according to the target to be updated package and the first Install a configuration file to update the target software in at least one target server.
需要说明的是,自动化运维组件接收到目标待更新软件包以后需要进行存储。具体的,可以存储在终端设备中,也可以存储在其他存储设备中。示例性的,目标待更新软件包可以存储在终端内设备的一个固定存储区域里,也可以存储在与终端内设备相连的存储设备中,如外接硬盘等存储设备。本申请实施例中在第一安装配置文件中可以预先设置一存储地址,自动化运维组件可以先获得该预先设置的存储地址进行存储目标待更新软件包。It should be noted that the automated operation and maintenance component needs to be stored after receiving the target software package to be updated. Specifically, it may be stored in the terminal device or may be stored in other storage devices. For example, the target software package to be updated may be stored in a fixed storage area of the device in the terminal, or may be stored in a storage device connected to the device in the terminal, such as an external hard disk storage device. In the embodiment of the present application, a storage address may be preset in the first installation configuration file, and the automatic operation and maintenance component may obtain the preset storage address to store the software package to be updated.
示例性的,第一安装配置文件中预先设置的存储地址为:F:\聊天软件A\2017年3月,那么自动化运维组件将接收到的目标待更新软件包存储至“F:\聊天软件A\2017年3月”中,然后自动化运维组件根据第一安装配置文件中的具体执行步骤,对于至少一个目标服务器中的目标软件进行更新处理。Exemplarily, the preset storage address in the first installation configuration file is: F:\chat software A\March 2017, then the automated operation and maintenance component stores the received target to be updated package to “F:\chat”. In software A\March 2017, the automated operation and maintenance component then updates the target software in at least one target server according to the specific execution steps in the first installation configuration file.
在一种实现方式中,第一安装配置文件中包含了自动化运维组件与至少一个目标服务器通信的具体步骤。具体的,自动化运维组件在存储了目标待更新软件包以后,将目标待更新软件包分别发送给各个目标服务器,同时给每一个目标服务器发送软件更新指令,各个目标服务器在获得软件更新指令以后直接使用目标待更新软件包对目标软件进行更新。In one implementation, the first installation configuration file includes specific steps for the automated operation and maintenance component to communicate with at least one target server. Specifically, after storing the target software package to be updated, the automatic operation and maintenance component sends the target software package to be updated to each target server, and sends a software update instruction to each target server, and each target server obtains the software update instruction. The target software is updated directly using the target to be updated package.
在另一种实现方式中,在第一安装配置文件中记录有:用于存储目标待更新软件包的预设存储地址和至少一个目标服务器的通信地址的情况下,自动化运维组件在接收到目标待更新软件后,根据预先存储的第一安装配置文件存储目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器。并在检测到符合预定更新条件时,根据第一安装配置文件中记录的至少一个目标服务器的通信地址,发送目标 待更新软件包的预设存储地址至至少一个目标服务器。至少一个目标服务器可以根据所获取的预设存储地址获取目标待更新软件包,并利用目标待更新软件包对至少一个目标服务器中的目标软件进行更新。In another implementation manner, when the first installation configuration file records: a preset storage address for storing the target software package to be updated and a communication address of the at least one target server, the automatic operation and maintenance component receives the After the target software is to be updated, the target to be updated package is stored according to the pre-stored first installation configuration file, and at least one target server to which the target software is installed is determined according to the pre-stated installation relationship between the software and the server. And when it is detected that the predetermined update condition is met, the preset storage address of the target software package to be updated is sent to the at least one target server according to the communication address of the at least one target server recorded in the first installation configuration file. The at least one target server may acquire the target to be updated software package according to the acquired preset storage address, and update the target software in the at least one target server by using the target to be updated software package.
自动化运维组件根据通信地址发送存储目标待更新软件包的存储地址至每一个目标服务器,各目标服务器可以获得目标待更新软件包。这个过程使得所有目标服务器中的目标待更新软件包不会出现代码有差异的情况;且能够通过预先存储的第一安装配置文件和目标待更新软件包软件的更新处理,可以进一步提高目标服务器中目标软件更新的效率。The automated operation and maintenance component sends the storage address of the storage target to be updated to each target server according to the communication address, and each target server can obtain the target to be updated software package. This process makes it possible for the target to be updated in all target servers to have no code difference; and the target server can be further improved by the pre-stored first installation configuration file and the update processing of the target software package to be updated. The efficiency of the target software update.
在另一种具体实现方式中,自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器。并在检测到符合预定更新条件时,根据目标待更新软件包以及预先存储的第二安装配置文件,对至少一个目标服务器中的目标软件进行更新。其中,第二安装配置文件为:根据目标存储地址所生成的文件,目标存储地址为自动化运维组件存储目标待更新软件包所利用的地址。In another specific implementation manner, after receiving the target to be updated software, the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And when it is detected that the predetermined update condition is met, the target software in the at least one target server is updated according to the target software package to be updated and the second installation configuration file stored in advance. The second installation configuration file is: a file generated according to the target storage address, and the target storage address is an address used by the automatic operation and maintenance component to store the target to be updated.
本申请实施例中,终端设备发送目标待更新软件包至自动化运维组件,自动化运维组件获得目标待更新软件包以后会进行存储,存储地址即为目标存储地址,然后根据目标存储地址生成第二安装配置文件。具体的,可以将目标存储地址直接作为第二安装配置文件所包含的内容。另外,第二安装配置文件中还可以包含目标服务器的通信地址。自动化运维组件可以通过目标服务器的通信地址,将目标存储地址发送至目标服务器1至目标服务器10,目标服务器1至目标服务器10根据目标存储地址从自动化运维组件中获取目标待更新软件包,然后目标服务器1至目标服务器10利用目标待更新软件包对目标软件进行更新处理。In the embodiment of the present application, the terminal device sends the target software package to be updated to the automatic operation and maintenance component, and the automatic operation and maintenance component obtains the target software package to be updated, and the storage address is the target storage address, and then generates the first storage address according to the target storage address. Second install the configuration file. Specifically, the target storage address can be directly used as the content included in the second installation configuration file. In addition, the second installation configuration file can also contain the communication address of the target server. The automated operation and maintenance component can send the target storage address to the target server 1 to the target server 10 through the communication address of the target server, and the target server 1 to the target server 10 obtain the target to be updated software package from the automated operation and maintenance component according to the target storage address. The target server 1 to the target server 10 then perform update processing on the target software using the target to-be-updated software package.
每一个目标服务器能够同时获得目标待更新软件包,使得这些目标服务器中目标软件的待更新软件包不会出现代码有差异的情况;且能根据目标待更新软件包的目标地址生成的第二安装配置文件和目标待更新软件包软件的更新处理,可以进一步提高服务器中目标软件更新的效率。Each target server can obtain the target software package to be updated at the same time, so that the software package of the target software in the target server does not have a code difference; and the second installation can be generated according to the target address of the target software package to be updated. The update processing of the configuration file and the target software package to be updated can further improve the efficiency of the target software update in the server.
实际应用中,会遇到目标软件的当前在使用的版本出现错误的情况,这时候需要将目标软件的当前版本回滚到一个指定版本号,这就是目标软件的 回滚。本申请提供目标软件回滚的一个具体实现方式,参见图3,图3为本申请实施例提供的软件处理方法的第三种流程示意图,在图1所示实施例的基础上增加如下步骤:In actual application, you will encounter an error in the currently used version of the target software. In this case, you need to roll back the current version of the target software to a specified version number, which is the rollback of the target software. The present application provides a specific implementation manner of the target software rollback. Referring to FIG. 3, FIG. 3 is a third schematic flowchart of the software processing method according to the embodiment of the present application. The following steps are added to the embodiment shown in FIG. 1 :
S106,当判断出处理指令为回滚操作指令时,获取回滚操作指令中包含的针对目标软件的指定版本号。S106. When it is determined that the processing instruction is a rollback operation instruction, obtain a specified version number for the target software included in the rollback operation instruction.
可以理解的是,当用户需要执行回滚操作时,除了要发送执行回滚操作的指令,还需要发送一个与回滚指令配套的指定版本号,用于指定将目标软件回滚到的具体版本。然后,当终端设备判断出接收到的操作指令为回滚操作指令时,还可以从回滚操作指令中获取指定版本号。示例性的,终端设备获得的回滚指令中包含的指定版本号为V2.1,服务器中运行的目标软件的当前版本号为V2.5,那么此次回滚的目的是将目标软件从当前的V2.5版本回滚至V2.1版本。终端设备获得的回滚指令中包含的指定版本号为V2.2,服务器中运行的目标软件的当前版本号为V2.6,那么此次回滚的目的是将目标软件从当前的V2.6版本回滚至V2.2版本。It can be understood that when the user needs to perform the rollback operation, in addition to sending an instruction to perform the rollback operation, a specified version number corresponding to the rollback instruction needs to be sent to specify the specific version to which the target software is rolled back. . Then, when the terminal device determines that the received operation instruction is a rollback operation instruction, the specified version number may also be obtained from the rollback operation instruction. Exemplarily, the specified version number included in the rollback instruction obtained by the terminal device is V2.1, and the current version number of the target software running in the server is V2.5, then the purpose of the rollback is to move the target software from the current The V2.5 version is rolled back to the V2.1 version. The specified version number included in the rollback instruction obtained by the terminal device is V2.2, and the current version number of the target software running in the server is V2.6. The purpose of this rollback is to remove the target software from the current V2.6 version. Roll back to version V2.2.
S107,获得指定版本号对应的软件包。S107. Obtain a software package corresponding to the specified version number.
需要说明的是,终端设备在每次对目标软件执行一次上线操作后,都会保存此次上线操作对应的目标待更新软件包,所以终端设备中会保存目标软件的历史安装软件包。在终端设备获得指定的版本号以后,从历史安装软件包中获得与指定版本号对应的软件包。It should be noted that, after each execution of the online operation on the target software, the terminal device saves the target to be updated software package corresponding to the online operation, so the historical installation software package of the target software is saved in the terminal device. After the terminal device obtains the specified version number, the software package corresponding to the specified version number is obtained from the historical installation package.
示例性的,终端设备中存储的历史安装软件包有:软件包x1、软件包x2、软件包x3、软件包x4,它们分别对应的版本号为:V2.1、V2.2、V2.3、V2.4;在指定版本号为V2.1的情况下,获得V2.1对应的软件包为:软件包x1;在指定版本号为V2.2的情况下,获得V2.2对应的软件包为:软件包x2。Exemplarily, the historical installation packages stored in the terminal device are: software package x1, software package x2, software package x3, and software package x4, and the corresponding version numbers are: V2.1, V2.2, and V2.3. V2.4; in the case of the specified version number V2.1, the software package corresponding to V2.1 is: software package x1; in the case of the specified version number V2.2, the software corresponding to V2.2 is obtained. The package is: package x2.
S108,将指定版本号对应的软件包发送至自动化运维组件,以使自动化运维组件在接收到指定版本号对应的软件包后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定回滚条件时,采用指定版本号对应的软件包对至少一个目标服务器中的目标软件进行替换。S108: Send the software package corresponding to the specified version number to the automatic operation and maintenance component, so that the automated operation and maintenance component determines the installed target according to the pre-stated installation relationship between the software and the server after receiving the software package corresponding to the specified version number. At least one target server of the software, and when detecting that the predetermined rollback condition is met, replacing the target software in the at least one target server with the software package corresponding to the specified version number.
示例性的,指定版本号为V2.1的情况下,对应的软件包为软件包x1,终端设备可以将软件包x1发送至自动化运维组件。自动化运维组件在接收到软件包x1后可以直接发送给待更新目标软件的至少一个目标服务器,每一个目标服务器将采用安装软件包x1的方式来替换当前已安装的目标软件。Exemplarily, if the specified version number is V2.1, the corresponding software package is the software package x1, and the terminal device can send the software package x1 to the automated operation and maintenance component. After receiving the software package x1, the automated operation and maintenance component can directly send to at least one target server of the target software to be updated, and each target server will replace the currently installed target software by installing the software package x1.
在本申请的一种实现方式中,在指定版本号V2.1对应的软件包为软件包x1的情况下,终端设备可以发送软件包x1至自动化运维组件,自动化运维组件根据预先设置的存储地址存储软件包x1。可以理解的是,因为目标服务器是与自动化运维组件相通信的,所以自动化运维组件知道目标服务器的通信地址,根据通信地址,再将软件包x1的存储地地址发送给每一个目标服务器。服务器可以直接去获取软件包x1,在每一个目标服务器中,目标服务器将采用安装软件包x1的方式来替换当前已安装的目标软件。具体的,存储软件包x1的存储地址以及每一个服务器的通信地址,可以存储在一个安装配置文件中,自动化运维组件根据该安装配置文件进行与目标服务器的通信,从而保证回滚过程的完成。In an implementation manner of the present application, in a case where the software package corresponding to the version number V2.1 is the software package x1, the terminal device may send the software package x1 to the automatic operation and maintenance component, and the automatic operation and maintenance component is configured according to the preset. Store the address storage package x1. It can be understood that because the target server is in communication with the automated operation and maintenance component, the automated operation and maintenance component knows the communication address of the target server, and sends the storage address of the software package x1 to each target server according to the communication address. The server can go directly to the package x1. In each target server, the target server will replace the currently installed target software with the installation package x1. Specifically, the storage address of the storage package x1 and the communication address of each server may be stored in an installation configuration file, and the automatic operation and maintenance component performs communication with the target server according to the installation configuration file, thereby ensuring completion of the rollback process. .
在本申请的另一种实现方式中,在指定版本号V2.1对应的软件包为软件包x1的情况下,终端设备可以发送软件包x1至自动化运维组件。自动化运维组件将软件包x1进行存储,并将存储地址发送给第三安装配置文件,终端设备发送软件包x1至自动化运维组件。第三安装配置文件中还可以包括至少一个目标服务器的通信地址,自动化运维组件根据第三安装配置文件,执行:将软件包x1的存储地地址发送给每一个目标服务器,每个目标服务器可以直接去获取软件包x1,在每一个目标服务器中,服务器将采用安装软件包x1的方式来替换当前已安装的目标软件。In another implementation manner of the present application, in a case where the software package corresponding to the designated version number V2.1 is the software package x1, the terminal device may send the software package x1 to the automated operation and maintenance component. The automated operation and maintenance component stores the software package x1 and sends the storage address to the third installation configuration file, and the terminal device sends the software package x1 to the automated operation and maintenance component. The third installation configuration file may further include a communication address of the at least one target server, and the automatic operation and maintenance component executes according to the third installation configuration file: sending the storage address of the software package x1 to each target server, and each target server may Go directly to the package x1. In each target server, the server will replace the currently installed target software with the installation package x1.
应用本申请图3所示的实施例,在终端设备获得的操作指令为回滚时,能够全自动的回滚到指令版本号,实现对目标软件当前版本的替换操作,提高了软件回滚的效率。Applying the embodiment shown in FIG. 3, when the operation instruction obtained by the terminal device is rollback, the method can automatically roll back to the command version number to implement the replacement operation of the current version of the target software, thereby improving the software rollback. effectiveness.
相应于上述方法实施例,本申请实施例还提供了软件处理装置。Corresponding to the foregoing method embodiments, the embodiment of the present application further provides a software processing apparatus.
图4为本申请实施例提供的软件处理装置的第一种结构示意图,装置包括:FIG. 4 is a schematic diagram of a first structure of a software processing apparatus according to an embodiment of the present disclosure, where the apparatus includes:
第一获得模块401,用于获得针对于软件的处理指令,其中,处理指令中携带有待处理的目标软件的目标标识;a first obtaining module 401, configured to obtain a processing instruction for the software, where the processing instruction carries a target identifier of the target software to be processed;
第一确定模块402,用于当判断出处理指令为上线操作指令时,从预先存储的待更新软件包中确定目标待更新软件包,其中,目标待更新软件包为:具有目标标识的待更新软件包;The first determining module 402 is configured to determine, from the pre-stored software package to be updated, a target software package to be updated, when the processing instruction is an online operation instruction, where the target software package to be updated is: to be updated with the target identifier. Software package
第二确定模块403,用于确定目标待更新软件包所具有的目标版本号;a second determining module 403, configured to determine a target version number of the target software package to be updated;
判断模块404,用于根据目标版本号和预先记录的与目标标识对应的历史版本号,判断目标软件是否符合更新条件,其中,历史版本号为:目标标识对应的并且当前已在服务器中安装过的软件包所具有的版本号;The determining module 404 is configured to determine, according to the target version number and the pre-recorded historical version number corresponding to the target identifier, whether the target software meets the update condition, where the historical version number is: the target identifier is corresponding and has been installed in the server. The version number of the package;
更新模块405,用于在判断模块404的判断结果为是的情况下,发送目标待更新软件包至自动化运维组件,以使自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,对至少一个目标服务器中的目标软件进行更新。The update module 405 is configured to send the target software package to be updated to the automatic operation and maintenance component if the determination result of the determination module 404 is YES, so that the automatic operation and maintenance component receives the target software to be updated, according to the pre-statistic The installation relationship between the software and the server determines at least one target server on which the target software is installed, and updates the target software in the at least one target server when detecting that the predetermined update condition is met.
具体的,自动化运维组件为saltstack组件、ansible组件或puppet组件。Specifically, the automated operation and maintenance component is a saltstack component, an ansible component, or a puppet component.
具体的,预定更新条件包括:Specifically, the predetermined update conditions include:
自动化运维组件与至少一个目标服务器之间的数据传输速率达到预定速率阈值;和/或,The data transfer rate between the automated operation and maintenance component and the at least one target server reaches a predetermined rate threshold; and/or,
至少一个目标服务器的当前运行负载低于预定负载值。The current running load of at least one target server is lower than a predetermined load value.
具体的,更新模块405,可以用于:Specifically, the update module 405 can be used to:
自动化运维组件在接收到目标待更新软件后,根据预先存储的第一安装配置文件存储目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据目标待更新软件包以及第一安装配置文件,对至少一个目标服务器中的目标软件进行更新。After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And when it is detected that the predetermined update condition is met, the target software in the at least one target server is updated according to the target software package to be updated and the first installation configuration file.
具体的,更新模块405,可以用于:自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的 至少一个目标服务器,并在检测到符合预定更新条件时,根据目标待更新软件包以及预先存储的第二安装配置文件,对至少一个目标服务器中的目标软件进行更新,其中,第二安装配置文件为:根据目标存储地址所生成的文件,目标存储地址为自动化运维组件存储目标待更新软件包所利用的地址。Specifically, the update module 405 can be configured to: after receiving the target to be updated software, determine, according to the pre-stated installation relationship between the software and the server, determine at least one target server of the installed target software, and detect When the predetermined update condition is met, the target software in the at least one target server is updated according to the target to be updated software package and the pre-stored second installation configuration file, where the second installation configuration file is: generated according to the target storage address. The file, the target storage address is the address used by the automated operation and maintenance component to store the target package to be updated.
具体的,第一安装配置文件中记录有:用于存储目标待更新软件包的预设存储地址和至少一个目标服务器的通信地址。Specifically, the first installation configuration file records: a preset storage address for storing the target software package to be updated and a communication address of the at least one target server.
具体的,更新模块405,可以用于:自动化运维组件在接收到目标待更新软件后,根据预先存储的第一安装配置文件存储目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据第一安装配置文件中记录的至少一个目标服务器的通信地址,发送目标待更新软件包的预设存储地址至至少一个目标服务器,以使至少一个目标服务器根据所获取的预设存储地址获取目标待更新软件包,并利用目标待更新软件包对至少一个目标服务器中的目标软件进行更新。Specifically, the update module 405 can be configured to: after receiving the target to be updated software, the automatic operation and maintenance component stores the target to be updated software package according to the pre-stored first installation configuration file, according to the pre-stated software and server installation relationship. Determining at least one target server of the target software installed, and transmitting a preset storage address of the target software package to be updated according to the communication address of the at least one target server recorded in the first installation configuration file when detecting the predetermined update condition is met And at least one target server, so that the at least one target server acquires the target to-be-updated software package according to the acquired preset storage address, and updates the target software in the at least one target server by using the target to-be-updated software package.
具体的,获得模块401,可以用于:Specifically, the obtaining module 401 can be used to:
从预设的集成工具中获得针对于软件的处理指令。Obtain processing instructions for the software from the preset integration tools.
应用本申请图4所示的实施例,终端设备可以在获得软件上线操作指令时,从待更新软件包中确定目标待更新软件包以及目标待更新软件包的目标版本号;并在判断目标版本号符合更新条件的情况下,发送目标待更新软件包至自动化运维组件,以使自动化运维组件在符合更新条件时对至少一个目标服务器中的目标软件进行更新。这个过程能够实现至少一个目标服务器中的目标软件同步上线处理,提高了软件上线的效率。Applying the embodiment shown in FIG. 4, the terminal device may determine the target to-be-updated software package and the target version number of the target to-be-updated software package from the software package to be updated when obtaining the software online operation instruction; and determine the target version. If the number meets the update condition, the target to be updated package is sent to the automated operation and maintenance component, so that the automated operation and maintenance component updates the target software in the at least one target server when the update condition is met. This process can realize the on-line processing of the target software in at least one target server, and improve the efficiency of the software going online.
图5为本申请实施例提供的软件处理装置的第二种结构示意图,在图4所示实施例的基础上增加以下模块:FIG. 5 is a schematic diagram of a second structure of a software processing apparatus according to an embodiment of the present disclosure. The following modules are added to the embodiment shown in FIG. 4:
获取模块406,用于当判断出处理指令为回滚操作指令时,获取回滚操作指令中包含的针对目标软件的指定版本号;The obtaining module 406 is configured to: when determining that the processing instruction is a rollback operation instruction, obtain a specified version number for the target software included in the rollback operation instruction;
第二获得模块407,用于获得指定版本号对应的软件包;a second obtaining module 407, configured to obtain a software package corresponding to the specified version number;
处理模块408,将指定版本号对应的软件包发送至自动化运维组件,以使自动化运维组件在接收到指定版本号对应的软件包后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定回滚条件时,采用指定版本号对应的软件包对至少一个目标服务器中的目标软件进行替换。The processing module 408 sends the software package corresponding to the specified version number to the automatic operation and maintenance component, so that after receiving the software package corresponding to the specified version number, the automated operation and maintenance component determines that the software and the server are installed according to the pre-stated installation relationship. Installing at least one target server of the target software, and when detecting that the predetermined rollback condition is met, replacing the target software in the at least one target server with the software package corresponding to the specified version number.
应用本申请图5所示的实施例,在终端设备获得的操作指令为回滚时,能够全自动的回滚到指令版本号,实现对目标软件当前版本的替换操作,提高了软件回滚的效率。Applying the embodiment shown in FIG. 5, when the operation instruction obtained by the terminal device is rollback, the method can automatically roll back to the instruction version number to implement the replacement operation of the current version of the target software, thereby improving the software rollback. effectiveness.
图6为本申请实施例提供的软件处理装置的第三种结构示意图,判断模块404,可以包括:FIG. 6 is a schematic diagram of a third structure of a software processing apparatus according to an embodiment of the present disclosure. The determining module 404 may include:
第一确定子模块601,在预先记录的与目标标识对应的历史版本号中,确定最高历史版本号;The first determining submodule 601 determines the highest historical version number in the historical version number corresponding to the target identifier recorded in advance;
判断子模块602,用于判断目标版本号是否高于最高历史版本号;a determining sub-module 602, configured to determine whether the target version number is higher than a highest historical version number;
第二确定子模块603,用于在判断子模块602的判断结果为是的情况下,确定目标软件符合更新条件;a second determining sub-module 603, configured to determine that the target software meets the update condition if the determination result of the determining sub-module 602 is YES;
第三确定子模块604,用于在判断子模块602的判断结果为否的情况下,确定目标软件不符合更新条件。The third determining sub-module 604 is configured to determine that the target software does not meet the update condition if the determination result of the sub-module 602 is negative.
应用本申请图6所示的实施例,通过在判断目标版本号高于历史版本号的情况下,确定目标软件符合更新条件;否则,不符合更新条件。能够简单且快捷的确定目标待更新软件包是否可以用来更新目标软件,且可以防止人员误将低版本的待更新软件包用来更新目标软件引起的操作错误。Applying the embodiment shown in FIG. 6 of the present application, by determining that the target version number is higher than the historical version number, it is determined that the target software meets the update condition; otherwise, the update condition is not met. It can be simple and quick to determine whether the target to be updated software package can be used to update the target software, and can prevent personnel from mistakenly using the lower version of the software package to be updated to update the operation error caused by the target software.
参见图7,本申请实施例提供的电子设备的一种结构示意图,该电子设备包括:处理器701和存储器702,其中,Referring to FIG. 7, a schematic structural diagram of an electronic device according to an embodiment of the present disclosure includes: a processor 701 and a memory 702, where
存储器702,用于存放计算机程序;a memory 702, configured to store a computer program;
处理器701,用于执行存储器上所存放的程序时,实现如下步骤:The processor 701 is configured to perform the following steps when executing the program stored on the memory:
获得针对于软件的处理指令,其中,处理指令中携带有待处理的目标软件的目标标识;Obtaining a processing instruction for the software, where the processing instruction carries a target identifier of the target software to be processed;
当判断出处理指令为上线操作指令时,从预先存储的待更新软件包中确定目标待更新软件包,其中,目标待更新软件包为:具有目标标识的待更新软件包;When it is determined that the processing instruction is an online operation instruction, the target software package to be updated is determined from the pre-stored software package to be updated, wherein the target software package to be updated is: the software package to be updated with the target identifier;
确定目标待更新软件包所具有的目标版本号;Determining the target version number of the target package to be updated;
根据目标版本号和预先记录的与目标标识对应的历史版本号,判断目标软件是否符合更新条件,其中,历史版本号为:目标标识对应的并且当前已在服务器中安装过的软件包所具有的版本号;Determining whether the target software meets the update condition according to the target version number and the pre-recorded historical version number corresponding to the target identifier, where the history version number is: the software package corresponding to the target identifier and currently installed in the server version number;
如果是,发送目标待更新软件包至自动化运维组件,以使自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,对至少一个目标服务器中的目标软件进行更新。If yes, sending the target to be updated software package to the automated operation and maintenance component, so that the automated operation and maintenance component determines at least one target of the installed target software according to the pre-stated installation relationship between the software and the server after receiving the target to be updated software. The server updates the target software in the at least one target server when it detects that the predetermined update condition is met.
可选的,预定更新条件包括:Optionally, the scheduled update conditions include:
自动化运维组件与至少一个目标服务器之间的数据传输速率达到预定速率阈值;和/或,The data transfer rate between the automated operation and maintenance component and the at least one target server reaches a predetermined rate threshold; and/or,
至少一个目标服务器的当前运行负载低于预定负载值。The current running load of at least one target server is lower than a predetermined load value.
可选的,方法还包括:Optionally, the method further includes:
当判断出处理指令为回滚操作指令时,获取回滚操作指令中包含的针对目标软件的指定版本号;When it is determined that the processing instruction is a rollback operation instruction, obtaining a specified version number for the target software included in the rollback operation instruction;
获得指定版本号对应的软件包;Obtain the software package corresponding to the specified version number;
将指定版本号对应的软件包发送至自动化运维组件,以使自动化运维组件在接收到指定版本号对应的软件包后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定回滚条件时,采用指定版本号对应的软件包对至少一个目标服务器中的目标软件进行替换。Send the software package corresponding to the specified version number to the automated operation and maintenance component, so that the automated operation and maintenance component determines the installed software of the target software according to the pre-stated installation relationship between the software and the server after receiving the software package corresponding to the specified version number. At least one target server, and when detecting that the predetermined rollback condition is met, replacing the target software in the at least one target server with the software package corresponding to the specified version number.
可选的,自动化运维组件为saltstack组件、ansible组件或puppet组件。Optionally, the automated operation and maintenance component is a saltstack component, an ansible component, or a puppet component.
可选的,根据目标版本号和预先记录的与目标标识对应的历史版本号, 判断目标软件是否符合更新条件,包括:Optionally, determining, according to the target version number and the pre-recorded historical version number corresponding to the target identifier, whether the target software meets the update condition, including:
从预先记录的与目标标识对应的历史版本号中,确定最高历史版本号;Determining a highest historical version number from a pre-recorded historical version number corresponding to the target identifier;
判断目标版本号是否高于最高历史版本号;Determine whether the target version number is higher than the highest historical version number;
如果是,确定目标软件符合更新条件;If yes, determine that the target software meets the update criteria;
如果否,确定目标软件不符合更新条件。If no, make sure the target software does not meet the update criteria.
可选的,自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,对至少一个目标服务器中的目标软件进行更新,包括:Optionally, after receiving the target to be updated software, the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and when detecting that the predetermined update condition is met, The target software in at least one target server is updated, including:
自动化运维组件在接收到目标待更新软件后,根据预先存储的第一安装配置文件存储目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据目标待更新软件包以及第一安装配置文件,对至少一个目标服务器中的目标软件进行更新。After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And when it is detected that the predetermined update condition is met, the target software in the at least one target server is updated according to the target software package to be updated and the first installation configuration file.
可选的,自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,对至少一个目标服务器中的目标软件进行更新,包括:Optionally, after receiving the target to be updated software, the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and when detecting that the predetermined update condition is met, The target software in at least one target server is updated, including:
自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据目标待更新软件包以及预先存储的第二安装配置文件,对至少一个目标服务器中的目标软件进行更新,其中,第二安装配置文件为:根据目标存储地址所生成的文件,目标存储地址为自动化运维组件存储目标待更新软件包所利用的地址。After receiving the target to be updated software, the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and according to the target to be updated after detecting the predetermined update condition is met. The package and the pre-stored second installation configuration file update the target software in the at least one target server, wherein the second installation configuration file is: a file generated according to the target storage address, and the target storage address is an automatic operation and maintenance component storage. The address used by the target package to be updated.
可选的,第一安装配置文件中记录有:用于存储目标待更新软件包的预设存储地址和至少一个目标服务器的通信地址。Optionally, the first installation configuration file records: a preset storage address for storing the target to be updated package and a communication address of the at least one target server.
可选的,自动化运维组件在接收到目标待更新软件后,根据预先存储的 第一安装配置文件存储目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据目标待更新软件包以及第一安装配置文件,对至少一个目标服务器中的目标软件进行更新,包括:Optionally, after receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated software package according to the pre-stored first installation configuration file, and determines the installed target software according to the pre-stated installation relationship between the software and the server. At least one target server, and when detecting that the predetermined update condition is met, updating the target software in the at least one target server according to the target software package to be updated and the first installation configuration file, including:
自动化运维组件在接收到目标待更新软件后,根据预先存储的第一安装配置文件存储目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据第一安装配置文件中记录的至少一个目标服务器的通信地址,发送目标待更新软件包的预设存储地址至至少一个目标服务器,以使至少一个目标服务器根据所获取的预设存储地址获取目标待更新软件包,并利用目标待更新软件包对至少一个目标服务器中的目标软件进行更新。After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And detecting, when the predetermined update condition is met, sending the preset storage address of the target software package to be updated to the at least one target server according to the communication address of the at least one target server recorded in the first installation configuration file, so that the at least one target The server acquires the target to be updated software package according to the obtained preset storage address, and updates the target software in the at least one target server by using the target to be updated software package.
可选的,获得针对于软件的处理指令,包括:Optionally, obtaining processing instructions for the software, including:
从预设的集成工具中获得针对于软件的处理指令。Obtain processing instructions for the software from the preset integration tools.
本申请实施例还提供了一种电子设备,如图8所示,包括处理器801、通信接口802、存储器803和通信总线804,其中,处理器801,通信接口802,存储器803通过通信总线804完成相互间的通信,The embodiment of the present application further provides an electronic device, as shown in FIG. 8, including a processor 801, a communication interface 802, a memory 803, and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 pass through the communication bus 804. Complete communication with each other,
存储器803,用于存放计算机程序;a memory 803, configured to store a computer program;
处理器801,用于执行存储器803上所存放的程序时,实现上述软件处理的方法步骤。The processor 801 is configured to implement the method steps of the software processing when the program stored on the memory 803 is executed.
上述电子设备提到的通信总线可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
通信接口用于上述电子设备与其他设备之间的通信。The communication interface is used for communication between the above electronic device and other devices.
存储器可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存 储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。The memory may include a random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; or may be a digital signal processing (DSP), dedicated integration. Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component.
本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质内存储有计算机程序,计算机程序被处理器执行时实如下步骤:The embodiment of the present application further provides a computer readable storage medium. The computer readable storage medium stores a computer program. When the computer program is executed by the processor, the following steps are performed:
获得针对于软件的处理指令,其中,处理指令中携带有待处理的目标软件的目标标识;Obtaining a processing instruction for the software, where the processing instruction carries a target identifier of the target software to be processed;
当判断出处理指令为上线操作指令时,从预先存储的待更新软件包中确定目标待更新软件包,其中,目标待更新软件包为:具有目标标识的待更新软件包;When it is determined that the processing instruction is an online operation instruction, the target software package to be updated is determined from the pre-stored software package to be updated, wherein the target software package to be updated is: the software package to be updated with the target identifier;
确定目标待更新软件包所具有的目标版本号;Determining the target version number of the target package to be updated;
根据目标版本号和预先记录的与目标标识对应的历史版本号,判断目标软件是否符合更新条件,其中,历史版本号为:目标标识对应的并且当前已在服务器中安装过的软件包所具有的版本号;Determining whether the target software meets the update condition according to the target version number and the pre-recorded historical version number corresponding to the target identifier, where the history version number is: the software package corresponding to the target identifier and currently installed in the server version number;
如果是,发送目标待更新软件包至自动化运维组件,以使自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,对至少一个目标服务器中的目标软件进行更新。If yes, sending the target to be updated software package to the automated operation and maintenance component, so that the automated operation and maintenance component determines at least one target of the installed target software according to the pre-stated installation relationship between the software and the server after receiving the target to be updated software. The server updates the target software in the at least one target server when it detects that the predetermined update condition is met.
可选的,预定更新条件包括:Optionally, the scheduled update conditions include:
自动化运维组件与至少一个目标服务器之间的数据传输速率达到预定速率阈值;和/或,The data transfer rate between the automated operation and maintenance component and the at least one target server reaches a predetermined rate threshold; and/or,
至少一个目标服务器的当前运行负载低于预定负载值。The current running load of at least one target server is lower than a predetermined load value.
可选的,方法还包括:Optionally, the method further includes:
当判断出处理指令为回滚操作指令时,获取回滚操作指令中包含的针对目标软件的指定版本号;When it is determined that the processing instruction is a rollback operation instruction, obtaining a specified version number for the target software included in the rollback operation instruction;
获得指定版本号对应的软件包;Obtain the software package corresponding to the specified version number;
将指定版本号对应的软件包发送至自动化运维组件,以使自动化运维组件在接收到指定版本号对应的软件包后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定回滚条件时,采用指定版本号对应的软件包对至少一个目标服务器中的目标软件进行替换。Send the software package corresponding to the specified version number to the automated operation and maintenance component, so that the automated operation and maintenance component determines the installed software of the target software according to the pre-stated installation relationship between the software and the server after receiving the software package corresponding to the specified version number. At least one target server, and when detecting that the predetermined rollback condition is met, replacing the target software in the at least one target server with the software package corresponding to the specified version number.
可选的,自动化运维组件为saltstack组件、ansible组件或puppet组件。Optionally, the automated operation and maintenance component is a saltstack component, an ansible component, or a puppet component.
可选的,根据目标版本号和预先记录的与目标标识对应的历史版本号,判断目标软件是否符合更新条件,包括:Optionally, determining whether the target software meets the update condition according to the target version number and the pre-recorded historical version number corresponding to the target identifier, including:
在预先记录的与目标标识对应的历史版本号中,确定最高历史版本号;Determining a highest historical version number in a pre-recorded historical version number corresponding to the target identifier;
判断目标版本号是否高于最高历史版本号;Determine whether the target version number is higher than the highest historical version number;
如果是,确定目标软件符合更新条件;If yes, determine that the target software meets the update criteria;
如果否,确定目标软件不符合更新条件。If no, make sure the target software does not meet the update criteria.
可选的,自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,对至少一个目标服务器中的目标软件进行更新,包括:Optionally, after receiving the target to be updated software, the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and when detecting that the predetermined update condition is met, The target software in at least one target server is updated, including:
自动化运维组件在接收到目标待更新软件后,根据预先存储的第一安装配置文件存储目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据目标待更新软件包以及第一安装配置文件,对至少一个目标服务器中的目标软件进行更新。After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And when it is detected that the predetermined update condition is met, the target software in the at least one target server is updated according to the target software package to be updated and the first installation configuration file.
可选的,自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,对至少一个目标服务器中的目标软件进行更 新,包括:Optionally, after receiving the target to be updated software, the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and when detecting that the predetermined update condition is met, The target software in at least one target server is updated, including:
自动化运维组件在接收到目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据目标待更新软件包以及预先存储的第二安装配置文件,对至少一个目标服务器中的目标软件进行更新,其中,第二安装配置文件为:根据目标存储地址所生成的文件,目标存储地址为自动化运维组件存储目标待更新软件包所利用的地址。After receiving the target to be updated software, the automated operation and maintenance component determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server, and according to the target to be updated after detecting the predetermined update condition is met. The package and the pre-stored second installation configuration file update the target software in the at least one target server, wherein the second installation configuration file is: a file generated according to the target storage address, and the target storage address is an automatic operation and maintenance component storage. The address used by the target package to be updated.
可选的,第一安装配置文件中记录有:用于存储目标待更新软件包的预设存储地址和至少一个目标服务器的通信地址。Optionally, the first installation configuration file records: a preset storage address for storing the target to be updated package and a communication address of the at least one target server.
可选的,自动化运维组件在接收到目标待更新软件后,根据预先存储的第一安装配置文件存储目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据目标待更新软件包以及第一安装配置文件,对至少一个目标服务器中的目标软件进行更新,包括:Optionally, after receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated software package according to the pre-stored first installation configuration file, and determines the installed target software according to the pre-stated installation relationship between the software and the server. At least one target server, and when detecting that the predetermined update condition is met, updating the target software in the at least one target server according to the target software package to be updated and the first installation configuration file, including:
自动化运维组件在接收到目标待更新软件后,根据预先存储的第一安装配置文件存储目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据第一安装配置文件中记录的至少一个目标服务器的通信地址,发送目标待更新软件包的预设存储地址至至少一个目标服务器,以使至少一个目标服务器根据所获取的预设存储地址获取目标待更新软件包,并利用目标待更新软件包对至少一个目标服务器中的目标软件进行更新。After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated package according to the pre-stored first installation configuration file, and determines at least one target server of the installed target software according to the pre-stated installation relationship between the software and the server. And detecting, when the predetermined update condition is met, sending the preset storage address of the target software package to be updated to the at least one target server according to the communication address of the at least one target server recorded in the first installation configuration file, so that the at least one target The server acquires the target to be updated software package according to the obtained preset storage address, and updates the target software in the at least one target server by using the target to be updated software package.
可选的,获得针对于软件的处理指令,包括:Optionally, obtaining processing instructions for the software, including:
从预设的集成工具中获得针对于软件的处理指令。Obtain processing instructions for the software from the preset integration tools.
本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述软件处理方法。The embodiment of the present application further provides a computer program product comprising instructions, which when executed on a computer, cause the computer to execute the above software processing method.
本申请实施例还提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述软件处理方法。The embodiment of the present application also provides a computer program that, when run on a computer, causes the computer to execute the above software processing method.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities or operations. There is any such actual relationship or order between them. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置、电子设备及计算机可读存储介质、包含指令的计算机程序产品、计算机程序实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in the present specification are described in a related manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the device, the electronic device and the computer readable storage medium, the computer program product including the instructions, and the computer program embodiment are relatively similar to the method embodiment, and the description is relatively simple. Part of the description can be.
以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。The above description is only the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application are included in the scope of the present application.
Claims (18)
- 一种软件处理方法,其特征在于,所述方法包括:A software processing method, characterized in that the method comprises:获得针对于软件的处理指令,其中,所述处理指令中携带有待处理的目标软件的目标标识;Obtaining a processing instruction for the software, where the processing instruction carries a target identifier of the target software to be processed;当判断出所述处理指令为上线操作指令时,从预先存储的待更新软件包中确定目标待更新软件包,其中,所述目标待更新软件包为:具有所述目标标识的待更新软件包;When it is determined that the processing instruction is an online operation instruction, the target software package to be updated is determined from the pre-stored software package to be updated, wherein the target software package to be updated is: the software package to be updated with the target identifier. ;确定所述目标待更新软件包所具有的目标版本号;Determining a target version number of the target to be updated software package;根据所述目标版本号和预先记录的与所述目标标识对应的历史版本号,判断所述目标软件是否符合更新条件,其中,所述历史版本号为:所述目标标识对应的并且当前已在服务器中安装过的软件包所具有的版本号;Determining, according to the target version number and a pre-recorded historical version number corresponding to the target identifier, whether the target software meets an update condition, where the historical version number is: the target identifier is corresponding and currently The version number of the package installed in the server;如果是,发送所述目标待更新软件包至自动化运维组件,以使所述自动化运维组件在接收到所述目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装所述目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,对所述至少一个目标服务器中的所述目标软件进行更新。If yes, sending the target to be updated software package to the automated operation and maintenance component, so that after receiving the target to be updated software, the automated operation and maintenance component determines that the software is installed according to the pre-stated installation relationship between the software and the server. At least one target server of the target software, and updating the target software in the at least one target server when detecting that the predetermined update condition is met.
- 根据权利要求1所述的方法,其特征在于,所述预定更新条件包括:The method of claim 1 wherein said predetermined update condition comprises:所述自动化运维组件与所述至少一个目标服务器之间的数据传输速率达到预定速率阈值;和/或,a data transmission rate between the automated operation and maintenance component and the at least one target server reaches a predetermined rate threshold; and/or,所述至少一个目标服务器的当前运行负载低于预定负载值。The current operational load of the at least one target server is lower than a predetermined load value.
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:当判断出所述处理指令为回滚操作指令时,获取所述回滚操作指令中包含的所述目标软件的指定版本号;When it is determined that the processing instruction is a rollback operation instruction, acquiring a specified version number of the target software included in the rollback operation instruction;获得所述指定版本号对应的软件包;Obtaining a software package corresponding to the specified version number;将所述指定版本号对应的软件包发送至所述自动化运维组件,以使所述自动化运维组件在接收到所述指定版本号对应的软件包后,根据预先统计的 软件与服务器的安装关系,确定已安装所述目标软件的至少一个目标服务器,并在检测到符合预定回滚条件时,采用所述指定版本号对应的软件包对所述至少一个目标服务器中的所述目标软件进行替换。Sending the software package corresponding to the specified version number to the automated operation and maintenance component, so that after the automatic operation and maintenance component receives the software package corresponding to the specified version number, according to pre-stated software and server installation a relationship, determining at least one target server in which the target software is installed, and detecting, when the predetermined rollback condition is met, performing the target software in the at least one target server by using a software package corresponding to the specified version number replace.
- 根据权利要求1所述的方法,其特征在于,所述自动化运维组件为saltstack组件、ansible组件或puppet组件。The method of claim 1 wherein the automated operation and maintenance component is a saltstack component, an ansible component, or a puppet component.
- 根据权利要求1所述的方法,其特征在于,所述根据所述目标版本号和预先记录的与所述目标标识对应的历史版本号,判断所述目标软件是否符合更新条件,包括:The method according to claim 1, wherein the determining whether the target software meets an update condition according to the target version number and a pre-recorded historical version number corresponding to the target identifier comprises:在预先记录的与所述目标标识对应的历史版本号中,确定最高历史版本号;Determining a highest historical version number in a historical version number corresponding to the target identifier recorded in advance;判断所述目标版本号是否高于所述最高历史版本号;Determining whether the target version number is higher than the highest historical version number;如果是,确定所述目标软件符合更新条件;If yes, determining that the target software meets the update condition;如果否,确定所述目标软件不符合更新条件。If not, it is determined that the target software does not meet the update condition.
- 根据权利要求1所述的方法,其特征在于,所述自动化运维组件在接收到所述目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装所述目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,对所述至少一个目标服务器中的所述目标软件进行更新,包括:The method according to claim 1, wherein after receiving the target to be updated software, the automated operation and maintenance component determines, according to a pre-stated installation relationship between the software and the server, that at least the target software is installed. a target server, and when detecting that the predetermined update condition is met, updating the target software in the at least one target server, including:所述自动化运维组件在接收到所述目标待更新软件后,根据预先存储的第一安装配置文件存储所述目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装所述目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据所述目标待更新软件包以及所述第一安装配置文件,对所述至少一个目标服务器中的所述目标软件进行更新。After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated software package according to the pre-stored first installation configuration file, and determines the installed installation according to the pre-stated software and server installation relationship. Determining at least one target server of the target software, and when detecting that the predetermined update condition is met, performing the target software in the at least one target server according to the target to-be-updated software package and the first installation configuration file Update.
- 根据权利要求1所述的方法,其特征在于,所述自动化运维组件在接收到所述目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装所述目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,对所述至少一个目标服务器中的所述目标软件进行更新,包括:The method according to claim 1, wherein after receiving the target to be updated software, the automated operation and maintenance component determines, according to a pre-stated installation relationship between the software and the server, that at least the target software is installed. a target server, and when detecting that the predetermined update condition is met, updating the target software in the at least one target server, including:所述自动化运维组件在接收到所述目标待更新软件后,根据预先统计的 软件与服务器的安装关系,确定已安装所述目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据所述目标待更新软件包以及预设存储的第二安装配置文件,对所述至少一个目标服务器中的所述目标软件进行更新,其中,所述第二安装配置文件为:根据目标存储地址所生成的文件,所述目标存储地址为所述自动化运维组件存储所述目标待更新软件包所利用的地址。After receiving the target to be updated software, the automated operation and maintenance component determines, according to the pre-stated installation relationship between the software and the server, at least one target server that has installed the target software, and when detecting that the predetermined update condition is met Updating the target software in the at least one target server according to the target to be updated software package and the second installed configuration file that is preset to be stored, wherein the second installation configuration file is: according to target storage The file generated by the address, where the target storage address is an address used by the automated operation and maintenance component to store the target software package to be updated.
- 根据权利要求6所述的方法,其特征在于,所述第一安装配置文件中记录有:用于存储所述目标待更新软件包的预设存储地址和所述至少一个目标服务器的通信地址。The method according to claim 6, wherein the first installation configuration file records: a preset storage address for storing the target to-be-updated software package and a communication address of the at least one target server.
- 根据权利要求8所述的方法,其特征在于,所述自动化运维组件在接收到所述目标待更新软件后,根据预先存储的第一安装配置文件存储所述目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装所述目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据所述目标待更新软件包以及所述第一安装配置文件,对所述至少一个目标服务器中的所述目标软件进行更新,包括:The method according to claim 8, wherein the automated operation and maintenance component stores the target to be updated software package according to a pre-stored first installation configuration file after receiving the target to be updated software, according to the pre- Statistic software and server installation relationship, determining at least one target server that has installed the target software, and when detecting that the predetermined update condition is met, according to the target to be updated software package and the first installation configuration file, Updating the target software in the at least one target server, including:所述自动化运维组件在接收到所述目标待更新软件后,根据预先存储的第一安装配置文件存储所述目标待更新软件包,根据预先统计的软件与服务器的安装关系,确定已安装所述目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,根据所述第一安装配置文件中记录的所述至少一个目标服务器的通信地址,发送所述目标待更新软件包的预设存储地址至所述至少一个目标服务器,以使所述至少一个目标服务器根据所获取的预设存储地址获取所述目标待更新软件包,并利用所述目标待更新软件包对所述至少一个目标服务器中的所述目标软件进行更新。After receiving the target to be updated software, the automated operation and maintenance component stores the target to be updated software package according to the pre-stored first installation configuration file, and determines the installed installation according to the pre-stated software and server installation relationship. And at least one target server of the target software, and when detecting that the predetermined update condition is met, sending the pre-update of the target software package to be updated according to the communication address of the at least one target server recorded in the first installation configuration file Setting a storage address to the at least one target server, so that the at least one target server acquires the target to-be-updated software package according to the acquired preset storage address, and uses the target to-be-updated software package to the at least one The target software in the target server is updated.
- 根据权利要求1-9任一项所述的方法,其特征在于,所述获得针对于软件的处理指令,包括:The method according to any one of claims 1 to 9, wherein the obtaining processing instructions for the software comprises:从预设的集成工具中获得针对于软件的处理指令。Obtain processing instructions for the software from the preset integration tools.
- 一种软件处理装置,其特征在于,所述装置包括:A software processing device, characterized in that the device comprises:第一获得模块,用于获得针对于软件的处理指令,其中,所述处理指令 中携带有待处理的目标软件的目标标识;a first obtaining module, configured to obtain a processing instruction for the software, where the processing instruction carries a target identifier of the target software to be processed;第一确定模块,用于当判断出所述处理指令为上线操作指令时,从预先存储的待更新软件包中确定目标待更新软件包,其中,所述目标待更新软件包为:具有所述目标标识的待更新软件包;a first determining module, configured to determine, from a pre-stored software package to be updated, a target software package to be updated, when the processing instruction is an online operation instruction, wherein the target to be updated software package is: The package to be updated of the target identifier;第二确定模块,用于确定所述目标待更新软件包所具有的目标版本号;a second determining module, configured to determine a target version number of the target software package to be updated;判断模块,用于根据所述目标版本号和预先记录的与所述目标标识对应的历史版本号,判断所述目标软件是否符合更新条件,其中,所述历史版本号为:所述目标标识对应的并且当前已在服务器中安装过的的软件包所具有的版本号;a determining module, configured to determine, according to the target version number and a pre-recorded historical version number corresponding to the target identifier, whether the target software meets an update condition, where the historical version number is: the target identifier corresponds to And the version number of the package that is currently installed on the server;更新模块,用于在所述判断模块的判断结果为是的情况下,发送所述目标待更新软件包至自动化运维组件,以使所述自动化运维组件在接收到所述目标待更新软件后,根据预先统计的软件与服务器的安装关系,确定已安装所述目标软件的至少一个目标服务器,并在检测到符合预定更新条件时,对所述至少一个目标服务器中的所述目标软件进行更新。An update module, configured to send the target to-be-updated software package to the automated operation and maintenance component if the determination result of the determination module is yes, so that the automated operation and maintenance component receives the target to be updated software And determining, according to the pre-stated software installation relationship with the server, at least one target server that has installed the target software, and when detecting that the predetermined update condition is met, performing the target software in the at least one target server Update.
- 根据权利要求11所述的装置,其特征在于,所述预定更新条件包括:The apparatus of claim 11 wherein said predetermined update condition comprises:所述自动化运维组件与所述至少一个目标服务器之间的数据传输速率达到预定速率阈值;和/或,a data transmission rate between the automated operation and maintenance component and the at least one target server reaches a predetermined rate threshold; and/or,所述至少一个目标服务器的当前运行负载低于预定负载值。The current operational load of the at least one target server is lower than a predetermined load value.
- 根据权利要求11所述的装置,其特征在于,所述装置还包括:The device according to claim 11, wherein the device further comprises:获取模块,用于当判断出所述处理指令为回滚操作指令时,获取所述回滚操作指令中包含的针对所述目标软件的指定版本号;An acquiring module, configured to: when determining that the processing instruction is a rollback operation instruction, acquire a specified version number for the target software included in the rollback operation instruction;第二获得模块,用于获得所述指定版本号对应的软件包;a second obtaining module, configured to obtain a software package corresponding to the specified version number;处理模块,用于将所述指定版本号对应的软件包发送至所述自动化运维组件,以使所述自动化运维组件在接收到所述指定版本号对应的软件包后,根据预先统计的软件与服务器的安装关系,确定已安装所述目标软件的至少一个目标服务器,并在检测到符合预定回滚条件时,采用所述指定版本号对应的软件包对所述至少一个目标服务器中的所述目标软件进行替换。a processing module, configured to send the software package corresponding to the specified version number to the automated operation and maintenance component, so that the automated operation and maintenance component receives the software package corresponding to the specified version number, according to pre-statistics An installation relationship between the software and the server, determining at least one target server that has the target software installed, and detecting, when the predetermined rollback condition is met, adopting a software package corresponding to the specified version number to the at least one target server The target software is replaced.
- 根据权利要求11所述的装置,其特征在于,所述自动化运维组件为saltstack组件、ansible组件或puppet组件。The apparatus according to claim 11, wherein the automated operation and maintenance component is a saltstack component, an ansible component, or a puppet component.
- 一种电子设备,其特征在于,所述电子设备包括:An electronic device, comprising:处理器和存储器,其中,a processor and a memory, wherein所述存储器,用于存放计算机程序;The memory is configured to store a computer program;所述处理器,用于执行存储器上所存放的程序时,实现权利要求1-10任一所述的方法步骤。The processor, when used to execute a program stored on a memory, implements the method steps of any of claims 1-10.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-10任一所述的方法步骤。A computer readable storage medium, wherein the computer readable storage medium stores a computer program, the computer program being executed by a processor to implement the method steps of any of claims 1-10.
- 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1-10任一所述的方法步骤。A computer program product comprising instructions, wherein the computer program product, when run on a computer, causes the computer to perform the method steps of any of claims 1-10.
- 一种计算机程序,其特征在于,当所述计算机程序在计算机上运行时,使得所述计算机执行如权利要求1-10任一所述的方法步骤。A computer program, wherein the computer program, when run on a computer, causes the computer to perform the method steps of any of claims 1-10.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710701202.2 | 2017-08-16 | ||
CN201710701202.2A CN109426510B (en) | 2017-08-16 | 2017-08-16 | Software processing method and device, electronic equipment and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019034095A1 true WO2019034095A1 (en) | 2019-02-21 |
Family
ID=65362630
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/100731 WO2019034095A1 (en) | 2017-08-16 | 2018-08-16 | Software processing method and apparatus, electronic device and computer-readable storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109426510B (en) |
WO (1) | WO2019034095A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111124458A (en) * | 2019-12-29 | 2020-05-08 | 北京浪潮数据技术有限公司 | Software updating method and related device |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110704076A (en) * | 2019-10-15 | 2020-01-17 | 上海元城汽车技术有限公司 | Data processing method and device, vehicle-mounted controller and computer-readable storage medium |
CN111610988A (en) * | 2020-05-26 | 2020-09-01 | 网神信息技术(北京)股份有限公司 | Processing method and device for software management |
CN111782252A (en) * | 2020-08-20 | 2020-10-16 | 深圳市元征科技股份有限公司 | Software update control method, system and related equipment |
CN112905219B (en) * | 2021-02-07 | 2024-06-18 | 北京云育科技有限公司 | Software updating method based on SD card, terminal and computer readable storage medium |
CN114675852A (en) * | 2022-05-26 | 2022-06-28 | 青岛美迪康数字工程有限公司 | Medical software installation system and method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101770375A (en) * | 2008-12-26 | 2010-07-07 | 新奥特(北京)视频技术有限公司 | Method for realizing automatic update of software as well as system and device therefor |
CN101877650A (en) * | 2010-05-20 | 2010-11-03 | 中兴通讯股份有限公司 | Method and system for updating software version automatically |
CN102043656A (en) * | 2011-01-20 | 2011-05-04 | 宇龙计算机通信科技(深圳)有限公司 | Software management method and software management server |
CN104956374A (en) * | 2013-03-01 | 2015-09-30 | 意法爱立信有限公司 | A method for software anti-rollback recovery |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103067445B (en) * | 2012-12-06 | 2015-07-08 | 华为技术有限公司 | Method and device of software upgrading of distributed system |
US9032392B2 (en) * | 2013-03-15 | 2015-05-12 | Quixey, Inc. | Similarity engine for facilitating re-creation of an application collection of a source computing device on a destination computing device |
CN105763350A (en) * | 2014-12-16 | 2016-07-13 | 中兴通讯股份有限公司 | Method of using multicast mode to upgrade version and apparatus thereof |
-
2017
- 2017-08-16 CN CN201710701202.2A patent/CN109426510B/en active Active
-
2018
- 2018-08-16 WO PCT/CN2018/100731 patent/WO2019034095A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101770375A (en) * | 2008-12-26 | 2010-07-07 | 新奥特(北京)视频技术有限公司 | Method for realizing automatic update of software as well as system and device therefor |
CN101877650A (en) * | 2010-05-20 | 2010-11-03 | 中兴通讯股份有限公司 | Method and system for updating software version automatically |
CN102043656A (en) * | 2011-01-20 | 2011-05-04 | 宇龙计算机通信科技(深圳)有限公司 | Software management method and software management server |
CN104956374A (en) * | 2013-03-01 | 2015-09-30 | 意法爱立信有限公司 | A method for software anti-rollback recovery |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111124458A (en) * | 2019-12-29 | 2020-05-08 | 北京浪潮数据技术有限公司 | Software updating method and related device |
Also Published As
Publication number | Publication date |
---|---|
CN109426510B (en) | 2021-03-26 |
CN109426510A (en) | 2019-03-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019034095A1 (en) | Software processing method and apparatus, electronic device and computer-readable storage medium | |
US10491704B2 (en) | Automatic provisioning of cloud services | |
CN108696581B (en) | Distributed information caching method and device, computer equipment and storage medium | |
US8910172B2 (en) | Application resource switchover systems and methods | |
CN108400904B (en) | Health examination method and device based on micro-service architecture | |
US20150019722A1 (en) | Determining, managing and deploying an application topology in a virtual environment | |
CN112380170B (en) | File updating operation association method and device and computer equipment | |
CN113220433A (en) | Agent program operation management method and system | |
US8103905B2 (en) | Detecting and recovering from process failures | |
CN110896362B (en) | Fault detection method and device | |
CN110113187B (en) | Configuration updating method and device, configuration server and configuration system | |
CN115113987A (en) | Method, device, equipment and medium for allocating non-uniform memory access resources | |
CN111414247A (en) | Server switching method, device, management node and storage medium | |
US9032014B2 (en) | Diagnostics agents for managed computing solutions hosted in adaptive environments | |
CN105897487B (en) | Equipment management method and device for operation and maintenance system | |
US8677323B2 (en) | Recording medium storing monitoring program, monitoring method, and monitoring system | |
US20150220380A1 (en) | Dynamically determining an external systems management application to report system errors | |
CN112579247A (en) | Method and device for determining task state | |
US9880855B2 (en) | Start-up control program, device, and method | |
CN116319758A (en) | Data migration method, device, electronic equipment and readable storage medium | |
CN115037653B (en) | Service flow monitoring method, device, electronic equipment and storage medium | |
CN112445549A (en) | Operation and maintenance method, operation and maintenance device, electronic equipment and medium | |
CN114070889B (en) | Configuration method, traffic forwarding device, storage medium, and program product | |
CN115580522A (en) | Method and device for monitoring running state of container cloud platform | |
CN115509714A (en) | Task processing method and device, electronic 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: 18845747 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: 18845747 Country of ref document: EP Kind code of ref document: A1 |