CN109753387B - Dual-computer hot standby method and system of rail transit multimedia system - Google Patents

Dual-computer hot standby method and system of rail transit multimedia system Download PDF

Info

Publication number
CN109753387B
CN109753387B CN201810068213.6A CN201810068213A CN109753387B CN 109753387 B CN109753387 B CN 109753387B CN 201810068213 A CN201810068213 A CN 201810068213A CN 109753387 B CN109753387 B CN 109753387B
Authority
CN
China
Prior art keywords
host
server
standby
machine
computer
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
Application number
CN201810068213.6A
Other languages
Chinese (zh)
Other versions
CN109753387A (en
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.)
BYD Co Ltd
Original Assignee
BYD 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 BYD Co Ltd filed Critical BYD Co Ltd
Priority to CN201810068213.6A priority Critical patent/CN109753387B/en
Publication of CN109753387A publication Critical patent/CN109753387A/en
Application granted granted Critical
Publication of CN109753387B publication Critical patent/CN109753387B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a dual-computer hot standby method and a dual-computer hot standby system of a rail transit multimedia system, wherein the method comprises the following steps: configuring a first server and a second server, and designating one of the servers as a host and the other as a standby; and the host and the standby machine receive data from an external network segment simultaneously, so that the data of the host and the data of the standby machine are kept consistent. According to the method, the host and the standby machine receive data from an external network segment simultaneously, so that the data of the host and the data of the standby machine are kept consistent, the problem of large data synchronization workload in a dual-machine hot standby system of a rail transit multimedia system is solved, the service can be switched rapidly when the host fails, the overall stability of the dual-machine hot standby system of the rail transit multimedia system is improved, and the failure switching time is greatly shortened.

Description

