Software state management and upgrading method and system supporting multi-mode deployment
By collecting and analyzing service status through the management platform's server, secure deployment and upgrades of software packages are achieved. This solves the problems of low operation and maintenance efficiency and insufficient security in existing technologies, improves the reliability and availability of the system, adapts to diverse business needs, and simplifies the operation and maintenance process.
Patent Information
- Application Number
- CN202511937268.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-22
- Publication Date
- 2026-01-20
AI Technical Summary
Existing technologies in software operation and maintenance management suffer from problems such as low efficiency, insufficient security, difficulty in tracing operation records, and insufficient service continuity assurance. In particular, in a cluster deployment environment, it is difficult to ensure the consistency of service status and the coordination of upgrades across multiple servers.
This invention provides a software status management and upgrade method and system that supports multi-mode deployment. The system collects service operation status and resource usage data through the server of the management platform, performs comprehensive analysis and executes service restart, receives software packages and performs integrity verification, realizes secure deployment and upgrade of software packages, and supports master-slave switchover in single-machine and cluster deployment modes to ensure uninterrupted service.
It improves operational efficiency and security, simplifies operational processes, lowers the operational threshold, and enables automatic detection and rapid intervention of abnormal services through a unified management platform. This enhances the overall reliability and availability of the system, supports diverse business needs, and reduces system development and maintenance costs.
Smart Images

