CN110890980A - Method, device, server and system for switching main terminal and standby terminal - Google Patents

Method, device, server and system for switching main terminal and standby terminal Download PDF

Info

Publication number
CN110890980A
CN110890980A CN201911121594.0A CN201911121594A CN110890980A CN 110890980 A CN110890980 A CN 110890980A CN 201911121594 A CN201911121594 A CN 201911121594A CN 110890980 A CN110890980 A CN 110890980A
Authority
CN
China
Prior art keywords
terminal
standby
main
server
main terminal
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.)
Pending
Application number
CN201911121594.0A
Other languages
Chinese (zh)
Inventor
韩少飞
张军
吴小川
史立军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Meetsoon Technologies Co Ltd
Original Assignee
Shenzhen Meetsoon Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Meetsoon Technologies Co Ltd filed Critical Shenzhen Meetsoon Technologies Co Ltd
Priority to CN201911121594.0A priority Critical patent/CN110890980A/en
Publication of CN110890980A publication Critical patent/CN110890980A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/22Arrangements for detecting or preventing errors in the information received using redundant apparatus to increase reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route

Abstract

The invention relates to the technical field of communication, and discloses a method, a device, a server and a system for switching a main terminal and a standby terminal. The method is used for a server, the server is connected with at least two terminals, the at least two terminals comprise a main terminal and a standby terminal, and the method comprises the following steps: receiving a service request instruction, establishing service connection with a main terminal according to the service request instruction, sending the service request instruction to a standby terminal, establishing service connection with the standby terminal, and receiving heartbeat messages sent by the main terminal; whether the main terminal is in a fault state or not is determined based on the heartbeat message, and if the main terminal is in the fault state, the standby terminal is used as the main terminal, so that the switching of the main terminal and the standby terminal is realized, the whole fault detection and switching process is in the second level, and the availability of terminal services is improved.

Description