Dual-computer hot standby method and system of rail transit multimedia system
Technical Field
The invention relates to the technical field of network communication, in particular to a dual-computer hot standby method and a dual-computer hot standby system of a rail transit multimedia system.
Background
The inventor finds that the existing dual-computer hot standby scheme needs two servers, one is a host computer, the other is a standby computer, each server stores service data by using a local disk, software is responsible for synchronizing the service data of the two servers in real time, the host computer serves a client and synchronizes the service data to the standby computer in real time, once the host computer fails, service application is automatically switched to the standby computer to continue to serve the client, and the service application is protected from running uninterruptedly as much as possible.
In the prior art, the data of the host computer is synchronized to the standby computer in real time through the network, and when the data volume is too large, the workload required for synchronization is very large. Moreover, when the host fails and the backup takes over the data, the huge data needs to be verified, which is a long process, resulting in long time for switching between failures and great influence on the application of the client.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, a first objective of the present invention is to provide a dual-computer hot-standby method for a rail transit multimedia system, in which data of an external network segment is received by the host and the standby at the same time, so that the data of the host and the standby are always consistent, the problem of large data synchronization workload in a dual-computer hot-standby scheme of the rail transit multimedia system is solved, a service can be quickly switched when the host fails, the overall stability of the dual-computer hot-standby system of the rail transit multimedia system is improved, and the failure switching time is greatly shortened.
The second objective of the present invention is to provide a dual-computer hot standby system of a rail transit multimedia system.
A third object of the invention is to propose a computer program product.
A fourth object of the invention is to propose a non-transitory computer-readable storage medium.
To achieve the above object, an embodiment of a first aspect of the present invention provides a dual-computer hot standby method for a rail transit multimedia system, including:
configuring a first server and a second server, and designating one of the servers as a host and the other as a standby;
and the host and the standby machine receive data from an external network segment simultaneously, so that the data of the host and the data of the standby machine are kept consistent.
Optionally, as a possible implementation manner of the embodiment of the first aspect, configuring a first server and a second server, and designating the first server or the second server as a host or a standby, includes:
configuring the working modes of the first server and the second server, and designating the first server or the second server as the host or the standby according to the working modes;
and configuring a virtual IP address, wherein the host provides service for the client in the local network segment through the virtual IP address.
Optionally, as a possible implementation manner of the embodiment of the first aspect, configuring a working mode of the first server and a working mode of the second server, and designating the first server or the second server as the host or the standby according to the working mode includes:
if the value of the working mode of the first server or the second server is configured to be 1, the first server or the second server is a host;
and if the value of the working mode of the first server or the second server is configured to be 0, the first server or the second server is a standby machine.
Optionally, as a possible implementation manner of the embodiment of the first aspect, configuring a first server and a second server, and designating the first server or the second server as a host or a standby, further includes:
the host periodically sends heartbeat packets to the standby machine, the standby machine receives the heartbeat packets, if the heartbeat packets cannot be received by the standby machine in a plurality of continuous heartbeat periods, the host is judged to be in fault, the host and the standby machine carry out the main-standby switching, and the virtual IP address is switched to the host after the main-standby switching.
Optionally, as a possible implementation manner in the embodiment of the first aspect, if the standby machine cannot receive the heartbeat packets in multiple continuous heartbeat cycles, determining that the host fails includes:
in each heartbeat period, adding one to the heartbeat packet counting value of the standby machine;
if the standby machine receives the heartbeat packet of the host machine, setting the heartbeat packet counting value to be zero;
and if the heartbeat packet counting value exceeds a first threshold value, judging that the host machine is in fault.
Optionally, as a possible implementation manner in the embodiment of the first aspect, the method further includes:
and if the host receives a plurality of heartbeat packets, judging that the host fails, switching the host to a standby machine and canceling the virtual IP address.
Optionally, as a possible implementation manner in the embodiment of the first aspect, the method further includes:
the host and the standby receive the main-standby switching information, and carry out main-standby switching according to the main-standby switching information, and the virtual IP address is switched to the host after the main-standby switching.
Optionally, as a possible implementation manner of the embodiment of the first aspect, the receiving, by the host and the standby device, data from an external network segment synchronously, so that the data of the host and the data of the standby device are always consistent, includes:
the host and the standby machine join the same multicast group, and the host and the standby machine receive data sent by a multicast source, so that the data of the host and the data of the standby machine are kept consistent.
The dual-computer hot standby method of the rail transit multimedia system in the embodiment of the invention designates the first server or the second server as the host computer or the standby computer by configuring the first server and the second server, and the host computer and the standby computer synchronously receive data from an external network segment, so that the data of the host computer and the data of the standby computer are always kept consistent. In the embodiment, the host and the standby machine synchronously receive data from the external network segment, so that the problem of large data synchronization workload in the dual-machine hot standby system of the rail transit multimedia system is solved, the service can be quickly switched when the host fails, the overall stability of the dual-machine hot standby system of the rail transit multimedia system is improved, and the failure switching time is greatly shortened.
To achieve the above object, a second aspect of the present invention provides a dual-computer hot standby system of a rail transit multimedia system, including:
a first server and a second server; wherein the first server and the second server each comprise:
the configuration module is used for configuring the first server or the second server, and appointing one server as a host computer and the other server as a standby computer;
and the host and the standby machine receive data from an external network segment through the synchronous receiving module at the same time, so that the data of the host and the data of the standby machine are kept consistent.
Optionally, as a possible implementation manner of the embodiment of the second aspect, the configuration module includes:
a working mode configuration unit, configured to configure a working mode of the first server or the second server, and designate the first server or the second server as the host or the standby according to the working mode;
and the host provides service to the client in the local network segment through the virtual IP address.
Optionally, as a possible implementation manner of the embodiment of the second aspect, the working mode configuration unit is specifically configured to:
if the value of the working mode of the first server or the second server is configured to be 1, the first server or the second server is a host;
and if the value of the working mode of the first server or the second server is configured to be 0, the first server or the second server is a standby machine.
Optionally, as a possible implementation manner of the embodiment of the second aspect, the method further includes:
the host periodically sends a heartbeat packet to the standby machine through the sending module;
the standby machine receives the heartbeat packets through the first receiving module, if the heartbeat packets cannot be received by the standby machine in a plurality of continuous heartbeat cycles, the host machine is judged to be in fault, the host machine and the standby machine are switched between the main machine and the standby machine, and the virtual IP address is switched to the host machine after the main machine and the standby machine are switched.
Optionally, as a possible implementation manner of the embodiment of the second aspect, the first receiving module is specifically configured to:
in each heartbeat period, adding one to the heartbeat packet counting value of the standby machine;
if the standby machine receives the heartbeat packet of the host machine, setting the heartbeat packet counting value to be zero;
and if the heartbeat packet counting value exceeds a first threshold value, judging that the host machine is in fault.
Optionally, as a possible implementation manner of the embodiment of the second aspect, the method further includes:
and the host receives the heartbeat packets through the second receiving module, if the host receives a plurality of heartbeat packets, the host is judged to be in fault, and the host is switched to be a standby machine and cancels the virtual IP address.
Optionally, as a possible implementation manner of the embodiment of the second aspect, the method further includes:
and the host or the standby machine receives the main/standby switching information through the third receiving module, performs main/standby switching according to the main/standby switching information, and switches the virtual IP address to the host after the main/standby switching.
Optionally, as a possible implementation manner of the embodiment of the second aspect, the synchronous receiving module is specifically configured to:
the host and the standby machine join the same multicast group, and the host and the standby machine receive data sent by a multicast source, so that the data of the host and the data of the standby machine are kept consistent.
According to the dual-computer hot standby system of the rail transit multimedia system, the first server and the second server are configured, the first server or the second server is designated as the host computer or the standby computer, and the host computer and the standby computer synchronously receive data from an external network segment, so that the data of the host computer and the data of the standby computer are always kept consistent. In the embodiment, the host and the standby machine synchronously receive data from the external network segment, so that the problem of large data synchronization workload in a dual-machine hot standby system of the rail transit multimedia system is solved, the service can be quickly switched when the host fails, the overall stability of the dual-machine hot standby system of the rail transit multimedia system is improved, and the failure switching time is greatly shortened.
To achieve the above object, a third aspect of the present invention provides a computer program product, wherein instructions of the computer program product, when executed by a processor, implement the dual hot-standby method of the rail transit multimedia system according to the first aspect.
In order to achieve the above object, a fourth aspect of the present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the dual-computer hot-standby method of the rail transit multimedia system according to the first aspect of the present invention.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart of a dual-computer hot standby method of a rail transit multimedia system according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating a working principle of a dual-computer hot standby system of a rail transit multimedia system according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a dual-computer hot standby system of a rail transit multimedia system according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a dual-computer hot standby system of another rail transit multimedia system according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a dual-computer hot standby system of a rail transit multimedia system according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a dual-computer hot standby system of another rail transit multimedia system according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a dual-computer hot standby system of a rail transit multimedia system according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The following describes a dual-computer hot standby method and system of a rail transit multimedia system according to an embodiment of the present invention with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a dual-computer hot standby method of a rail transit multimedia system according to an embodiment of the present invention.
Step 101, configuring a first server and a second server, and designating one of the servers as a host and the other as a standby.
The dual-computer hot standby method of the rail transit multimedia system provided by the embodiment of the invention can be used in occasions with higher requirements on the stability and continuity of network services or occasions with lower tolerance of terminal users to service interruption, such as the rail transit multimedia system, a rail transit driving control system, a car multimedia system, a car automatic driving control system, a business service system of an enterprise and public institution, and the like.
In this step, a first server and a second server are manually configured, so that one server works as a host and the other server works as a standby, wherein the host or the standby is not a fixed server, the host or the standby is determined according to the configuration of the first server or the second server, and if the server is the host, the server provides service for a client of the network segment; and if the server is a standby machine, the server does not provide service for the client side of the network segment.
And 102, simultaneously receiving data from the external network segment by the host and the standby machine, so that the data of the host and the standby machine are kept consistent.
In the existing dual-computer hot standby scheme of the rail transit multimedia system, data of an external network segment is received through a host computer, the data of the host computer and the data of a standby computer are synchronized in real time through a network, and when the data volume is overlarge, the workload required for synchronization is very large. Moreover, when the host fails and the backup takes over the data, the huge data needs to be verified, which results in long time for switching between failures and has great influence on the application of the client.
In this embodiment, the host and the standby machine are both in a working state, and simultaneously receive data of an external network segment, the data of the host and the data of the standby machine are always consistent, and the data of the two servers do not need to be synchronized.
It can be seen that, in this embodiment, the main and standby hosts receive data of an external network segment simultaneously, so that the problem of large data synchronization workload in the dual-host hot-standby scheme of the existing rail transit multimedia system is solved, and when a host fails, services can be switched quickly.
In order to more clearly illustrate the above embodiments, the following description is made with reference to the dual-computer hot standby system of the rail transit multimedia system shown in fig. 2, which includes a host computer and a standby computer.
The client can be a broadcast control (LCD) display or an LED display, and the transmitted and received data can be weather forecast or advertisement data. The internal network segment refers to a local area network consisting of a host, a standby machine and a client, and the external network segment is other local area networks in the rail transit system capable of communicating with the internal network segment or wide area networks outside the rail transit system, for example, the local area network can be a local area network consisting of a clock system or a local area network consisting of a train dispatching system. The internal network segment needs to communicate with the external network segment through a control center in the rail transit system.
Specifically, working modes of a first server and a second server are configured, and the first server or the second server is designated as a host or a standby according to the working modes; and configuring a virtual IP address, and providing services for the client in the local network segment by the host through the virtual IP address.
In this embodiment, after the operating modes of the first server and the second server are configured, the first server or the second server is designated as a host or a standby according to the operating modes. In order to distinguish and communicate the first server and the second server with other network devices, the host and the standby machine are configured with the IP addresses of the first server and the second server. The host also configures a virtual IP address through which the host provides services to clients in the local network segment. To prevent the standby machine from being configured with a virtual IP, the standby machine needs to cancel the virtual IP.
Taking linux operating system as an example, the host configures a command of virtual IP: ifconfig enp2s0:110.4.20.209netmask 255.255.255.0 up; the standby machine cancels the command of the virtual IP: the commands for virtual IP configuration and cancellation for the ifconfig enp2s0:1down, windows operating system, and embedded operating system are not listed.
Under the condition that the host is normal, the client accesses the host through the virtual IP address, and when the host fails, the virtual IP address is switched to the standby host. The client still accesses the virtual IP address, so the client can only find a short communication interruption in the switching process, and the service can be recovered after a short time.
Specifically, if the value of the working mode of the first server or the second server is configured to be 1, the first server or the second server is the host; and if the value of the working mode of the first server or the second server is configured to be 0, the first server or the second server is a standby machine.
In this embodiment, the host or the standby is not the fixed first server or the second server, but the host and the standby are designated according to the value of the working mode of the first server or the second server, so that the working mode of the host and the standby can be quickly established and the client can be provided with services, and function migration can be easily performed for different operating systems. In addition, the initial value of the working mode of the hot-standby dual computer is not set, so that the conflict processing mechanism of the system automatically coordinates the working modes of the dual computers, and the deployment of the system is facilitated.
After the host and the standby machine are determined, the host periodically sends heartbeat packets to the standby machine, and the standby machine receives the heartbeat packets. As shown in fig. 2, the standby device receives the heartbeat packet and determines the state of the host according to the heartbeat packet.
Specifically, the host periodically sends heartbeat packets to the standby machine, the standby machine receives the heartbeat packets, if the heartbeat packets cannot be received by the standby machine in a plurality of continuous heartbeat cycles, the host is judged to be in fault, the host and the standby machine are switched, and the virtual IP address is switched to the host after the host and the standby are switched.
In this embodiment, the host periodically sends the heartbeat packet to the standby device based on the UDP protocol, which is convenient and fast compared to sending the heartbeat packet based on the TCP protocol. The standby machine does not send heartbeat packets to the host machine, and monitors the heartbeat packets of the host machine and counts the heartbeat packets. When the standby machine cannot receive the heartbeat packets in a plurality of continuous heartbeat cycles, if the count value of the heartbeat packets is greater than a set first threshold value, the host machine is considered to be in fault, the main-standby switching is prepared, and meanwhile, the host machine of the system is reported to the upper-level system to be in fault. The main-standby switching means that the value of the working mode of the first server or the second server corresponding to the host is configured to be 0, and the value of the working mode of the first server or the second server corresponding to the standby is configured to be 1, that is, the host before the main-standby switching is the standby after the main-standby switching, and the standby before the main-standby switching is the host after the main-standby switching. The standby machine after the main-standby switching needs to cancel the virtual IP, so that the conflict with the main machine after the main-standby switching is avoided, and the service supply to the client side is stopped; and the standby machine after the main and standby switching needs to be configured with a virtual IP and provides service for the client through the virtual IP.
The heartbeat cycle of the host sending the heartbeat packet mainly depends on the Round Trip Time (RTT) of the network and the service processing time of the actual server hardware device, wherein the round trip time represents the total elapsed time from the sending of the data by the sending end to the receiving of the acknowledgement from the receiving end (the acknowledgement is sent immediately after the receiving end receives the data). At present, the RTT of a general network is about 1 millisecond, the operating rate of hardware is very high, and general services can be completed within tens of milliseconds. Therefore, the period is preferably set between 60 ms and 1000 ms, and specific data can be determined in a debugging mode when the system is implemented.
The first threshold of the heartbeat packet count is influenced by various factors such as hardware environment and network communication quality, for example, the packet loss rate is small, the packet loss rate of the current local area network is small, the value of the first threshold can be 3-10, and the first threshold can be specifically debugged and determined when a dual-computer hot standby system of a rail transit multimedia system is deployed.
Specifically, in each heartbeat cycle, the heartbeat packet count value of the standby machine is increased by one; if the standby machine receives the heartbeat packet of the host machine, setting the heartbeat packet counting value to be zero; and if the count value of the heartbeat packet is overlarge, judging that the host machine is in fault.
In this embodiment, in each heartbeat cycle, the heartbeat packet count value of the standby device is increased by one; when the standby machine receives the heartbeat packet of the host machine, the counting value of the heartbeat packet is set to be zero. When the standby machine cannot receive the heartbeat packet within a certain time, the counting value of the heartbeat packet is added by one in each heartbeat period, and if the counting value of the heartbeat packet exceeds a first threshold value, the host machine is considered to be in fault.
And if the host receives a plurality of heartbeat packets, judging that the host fails, switching the host to a standby machine and canceling the virtual IP address.
The standby machine does not send the heartbeat packet to the host machine, when the host machine receives the heartbeat packet, the other server is also the host machine, the host machine counts the received heartbeat packet, if the count value of the heartbeat packet received by the host machine is larger than the set second threshold value, the host machine is judged to be in fault, the host machine is switched to the standby machine, namely the working mode value of the host machine is configured to be 0, service is stopped being provided for the client side, and the virtual IP is cancelled.
The second threshold of the heartbeat packet count is influenced by various factors such as hardware environment and network communication quality, for example, the packet loss rate is small, the packet loss rate of the local area network is small at present, the value of the second threshold can be 3-10, and the second threshold can be specifically debugged and determined when the dual-computer hot standby system of the rail transit multimedia system is deployed.
The first threshold and the second threshold should have the same value, otherwise, the dual-computer system may fail to operate, for example, the two servers may frequently switch operating modes and may not provide services to the client normally.
Specifically, the host and the standby receive the primary/standby switching information, perform the primary/standby switching according to the primary/standby switching information, and switch the virtual IP address to the host after the primary/standby switching.
Taking a dual-host hot-standby system of a rail transit multimedia system as an example, when a vehicle turns around, host-host switching information is sent, the host and the standby monitor the host-host switching information, and the host and the standby switch the host and the standby. The standby machine after the main-standby switching needs to cancel the virtual IP, so that the conflict with the main machine after the main-standby switching is avoided, and the service supply to the client side is stopped; and the standby machine after the main and standby switching needs to be configured with a virtual IP and provides service for the client through the virtual IP.
Specifically, the host and the standby join the same multicast group, and the host and the standby receive the data sent by the multicast source, so that the data of the host and the standby are kept consistent.
In this embodiment, the multicast source sends data to the host and the standby machine respectively in a multicast manner, and the multicast source only needs to send one copy of data, and the data is copied and sent to the host and the standby machine by a router or a switch close to the standby machine and the host in the network, so that the data transmission efficiency can be improved and the bandwidth resources of the network can be saved.
For example, a client in a dual-computer hot standby system of a rail transit multimedia system requests weather forecast information, and firstly, the client sends the request information to a host through a virtual IP address; then, the host sends request information to the external network through the control center; then, the control center sends the weather forecast information to the host and the standby machine in a multicast mode; and finally, the host sends the weather forecast information to the client in a broadcasting mode. When the control center receives the request information sent by the host, the default host and the standby machine both send the request information, and at the moment, the host and the standby machine join the same multicast group.
The dual-computer hot standby method of the rail transit multimedia system of the embodiment of the invention designates the first server or the second server as the host computer or the standby computer by configuring the first server and the second server, and the host computer and the standby computer receive data from an external network segment simultaneously, so that the data of the host computer and the data of the standby computer are kept consistent. In the embodiment, the host and the standby machine synchronously receive data from the external network segment, so that the problem of large data synchronization workload in the dual-machine hot standby system of the rail transit multimedia system is solved, the service can be quickly switched when the host fails, the overall stability of the dual-machine hot standby system of the rail transit multimedia system is improved, and the failure switching time is greatly shortened.
In order to implement the above embodiment, the present invention further provides a dual-computer hot standby system of a rail transit multimedia system.
As shown in fig. 3, the dual-computer hot standby system of the rail transit multimedia system includes: a first server, a second server, a configuration module 410, and a synchronization reception module 420.
The configuration module 410 is configured to configure a first server or a second server, and designate the first server or the second server as a host or a standby.
The synchronous receiving module 420 is used for receiving data from the external network segment simultaneously by the host and the standby machine through the synchronous receiving module 420, so that the data of the host and the standby machine are always kept consistent.
Based on fig. 3, fig. 4 is a schematic structural diagram of a dual-computer hot standby system of another rail transit multimedia system according to an embodiment of the present invention.
As shown in fig. 4, the configuration module 410 includes: an operating mode configuration unit 411 and a virtual IP configuration unit 412.
The working mode configuring unit 411 is configured to configure a working mode of the first server or the second server, and designate the first server or the second server as a host or a standby according to the working mode;
and a virtual IP configuration unit 412, configured to configure a virtual IP address, where the host provides a service to the client in the local network segment through the virtual IP address.
As a possible implementation manner of this embodiment, the working mode configuration unit 521 is specifically configured to:
if the value of the working mode of the first server or the second server is configured to be 1, the first server or the second server is a host;
and if the value of the working mode of the first server or the second server is configured to be 0, the first server or the second server is a standby machine.
Based on fig. 3, fig. 5 is a schematic structural diagram of a dual-computer hot standby system of a rail transit multimedia system according to an embodiment of the present invention.
As shown in fig. 5, the dual-computer hot standby system of a rail transit multimedia system according to an embodiment of the present invention further includes: a sending module 510 and a first receiving module 520.
As a possible implementation manner of this embodiment, the method further includes:
a sending module 510, where the host periodically sends a heartbeat packet to the standby device through the sending module 510;
the first receiving module 520, the standby machine receives the heartbeat packet through the first receiving module 520, if the heartbeat packet cannot be received by the standby machine in a plurality of continuous heartbeat cycles, the host machine is determined to be in fault, the host machine and the standby machine perform the main-standby switching, and the virtual IP address is switched to the host machine after the main-standby switching.
As a possible implementation manner of this embodiment, the first receiving module 520 is specifically configured to:
in each heartbeat period, the heartbeat packet count of the standby machine is increased by one;
if the standby machine receives the heartbeat packet of the host machine, setting the heartbeat packet count to zero;
and if the heartbeat packet count value exceeds a first threshold value, judging that the host computer is in failure.
On the basis of fig. 3, fig. 6 is a diagram illustrating a dual-computer hot standby system of a rail transit multimedia system according to an embodiment of the present invention, further including: and a second receiving module 610.
And a second receiving module 610, where the host receives the heartbeat packets through the second receiving module 610, and if the host receives multiple heartbeat packets, it determines that the host fails, and the host switches to the standby host and cancels the virtual IP address.
Based on fig. 3, fig. 7 is a schematic structural diagram of a dual-computer hot standby system of another rail transit multimedia system according to an embodiment of the present invention.
As shown in fig. 7, another dual-computer hot standby system of a rail transit multimedia system according to an embodiment of the present invention further includes: and a third receiving module 710.
As a possible implementation manner of this embodiment, the configuration module 410 is further configured to:
the third receiving module 710, the host or the standby machine, receives the primary/standby switching information through the third receiving module 710, and performs the primary/standby switching according to the primary/standby switching information, and the virtual IP address is switched to the host after the primary/standby switching.
As a possible implementation manner of this embodiment, the synchronous receiving module 420 is specifically configured to:
the host and the standby machine join the same multicast group, and the host and the standby machine receive the data sent by the multicast source, so that the data of the host and the standby machine are kept consistent.
The dual-computer hot standby system of the rail transit multimedia system of the embodiment of the invention designates the first server or the second server as the host computer or the standby computer by configuring the first server and the second server, and the host computer and the standby computer receive data from an external network segment simultaneously, so that the data of the host computer and the data of the standby computer are kept consistent. In the embodiment, the host and the standby machine synchronously receive data from the external network segment, so that the problem of large data synchronization workload in the dual-machine hot standby system of the rail transit multimedia system is solved, the service can be quickly switched when the host fails, the overall stability of the dual-machine hot standby system of the rail transit multimedia system is improved, and the failure switching time is greatly shortened.
In order to implement the foregoing embodiment, the present invention further provides a computer program product, wherein when instructions in the computer program product are executed by a processor, the dual-computer hot-standby method of the rail transit multimedia system according to the foregoing embodiment is implemented.
In order to implement the foregoing embodiments, the present invention further provides a non-transitory computer readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the dual hot-standby method of the rail transit multimedia system according to the foregoing embodiments.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware that is related to instructions of a program, and the program may be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (14)