Figure CN121364863A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of computer software and system maintenance, and more particularly relates to a software state management and upgrading method and system supporting multi-mode deployment. BACKGROUND
[0002] With the continuous deepening of enterprise informatization, the number and complexity of background service software increase dramatically. The traditional software operation and maintenance management mode, including the following schemes: (1) Manual operation and maintenance scheme: the operation and maintenance personnel log in the server through SSH, remote desktop, query the service state by using the ps / top command, upload the software package by using the scp command, and manually execute the process of "stopping service - replacing file - starting service"; in the cluster scenario, it is necessary to manage each server, and rely on manual judgment of master and slave node states and switching.
[0003] (2) Through the monitoring tool scheme: tools such as Zabbix and Prometheus can use service CPU / memory usage and other states and alarms, but only focus on "state monitoring", and have no software package management and upgrading function; additional tools such as Keepalived are needed for cluster management, and the components are fragmented and the configuration is complex.
[0004] (3) Basic automation tool scheme: Jenkins supports software package deployment, and Ansible supports batch execution of commands, but the former needs to be linked with the monitoring tool to realize state feedback, and the latter lacks a web visual interface; and both of them lack the closed-loop mechanism of "service abnormal restart - cluster host switching", and need manual intervention.
[0005] However, the above schemes have problems such as low operation and maintenance efficiency, insufficient security, difficult to trace operation records, and insufficient service continuity guarantee. Especially in the cluster deployment environment, it is more difficult to ensure the consistency of service states and the collaboration of upgrades on multiple servers. SUMMARY
[0006] In view of the defects of the prior art, the purpose of the present application is to improve the operation and maintenance efficiency and security of software management.
[0007] To achieve the above purpose, in a first aspect, the present application provides a software state management and upgrading method supporting multi-mode deployment, applied to a service end of a management platform, the method comprising: Collecting service running states and resource usage data of software, comprehensively analyzing and storing the service running states, and executing service restart according to the analysis result; Receiving a software package uploaded by a user through a front end of the management platform, calculating a software package verification code, and storing the information data of the software package, the verification code, and a storage path in a database based on a preset path, and recording upgrade package upload information; receiving the software upgrade instruction sent by the front end, obtaining the storage path of the target software package and the stored check code from the database, and checking the integrity of the target software package; determining that the target software package is checked successfully, deploying the target software package to a specified path, recording upgrade information, and closing an old version service to start a new version service.
[0008] Optionally, the method further comprises: reading a configuration file in a cluster deployment mode to obtain a virtual service address and network addresses of nodes in the cluster; determining a local address, comparing the local address with the network addresses of the nodes and the virtual service address to determine whether the local machine is a master or a backup; when the local machine is determined to be the master, querying a working master node address in a cluster state record, and determining whether the working master node address is consistent with the local address to determine that a master switch has occurred, and recording switch information in the switch process; the switch information includes a new master node and a switch time.
[0009] Optionally, the process of performing service restart comprises: when the service state supervision is determined to be periodic automatic supervision and maintenance, relying on a daemon process deployed on a service end, periodically collecting service running states, server CPU usage, and memory usage of each software according to a preset configuration file; based on the service running states, server CPU usage, and memory usage, comprehensively judging the service state, and when the service state is determined to be abnormal, performing service restart according to a server deployment mode.
[0010] Optionally, the process of performing service restart comprises: based on the judgment result, determining that a target service has a service exception; determining a deployment mode of a server; in a single-computer deployment mode, restarting the target service; in a cluster deployment mode, restarting a master server currently carrying the target service, and switching the master.
[0011] Optionally, in the cluster deployment mode, the process of restarting the target service further comprises: restarting the current server in the cluster deployment mode to enable the current server to use a new version of software; according to a master-backup switch rule of the cluster deployment mode, guiding a user to upgrade software of all master servers in the cluster in sequence to ensure that the service is not interrupted during the software upgrade process.
[0012] Optionally, the process of performing service restart comprises: In a case that the service state supervision is determined to be real-time query control, a system command is invoked to acquire the service running state, the server CPU usage and the memory usage of the specified service in real time; After comprehensive analysis of the service running state, the server CPU usage and the memory usage, the management platform presents the real-time information to the user; The service restart instruction initiated by the user through the front end is received; In response to the service restart instruction, the daemon process performs the operation of closing the service, restarting the service or triggering the cluster master-backup switching.
[0013] In a second aspect, the application further provides a software state management and upgrade system supporting multi-mode deployment, comprising: A state supervision module is configured to collect the service running state, the CPU and memory usage of the software, to comprehensively analyze the service running state and store the same, and to perform service restart according to the analysis result; A software package management module is configured to receive the software package uploaded by the user through the front end of the management platform, to calculate the software package verification code, and to store the information data of the software package, the verification code and the storage path in the database based on the preset path, and to record the upgrade package upload information; A verification module is configured to receive the software upgrade instruction sent by the front end, to acquire the storage path of the target software package and the stored verification code from the database, and to verify the integrity of the target software package; A software upgrade module is configured to determine whether the verification of the target software package is successful, to deploy the target software package to the specified path, to record the upgrade information and to close the old version service to start the new version service.
[0014] In a third aspect, the application further provides a management platform supporting multi-mode deployment, comprising a front end and a service end; The front end is configured to run in the user browser to provide a visual interface for the user to view the system service running state, the host node information, upload the upgrade package and issue the control instruction; The service end is configured to run in the back-end server to interact with the front end, and comprises the software state management and upgrade system supporting multi-mode deployment.
[0015] In a fourth aspect, the application provides an electronic device, comprising at least one memory configured to store a program, and at least one processor configured to execute the program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to execute the method described in the first aspect or any possible implementation manner of the first aspect.
[0016] In a fifth aspect, the present application provides a computer readable storage medium, which stores a computer program, and when the computer program is run on a processor, the processor executes the method described in the first aspect or any possible implementation manner of the first aspect.
[0017] In a sixth aspect, the present application provides a computer program product, and when the computer program product is run on a processor, the processor executes the method described in the first aspect or any possible implementation manner of the first aspect.
[0018] It can be understood that the beneficial effects of the second aspect to the fifth aspect described above can be referred to the related description in the first aspect, and will not be repeated here.
[0019] Overall, compared with the prior art, the above technical solutions conceived by the present application have the following beneficial effects: (1) Through the unified management platform, the operation and maintenance personnel can remotely and real-timely check the running state of all services, and perform restart and upgrade operations, which greatly simplifies the operation and maintenance process, reduces the operation threshold, and improves the operation and maintenance efficiency and convenience; and by implementing software package checksum management and integrity verification before deployment, a safe upgrade channel is constructed, which can effectively identify and resist security risks caused by tampering and destruction of software packages in the transmission or storage process, and ensure the security of the system basic software environment.
[0020] (2) Through the cooperative work of the background daemon process and the intelligent cluster management logic, automatic detection and rapid intervention of abnormal services are realized. In single machine mode, the abnormal services can be automatically restarted, and in cluster mode, the master-backup switching can be automatically performed, which significantly improves the overall reliability and availability of the system; and supports two mainstream deployment modes of single machine and cluster, so that one set of solution can flexibly adapt to diversified business needs from development testing to large-scale production environment, reducing the system development and maintenance cost.
[0021] (3) All software package uploading and upgrading operations, and master-backup switching operations of the present application have detailed database records, which are convenient for subsequent auditing and problem tracing. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 is one of the flowcharts of the software state management and upgrade method supporting multi-mode deployment provided by the embodiments of the present application; Figure 2 is a system architecture diagram of the management platform provided by the embodiments of the present application; Figure 3 is the second flowchart of the software state management and upgrade method supporting multi-mode deployment provided by the embodiments of the present application; Figure 4 Figure 3 is a flowchart of a third process of a software state management and upgrade method supporting multi-mode deployment according to an embodiment of the present application; Figure 5 Figure 4 is a flowchart of a fourth process of a software state management and upgrade method supporting multi-mode deployment according to an embodiment of the present application; Figure 6 Figure 5 is a flowchart of a fifth process of a software state management and upgrade method supporting multi-mode deployment according to an embodiment of the present application; Figure 7 Figure 6 is a structural diagram of a software state management and upgrade system supporting multi-mode deployment according to an embodiment of the present application; Figure 8 Figure 7 is a structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.
[0024] The term "and / or" used herein is used to describe an association relationship of associated objects, which means that there can be three relationships, for example, A and / or B can mean that there are three cases of A alone, A and B together, and B alone. The symbol " / " in this paper represents the relationship of or, for example, A / B represents A or B.
[0025] The terms "first" and "second" and the like in the specification and claims herein are used to distinguish different objects, and are not used to describe a specific order of the objects. For example, the first response message and the second response message are used to distinguish different response messages, and are not used to describe a specific order of the response messages.
[0026] In the embodiments of the present application, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of "exemplary" or "for example" is intended to present relevant concepts in a specific manner.
[0027] In the description of the embodiments of the present application, unless otherwise specified, "a plurality of" means two or more, for example, a plurality of processing units means two or more processing units, and the like; a plurality of elements means two or more elements, and the like.
[0028] The embodiments of the present application will be described below with reference to the accompanying drawings.
[0029] Referring to Figure 1 The application provides a software state management and upgrading method supporting multi-mode deployment, applied to a server of a management platform, and the method comprises the following steps: S101. Collecting service running state and resource usage data of software, comprehensively analyzing and storing the service running state, and executing service restart based on the analysis result; S102. Receiving a software package uploaded by a user through a front end of the management platform, calculating a verification code of the software package, and storing the software package, the verification code and information data of a storage path in a database based on a preset path, and recording upgrade package uploading information; S103. Receiving a software upgrading instruction sent by the front end, obtaining a storage path of a target software package and a stored verification code from the database, and verifying the integrity of the target software package; S104. Determining that the target software package is verified successfully, deploying the target software package to a specified path, recording upgrading information and closing an old version service to start a new version service.
[0030] First of all, it should be pointed out that the management platform of the application can be built with B / S architecture or C / S architecture, and the user interaction end can be realized in different forms. In an optional example, the platform is a Web platform, built based on B / S architecture, and users can access it through a browser without the need to install special software, which has the best convenience and cross-platform capability. The management platform can also be built as a desktop platform based on C / S architecture, and a special desktop client program developed for Windows, macOS or Linux operating system is used to provide a user interface.
[0031] Referring to Figure 2 The management platform of the application is composed of a back-end server and a front-end browser. The user views the system service running state, host node information, uploads an upgrade package, etc. in the front-end browser, and the back-end server implements service startup self-start, service state supervision and control, upgrade package management, upgrade management and cluster management.
[0032] Specifically, the service state supervision function in step S101 includes two parts, namely periodic automatic supervision and maintenance and real-time query control.
[0033] Referring to Figure 3 , Figure 3 is a service state supervision principle diagram provided by the embodiment of the application under different functions. The system first selects periodic control and / or query control according to pre-configuration or real-time request. In the periodic control mode, the process state, CPU and memory occupation rate, etc. of the target service are collected according to the configuration file, and the real-time running data are aggregated into a unified database for persistent storage.
[0034] Based on the built-in rule engine, the historical and real-time data are comprehensively analyzed, and once service exceptions such as process unresponsiveness and resource exhaustion are found, predefined recovery processes are automatically triggered, such as restarting the service in single-machine mode or restarting the entire server and performing master-slave switching in cluster mode.
[0035] In the query control mode, the service state is directly determined for real-time query control in response to the operation of the operation and maintenance personnel on the Web interface, the system command is called to instantaneously obtain the service state, and the result is rendered to the front-end interface in real time for user decision-making; when the user issues a restart instruction through the interface, the system parses the instruction and drives the underlying daemon process to complete the service restart or switching operation.
[0036] The software package management and security upgrade are implemented through steps S102 and S103. Referring to Figure 4 , Figure 4 is a schematic diagram of the service security upgrade module of the embodiment of the present application.
[0037] The software package uploaded by the user through the front end of the management platform is received, the software package check code is calculated, and the information data of the software package, the check code, and the storage path are stored in the database based on the preset path, and the upgrade package upload information is recorded.
[0038] When the user uploads the software package through the Web interface by dragging and dropping or selecting, the system backend receives the file data stream. To ensure the reliability and security of the subsequent upgrade process, the system immediately calculates the check code of the software package, which is the only identifier of the integrity of the software package.
[0039] Subsequently, the software package file itself is safely stored in a specific directory of the server according to the preset storage strategy, and a key record is written into the database. The record not only contains the physical storage path of the software package and the calculated check code, but also forms complete upgrade package upload information.
[0040] Further, step S103 ensures that the software package to be deployed is not tampered with or damaged compared with when it is stored. When the operation and maintenance personnel select the target version through the Web interface and trigger the upgrade instruction, the system backend receives the instruction. According to the identifier in the instruction, the storage path of the corresponding software package and the original check code saved previously are retrieved from the database record created in step S102.
[0041] Then, the physically stored package file is read again according to the path, and its instant check code is recalculated using the same algorithm. The integrity verification is implemented by comparing whether the recalculated check code is completely consistent with the original check code stored in the database. If the comparison fails, it means that the package may be damaged or illegally modified, and the upgrade process is immediately suspended, and a high-level security alarm event is recorded.
[0042] Finally, when the check is successfully passed in step S104, it is confirmed that the software package is safe and reliable, and the deployment program is started. The software package is decompressed or copied to the specified running path of the production environment, a detailed upgrade information record is generated, including the upgrade time, target version, operator, etc., and stored in the log database. Further, the key version switching operation is performed, a termination signal is sent to the currently running old version service process to make it normally close; then, relying on the daemon capability of the system daemon, the new version service program located in the new deployment path is automatically started.
[0043] Optionally, it further comprises: reading the configuration file in the cluster deployment mode to obtain the virtual service address and the network addresses of the nodes in the cluster; determining the local address, and comparing the local address with the node network addresses and the virtual service address to determine whether the local node is a master or a standby; when the local node is determined to be a master, querying the working master node address in the cluster state record, and determining whether the working master node address is consistent with the local address to determine whether a master switch has occurred, and recording switching information during the switching; the switching information includes a new master node and a switching time.
[0044] Specifically, referring to Figure 5 In the cluster deployment environment, how do each node autonomously determine the role and form a traceable record when a master-standby switch occurs. Each node reads the cluster configuration file when starting or periodically running, determines the virtual IP address for providing services externally and the network addresses of all member nodes in the cluster. The node obtains its actual network address and compares it with the address list and virtual address listed in the configuration file; through this comparison logic, the node can determine whether it is a master node that bears the main workload or a standby node that is in standby state.
[0045] Further, when the local node is determined to be a master, it will bear the additional cluster state monitoring responsibility, and when a passive master-standby switch event is detected, the system will immediately generate a detailed switching record. The switching record accurately records the timestamp of the switching and the identifier of the new master node that takes over the service, thereby providing clear cluster fault timeline and behavior trace basis for the operation and maintenance personnel.
[0046] Optionally, the process of performing service restart comprises: In the case that the service state supervision is periodic automatic supervision maintenance, the daemon deployed on the service end is relied on to periodically collect the service running state, server CPU usage and memory usage of each software according to a preset configuration file; Based on the service running state, server CPU usage and memory usage, a comprehensive judgment is made, and when the service state is judged to be abnormal, service restart is performed according to the server deployment mode.
[0047] Optionally, the process of performing service restart comprises: Based on the judgment result, it is determined that the target service has a service exception; The deployment mode of the server is determined; In the single-machine deployment mode, the target service is restarted; In the cluster deployment mode, the host server currently carrying the target service is restarted, and the host is switched.
[0048] Optionally, in the cluster deployment mode, the process of restarting the target service further comprises: The current server in the cluster deployment mode is restarted to enable the current server to use the new version of software; According to the master-backup switching rule of the cluster deployment mode, the user is guided to upgrade the software of all hosts in the cluster in sequence to ensure that the service is not interrupted during the software upgrade process.
[0049] The core of the embodiment is to rely on the daemon deployed on the backend server. The daemon, as a resident memory background service, actively and periodically queries the detailed running state of all supervised services to the operating system according to a preset configuration file, including but not limited to checking whether the service process exists, whether its CPU occupancy exceeds a threshold, and whether the memory usage is abnormal.
[0050] After successfully collecting the original monitoring data, the judgment engine built in the system will be started immediately, and if it is determined that the state of a certain service is abnormal, the preset recovery process will be automatically triggered. Specifically, in the single-machine deployment mode, the recovery action is usually to directly restart the abnormal service; and in the cluster deployment mode, the host server currently carrying the service is restarted, and the cluster high-availability mechanism is used to automatically switch the business traffic to the healthy backup machine.
[0051] Further, when it is necessary to upgrade a server in the cluster, the system performs a complete server restart. In the cluster deployment mode, the current server is restarted to enable the current server to use the new version of software, so that the user is guided to upgrade the software of all hosts in the cluster in sequence according to the master-backup switching rule, while ensuring that the service is not interrupted.
[0052] Specifically, when the current host server needs to be restarted, the new version software has been successfully deployed to the host; then, the restart operation is performed, thereby automatically triggering the master-slave switching rule to switch the service traffic uninterruptedly to the server originally in the role of the slave, and the service is taken over by the slave, thereby guaranteeing the service continuity.
[0053] After the restart is completed, the original host server is restarted, and the system daemon of the server will automatically load and run the new version software deployed in advance. Then, the server re-joins the cluster in the role of the slave and becomes a healthy node running the new version. The above process constitutes a complete upgrade unit.
[0054] By repeating the above process, that is, performing software upgrade, restart and switching on the server in the role of the host in the current cluster, each server in the cluster is processed in turn. Finally, all servers are upgraded to the new version software in a cycle.
[0055] Specifically, refer to Figure 6 , Figure 6 is a specific process diagram of server switching of the embodiment of the application, comprising the following steps: Initial state, before the host server is restarted: Host: server A, running old version 1; Slave: server B, running old version 1; The host server A is prepared to execute the restart instruction, the new version 2 is deployed on A, and then A is restarted to trigger cluster switching, and the slave B is automatically promoted to the new host, still running the old version 1.
[0056] After A is restarted, A runs the new version 2 and joins the cluster in the role of the slave.
[0057] The state at this time, after the original host server A is restarted: Host: server B, running old version 1; Slave: server A, running new version 2; The current host server B is prepared to execute the restart instruction, the new version 2 is deployed on B, and then B is restarted to trigger cluster switching, and the slave A is promoted to the new host and runs the new version 2.
[0058] After B is restarted, B runs the new version 2 and joins the cluster in the role of the slave.
[0059] Final state, after servers A and B perform upgrade and restart: Host: server A, running new version 2; Slave: server B, running new version 2; Therefore, the entire cluster has been upgraded from the old version 1 to the new version 2, and the service has not been interrupted at any time.
[0060] Optionally, the process of performing service restart comprises: In a case that the service state supervision is real-time query control, a system command is invoked to obtain the service running state, the server CPU usage and the memory usage of the specified service in real time; After comprehensive analysis and judgment of the service running state, the server CPU usage and the memory usage, the management platform presents the real-time data to the user; The service restart instruction initiated by the user through the front end is received; In response to the service restart instruction, the daemon process is used to perform the operation of closing the service, restarting the service or triggering the cluster master-backup switching.
[0061] Specifically, the embodiment of the present application provides a channel for the operation and maintenance personnel to actively intervene in the system, and emphasizes real-time and manual decision-making. When the user initiates a state query request for a specific service through the Web interface, the underlying system command is invoked to instantaneously obtain the most real process state, CPU and memory resource consumption of the service, thereby ensuring the immediacy and accuracy of the data.
[0062] After obtaining the real-time data, the data is quickly analyzed and clearly presented on the front-end interface in a graphical manner for the user to analyze and make decisions. Based on this information, if the user determines that the service needs to be restarted, the user can initiate an explicit service restart instruction through a button or other means on the interface. After receiving the instruction, the system hands over the execution to the reliable daemon process in the background. The daemon process specifically completes the operation sequence of closing the old service process and starting the new service process, or triggers a controlled master-backup switching in the cluster scenario.
[0063] Reference Figure 7 The present application also provides a software state management and upgrade system supporting multi-mode deployment, comprising: A state supervision module 710 is configured to collect the service running state, CPU and memory usage of the software, to comprehensively analyze and judge the service running state and store the service running state, and to perform service restart according to the judgment result; A software package management module 720 is configured to receive the software package uploaded by the user through the front end of the management platform, to calculate the software package verification code, and to store the information data of the software package, the verification code and the storage path in the database based on the preset path, and to record the upgrade package upload information; A verification module 730 is configured to receive the software upgrade instruction sent by the front end, to obtain the storage path of the target software package and the stored verification code from the database, and to verify the integrity of the target software package; The software upgrade module 740 is configured to determine that the target software package is successfully verified, deploy the target software package to a specified path, record upgrade information, and shut down an old version service to start a new version service.
[0064] Optionally, the method further comprises a worker node judgment module configured to: read a configuration file in a cluster deployment mode to obtain a virtual service address and network addresses of nodes in the cluster; determine a local address, and compare the local address with the network addresses of the nodes and the virtual service address to determine whether the local node is a master node or a standby node; when the local node is determined to be the master node, query a worker master node address in a cluster state record, and determine whether the worker master node address is consistent with the local address to determine whether a master node switching occurs, and record switching information in the switching process; the switching information comprises a new master node and a switching time.
[0065] Optionally, the process of performing service restart comprises: when the service state supervision is determined to be periodic automatic supervision and maintenance, periodically collect service running states, server CPU usage, and memory usage of each software based on a preset configuration file and a daemon process deployed on a server; perform comprehensive analysis and judgment on the service states, the server CPU usage, and the memory usage, and when the service states are determined to be abnormal, perform service restart according to a server deployment mode.
[0066] Optionally, the process of performing service restart according to the server deployment mode comprises: determine that a target service is abnormal based on a judgment result; determine a deployment mode of the server; in a single-machine deployment mode, restart the target service; in a cluster deployment mode, restart a master server currently carrying the target service, and switch the master server.
[0067] Optionally, in the cluster deployment mode, the process of restarting the target service further comprises: restart a current server in the cluster deployment mode to enable the current server to use a new version of software; according to a master-standby switching rule of the cluster deployment mode, guide a user to sequentially upgrade software of all master servers in the cluster to ensure that services are not interrupted during the software upgrade.
[0068] Optionally, the process of performing service restart comprises: In the case of real-time query control of service state supervision, a system command is invoked to obtain the service running state, server CPU usage and memory usage of the specified service in real time; After comprehensive analysis of the service running state, server CPU usage and memory usage, the management platform presents the information to the user in real time; The service restart instruction initiated by the user through the front end is received; In response to the service restart instruction, the daemon process performs the operation of closing the service, restarting the service or triggering the cluster master-backup switching.
[0069] The application also provides a management platform supporting multi-mode deployment, comprising a front end and a service end; The front end runs in the user's browser and provides a visual interface for the user to view the system service running state, host node information, upload upgrade package and issue control instruction. The service end runs in the back-end server and interacts with the front end, including the software state management and upgrade system supporting multi-mode deployment as described above.
[0070] It should be understood that the above device is used to execute the method in the above embodiments, and the corresponding program modules in the device have similar implementation principles and technical effects to those described in the above method. The working process of the device can refer to the corresponding process in the above method, and will not be described here.
[0071] Reference Figure 8 Based on the method in the above embodiments, the electronic device provided by the embodiments of the present application can include a processor (Processor) 810, a communication interface (Communications Interface) 820, a memory (Memory) 830 and a communication bus 840. The processor 810, the communication interface 820 and the memory 830 can communicate with each other through the communication bus 840. The processor 810 can invoke the logic instructions in the memory 830 to execute the method in the above embodiments.
[0072] In addition, the logic instructions in the memory 830 described above can be implemented in the form of a software functional unit and sold or used as an independent product. It can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present application.
[0073] Based on the method in the above embodiment, the embodiment of the application provides a computer readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0074] Based on the method in the above embodiment, the embodiment of the application provides a computer program product, which makes the processor execute the method in the above embodiment when the computer program product runs on the processor.
[0075] It can be understood that the processor in the embodiment of the application can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor can be a microprocessor or any conventional processor.
[0076] The method steps in the embodiment of the application can be realized in the form of hardware or by the processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in a random access memory (RAM), a flash memory, a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically EPROM (EEPROM), a register, a hard disk, a mobile hard disk, a CD-ROM or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an ASIC.
[0077] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions can be stored in or transmitted by a computer readable storage medium. The computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through a wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media sets. The available media can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.
[0078] It can be understood that various numerical numbers involved in the embodiments of the present application are only distinguished for convenience of description, and are not used to limit the scope of the embodiments of the present application.
[0079] Those skilled in the art easily understand that the above only describes the preferred embodiments of the present application and is not used to limit the present application. Any modification, equivalent replacement and improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims
1. A method for software state management and upgrade in support of multi-mode deployment, the method comprising: The application is applied to a service end of a management platform, and the method comprises the following steps: Collecting service running state and resource usage data of software, comprehensively judging the service running state and storing it, and executing service restart according to the judgment result; Receiving a software package uploaded by a user through a front end of the management platform, calculating a software package check code, and storing the software package, the check code and information data of a storage path in a database based on a preset path, and recording upgrade package upload information; Receiving a software upgrade instruction sent by the front end, obtaining a storage path of a target software package and a stored check code from the database, and verifying the integrity of the target software package; Determining that the target software package is verified successfully, deploying the target software package to a specified path, recording upgrade information and closing an old version service to start a new version service.
2. The software state management and upgrade method to support multi-mode deployment according to claim 1, wherein, The process of executing service restart comprises the following steps: When service state supervision is periodic automatic supervision and maintenance, relying on a daemon process deployed in the service end, periodically collecting service running state, server CPU usage rate and memory usage rate of each software according to a preset configuration file; Based on the service running state, server CPU usage rate and memory usage rate, comprehensively judging the service state, and when the service state is abnormal, executing service restart according to a server deployment mode.
3. The software state management and upgrade method to support multi-mode deployment of claim 2, wherein, The process of executing service restart according to the server deployment mode comprises the following steps: Based on the judgment result, determining that a target service is abnormal; Determining a deployment mode of the server; In the single-machine deployment mode, restarting the target service; In the cluster deployment mode, restarting a host server currently bearing the target service and switching the host.
4. The software state management and upgrade method to support multi-mode deployment of claim 3, wherein, Further comprising the following steps: In the cluster deployment mode, reading a configuration file to obtain a virtual service address and network addresses of nodes in the cluster; Determining a local address, comparing the local address with the network addresses of the nodes and the virtual service address to determine whether the local machine is a host or a standby machine; When the local machine is the host, querying a working host node address in a cluster state record, determining whether the working host node address is consistent with the local address to determine whether host switching occurs, and recording switching information in the switching process; the switching information comprises a new host node and a switching time.
5. The software state management and upgrade method to support multi-mode deployment of claim 3, wherein, In the cluster deployment mode, the process of restarting the target service further comprises the following steps: Issuing a restart instruction to the current host server in the cluster deployment mode to upgrade and enable a new version of software of the host server; Based on the restart instruction, triggering a host-standby switching rule of the cluster to enable a standby server to take over an old version of software service running on the current host server to ensure business continuity; After the restart is completed, determining that the host server loads and runs the upgraded new version of software, and adding the host server as a standby machine to the cluster; Repeating the software upgrade, server restart and host switching process to upgrade all servers in the cluster in turn until the entire cluster is switched to the new version of software, and maintaining service continuity through host-standby switching in the entire process.
6. The software state management and upgrade method to support multi-mode deployment of claim 1, wherein, The process of executing service restart comprises the following steps: In the case of real-time query control of service state supervision, a system command is invoked to obtain the service running state, server CPU usage and memory usage of the specified service in real time; After comprehensive analysis of the service running state, server CPU usage and memory usage, the management platform presents the real-time state to the user; The service restart instruction initiated by the user through the front end is received; In response to the service restart instruction, the daemon process performs the operation of closing the service, restarting the service or triggering the cluster master backup switching.
7. A software state management and upgrade system supporting multi-mode deployment, characterized by, Comprise: The state supervision module is used for collecting the service running state, CPU and memory usage of the software, comprehensively analyzing the service running state and storing the same, and performing service restart according to the analysis result; The software package management module is used for receiving the software package uploaded by the user through the front end of the management platform, calculating the software package verification code, and storing the information data of the software package, verification code and storage path in the database based on the preset path, and recording the upgrade package upload information; The verification module receives the software upgrade instruction sent by the front end, obtains the storage path of the target software package and the stored verification code from the database, and verifies the integrity of the target software package; The software upgrade module is used for determining that the target software package verification is successful, deploying the target software package to the specified path, recording the upgrade information and closing the old version service to start the new version service.
8. A management platform supporting multi-mode deployment, characterized by, Comprise front end and service end; The front end runs in the user browser and is used for providing a visual interface for the user to view the system service running state, host node information, upload upgrade package and issue control instruction; The service end runs in the back-end server and is used for data interaction with the front end, including the software state management and upgrade system supporting multi-mode deployment as claimed in claim 7.
9. An electronic device, comprising: Comprise: At least one memory for storing computer programs; At least one processor for executing the programs stored in the memory, when the programs stored in the memory are executed, the processor is used for executing the method as claimed in any one of claims 1-6.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. When the computer program runs on the processor, the processor executes the method as claimed in any one of claims 1-6.
Citation Information
Patent Citations
Method and device for operating infrastructure layer of cloud computing architecture
CN106357735A
Redis operation and maintenance method and system based on private cloud platform
CN109687986A
Automatic upgrading method and device for distributed system
CN110209405A
Application publishing / updating method and system for offline container cloud environment
CN111610989A
Application deployment management method and device, equipment and computer storage medium
CN117008925A
Cited By
Software deployment method and electronic equipment
CN121614150A