Method, device, server and system for switching main terminal and standby terminal
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, a server, and a system for switching between a master terminal and a slave terminal.
Background
In video application services, such as video conferences, emergency commands and remote classroom interaction, a user enters a system through a local video terminal to develop services. In these applications, the reliability of the terminal used by some important users is very high, such as a conference chairman in a video conference, an emergency command center, a central classroom, and the like. If the terminals of these users fail, the service is not available, and the consequences and losses are more serious.
When software of the video terminal fails, the terminal quits the service, the conventional method is to restart the video terminal and re-access the service, and when hardware of the video terminal has a problem, the video terminal is replaced. Whether the video terminal is restarted or replaced, the service interruption time is in the order of minutes or longer, thereby reducing service reliability.
Disclosure of Invention
Therefore, it is necessary to provide a method, an apparatus, a server and a system for switching a main/standby terminal, which can improve the reliability of services.
In a first aspect, an embodiment of the present invention provides a method for switching a master terminal and a standby terminal, where the method is used for a server, the server is connected to at least two terminals, and the at least two terminals include a master terminal and a standby terminal, and the method includes:
receiving a service request instruction;
establishing service connection with the main terminal according to the service request instruction;
sending the service request instruction to the standby terminal, and establishing the service connection with the standby terminal;
receiving a heartbeat message sent by the main terminal;
determining whether the main terminal is in a fault state or not based on the heartbeat message;
and if the main terminal is in a fault state, taking the standby terminal as the main terminal.
In some embodiments, the determining whether the active terminal is in a failure state based on the heartbeat message includes:
and if the heartbeat message sent by the main terminal is not received within a preset time period, determining that the main terminal is in a fault state.
In some embodiments, the active terminal and the standby terminal are connected through an active/standby signal controller;
if the main terminal is in a fault state, taking the standby terminal as the main terminal, including:
disconnecting the service connection with the main terminal;
sending a standby raising main instruction to the standby terminal so that the standby terminal outputs a control signal to the main/standby signal controller, wherein the control signal is used for controlling the main/standby signal controller to output an output signal of the standby terminal;
receiving a standby rising main response message returned by the standby terminal;
and setting the standby terminal as the main terminal according to the standby ascending main response message.
In some embodiments, before the receiving the service request instruction, the method further includes:
presetting at least two terminals as a hot standby relation;
receiving main/standby inquiry request messages sent by the at least two terminals;
and setting the at least two terminals as an active terminal and a standby terminal respectively according to the priority of the active-standby inquiry request message.
In some embodiments, the method further comprises:
after the fault of the main terminal is recovered, receiving a main/standby state request instruction sent by the main terminal;
setting the main terminal as a standby according to the main/standby state request instruction, and sending a main/standby state to the main terminal, wherein the main/standby state comprises a main state and a standby state;
and sending a service request instruction to the main terminal in the standby state, and establishing service connection with the main terminal in the standby state.
In a second aspect, an embodiment of the present invention further provides a device for switching between a main terminal and a standby terminal, where the device is used in a server, the server is connected to at least two terminals, where the at least two terminals include a main terminal and a standby terminal, and the device includes:
the first receiving module is used for receiving a service request instruction;
the first connection module is used for establishing service connection with the main terminal according to the service request instruction;
the second connection module is used for sending the service request instruction to the standby terminal and establishing the service connection with the standby terminal;
the second receiving module is used for receiving the heartbeat message sent by the main terminal;
a determining module, configured to determine whether the primary terminal is in a fault state based on the heartbeat message;
and the switching module is used for taking the standby terminal as the main terminal if the main terminal is in a fault state.
In some embodiments, the switching module is specifically configured to:
disconnecting the service connection with the main terminal;
sending a standby ascending main instruction to the standby terminal so that the standby terminal outputs a control signal to a main and standby signal controller, wherein the control signal is used for controlling the main and standby signal controller to output an output signal of the standby terminal;
receiving a standby rising main response message returned by the standby terminal;
and setting the standby terminal as the main terminal according to the standby ascending main response message.
In a third aspect, an embodiment of the present invention further provides a server, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the active/standby terminal switching method.
In a fourth aspect, an embodiment of the present invention further provides a system for switching between a main terminal and a standby terminal, where the system includes a server, at least two terminals, a main signal controller and a standby signal controller, the server is connected to the at least two terminals, the at least two terminals include a main terminal and a standby terminal, the main terminal and the standby terminal are connected to the main signal controller, and the display device is connected to the main signal controller;
the master/slave signal controller is used for:
receiving an input signal, copying the input signal into two paths of signals, and respectively sending the two paths of signals to the main terminal and the standby terminal;
receiving a control signal sent by the main terminal, and taking an output signal of the main terminal as output according to the control signal;
and receiving an output signal sent by the main terminal, and sending the output signal to the display device.
In a fifth aspect, an embodiment of the present invention further provides a non-volatile computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the processor is caused to execute the method for switching between the active and standby terminals.
Compared with the prior art, the invention has the beneficial effects that: different from the situation of the prior art, in the method for switching the main terminal and the standby terminal in the embodiment of the invention, the server establishes service connection with the main terminal by receiving a service request instruction, then sends the service request instruction to the standby terminal and establishes service connection with the standby terminal, then the server receives a heartbeat message sent by the main terminal, determines whether the main terminal is in a fault state or not based on the heartbeat message, and if so, the server takes the standby terminal as the main terminal, thereby realizing the switching of the main terminal and the standby terminal, and the whole fault detection and switching process is in the second level, thereby improving the availability of terminal services.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
Fig. 1 is a schematic view of an application scenario of a switching method between a main terminal and a standby terminal according to the present invention;
fig. 2 is a flowchart illustrating an embodiment of a method for switching between active and standby terminals according to the present invention;
fig. 3 is a flowchart of switching between the main terminal and the standby terminal in an embodiment of the method for switching between the main terminal and the standby terminal of the present invention;
fig. 4 is a flowchart illustrating a hot standby relationship setting process in an embodiment of a method for switching between a host terminal and a standby terminal according to the present invention;
fig. 5 is a flowchart of failure recovery of a primary terminal in an embodiment of a primary/secondary terminal switching method according to the present invention;
fig. 6 is a flowchart of a method for switching between active and standby terminals according to a specific embodiment of the present invention;
fig. 7 is a schematic structural diagram of an embodiment of a main/standby terminal switching device according to the present invention;
fig. 8 is a schematic diagram of a hardware structure of a server provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that, if not conflicted, the various features of the embodiments of the invention may be combined with each other within the scope of protection of the invention. Additionally, while functional block divisions are performed in apparatus schematics, with logical sequences shown in flowcharts, in some cases, steps shown or described may be performed in sequences other than block divisions in apparatus or flowcharts. In addition, the words "active", "standby" and "third" used in the present invention do not limit the data and the execution order, but only distinguish the same items or similar items with basically the same functions and actions.
In the embodiment of the present invention, the application scenario is a main/standby terminal switching system, and the application scenario includes a server, at least two terminals, a main/standby signal controller, and a display device, where the at least two terminals include a main terminal and a standby terminal, and it should be noted that the terminals may also include other terminals besides the main terminal and the standby terminal, for example, a non-main/standby terminal. Fig. 1 exemplarily shows a server 10, an active terminal 20A, a standby terminal 20B, an inactive terminal 20C, an active/standby signal controller 30, and a display device 40. The active terminal 20A and the standby terminal 20B are connected through an active/standby signal controller 30, the active/standby signal controller 30 is connected with the display device 40, and the active terminal 20A, the standby terminal 20B, and the inactive/standby terminal 20C are connected to the server 10 through network communication, for example: the server 10 is connected to the Mobile communication network by communication in a local area network, a wide area network, a wireless network, a global system for Mobile communication (GSM), a third generation Mobile communication network, a fourth generation Mobile communication network, a fifth generation Mobile communication network, or the like.
The active-standby signal controller 30 is configured to receive an input signal, copy the input signal into two paths of signals, and send the two paths of signals to the active terminal 20A and the standby terminal 20B, respectively, the active-standby signal controller 30 is further configured to receive a control signal sent by the active terminal 20A, and take an output signal of the active terminal 20A as an output according to the control signal, and the active-standby signal controller is further configured to receive an output signal sent by the active terminal 20A, and send the output signal to the display device 40. The input signal and the output signal may be video signals or audio signals, and the control signal is used to control signal switching of the active/standby signal controllers. In a practical application environment, there may be one or more input signals and output signals, or there may be no input signal, only an output signal, etc.
The at least two terminals may be, for example, a tablet computer, a personal computer, a laptop computer, and the like with video functions. The server may be a server, such as a rack server, a blade server, a tower server, or a rack server, or may be a server cluster composed of a plurality of servers, or a cloud computing service center. The display device may be a TV, a projector, or a stereo.
It should be noted that the method provided by the embodiment of the present application may be further extended to other suitable application environments, and is not limited to the application environment shown in fig. 1. In practical applications, the application environment may also include more or fewer terminals and servers.
As shown in fig. 2, an embodiment of the present invention further provides a method for switching between a master terminal and a standby terminal, where the method is applied to a server, and the method includes:
step 202, receiving a service request instruction.
In the embodiment of the present invention, the service request instruction may be initiated by the master terminal or initiated by other terminals. Specifically, when the main terminal serves as a service initiator, the server receives a service request instruction initiated by the main terminal. Or, when the main terminal and the standby terminal are used as service participants, the other terminals send service request instructions to the server, and the server receives the service request instructions sent by the other terminals.
And 204, establishing service connection with the main terminal according to the service request instruction.
When the initiator of the service request instruction is the main terminal, the server establishes service connection with the main terminal according to the received service request instruction, and the service connection is established in advance, so that the service data transmission efficiency is improved. It can be understood that, in some other embodiments, when the initiator of the service request instruction is another terminal, after receiving the service request instruction sent by the other terminal, the server sends the service request instruction to the active terminal and the standby terminal respectively, and establishes service connections with the active terminal and the standby terminal respectively.
Step 206, sending the service request instruction to the standby terminal, and establishing the service connection with the standby terminal.
After the service connection is established between the main terminal and the server, the server sends a service request instruction sent by the main terminal to the standby terminal, and establishes the service connection with the standby terminal. The service request instruction sent by the server to the standby terminal is the same as the service request instruction sent by the main terminal to the server.
And 208, receiving the heartbeat message sent by the master terminal.
In the embodiment of the present invention, the format and the content of the heartbeat message may be set according to a specific application scenario, for example, the heartbeat message may carry an identity of a master terminal that sends the heartbeat message, and the server receives the heartbeat message sent by the master terminal and determines the master terminal that sends the heartbeat message through the identity. The identity can be characterized by the network protocol address of the primary terminal or by the media access address.
Step 210, determining whether the active terminal is in a fault state based on the heartbeat message.
Step 212, if the active terminal is in a failure state, the standby terminal is used as the active terminal.
The server can determine whether the main terminal is in a fault state based on the heartbeat message, wherein the fault state can be that the main terminal fails in hardware or software, so that service data output cannot be normally performed. The whole fault detection and switching process of the main terminal and the standby terminal is in the second level, so that a user cannot feel that the terminals are switched, and the service availability is improved.
In the embodiment of the invention, the server establishes service connection with the main terminal according to the service request instruction by receiving the service request instruction, then sends the service request instruction to the standby terminal and establishes service connection with the standby terminal, then receives heartbeat messages sent by the main terminal, determines whether the main terminal is in a fault state or not based on the heartbeat messages, and if so, takes the standby terminal as the main terminal, thereby improving the service reliability.
In some embodiments, the determining whether the active terminal is in a failure state based on the heartbeat message includes: and if the heartbeat message sent by the main terminal is not received within a preset time period, determining that the main terminal is in a fault state.
In the embodiment of the present invention, for example, it is assumed that the active terminal is preset to send a heartbeat message to the server every 3 seconds, and if the server does not receive the heartbeat message sent by the active terminal within 9 seconds, it may be considered that the active terminal is currently in a fault state. It can be understood that, in some other embodiments, the server and the primary terminal maintain normal heartbeat, at this time, the heartbeat message carries a fault state of the primary terminal, and if the heartbeat message sent by the primary terminal indicates that the camera thereof is unavailable, the server determines that the primary terminal is currently in the fault state, and prepares to initiate primary-secondary switching. Meanwhile, the fault terminal can prompt a user to troubleshoot faults through the indicator lamp and the operation page, and the server informs the user through the operation page to remind the user to troubleshoot faults. It should be noted that the time when the terminal sends the heartbeat to the server, that is, the preset value, is preset and is fixed.
In some embodiments, as shown in fig. 3, the active terminal and the standby terminal are connected through an active/standby signal controller; if the main terminal is in a fault state, taking the standby terminal as the main terminal, including:
step 302, disconnecting the service connection with the active terminal.
When the server detects that the main terminal is in the fault state based on the heartbeat message, the server records the fault state of the main terminal and disconnects the service connection with the main terminal in the fault state, thereby being beneficial to providing a service channel for the data output of a subsequent standby terminal.
Step 304, sending a standby raising main instruction to the standby terminal, so that the standby terminal outputs a control signal to the main/standby signal controller, where the control signal is used to control the main/standby signal controller to output an output signal of the standby terminal.
And after the server disconnects the service connection with the main terminal in the fault state, the server outputs the data of the standby terminal to the service. Specifically, the server sends a standby main instruction to the standby terminal, and when the standby terminal receives the standby main instruction, the server outputs a control signal to the main/standby signal controller to control the main/standby signal controller to output the output signal of the standby terminal.
Step 306, receiving a backup upgrade main response message returned by the backup terminal.
Step 308, setting the standby terminal as the active terminal according to the standby ascending main response message
After the server sends a standby raising main instruction to the standby terminal, on one hand, the standby terminal outputs a control signal to the main and standby signal controllers according to the standby raising main instruction, on the other hand, the standby terminal feeds back a standby raising main response message to the server, and after the server receives the standby raising main response message returned by the standby terminal, the standby terminal is set as a main terminal according to the standby raising main message, so that the switching of the main and standby terminals is realized, and the whole fault detection and switching process is in the second level, so that the availability of terminal services is improved.
In some embodiments, as shown in fig. 4, before the receiving the service request instruction, the method further includes:
step 402, presetting at least two terminals as hot standby relation.
The hot standby relation refers to that two devices are mutually backed up and jointly execute the same service. When one device fails, the other device undertakes the service task, and the system can be ensured to continuously provide services without manual intervention. Specifically, the two terminals are preset to be in a hot standby relationship through a maintenance interface of the server, and the two terminals in the hot standby relationship each other join the service at the same time.
Step 404, receiving the master/backup query request message sent by the at least two terminals.
Step 406, setting the at least two terminals as an active terminal and a standby terminal respectively according to the priority of the active/standby inquiry request message.
After the terminal is started, a main/standby query request message is sent to the server, and after the server receives the main/standby query request messages sent by at least two terminals, the server sets the at least two terminals as a main terminal and a standby terminal according to a competition principle. Specifically, the server sends the priority of the master/slave query request message according to the at least two terminals, that is, the terminal that requests first is the master terminal, and the terminal that requests later is the slave terminal. It can be understood that the server may also set a terminal without a primary-secondary relationship as an inactive terminal.
In some embodiments, as shown in fig. 5, the method further comprises:
step 502, after the primary terminal is recovered from the fault, receiving a primary/standby state request instruction sent by the primary terminal.
When the fault of the main terminal is recovered, the main state and the standby state are requested to the server again, and the server receives a main state and standby state request instruction sent by the main terminal.
Step 504, setting the active terminal as a standby according to the active-standby state request instruction, and sending an active-standby state to the active terminal, where the active-standby state includes an active state and a standby state.
When the primary terminal fails, the standby terminal is already used as the current primary terminal, so that when the server receives a primary/standby state request instruction sent by the primary terminal after the failure is recovered, the primary terminal can only be set as standby, and the primary/standby state is sent to the primary terminal to inform the primary terminal that the primary terminal is currently used as the standby state. The active/standby state includes an active state, a standby state, and an inactive/standby state. The state may be identified by a state identifier, and when the state identifier is a first identifier, the state identifier indicates a primary state, when the state identifier is a second identifier, the state identifier indicates a standby state, and when the state identifier is a third identifier, the state identifier indicates an inactive state. The first flag of the state may be 1, the second flag may be 2, and the third flag may be 3. The first flag of the state may be 0, the second flag may be 1, and the third flag may be 2, which is only an example and is not a limitation thereto.
Step 506, sending a service request instruction to the active terminal in the standby state, and establishing a service connection with the active terminal in the standby state.
And after setting the main terminal after the fault recovery as a standby state, the server sends a service request instruction to the main terminal in the standby state, establishes service connection with the main terminal in the standby state, and recovers to a state that the main terminal and the standby terminal work simultaneously. It should be noted that when the two terminals operate simultaneously, that is, the two terminals join in the service simultaneously, only the main terminal can output the audio and video data, and the standby terminal only joins in the service and does not output the audio and video data.
To facilitate an understanding of the invention, the following examples are given:
referring to fig. 6, two terminals are preset to be in a hot standby relationship through a maintenance interface of the server, and two terminals in the hot standby relationship each other join in a service at the same time. After the terminal is started, a main/standby query request message is sent to the server, and after the server receives the main/standby query request messages sent by at least two terminals, the server sets the at least two terminals as a main terminal and a standby terminal according to a competition principle. Specifically, the server sends the priority of the master/slave query request message according to the at least two terminals, that is, the terminal that requests first is the master terminal, and the terminal that requests later is the slave terminal.
And then, the server receives a service request instruction initiated by the main terminal, and establishes service connection with the main terminal according to the service request instruction. And the server sends the service request instruction sent by the main terminal to the standby terminal and establishes the service connection with the standby terminal. The server receives heartbeat messages sent by the main terminal, determines whether the main terminal is in a fault state or not based on the heartbeat messages, specifically, if the main terminal is preset to send the heartbeat messages to the server every 3 seconds, if the server does not receive the heartbeat messages sent by the main terminal within 9 seconds, the main terminal can be considered to be in the fault state currently, or the server and the main terminal keep normal heartbeat, at the moment, the heartbeat messages carry the fault state of the main terminal, and if the heartbeat messages sent by the main terminal indicate that a camera of the main terminal is unavailable, the server determines that the main terminal is in the fault state currently. The fault state may be that the main terminal hardware fails or the software fails, which results in that the service data output cannot be performed normally, and when the main terminal is in the fault state, the audio/video service data output is interrupted, and at this time, the server determines that the main terminal is unavailable.
Then, the server records the fault state of the main terminal, and disconnects the service connection with the main terminal in the fault state, the server sends a standby raising main instruction to the standby terminal, when the standby terminal receives the standby raising main instruction, a control signal is output to a main and standby signal controller, the main and standby signal controller is controlled to output the output signal of the standby terminal, meanwhile, the standby terminal feeds back a standby raising main response message to the server, and after the server receives the standby raising main response message returned by the standby terminal, the standby terminal is set as the main terminal according to the standby raising main message, so that the switching of the main and standby terminals is realized, and the whole fault detection and switching process is second level, thereby improving the availability of terminal services. Meanwhile, the fault terminal can prompt a user to troubleshoot faults through the indicator lamp and the operation page, and the server informs the user through the operation page to remind the user to troubleshoot faults.
Then, after the fault of the primary terminal is recovered, the primary and secondary states are requested from the server again, the server receives a primary and secondary state request instruction sent by the primary terminal, and the primary terminal is used as the current primary terminal when the fault of the primary terminal occurs. The active/standby state includes an active state, a standby state, and an inactive/standby state. And after setting the main terminal after the fault recovery as a standby state, the server sends a service request instruction to the main terminal in the standby state, establishes service connection with the main terminal in the standby state, and recovers to a state that the main terminal and the standby terminal work simultaneously.
Correspondingly, an embodiment of the present invention further provides a device 700 for switching between an active terminal and a standby terminal, where the device is used for a server, and as shown in fig. 7, the device includes:
a first receiving module 702, configured to receive a service request instruction;
a first connection module 704, configured to establish a service connection with the active terminal according to the service request instruction;
a second connection module 706, configured to send the service request instruction to the standby terminal, and establish the service connection with the standby terminal;
a second receiving module 708, configured to receive the heartbeat message sent by the active terminal;
a determining module 710, configured to determine whether the active terminal is in a failure state based on the heartbeat message;
a switching module 712, configured to use the standby terminal as the active terminal if the active terminal is in a failure state.
Optionally, in some embodiments, the switching module 712 has a module for:
disconnecting the service connection with the main terminal;
sending a standby ascending main instruction to the standby terminal so that the standby terminal outputs a control signal to a main and standby signal controller, wherein the control signal is used for controlling the main and standby signal controller to output an output signal of the standby terminal;
receiving a standby rising main response message returned by the standby terminal;
and setting the standby terminal as the main terminal according to the standby ascending main response message.
Optionally, in some embodiments, the determining module 710 is specifically configured to:
and if the heartbeat message sent by the main terminal is not received within a preset time period, determining that the main terminal is in a fault state.
The device for switching the main terminal and the standby terminal provided in the embodiment of the present invention receives a service request instruction through a first receiving module, establishes a service connection with the main terminal through a first connection module, simultaneously sends the service request instruction to the standby terminal through a second connection module, establishes the service connection with the standby terminal, then receives a heartbeat message sent by the main terminal through a second receiving module, then determines whether the main terminal is in a failure state or not through a determination module based on the heartbeat message, and finally switches the standby terminal into the main terminal through a switching module when the main terminal is in the failure state, thereby improving the reliability of the service.
It should be noted that the active/standby terminal switching device may execute the active/standby terminal switching method provided in the embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
Fig. 8 is a schematic diagram of a hardware structure of a server according to an embodiment of the present invention, and as shown in fig. 8, the server 800 includes:
one or more processors 802 and a memory 804, one processor 802 being illustrated in fig. 8.
The processor 802 and the memory 804 may be connected by a bus or other means, such as by a bus in FIG. 8.
The memory 804 is used as a non-volatile computer-readable storage medium, and can be used for storing non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the active/standby terminal switching method in the embodiment of the present invention (for example, the first receiving module 702, the first connecting module 704, the second connecting module 706, the second receiving module 708, the determining module 710, and the switching module 712 shown in fig. 7). The processor 802 executes various functional applications and data processing of the server by operating the nonvolatile software program, instructions, and modules stored in the memory 804, that is, implements the active/standby terminal switching method according to the foregoing method embodiment.
The memory 804 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the data storage area may store data created according to use of the main/standby terminal switching device, and the like. Further, the memory 804 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 804 optionally includes memory located remotely from processor 802, and these remote memories may be connected to the active/standby terminal switching devices via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the memory 804, and when executed by the one or more servers, perform the active/standby terminal switching method in any of the above method embodiments, for example, perform the above-described method steps 202 to 212 in fig. 2, method steps 302 to 308 in fig. 3, method steps 402 to 406 in fig. 4, and method steps 502 to 506 in fig. 5; the functionality of modules 702 to 712 in fig. 7 is implemented.
The active/standby terminal of the embodiment of the present invention exists in various forms, including but not limited to:
(1) mobile communication devices, such devices are characterized by mobile communication capabilities and are primarily targeted at providing voice, video, and data communications. Such terminals include smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(2) The ultra-mobile personal computer equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such terminals include PDA, MID, and UMPC devices, such as ipads.
(3) Portable entertainment devices such devices may display and play multimedia content. Such devices include audio and video players (e.g., ipods), handheld game consoles, electronic books, as well as smart toys and portable car navigation devices.
The server of embodiments of the present invention exists in a variety of forms, including but not limited to:
(1) tower server
The general tower server chassis is almost as large as the commonly used PC chassis, while the large tower chassis is much larger, and the overall dimension is not a fixed standard.
(2) Rack-mounted server
Rack-mounted servers are a type of server that has a standard width of 19 inch racks, with a height of from 1U to several U, due to the dense deployment of the enterprise. Placing servers on racks not only facilitates routine maintenance and management, but also may avoid unexpected failures. First, placing the server does not take up too much space. The rack servers are arranged in the rack in order, and no space is wasted. Secondly, the connecting wires and the like can be neatly stored in the rack. The power line, the LAN line and the like can be distributed in the cabinet, so that the connection lines accumulated on the ground can be reduced, and the accidents such as the electric wire kicking off by feet can be prevented. The specified dimensions are the width (48.26cm ═ 19 inches) and height (multiples of 4.445 cm) of the server. Because of its 19 inch width, a rack that meets this specification is sometimes referred to as a "19 inch rack".
(3) Blade server
A blade server is a HAHD (High Availability High Density) low cost server platform designed specifically for the application specific industry and High Density computer environment, where each "blade" is actually a system motherboard, similar to an individual server. In this mode, each motherboard runs its own system, serving a designated group of different users, without any relationship to each other. Although system software may be used to group these motherboards into a server cluster. In the cluster mode, all motherboards can be connected to provide a high-speed network environment, and resources can be shared to serve the same user group.
(4) Cloud server
The cloud server (ECS) is a computing Service with simplicity, high efficiency, safety, reliability, and flexible processing capability. The management mode is simpler and more efficient than that of a physical server, and a user can quickly create or release any plurality of cloud servers without purchasing hardware in advance. The distributed storage of the cloud server is used for integrating a large number of servers into a super computer, and a large number of data storage and processing services are provided. The distributed file system and the distributed database allow access to common storage resources, and IO sharing of application data files is achieved. The virtual machine can break through the limitation of a single physical machine, dynamically adjust and allocate resources to eliminate single-point faults of the server and the storage equipment, and realize high availability.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a general hardware platform, and certainly can also be implemented by hardware. It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a computer readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; within the idea of the invention, also technical features in the above embodiments or in different embodiments may be combined, steps may be implemented in any order, and there are many other variations of the different aspects of the invention as described above, which are not provided in detail for the sake of brevity; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for switching between a main terminal and a standby terminal is characterized in that the method is used for a server, the server is connected with at least two terminals, the at least two terminals comprise a main terminal and a standby terminal, and the method comprises the following steps:
receiving a service request instruction;
establishing service connection with the main terminal according to the service request instruction;
sending the service request instruction to the standby terminal, and establishing the service connection with the standby terminal;
receiving a heartbeat message sent by the main terminal;
determining whether the main terminal is in a fault state or not based on the heartbeat message;
and if the main terminal is in a fault state, taking the standby terminal as the main terminal.
2. The method of claim 1, wherein the determining whether the active terminal is in a failure state based on the heartbeat message comprises:
and if the heartbeat message sent by the main terminal is not received within a preset time period, determining that the main terminal is in a fault state.
3. The method according to claim 2, wherein the active terminal and the standby terminal are connected through an active/standby signal controller;
if the main terminal is in a fault state, taking the standby terminal as the main terminal, including:
disconnecting the service connection with the main terminal;
sending a standby raising main instruction to the standby terminal so that the standby terminal outputs a control signal to the main/standby signal controller, wherein the control signal is used for controlling the main/standby signal controller to output an output signal of the standby terminal;
receiving a standby rising main response message returned by the standby terminal;
and setting the standby terminal as the main terminal according to the standby ascending main response message.
4. The method of claim 1, wherein before the receiving the service request instruction, the method further comprises:
presetting at least two terminals as a hot standby relation;
receiving main/standby inquiry request messages sent by the at least two terminals;
and setting the at least two terminals as an active terminal and a standby terminal respectively according to the priority of the active-standby inquiry request message.
5. The method according to claim 3 or 4, characterized in that the method further comprises:
after the fault of the main terminal is recovered, receiving a main/standby state request instruction sent by the main terminal;
setting the main terminal as a standby according to the main/standby state request instruction, and sending a main/standby state to the main terminal, wherein the main/standby state comprises a main state and a standby state;
and sending a service request instruction to the main terminal in the standby state, and establishing service connection with the main terminal in the standby state.
6. A device for switching between a main terminal and a standby terminal is characterized in that the device is used for a server, the server is connected with at least two terminals, the at least two terminals comprise a main terminal and a standby terminal, and the device comprises:
the first receiving module is used for receiving a service request instruction;
the first connection module is used for establishing service connection with the main terminal according to the service request instruction;
the second connection module is used for sending the service request instruction to the standby terminal and establishing the service connection with the standby terminal;
the second receiving module is used for receiving the heartbeat message sent by the main terminal;
a determining module, configured to determine whether the primary terminal is in a fault state based on the heartbeat message;
and the switching module is used for taking the standby terminal as the main terminal if the main terminal is in a fault state.
7. The apparatus of claim 6, wherein the switching module is specifically configured to:
disconnecting the service connection with the main terminal;
sending a standby ascending main instruction to the standby terminal so that the standby terminal outputs a control signal to a main and standby signal controller, wherein the control signal is used for controlling the main and standby signal controller to output an output signal of the standby terminal;
receiving a standby rising main response message returned by the standby terminal;
and setting the standby terminal as the main terminal according to the standby ascending main response message.
8. A server, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
9. A master-slave terminal switching system, comprising the server according to claim 8, at least two terminals, a master-slave signal controller and a display device, wherein the server is connected to the at least two terminals, respectively, wherein the at least two terminals include a master terminal and a slave terminal, the master terminal and the slave terminal are connected through the master-slave signal controller, and the display device is connected to the master-slave signal controller;
the master/slave signal controller is used for:
receiving an input signal, copying the input signal into two paths of signals, and respectively sending the two paths of signals to the main terminal and the standby terminal;
receiving a control signal sent by the main terminal, and taking an output signal of the main terminal as output according to the control signal;
and receiving an output signal sent by the main terminal, and sending the output signal to the display device.
10. A non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by a processor, cause the processor to perform the method of any one of claims 1-5.
CN201911121594.0A 2019-11-15 2019-11-15 Method, device, server and system for switching main terminal and standby terminal Pending CN110890980A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911121594.0A CN110890980A (en) 2019-11-15 2019-11-15 Method, device, server and system for switching main terminal and standby terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911121594.0A CN110890980A (en) 2019-11-15 2019-11-15 Method, device, server and system for switching main terminal and standby terminal

Publications (1)

Publication Number Publication Date
CN110890980A true CN110890980A (en) 2020-03-17

Family

ID=69747668

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911121594.0A Pending CN110890980A (en) 2019-11-15 2019-11-15 Method, device, server and system for switching main terminal and standby terminal

Country Status (1)

Country Link
CN (1) CN110890980A (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111652610A (en) * 2020-04-28 2020-09-11 杭州铭盛威科技有限公司 Automatic recharging method, application equipment, terminal equipment and storage medium
CN111884847A (en) * 2020-07-20 2020-11-03 北京百度网讯科技有限公司 Method and apparatus for handling faults
CN112612654A (en) * 2021-01-08 2021-04-06 成都民航空管科技发展有限公司 Multi-machine main-standby switching method of air traffic control automation system and redundancy service system
CN113258679A (en) * 2021-06-08 2021-08-13 南方电网数字电网研究院有限公司 Power grid monitoring system channel distribution method based on server instance capacity reduction
CN113342581A (en) * 2021-08-05 2021-09-03 中国人民解放军国防科技大学 Main and standby software management method and system based on cloud platform
CN114157528A (en) * 2021-11-28 2022-03-08 浙江中控技术股份有限公司 Redundant communication method, system, electronic device, and storage medium
CN114189647A (en) * 2021-10-29 2022-03-15 帜扬信通科技股份有限公司 Terminal private line switching method, device, equipment and system
CN114244690A (en) * 2021-12-30 2022-03-25 深圳市潮流网络技术有限公司 Fault processing method, device, network equipment and storage medium
CN114640574A (en) * 2022-02-28 2022-06-17 天翼安全科技有限公司 Method and device for switching main equipment and standby equipment
CN114650283A (en) * 2020-12-21 2022-06-21 京东科技控股股份有限公司 Method and device for dynamically switching cloud storage service, electronic equipment and storage medium
CN115277377A (en) * 2022-05-19 2022-11-01 亿点云计算(珠海)有限公司 Service acquisition method, device, terminal and storage medium based on distributed cloud
CN115333926A (en) * 2021-04-21 2022-11-11 大唐高鸿智联科技(重庆)有限公司 Road side unit fault processing method, RSU and vehicle networking system
CN117201507A (en) * 2023-11-08 2023-12-08 苏州元脑智能科技有限公司 Cloud platform switching method and device, electronic equipment and storage medium
CN117555278A (en) * 2024-01-11 2024-02-13 国网经济技术研究院有限公司 Control chip system for zero data loss in flexible direct valve control system and application method thereof

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1878088A (en) * 2006-03-07 2006-12-13 华为技术有限公司 Hot standby maintenance system and hot standby maintenance and failover method
JP2013045191A (en) * 2011-08-23 2013-03-04 Shunji Sugaya Backup device, backup method, and backup program
CN103560922A (en) * 2013-11-18 2014-02-05 北京特立信电子技术股份有限公司 Disaster recovery method and system
CN107818030A (en) * 2017-11-21 2018-03-20 深圳市沃特沃德股份有限公司 The method of data backup and primary terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1878088A (en) * 2006-03-07 2006-12-13 华为技术有限公司 Hot standby maintenance system and hot standby maintenance and failover method
JP2013045191A (en) * 2011-08-23 2013-03-04 Shunji Sugaya Backup device, backup method, and backup program
CN103560922A (en) * 2013-11-18 2014-02-05 北京特立信电子技术股份有限公司 Disaster recovery method and system
CN107818030A (en) * 2017-11-21 2018-03-20 深圳市沃特沃德股份有限公司 The method of data backup and primary terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
钱鸣: ""监控中心站主备操作终端、上传机及数据库服务器更换期间安全保障措施"", 《HTTPS://WENKU.BAIDU.COM/VIEW/9B058AB40342A8956BEC0975F46527D3240CA627.HTML》 *

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111652610A (en) * 2020-04-28 2020-09-11 杭州铭盛威科技有限公司 Automatic recharging method, application equipment, terminal equipment and storage medium
CN111884847A (en) * 2020-07-20 2020-11-03 北京百度网讯科技有限公司 Method and apparatus for handling faults
CN111884847B (en) * 2020-07-20 2022-06-28 北京百度网讯科技有限公司 Method and device for processing fault
CN114650283A (en) * 2020-12-21 2022-06-21 京东科技控股股份有限公司 Method and device for dynamically switching cloud storage service, electronic equipment and storage medium
CN112612654A (en) * 2021-01-08 2021-04-06 成都民航空管科技发展有限公司 Multi-machine main-standby switching method of air traffic control automation system and redundancy service system
CN112612654B (en) * 2021-01-08 2024-03-29 成都民航空管科技发展有限公司 Multi-host-standby switching method of air traffic control automation system and redundant service system
CN115333926A (en) * 2021-04-21 2022-11-11 大唐高鸿智联科技(重庆)有限公司 Road side unit fault processing method, RSU and vehicle networking system
CN113258679A (en) * 2021-06-08 2021-08-13 南方电网数字电网研究院有限公司 Power grid monitoring system channel distribution method based on server instance capacity reduction
CN113342581A (en) * 2021-08-05 2021-09-03 中国人民解放军国防科技大学 Main and standby software management method and system based on cloud platform
CN114189647A (en) * 2021-10-29 2022-03-15 帜扬信通科技股份有限公司 Terminal private line switching method, device, equipment and system
CN114157528A (en) * 2021-11-28 2022-03-08 浙江中控技术股份有限公司 Redundant communication method, system, electronic device, and storage medium
CN114244690A (en) * 2021-12-30 2022-03-25 深圳市潮流网络技术有限公司 Fault processing method, device, network equipment and storage medium
CN114640574A (en) * 2022-02-28 2022-06-17 天翼安全科技有限公司 Method and device for switching main equipment and standby equipment
CN114640574B (en) * 2022-02-28 2023-11-28 天翼安全科技有限公司 Main and standby equipment switching method and device
CN115277377A (en) * 2022-05-19 2022-11-01 亿点云计算(珠海)有限公司 Service acquisition method, device, terminal and storage medium based on distributed cloud
CN117201507A (en) * 2023-11-08 2023-12-08 苏州元脑智能科技有限公司 Cloud platform switching method and device, electronic equipment and storage medium
CN117555278A (en) * 2024-01-11 2024-02-13 国网经济技术研究院有限公司 Control chip system for zero data loss in flexible direct valve control system and application method thereof
CN117555278B (en) * 2024-01-11 2024-03-26 国网经济技术研究院有限公司 Control chip system for zero data loss in flexible direct valve control system and application method thereof

Similar Documents

Publication Publication Date Title
CN110890980A (en) Method, device, server and system for switching main terminal and standby terminal
CN106899518B (en) Resource processing method and device based on Internet data center
US9141491B2 (en) Highly available server system based on cloud computing
EP4120652A1 (en) Hot standby method, apparatus, and system
US20170270015A1 (en) Cluster Arbitration Method and Multi-Cluster Cooperation System
JP6431197B2 (en) Snapshot processing methods and associated devices
US9985893B2 (en) Load sharing method and apparatus, and board
CN105554130A (en) Distributed storage system-based NameNode switching method and switching device
CN110932876B (en) Communication system, method and device
CN112398689A (en) Network recovery method and device, storage medium and electronic equipment
CN112612769A (en) File processing method, device and storage medium
CN111541762B (en) Data processing method, management server, device and storage medium
CN113467873A (en) Virtual machine scheduling method and device, electronic equipment and storage medium
EP3056988A1 (en) Method, apparatus and system for home management device virtualization
CN115309497A (en) Request scheduling method, device, equipment and storage medium
CN114598594B (en) Method, system, medium and equipment for processing application faults under multiple clusters
WO2020252724A1 (en) Log processing method and device, and computer-readable storage medium
CN116193481A (en) 5G core network processing method, device, equipment and medium
CN114884805A (en) Data transmission method, device, terminal and storage medium
CN102843428A (en) Uploaded data processing system and method
CN113259975A (en) Network game connection method, electronic device and computer readable medium
CN111884921A (en) Communication method, system, equipment and computer readable storage medium
CN111212252A (en) Method, device, terminal equipment and system for switching picture layout
CN110890989A (en) Channel connection method and device
CN105323083A (en) IP data flow backup method and device

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200317