A server master-slave switching system for broadcasting
Through the full-duplex mechanism and MySQL database synchronization, real-time switching and data redundancy of the active and standby servers are realized, which solves the problems of non-real-time switching of the active and standby servers and insufficient data redundancy in the existing technology, and improves the user experience and system stability. sex.
Patent Information
- Application Number
- CN202111615555.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-12-27
AI Technical Summary
It is difficult for existing active and standby servers to achieve real-time switching when they fail, resulting in poor user experience, and the lack of a full-duplex mechanism leads to insufficient data redundancy.
The server master-slave switching system adopts a full-duplex mechanism, synchronizes the basic data of the system through the master-slave mode of the Mysql database, and achieves clock consistency and data redundancy of the master and slave servers through shared clocks and audio caches. The master and slave servers send and receive broadcasts at the same time. Data, real-time detection of faults and switching.
It achieves real-time switching and high availability of active and standby servers, avoids erroneous data replication, and ensures data redundancy and a low-cost solution.
Smart Images

Figure CN114297296B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of active-standby backup, and in particular to an active-standby switching system of a server for broadcasting. Background Art
[0002] Server master-slave is a solution that synchronizes and redundantly backs up the data of the master and slave servers. When the master server fails or an accident occurs, the slave server replaces the master server to provide services to the outside world, thereby improving the stability of the server. Most of the common master and slave servers now use non-full-duplex mode, making it difficult to achieve real-time task connection between the master and slave servers, resulting in a poor user experience. Summary of the invention
[0003] In view of the deficiencies in the prior art, an object of the present invention is to provide a server active-standby switching system for broadcasting, which can solve the problem of automatic switching between active and standby servers.
[0004] The technical solution to achieve the purpose of the present invention is: a server master-slave switching system for broadcasting, including a master server and a backup server, the master server and the backup server both including an underlying database, service status information generated by service operation and broadcast data for broadcasting,
[0005] The underlying database stores system basic data and current server data. The system basic data includes the terminal information and task configuration information connected to the current server.
[0006] The current server data of the primary server includes the primary server tag and server IP address, and the current server data of the backup server includes the backup server tag and server IP address.
[0007] The system basic data adopts the master-slave mode of MySQL database. The main server responds to the user's modification of the system basic data, and synchronizes the modified system basic data directly to the system basic data of the standby server through the network to update the system basic data of the standby server.
[0008] Furthermore, the primary and backup servers simultaneously receive modification instructions or operation instructions initiated by users to modify system basic data.
[0009] Furthermore, when the data generated by the primary and backup servers in response to user operations are different, the following processing scheme is executed:
[0010] The primary server or backup server identifies its own fault. If the identification is successful, it will mark itself as downgraded and notify the terminals connected to the current server so that each connected terminal can perceive that the current server is in a faulty state. Each terminal will give priority to responding to requests from servers that are not faulty.
[0011] When one of the primary and backup servers fails, the other server that is not faulty becomes the primary server and is marked as the primary server, and the currently faulty server becomes the backup server and is marked as the backup server.
[0012] Or when both the primary and backup servers fail, the server with the lower failure level becomes the primary server and is marked as the primary server, and the server with the higher failure level becomes the backup server and is marked as the backup server.
[0013] The primary and backup servers communicate through the network to determine whether the primary and backup servers need to switch by sensing in real time whether the other party has a fault and the fault level.
[0014] Furthermore, when both the primary and backup servers fail, the primary server's requests are responded to first by default.
[0015] Furthermore, the active and standby servers keep their clocks consistent by sharing a clock synchronization server, and the active and standby servers use the same size of audio cache. Ultimately, on the active and standby servers, the same audio is sent to the output device with the same time period and frequency.
[0016] Furthermore, the database used for the system basic data is Mysql.
[0017] The beneficial effects of the present invention are as follows: except for the system basic database which is completely synchronized by the underlying database, the rest of the data is run in the two systems of the primary and standby servers respectively by the same input signal, the same operating environment (system environment, underlying data) and the same, fixed execution mode (same system software), so as to keep the results of the two servers fixed and identical. Moreover, this method of synchronizing only the underlying data and maintaining the unity of the upper-layer data by calculation makes the two systems highly independent, and does not directly copy and synchronize the erroneous upper-layer data on one server to another server, thus achieving data redundancy. The primary and standby servers of the present invention adopt a full-duplex mechanism, and the primary and standby servers simultaneously send and receive broadcast data (audio data), and all broadcast data have at least one redundancy, so as to achieve good real-time performance and low cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a schematic diagram of the principle of the present invention. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0020] like Figure 1 As shown, a server active-standby switching system for broadcasting includes a primary server and a standby server. Both the primary server and the standby server include an underlying database, service status information generated by service operation, and broadcast data for broadcasting.
[0021] The primary and backup servers can obtain broadcast data by receiving data sent by the input device, such as audio data sent by the input device.
[0022] The underlying database stores system basic data and current server data. System basic data includes terminal information, task configuration information, etc. connected to the current server (primary server or standby server). For the primary and standby servers, the system basic data of the two are the same. The current server data of the primary server includes the primary server mark, server IP address, etc., and the current server data of the standby server includes the standby server mark, server IP address, etc.
[0023] The system basic data adopts the master-slave mode of MySQL database. The main server responds to the user's modification of the system basic data, and synchronizes the modified system basic data directly to the system basic data of the standby server through the network to update the system basic data of the standby server.
[0024] For the current server data, the primary and backup servers uniformly configure the current information of their respective servers, and use them independently without interfering with each other.
[0025] The primary and backup servers generate exactly the same business status information and broadcast data under the same system basic data, the same equipment status and operating environment, so that the primary and backup servers each have a set of identical operating data except for the current server data. The primary and backup servers each use their own operating data to form two redundant sets of data, achieving the effect of data redundancy backup.
[0026] After the user's terminal is initialized, it can identify the IP addresses of the current primary and backup servers. When the user initiates a modification instruction or other operation instruction to modify the basic data of the system, the modification instruction or operation instruction is sent to the primary and backup servers respectively at the same time to ensure that the response mode of the primary and backup servers is unified.
[0027] The user may send modification instructions, operation instructions or other instructions to the primary and backup servers on the WEB or UI of his terminal.
[0028] Theoretically, if the primary and backup servers have the same system basic data, they will generate the same business layer data for the same business operation. However, in actual operation, accidents may occur, for example, the primary and backup servers are located in different spatial environments, server hardware failures, network failures (such as disconnected network cables, server IP address conflicts, etc.), human configuration errors, etc. When the data generated by the primary and backup servers in response to user operations are different, the following processing solutions are executed:
[0029] The primary server or backup server attempts to identify its own fault. If the identification is successful, it will mark itself as downgraded and notify the terminals connected to the current server so that each connected terminal can perceive that the current server is in a faulty state. Each terminal will give priority to responding to requests from servers that are not faulty. When both the primary and backup servers are faulty, the primary server's requests will be responded to by default.
[0030] When one of the primary and backup servers fails, the other server that is not faulty becomes the primary server and is marked as the primary server, and the currently faulty server becomes the backup server and is marked as the backup server. Or when both the primary and backup servers fail, the server with a lower fault level becomes the primary server and is marked as the primary server, and the server with a higher fault level becomes the backup server and is marked as the backup server.
[0031] The primary and backup servers communicate through the network and can sense in real time whether the other party has a fault and the fault level, so as to determine whether a primary and backup switch is needed. In other words, the primary server can sense whether the backup server has a fault and the fault level, and the backup server can also sense whether the primary server has a fault and the fault level. The primary and backup servers are mutually dependent.
[0032] The master and backup servers keep their clocks consistent by sharing a clock synchronization server (NTP). The master and backup servers use the same size of audio cache. Ultimately, on the master and backup servers, the same audio is sent to the output device at the same time period and frequency. That is, the period of each audio data packet sent by the master and backup servers (that is, as broadcast data, of course, broadcast data can also be other data, such as video data) is the same and fixed. The time difference between the master and backup servers in successfully sending the audio data packet to the output device only depends on the time difference of the audio initiation. For example, the trigger signal for sending the audio data packet is sent to the server, and the master and backup servers respectively start sending the audio data packet to the output device. There is a small error (0-50ms) in the processing time of the two servers. The output device takes the audio data packet received first as the basis and discards the duplicate audio data packets. The time difference between the sending of the same audio data packet between the two servers is always fixed, and only depends on the error of the task start time.
[0033] For the primary and backup servers, the same task has the same audio tag, and the same audio packet has the same audio sequence number and different sender IPs as additional information. That is, the output device can determine whether the data packet is a repeated task, repeated data packet, and its source through the audio tag and audio sequence number.
[0034] Method for deduplication of redundant information: The output device can determine whether the data packet is a repeated task, repeated data packet, and its source through audio tags and audio sequence numbers. Data packets between different tasks and data packets with different audio sequence numbers will not interfere with each other. For data packets of the same task and the same audio sequence number, the output device confirms the first received data packet through the cache tag and enters it into the cache. Subsequent redundant data packets received will be discarded.
[0035] When a server fails, for the output device, the two channels of audio data it receives become one channel, and it still only plays one non-duplicate audio data packet. Therefore, even if a server fails, the output device can still broadcast the corresponding broadcast data (i.e., audio data) in real time, achieving seamless connection and switching.
[0036] Except for the system basic database that relies on the underlying database for complete synchronization, the rest of the data in the present invention relies on the same input signal, the same operating environment (system environment, underlying data) and the same, fixed execution mode (same system software), and runs in the two systems of the primary and standby servers respectively, keeping the results of the two servers fixed and identical. In addition, this method of synchronizing only the underlying data and maintaining the unity of the upper-layer data through calculation makes the two systems highly independent, and will not directly copy and synchronize the erroneous upper-layer data on one server to another server, thus achieving data redundancy. The primary and standby servers of the present invention adopt a full-duplex mechanism, and the primary and standby servers simultaneously send and receive broadcast data (audio data), and all broadcast data have at least one redundancy, thereby achieving good real-time performance and low cost.
[0037] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0038] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0039] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0040] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0041] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A server master-slave switching system for broadcasting, characterized in that: It includes a primary server and a backup server. Both the primary server and the backup server include the underlying database, business status information generated by business operation, and broadcast data used for broadcasting. The underlying database stores system basic data and current server data. The system basic data includes the terminal information and task configuration information connected to the current server. The current server data of the primary server includes the primary server tag and server IP address, and the current server data of the backup server includes the backup server tag and server IP address. The system basic data adopts the database master-slave mode. The master server responds to the user's modification of the system basic data and directly synchronizes the modified system basic data to the system basic data of the standby server through the network to update the system basic data of the standby server; The primary and backup servers simultaneously receive modification instructions or operation instructions initiated by users to modify basic system data; When the data generated by the primary and backup servers in response to user operations are different, the following processing solutions are implemented: The primary server or backup server identifies its own fault. If the identification is successful, it will mark itself as downgraded and notify the terminals connected to the current server so that each connected terminal can perceive that the current server is in a faulty state. Each terminal will give priority to responding to requests from servers that are not faulty. When one of the primary and backup servers fails, the other server that is not faulty becomes the primary server and is marked as the primary server, and the currently faulty server becomes the backup server and is marked as the backup server. Or when both the primary and backup servers fail, the server with the lower failure level becomes the primary server and is marked as the primary server, and the server with the higher failure level becomes the backup server and is marked as the backup server. The primary and backup servers communicate with each other through the network to detect in real time whether the other party has a fault and the fault level to determine whether a primary and backup switch is needed; The active and standby servers keep their clocks consistent by sharing a clock synchronization server. The active and standby servers use the same audio cache size. Ultimately, the same audio is sent to the output device at the same time period and frequency on the active and standby servers. The primary and backup servers have the same system basic data, the same equipment status and operating environment, and generate exactly the same business status information and broadcast data. The primary and backup servers each have a set of identical operating data except for the current server data. The primary and backup servers each use their own operating data to form two redundant sets of data.
2. The server master-slave switching system for broadcasting according to claim 1, characterized in that: When both the primary and backup servers fail, the primary server's requests will be responded to first by default.
3. The server active / standby switching system for broadcasting according to claim 1, characterized in that: The database used for system basic data is Mysql.
Citation Information
Patent Citations
System and method for transferring multimedia broadcasting service
CN101547084A
Distribution network adjustment and control system and control method thereof
CN105553701A
Data synchronization method between servers in multi-server redundancy system
CN109547532A
Method and system for using a standby server to improve redundancy in a dual-node data storage system
US20120254654A1