1. A dual-computer hot standby method of a rail transit multimedia system is characterized by comprising the following steps:
configuring a first server and a second server, wherein one server is designated as a host and the other server is designated as a standby, the host or the standby is not a fixed first server or a fixed second server, and if the first server or the second server is the host, the first server or the second server provides service for a client of the network segment; if the first server or the second server is a standby machine, service is not provided for the client of the network segment;
configuring a virtual IP address, wherein the host provides service to a client in a local network segment through the virtual IP address;
the host and the standby machine receive data from an external network segment simultaneously, so that the data of the host and the data of the standby machine are kept consistent;
wherein the configuring the first server and the second server, and designating the first server or the second server as a host or a backup, comprises:
configuring the working modes of the first server and the second server, and designating the first server or the second server as the host or the standby according to the working modes;
and if the host receives a plurality of heartbeat packets, judging that the host fails, switching the host to a standby machine and canceling the virtual IP address.
2. The method of claim 1, wherein configuring the operating mode of the first server and the second server, and wherein assigning the first server or the second server to be the host or the standby according to the operating mode comprises:
if the value of the working mode of the first server or the second server is configured to be 1, the first server or the second server is a host;
and if the value of the working mode of the first server or the second server is configured to be 0, the first server or the second server is a standby machine.
3. The method of claim 1, further comprising:
the host periodically sends heartbeat packets to the standby machine, the standby machine receives the heartbeat packets, if the heartbeat packets cannot be received by the standby machine in a plurality of continuous heartbeat periods, the host is judged to be in fault, the host and the standby machine carry out the main-standby switching, and the virtual IP address is switched to the host after the main-standby switching.
4. The method of claim 3, wherein if the standby machine does not receive heartbeat packets for a plurality of consecutive heartbeat cycles, determining that the host fails comprises:
in each heartbeat period, adding one to the heartbeat packet counting value of the standby machine;
if the standby machine receives the heartbeat packet of the host machine, setting the heartbeat packet counting value to be zero;
and if the heartbeat packet counting value exceeds a first threshold value, judging that the host machine is in fault.
5. The method of claim 1, further comprising:
the host and the standby receive the main-standby switching information, and carry out main-standby switching according to the main-standby switching information, and the virtual IP address is switched to the host after the main-standby switching.
6. The method of claim 1, wherein the host and the backup receive data from the external network segment simultaneously, and wherein keeping the data of the host and the backup consistent comprises:
the host and the standby machine join the same multicast group, and the host and the standby machine receive data sent by a multicast source, so that the data of the host and the data of the standby machine are kept consistent.
7. A dual-computer hot standby system of a rail transit multimedia system is characterized by comprising:
a first server and a second server; wherein the first server and the second server each comprise:
the configuration module is used for configuring the first server or the second server, designating one server as a host computer and the other server as a standby computer, wherein the host computer or the standby computer is not the fixed first server or the second server, and providing service for the client of the local network segment if the first server or the second server is the host computer; if the first server or the second server is a standby machine, the service is not provided for the client of the network segment, and the configuration module comprises:
a working mode configuration unit, configured to configure a working mode of the first server or the second server, and designate the first server or the second server as the host or the standby according to the working mode;
the virtual IP configuration unit is used for configuring a virtual IP address, and the host provides service for the client in the local network segment through the virtual IP address;
the host and the standby machine receive data from an external network segment through the synchronous receiving module at the same time, so that the data of the host and the data of the standby machine are kept consistent;
and the host receives the heartbeat packets through the second receiving module, if the host receives a plurality of heartbeat packets, the host is judged to be in fault, and the host is switched to be a standby machine and cancels the virtual IP address.
8. The dual-computer hot-standby system of a rail transit multimedia system according to claim 7, wherein the working mode configuring unit is specifically configured to:
if the value of the working mode of the first server or the second server is configured to be 1, the first server or the second server is a host;
and if the value of the working mode of the first server or the second server is configured to be 0, the first server or the second server is a standby machine.
9. The dual-computer hot-standby system of the rail transit multimedia system according to claim 7, further comprising:
the host periodically sends a heartbeat packet to the standby machine through the sending module;
the standby machine receives the heartbeat packets through the first receiving module, if the heartbeat packets cannot be received by the standby machine in a plurality of continuous heartbeat cycles, the host machine is judged to be in fault, the host machine and the standby machine are switched between the main machine and the standby machine, and the virtual IP address is switched to the host machine after the main machine and the standby machine are switched.
10. The dual-computer hot-standby system of the rail transit multimedia system according to claim 9, wherein the first receiving module is specifically configured to:
in each heartbeat period, adding one to the heartbeat packet counting value of the standby machine;
if the standby machine receives the heartbeat packet of the host machine, setting the heartbeat packet counting value to be zero;
and if the heartbeat packet counting value exceeds a first threshold value, judging that the host machine is in fault.
11. The dual-computer hot-standby system of the rail transit multimedia system according to claim 7, further comprising:
and the host or the standby machine receives the main/standby switching information through the third receiving module, performs main/standby switching according to the main/standby switching information, and switches the virtual IP address to the host after the main/standby switching.
12. The dual-computer hot-standby system of the rail transit multimedia system according to claim 7, wherein the synchronous receiving module is specifically configured to:
the host and the standby machine join the same multicast group, and the host and the standby machine receive data sent by a multicast source, so that the data of the host and the data of the standby machine are kept consistent.
13. Computer program product, characterized in that instructions in the computer program product, when executed by a processor, implement the dual hot-standby method of a rail transit multimedia system according to any of claims 1-6.
14. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the program when executed by a processor implements the dual hot-standby method of the rail transit multimedia system according to any of claims 1-6.
CN201810068213.6A 2018-01-24 2018-01-24 Dual-computer hot standby method and system of rail transit multimedia system Active CN109753387B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810068213.6A CN109753387B (en) 2018-01-24 2018-01-24 Dual-computer hot standby method and system of rail transit multimedia system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810068213.6A CN109753387B (en) 2018-01-24 2018-01-24 Dual-computer hot standby method and system of rail transit multimedia system

Publications (2)

Publication Number Publication Date
CN109753387A CN109753387A (en) 2019-05-14
CN109753387B true CN109753387B (en) 2019-12-20

Family

ID=66401761

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810068213.6A Active CN109753387B (en) 2018-01-24 2018-01-24 Dual-computer hot standby method and system of rail transit multimedia system

Country Status (1)

Country Link
CN (1) CN109753387B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110784354A (en) * 2019-10-30 2020-02-11 北京大米未来科技有限公司 Data processing method, device, system and readable storage medium
CN111083174B (en) * 2019-12-31 2022-03-29 北京力控华康科技有限公司 Firewall dual-computer hot standby system, standby firewall and state processing method and device
CN111277596A (en) * 2020-01-20 2020-06-12 广东电网有限责任公司电力调度控制中心 Power grid regulation and control safety zone data transmission system, method and equipment
CN112822039B (en) * 2020-12-31 2023-05-23 英赛克科技(北京)有限公司 Main and standby mode switching method for dual-machine hot standby system
CN113625540A (en) * 2021-07-19 2021-11-09 交控科技股份有限公司 Dual-computer hot standby control method and device and dual-computer hot standby system
CN114124669A (en) * 2021-11-02 2022-03-01 卡斯柯信号有限公司 Method and system for interconnecting CTC and existing vehicle system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101076992A (en) * 2004-08-13 2007-11-21 塞特里克斯系统公司 A method and systems for securing remote access to private networks
CN202551065U (en) * 2011-12-26 2012-11-21 煤炭科学研究总院 Data double-computer hot-standby system
CN102868560A (en) * 2012-09-28 2013-01-09 南京恩瑞特实业有限公司 System and method for realizing hot standby of servers
CN103077242A (en) * 2013-01-11 2013-05-01 北京佳讯飞鸿电气股份有限公司 Method for hot standby of dual database servers
CN104679604A (en) * 2015-02-12 2015-06-03 大唐移动通信设备有限公司 Method and device for switching between master node and standby node

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040153709A1 (en) * 2002-07-03 2004-08-05 Burton-Krahn Noel Morgen Method and apparatus for providing transparent fault tolerance within an application server environment
US20040034807A1 (en) * 2002-08-14 2004-02-19 Gnp Computers, Inc. Roving servers in a clustered telecommunication distributed computer system
CN102684929A (en) * 2012-06-06 2012-09-19 广东威创视讯科技股份有限公司 Dual-computer hot redundancy back-up method and dual-computer hot redundancy back-up system
CN103744809B (en) * 2013-12-23 2016-10-05 天泽信息产业股份有限公司 Vehicle information management system double hot standby method based on VRRP
CN106953761B (en) * 2017-03-29 2020-03-10 恒生电子股份有限公司 Server disaster recovery system and message processing method based on disaster recovery system
CN106982259A (en) * 2017-04-19 2017-07-25 聚好看科技股份有限公司 The failure solution of server cluster
CN107255918A (en) * 2017-06-19 2017-10-17 北京航天发射技术研究所 A kind of remote control computer hot backup redundancy control method for automatically switching

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101076992A (en) * 2004-08-13 2007-11-21 塞特里克斯系统公司 A method and systems for securing remote access to private networks
CN202551065U (en) * 2011-12-26 2012-11-21 煤炭科学研究总院 Data double-computer hot-standby system
CN102868560A (en) * 2012-09-28 2013-01-09 南京恩瑞特实业有限公司 System and method for realizing hot standby of servers
CN103077242A (en) * 2013-01-11 2013-05-01 北京佳讯飞鸿电气股份有限公司 Method for hot standby of dual database servers
CN104679604A (en) * 2015-02-12 2015-06-03 大唐移动通信设备有限公司 Method and device for switching between master node and standby node

Also Published As

Publication number Publication date
CN109753387A (en) 2019-05-14

Similar Documents

Publication Publication Date Title
CN109753387B (en) Dual-computer hot standby method and system of rail transit multimedia system
EP3373547B1 (en) Method for realizing disaster tolerance backup
US8842518B2 (en) System and method for supporting management network interface card port failover in a middleware machine environment
CN102904818B (en) A kind of ARP information entry updating method and device
US9219641B2 (en) Performing failover in a redundancy group
JP4164704B2 (en) Network connection device switching method and network system using redundancy protocol and pseudo-redundant configuration means
EP3171555A1 (en) Fault detection method for virtual router redundancy protocol and router device
JP2004032758A (en) Router interface backup execution method by vrrp (virtual router redundancy protocol)
WO2012000234A1 (en) Method, apparatus and system for fast switching between links
US20070177497A1 (en) Method and device for implementing broadcast or multicast on resilient packet ring
CN109861867B (en) MEC service processing method and device
CN103036702B (en) A kind of N+1 backup method of cross-network segment and device
CN105024836B (en) Method and device for switching primary Service Router (SR) and standby SR and SR
US20130132499A1 (en) Method and system for auto-configuartion, and network node
CN102647304A (en) Synchronizing method of address resolution protocols and device
US20220006868A1 (en) N+1 Redundancy for Virtualized Services with Low Latency Fail-Over
CN102647288A (en) VM (Virtual Machine) data access protection method and system
JP5775473B2 (en) Edge device redundancy system, switching control device, and edge device redundancy method
CN105516252A (en) TCP (Transmission Control Protocol) connection switching method, apparatus and system
US20220286350A1 (en) Systems and methods for seamless failover in branch deployments by superimposing clustering solution on vrrp
CN112564983B (en) Data transmission method, device, computer system and medium
CN104125079A (en) Method and device for determining double-device hot-backup configuration information
CN107959626B (en) Communication method, device and system of data center
CN102271045B (en) Virtual private network (VPN)-instance-based inter-equipment backup method, equipment and system
US9554290B2 (en) Wireless communication system and method for automatically switching device identifications

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