CN111277373B - Server switching control method, terminal and storage medium - Google Patents
Server switching control method, terminal and storage medium Download PDFInfo
- Publication number
- CN111277373B CN111277373B CN202010035307.0A CN202010035307A CN111277373B CN 111277373 B CN111277373 B CN 111277373B CN 202010035307 A CN202010035307 A CN 202010035307A CN 111277373 B CN111277373 B CN 111277373B
- Authority
- CN
- China
- Prior art keywords
- service
- server
- preemption
- key
- key service
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/22—Arrangements for detecting or preventing errors in the information received using redundant apparatus to increase reliability
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0659—Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0659—Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities
- H04L41/0661—Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities by reconfiguring faulty entities
Abstract
The invention discloses a control method, a terminal and a storage medium for server switching, wherein a main server and a standby server are started to control the main server and the standby server to start a key service detection program; when the key service is detected, judging whether the key service is effective, and when the key service is effective, reporting service data to a service management center by the key service detection program; the key service detection program applies for a preemption service, and the preemption service applies for preemption of the main server; and judging whether the preemption service is successful, if so, broadcasting service information change information for notifying a service change dependency relationship associated with the main server. The invention detects the key service of the server, thereby determining whether to switch the server, providing preemption operation and determining the switching mode of the target server, without pre-configuring the switched target server, and the invention can dynamically increase the number of the servers and has higher flexibility.
Description
Technical Field
The present invention relates to the field of computer application technologies, and in particular, to a server switching control method, a terminal, and a storage medium.
Background
In order to provide services for a plurality of users simultaneously, software is generally divided into a client and a background service according to business repeatability in a software design process, the client is used by the clients, and the software design method is characterized by interfacing and usability, and the background service is characterized by high performance and high concurrency. Due to economic considerations, a plurality of clients simultaneously access background services on one server, so that the server can cause the problem that all users cannot use the server once the server has the problems of crash and the like.
Accordingly, the prior art is yet to be improved and developed.
Disclosure of Invention
The present invention mainly aims to provide a server switching control method, a terminal and a storage medium, which aim to solve the above-mentioned defects in the prior art.
In order to achieve the above object, the present invention provides a method for controlling server switching, which comprises the following steps:
starting a main server and a standby server, and controlling the main server and the standby server to start a key service detection program;
when the key service is detected, judging whether the key service is effective, and when the key service is effective, reporting service data to a service management center by the key service detection program;
the key service detection program applies for a preemption service, and the preemption service applies for preemption of the main server;
and judging whether the preemption service is successful, if so, broadcasting service information change information for notifying a service change dependency relationship associated with the main server.
Optionally, the method for controlling server switching, where the determining whether the key service is valid further includes:
and when the key service is invalid, restarting the main server and the standby server, and controlling the main server and the standby server to restart a key service detection program.
Optionally, the method for controlling server switching, where the determining whether the preemption service is successful further includes:
and if the preemption service is unsuccessful, controlling the main server and the standby server to start the key service detection program again after a preset time delay.
Optionally, in the method for controlling server switching, the key service detection program is configured to call a key service at regular time to monitor a running state of the key service.
Optionally, in the method for controlling server switching, the key service is used to determine whether a background service is available.
Optionally, the method for controlling server switching, wherein the service data includes: server hardware information, whether a key service was invoked successfully, when a service was invoked, and a service name.
Optionally, the method for controlling server switching, where the server hardware information includes: CPU information, memory information, and operating terminal information.
Optionally, the method for controlling server switching, where the message includes: server name and server IP information.
In addition, to achieve the above object, the present invention further provides a terminal, wherein the terminal includes: the server switching control method comprises the steps of a memory, a processor and a server switching control program which is stored on the memory and can run on the processor, wherein the server switching control program realizes the steps of the server switching control method when being executed by the processor.
In order to achieve the above object, the present invention further provides a storage medium, wherein the storage medium stores a server switching control program, and the server switching control program realizes the steps of the server switching control method as described above when executed by a processor.
The method comprises the steps of controlling a main server and a standby server to start a key service detection program by starting the main server and the standby server; when the key service is detected, judging whether the key service is effective, and when the key service is effective, reporting service data to a service management center by the key service detection program; the key service detection program applies for a preemption service, and the preemption service applies for preemption of the main server; and judging whether the preemption service is successful, if so, broadcasting service information change information for notifying a service change dependency relationship associated with the main server. The invention determines whether to switch the server or not by detecting the key service of the server, provides preemption operation for determining the switching mode of the target server, does not need to pre-configure the switched target server, can dynamically increase the number of the servers and has higher flexibility.
Drawings
FIG. 1 is a flow chart of a method for controlling server switching according to a preferred embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating the whole implementation process of the control method for server switching according to the present invention;
fig. 3 is a schematic operating environment of a terminal according to a preferred embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, the method for controlling server switching according to the preferred embodiment of the present invention includes the following steps:
and step S10, starting a main server and a standby server, and controlling the main server and the standby server to start a key service detection program.
Specifically, the number of the standby servers (backup servers) in the present invention may be one or more, that is, there is one main server and one standby server in the backup scheme, and preempting means preempting the main server. When the server is switched, the destination server of the switching is obtained by the preemption of a plurality of servers, and if the alternative server to be switched is regarded as a denomination, the plurality of alternative servers preempt the denomination.
The key service detection program is used for calling the key service at regular time to monitor the running state of the key service.
And step S20, when the key service is detected, judging whether the key service is effective, and when the key service is effective, the key service detection program reports service data to a service management center.
Specifically, the key service can quickly find whether a background service is available or not, so as to achieve the purpose of timely switching, where the key service refers to which service is core content under the condition that a server provides functions, for example, a WeChat provides multiple functions, then login may be the key service, and after the service makes a mistake, the server still needs to be switched although other services are normally performed.
The method uses key service detection, and the written key service detection program detects service availability to trigger switching server operation. Compared with the existing switching mode for detecting the process running state, the method solves the problems that the process state is normal and the server cannot be switched normally when the service state is abnormal (such as the process state is normal when the server is stuck and the service is unavailable) aiming at the service content. And because the switching condition is whether the service state is normal or not, the method is more suitable for the actual requirement of improving the availability of the system.
Wherein the service data comprises: server hardware information, whether a key service is called successfully, the time for calling a service, and a service name. The server hardware information includes: CPU information, memory information, and operating terminal information.
Further, when the key service is judged to be invalid, the main server and the standby server are restarted, and the main server and the standby server are controlled to restart the key service detection program.
And step S30, the key service detection program applies for preemption service, and the preemption service applies for preemption of the main server.
Specifically, a key service detection program applies for preemption service, a main server and a standby server exist in a backup scheme, and preemption refers to preemption of the main server.
Step S40, determining whether the preemption service is successful, and if the preemption is successful, broadcasting a service information change message for notifying a service change dependency associated with the primary server.
Specifically, if the broadcast service information change message is successfully preempted, the service preemption success represents that the change of the main server is about to occur, and therefore a message needs to be sent to allow other services related to the service to change the dependency relationship. The message content comprises: server name, server IP information.
Further, if the preemption service is unsuccessful, controlling the main server and the standby server to start the key service detection program again after a preset time delay.
The preemptive switching of the invention does not need to decide the switching server in advance, the method sets a service management center, when the background service is started, the service content of the center is registered, a plurality of servers with consistent content automatically form a group, when the switching is needed, the server initiates the preemptive operation to complete the selection of the switching target, the mode does not need to configure the switching target server in advance, the number of the servers can be dynamically increased, compared with the traditional pre-configuration scheme, the preemptive switching is not needed, and the flexibility is higher.
Further, as shown in fig. 2, the whole process of server switching control in the present invention is as follows:
starting the main server and the standby server after starting;
controlling the main server and the standby server to start a key service detection program;
judging whether the key service is effective or not after the key service is detected;
when the key service is effective, the key service detection program reports service data to a service management center;
when the key service is invalid, restarting the main server and the standby server, and controlling the main server and the standby server to restart a key service detection program;
the key service detection program applies for a preemption service, and the preemption service applies for preemption of the main server;
judging whether the preemption service is successful or not;
and if the preemption service is unsuccessful, controlling the main server and the standby server to start a key service detection program again after a preset time delay (namely timing delay).
And if the preemption is successful, broadcasting a service information change message for notifying the service change dependency relationship associated with the main server.
The invention provides a preemptive server switching method based on a key service state, wherein a key service checking program can trigger the operation of a switching server according to a service available state, the server actively applies for the preemptive server in a preemptive mode, and the sequence of switching the server is determined by the service state. The method is particularly suitable for using hot and cold backup (which is a server disaster tolerance scheme generally accepted in the industry, and is an operation method for switching to a standby server when a single server is unavailable, and the standby server switching is possible only by using a backup scheme, so that the method is particularly suitable) so as to improve the system availability.
Further, as shown in fig. 3, based on the above control method for server switching, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Fig. 3 shows only some of the components of the terminal, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
The memory 20 may in some embodiments be an internal storage unit of the terminal, such as a hard disk or a memory of the terminal. The memory 20 may also be an external storage device of the terminal in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the terminal. Further, the memory 20 may also include both an internal storage unit and an external storage device of the terminal. The memory 20 is used for storing application software installed in the terminal and various types of data, such as program codes of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In an embodiment, the memory 20 stores a server switching control program 40, and the server switching control program 40 can be executed by the processor 10, so as to implement the server switching control method in the present application.
The processor 10 may be a Central Processing Unit (CPU), a microprocessor or other data Processing chip in some embodiments, and is used for running program codes stored in the memory 20 or Processing data, such as executing a control method for switching the servers.
The display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch panel, or the like in some embodiments. The display 30 is used for displaying information at the terminal and for displaying a visual user interface. The components 10-30 of the terminal communicate with each other via a terminal bus.
In one embodiment, when the processor 10 executes the server switching control program 40 in the memory 20, the following steps are implemented:
starting a main server and a standby server, and controlling the main server and the standby server to start a key service detection program;
when the key service is detected, judging whether the key service is effective, and when the key service is effective, reporting service data to a service management center by the key service detection program;
the key service detection program applies for a preemption service, and the preemption service applies for preemption of the main server;
and judging whether the preemption service is successful, if so, broadcasting service information change information for notifying a service change dependency relationship associated with the main server.
The judging whether the key service is valid further includes:
and when the key service is invalid, restarting the main server and the standby server, and controlling the main server and the standby server to restart a key service detection program.
The determining whether the preemption service is successful further comprises:
and if the preemption service is unsuccessful, controlling the main server and the standby server to start the key service detection program again after a preset time delay.
The key service detection program is used for calling the key service at regular time to monitor the running state of the key service.
The key service is used for determining whether the background service is available.
The service data includes: server hardware information, whether a key service was invoked successfully, when a service was invoked, and a service name.
The server hardware information includes: CPU information, memory information, and operating terminal information.
The message comprises: server name and server IP information.
The present invention also provides a storage medium, wherein the storage medium stores a server switching control program, and the server switching control program implements the steps of the server switching control method when executed by a processor.
In summary, the present invention provides a method, a terminal, and a storage medium for controlling server switching, where the method includes: starting a main server and a standby server, and controlling the main server and the standby server to start a key service detection program; when the key service is detected, judging whether the key service is effective, and when the key service is effective, reporting service data to a service management center by the key service detection program; the key service detection program applies for a preemption service, and the preemption service applies for preemption of the main server; and judging whether the preemption service is successful, if so, broadcasting service information change information for notifying a service change dependency relationship associated with the main server. The invention determines whether to switch the server or not by detecting the key service of the server, provides preemption operation for determining the switching mode of the target server, does not need to pre-configure the switched target server, can dynamically increase the number of the servers and has higher flexibility.
Of course, it will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program instructing relevant hardware (such as a processor, a controller, etc.), and the program may be stored in a computer readable storage medium, and when executed, the program may include the processes of the above method embodiments. The storage medium may be a memory, a magnetic disk, an optical disk, etc.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.
Claims (9)
1. A method for controlling server switching is characterized by comprising the following steps:
starting a main server and a standby server, and controlling the main server and the standby server to start a key service detection program;
when the key service is detected, judging whether the key service is effective, and when the key service is effective, reporting service data to a service management center by the key service detection program;
detecting the service availability by a written key service detection program to trigger the operation of a switching server;
when the key service is invalid, restarting the main server and the standby server, and controlling the main server and the standby server to restart a key service detection program;
the key service detection program applies for a preemption service, and the preemption service applies for preemption of the main server;
judging whether the preemption service is successful, if the preemption is successful, broadcasting service information change information for notifying a service change dependency relationship associated with the main server;
the method comprises the steps of detecting key services of the servers, determining whether the servers are switched or not, providing preemption operation for determining the switching mode of a target server, setting a service management center, registering own service content to the service management center when background service is started, enabling a plurality of servers with consistent content to automatically form a group, initiating preemption operation by the servers when switching is needed, completing selection of a switching target, not needing to pre-configure the switched target server, and dynamically increasing the number of the servers.
2. The method of claim 1, wherein the determining whether the preemption service was successful further comprises:
and if the preemption service is unsuccessful, controlling the main server and the standby server to start the key service detection program again after a preset time delay.
3. The method according to claim 1, wherein the key service detection program is configured to call a key service at regular time to monitor a running status of the key service.
4. The method for controlling server switching according to claim 3, wherein the critical service is used to determine whether a background service is available.
5. The method according to claim 1, wherein the service data includes: server hardware information, whether a key service was invoked successfully, when a service was invoked, and a service name.
6. The method of claim 5, wherein the server hardware information comprises: CPU information, memory information, and operating terminal information.
7. The method of claim 1, wherein the message comprises: server name and server IP information.
8. A terminal, characterized in that the terminal comprises: a memory, a processor and a server switching control program stored on the memory and executable on the processor, the server switching control program when executed by the processor implementing the steps of the server switching control method according to any one of claims 1 to 7.
9. A storage medium characterized in that it stores a server switching control program which, when executed by a processor, realizes the steps of the server switching control method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010035307.0A CN111277373B (en) | 2020-01-14 | 2020-01-14 | Server switching control method, terminal and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010035307.0A CN111277373B (en) | 2020-01-14 | 2020-01-14 | Server switching control method, terminal and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111277373A CN111277373A (en) | 2020-06-12 |
CN111277373B true CN111277373B (en) | 2022-08-16 |
Family
ID=70998943
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010035307.0A Active CN111277373B (en) | 2020-01-14 | 2020-01-14 | Server switching control method, terminal and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111277373B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112100031B (en) * | 2020-09-16 | 2022-08-26 | 杭州边神网络技术有限公司 | Equipment management method, server framework and computer readable storage medium |
CN112751782B (en) * | 2020-12-29 | 2022-09-30 | 微医云(杭州)控股有限公司 | Flow switching method, device, equipment and medium based on multi-activity data center |
WO2023130453A1 (en) * | 2022-01-10 | 2023-07-13 | Mediatek Singapore Pte. Ltd. | Methods and apparatus of packet classification for xr traffic |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106506278A (en) * | 2016-11-17 | 2017-03-15 | 杭州华三通信技术有限公司 | A kind of service availability monitoring method and device |
CN107566460A (en) * | 2017-08-16 | 2018-01-09 | 微梦创科网络科技(中国)有限公司 | The method and system of distributed deployment plan target |
CN107819605A (en) * | 2016-09-14 | 2018-03-20 | 北京百度网讯科技有限公司 | Method and apparatus for the switching server in server cluster |
CN108040108A (en) * | 2017-12-11 | 2018-05-15 | 杭州电魂网络科技股份有限公司 | Communication handover method, device, coordination service device and readable storage medium storing program for executing |
CN110474797A (en) * | 2019-07-25 | 2019-11-19 | 北京旷视科技有限公司 | API operation system, the method and device of active-standby switch |
CN110673960A (en) * | 2019-08-22 | 2020-01-10 | 中国平安财产保险股份有限公司 | Data synchronization method, device, equipment and computer readable storage medium |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104158911A (en) * | 2014-09-01 | 2014-11-19 | 青岛海信电器股份有限公司 | Server cluster-oriented control method and system |
CN104639367B (en) * | 2015-01-04 | 2018-04-03 | 中国联合网络通信集团有限公司 | A kind of method and system for realizing active/standby server switching |
CN109560903B (en) * | 2019-02-14 | 2024-01-19 | 湖南智领通信科技有限公司 | Vehicle-mounted command communication system for complete disaster recovery |
-
2020
- 2020-01-14 CN CN202010035307.0A patent/CN111277373B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107819605A (en) * | 2016-09-14 | 2018-03-20 | 北京百度网讯科技有限公司 | Method and apparatus for the switching server in server cluster |
CN106506278A (en) * | 2016-11-17 | 2017-03-15 | 杭州华三通信技术有限公司 | A kind of service availability monitoring method and device |
CN107566460A (en) * | 2017-08-16 | 2018-01-09 | 微梦创科网络科技(中国)有限公司 | The method and system of distributed deployment plan target |
CN108040108A (en) * | 2017-12-11 | 2018-05-15 | 杭州电魂网络科技股份有限公司 | Communication handover method, device, coordination service device and readable storage medium storing program for executing |
CN110474797A (en) * | 2019-07-25 | 2019-11-19 | 北京旷视科技有限公司 | API operation system, the method and device of active-standby switch |
CN110673960A (en) * | 2019-08-22 | 2020-01-10 | 中国平安财产保险股份有限公司 | Data synchronization method, device, equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111277373A (en) | 2020-06-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111277373B (en) | Server switching control method, terminal and storage medium | |
US7127635B2 (en) | Method for correcting a program running on a computer system | |
US7873957B2 (en) | Minimizing user disruption during modification operations | |
US8250412B2 (en) | Method and apparatus for monitoring and resetting a co-processor | |
CN106412656B (en) | The method that Android smart machine quickly connects bluetooth | |
US8245077B2 (en) | Failover method and computer system | |
CN111352797A (en) | System and method for monitoring software application processes | |
US7100162B2 (en) | System and method for process management | |
CN105373563B (en) | Database switching method and device | |
CN114327606B (en) | Configuration management method and device, electronic equipment and computer readable storage medium | |
CN110750284A (en) | Application quick starting method, terminal and computer readable storage medium | |
JP4009192B2 (en) | Efficient timer management system | |
CN113573344A (en) | SMF session detection method based on 5G and terminal | |
CN111045789B (en) | Virtual machine starting method and device, electronic equipment and storage medium | |
CN111427259A (en) | Frame slot type main/standby switching method, intelligent device and storage medium | |
WO2023019736A1 (en) | Cloud host-based qga service management method and apparatus, device and medium | |
CN106972963B (en) | Service module starting control method and starting control method after crash restart | |
US20220179680A1 (en) | Application state control method apparatus, and terminal and computer-readable storage medium | |
CN105589738A (en) | Concurrent processing method of intelligent split screen and corresponding intelligent terminal | |
US20220276901A1 (en) | Batch processing management | |
CN114625575A (en) | Business system synchronization method, device, equipment and storage medium | |
CN110677378B (en) | Control method of MAC address, intelligent terminal and storage medium | |
CN112954035B (en) | Server restarting method, device, equipment and storage medium | |
CN112181609B (en) | Service daemon method, device and readable storage medium | |
CN117762457A (en) | Service upgrading method and device for operating system without interrupting service |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |