Main-standby high-availability video storage method, device and equipment and storage medium
By using the high-availability video storage method of the main and backup video storage system, it automatically switches to an alternative server for video storage and performs real-time data copying, and solves the data loss and monitoring screen interruption of the surveillance video storage system when the server failure is performed, and the continuity and integrity of the surveillance video is achieved.
Patent Information
- Application Number
- CN202411809205.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-03-28
AI Technical Summary
The existing surveillance video storage system can easily lead to data loss and monitoring screen interruption in the event of server failure, affecting the stability and reliability of security monitoring.
The high-availability video storage method of the master and backup is adopted to monitor the operating status of the master server through the control unit. When an abnormality occurs on the master server, it automatically switches to the alternative server for recording and storage, and copy data from the master server in real time or regularly for backup.
Ensure the continuity and integrity of monitoring videos. Even if the primary server fails, the backup server can immediately take over the storage tasks to ensure real-time data backup and disaster recovery backup.
Smart Images

Figure CN119728893A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video storage, and in particular to a method, device, equipment and storage medium for video storage with high availability. Background Art
[0002] With the development of society, the demand and role of monitoring technology have become increasingly prominent. Surveillance video has become an effective means of security prevention and is widely used in various occasions.
[0003] Video surveillance plays an important role in security, traffic management, environmental monitoring and other fields. Recording is one of the most important functions of a video surveillance system. When a server used for video storage fails, it may cause loss of video data, interruption of surveillance images and other problems, which will have a significant impact on security monitoring.
[0004] It can be seen that how to ensure the stability and reliability of monitoring images has become a technical problem that technical personnel in this field need to solve urgently. Summary of the invention
[0005] The present invention provides a primary-standby highly available video storage method, device, equipment and storage medium to optimize the stability of the video storage function of monitoring data.
[0006] In order to solve the above technical problems, an embodiment of the present invention provides a primary-backup high-availability video storage method, comprising:
[0007] In response to the recording signal sent by the control unit, the recording unit obtains real-time image data and sends the real-time image data to the main server; the main server processes the received real-time image data and stores the real-time image data in the image database.
[0008] In response to the video recording signal sent by the control unit, the operation status monitoring unit monitors the operation status of the main server in real time, and sends an abnormal signal to the control unit after detecting abnormal data of the main server.
[0009] The control unit starts the alternative server after receiving the abnormal signal, and controls the video recording unit to send the real-time image data to the alternative server.
[0010] The candidate server receives and processes the real-time image data, and stores the real-time image data in the image database.
[0011] Furthermore, the number of the main server and the number of the backup servers are both greater than one.
[0012] Further, the main server processes the received real-time image data and stores the real-time image data in an image database, including:
[0013] After receiving the real-time image data, the main server obtains current timestamp information in real time, and stores the real-time image data and the timestamp information in an image database.
[0014] Furthermore, the status monitoring unit is also used to monitor the operating status of the candidate server in real time;
[0015] When the state monitoring unit detects that the running state of the candidate server is abnormal, it sends an abnormal signal to the control unit. After receiving the abnormal signal, the control unit switches the video storage of the candidate server.
[0016] Further, when the status monitoring unit detects that the main server resumes operation, it sends a normal operation signal to the control unit;
[0017] After receiving the normal operation signal, the control unit controls the main server to resume video storage and suspends the operation of the corresponding standby server.
[0018] Furthermore, after the server switching occurs, the control unit filters out the adjacent real-time image data in time series according to the timestamp information, and repairs and synthesizes the adjacent real-time image data.
[0019] Furthermore, the method further comprises:
[0020] Record the fault data of the system during operation, and generate a video recording and storage fault log file based on the fault data.
[0021] Another embodiment of the present invention provides a primary-standby high-availability video storage device, comprising:
[0022] The main server operation module is used to respond to the recording signal sent by the control unit, the recording unit obtains real-time image data, and sends the real-time image data to the main server; the main server processes the received real-time image data and stores the real-time image data in the image database.
[0023] The status monitoring module is used to respond to the video signal sent by the control unit. The operation status monitoring unit monitors the operation status of the main server in real time and sends an abnormal signal to the control unit after detecting abnormal data of the main server.
[0024] The server switching module is used for the control unit to start the alternative server after receiving the abnormal signal, and control the recording unit to send the real-time image data to the alternative server.
[0025] The alternative server running module is used for the alternative server to receive and process the real-time image data and store the real-time image data in the image database.
[0026] Another embodiment of the present invention provides a computer device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the active-standby high-availability video storage method as described above is implemented.
[0027] Yet another embodiment of the present invention provides a computer-readable storage medium storing a computer program, wherein when a device where the computer-readable storage medium is located executes the computer program, the above-mentioned active-standby high-availability video storage method is implemented.
[0028] Compared with the prior art, the embodiments of the present invention have the following advantages:
[0029] (1) When the main server fails, the backup server can immediately take over the storage task to ensure the continuity and integrity of the surveillance video;
[0030] (2) The backup server can copy data from the primary server in real time or periodically to achieve real-time data backup and disaster recovery backup. Even if the primary server fails, the backup data can still be restored and used. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A flowchart of the steps of the active / standby high-availability video storage method provided by an embodiment of the present invention;
[0032] Figure 2 A structural block diagram of a primary-backup highly available video storage device provided in an embodiment of the present invention;
[0033] Figure 3 A structural diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] In the description of this application, the terms "first", "second", "third", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", "third", etc. may explicitly or implicitly include one or more of the feature. In the description of this application, unless otherwise specified, "plurality" means two or more.
[0036] In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two elements. The terms "vertical", "horizontal", "left", "right", "upper", "lower" and similar expressions used herein are only for illustrative purposes, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0037] In the description of this application, it should be noted that, unless otherwise defined, all technical and scientific terms used in the present invention have the same meaning as those commonly understood by those skilled in the art. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood by specific circumstances.
[0038] An embodiment of the present invention provides a method for storing video recordings with high availability. Figure 1 , Figure 1 The flowchart of the method for storing video recordings in a primary-backup manner with high availability in one embodiment of the present invention includes steps S11 to S14:
[0039] Step S11, in response to the recording signal sent by the control unit, the recording unit obtains real-time image data and sends the real-time image data to the main server; the main server processes the received real-time image data and stores the real-time image data in the image database.
[0040] With the increasing demand for monitoring storage functions, the traditional single-server video storage system has gradually been unable to meet the video storage needs due to the limitations of single point failure risk, data security risk, maintenance cost, etc. Therefore, the embodiment of the present invention adopts an M+N master-slave server mode to perform video recording and storage operations of monitoring data. Specifically, the solution of this embodiment adopts a combination of multiple master servers and multiple backup servers to realize the video recording and storage functions.
[0041] The system of this embodiment is controlled by a control unit, and the video recording unit is composed of multiple video cameras for obtaining monitoring screen data in real time.
[0042] During the specific recording process, the control unit is responsible for the overall control and scheduling of the monitoring system. When recording is required, it will send a recording signal as the starting point of the entire recording process.
[0043] After receiving the recording signal, the recording unit captures real-time image data and needs to send this data to the main server for processing and storage. This step is the key to data transmission, which ensures that the real-time image data can be transmitted to the main server in a timely and accurate manner.
[0044] As the core part of the monitoring system, the main server is responsible for processing the received real-time image data, including data decoding, compression, format conversion and other operations to ensure that the data can be stored in the image database in an efficient and accessible manner. After completing the data processing steps, the processed real-time image data and timestamp are stored in the image database together.
[0045] Step S12, in response to the video recording signal sent by the control unit, the operation status monitoring unit monitors the operation status of the main server in real time, and sends an abnormal signal to the control unit after detecting abnormal data of the main server.
[0046] During the operation of the monitoring system, the status monitoring unit continuously monitors the operating status of each main server and backup server in real time, including key indicators such as CPU utilization, memory utilization, network bandwidth, etc., to ensure that the main server can process real-time image data normally.
[0047] When abnormal data is detected on the main server, such as performance degradation, insufficient resources, etc., the operation status monitoring unit will immediately send an abnormal signal to the control unit so that the system can take timely measures.
[0048] Step S13: After receiving the abnormal signal, the control unit starts the alternative server and controls the video recording unit to send the real-time image data to the alternative server.
[0049] The control unit is the command center of the system and is responsible for receiving signals from various monitoring units. When receiving an abnormal signal from the operation status monitoring unit, the control unit will immediately identify possible problems with the main server.
[0050] After confirming that the main server is abnormal, the control unit will start the backup server. Preferably, the backup server is pre-configured and can take over the tasks of the main server when it cannot work normally. Specifically, the method of pre-configuring the backup server in this embodiment is: the available backup servers are selected through a campaign to replace the failed server with the highest priority as the backup server to replace the main server during the failure.
[0051] Since there are multiple main servers in the monitoring system, in order to improve resource utilization efficiency and achieve high availability of the system, multiple available backup servers can serve as backup options for multiple main servers at the same time. When a main server fails, the optimal backup server replaces the main server to perform the video storage function, and the backup server is temporarily deleted from the backup queue of other main servers.
[0052] When a main server fails, the best one can be quickly selected from the backup servers to take over the work, without having to configure a backup server for each main server, thus saving a lot of hardware resources. When a backup server is selected to take over the work of a main server, it will be temporarily deleted from the backup queue of other main servers. This method of dynamically adjusting the backup queue ensures that each backup server can take over the work in the best state when needed, avoiding waste of resources and conflicts.
[0053] Step S14: the candidate server receives and processes the real-time image data, and stores the real-time image data in the image database.
[0054] After taking over the work of the main server, the backup server seamlessly receives real-time image data from the surveillance camera and performs necessary processing, such as decoding and compression, to ensure data readability and storage efficiency.
[0055] In order to effectively splice the video data stored in the main server and the standby server later, the standby server also needs to record and store the timestamp information when storing the real-time image data.
[0056] When the standby server takes over the main service, the standby server acts as a temporary main server, and the status monitoring unit also monitors the working status of the temporary main server. The specific monitoring process is the same as the process of detecting the main server.
[0057] When the status monitoring unit detects that the operation status of the temporary main server fails, a new optimal standby server selected in advance is selected from the remaining standby servers to take over the work.
[0058] At the same time, the status monitoring unit also keeps monitoring the main server at all times. Once it detects that the main server has resumed normal operation, it sends a normal operation signal to the control unit. After receiving the normal operation signal, the control unit controls the main server to resume video storage and suspends the operation of the corresponding standby server.
[0059] By continuously monitoring the status of the primary server and switching back to the primary server in time when it returns to normal, the system can maintain higher stability and reduce the potential risk of failure caused by the long-term operation of the backup server. In addition, the backup server can be released and re-enter the election queue of each primary server, thus avoiding the waste of resources. This dynamic resource allocation method enables the system to use hardware resources more efficiently.
[0060] After the switch between the primary and backup servers occurs, the monitoring video is temporarily interrupted. Therefore, it is necessary to synthesize the real-time image data of each continuous time. Specifically, the method adopted in this embodiment is: select the real-time image data with corresponding timestamps in the image database, and splice and synthesize them by video frame splicing to form a complete video.
[0061] During the video stitching process, you need to pay attention to the transition effect between the previous and next videos to avoid obvious jumps or flickers. In addition, if there is jitter between the two videos, you need to perform de-jitter processing after stitching to improve the stability of the video.
[0062] After stitching is completed, the quality of the stitched video is evaluated. The specific evaluation content includes visual quality, stitching traces, peak signal-to-noise ratio, structural similarity and other aspects.
[0063] Preferably, during the operation of the monitoring system, all fault operation data and server switching data are saved and recorded, and a video storage fault log file is generated based on the recorded historical data. By recording and analyzing fault data, the system design and configuration can be continuously improved, the system's fault tolerance and self-healing capabilities can be improved, which helps to enhance the system's reliability and ensure the smooth progress of monitoring tasks.
[0064] When the main server fails, the backup server can immediately take over the storage task to ensure the continuity and integrity of the surveillance video; the backup server can copy data from the main server in real time or periodically to achieve real-time backup and disaster recovery backup of data. Even if the main server fails, the backup data can still be restored and used.
[0065] The embodiment of the present invention further provides a primary and secondary high-availability video storage device, which is used to execute the primary and secondary high-availability video storage method as described above. Figure 2 This is a structural block diagram of a primary-standby high-availability video storage device according to an embodiment of the present invention, wherein the device comprises:
[0066] The main server operation module 21 is used to respond to the recording signal sent by the control unit, the recording unit obtains real-time image data, and sends the real-time image data to the main server; the main server processes the received real-time image data and stores the real-time image data in the image database.
[0067] The status monitoring module 22 is used to respond to the video signal sent by the control unit. The operation status monitoring unit monitors the operation status of the main server in real time, and sends an abnormal signal to the control unit after detecting abnormal data of the main server.
[0068] The server switching module 23 is used for the control unit to start the alternative server after receiving the abnormal signal, and control the video recording unit to send the real-time image data to the alternative server.
[0069] The candidate server running module 24 is used for the candidate server to receive and process the real-time image data and store the real-time image data in the image database.
[0070] The technical features and technical effects of the device proposed in the embodiment of the present invention are the same as those of the method proposed in the embodiment of the present invention, and are not described in detail here. Each module in the above device can be implemented in whole or in part by software, hardware, and a combination thereof. Each of the above modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.
[0071] An embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the above-mentioned active-standby high-availability video storage method.
[0072] The embodiment of the present invention further provides a computer device, Figure 3 A structural block diagram of a preferred embodiment of a computer device provided by the present invention, wherein the computer device includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and the processor implements the above-mentioned primary-standby high-availability video storage method when executing the computer program.
[0073] Preferably, the computer program can be divided into one or more modules / units (such as computer program 1, computer program 2, ...), and the one or more modules / units are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units can be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program in the computer device.
[0074] The processor may be a central processing unit (CPU), or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor. The processor is the control center of the computer device, and various parts of the computer device are connected using various interfaces and lines.
[0075] The memory mainly includes a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function, etc., and the data storage area can store related data, etc. In addition, the memory can be a high-speed random access memory, or a non-volatile memory, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, and a flash card (Flash Card), etc., or the memory can also be other volatile solid-state storage devices.
[0076] It should be noted that the above-mentioned computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that Figure 3 The structural block diagram is merely an example of a computer device and does not constitute a limitation of the computer device, and may include more or less components than shown in the figure, or combine certain components, or different components.
[0077] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A method for storing video with high availability, characterized in that: include: In response to the video recording signal sent by the control unit, the video recording unit obtains real-time image data and sends the real-time image data to the main server; The main server processes the received real-time image data and stores the real-time image data in an image database; In response to the video recording signal sent by the control unit, the operation status monitoring unit monitors the operation status of the main server in real time, and sends an abnormal signal to the control unit after detecting abnormal data of the main server; The control unit starts the alternative server after receiving the abnormal signal, and controls the video recording unit to send the real-time image data to the alternative server; The candidate server receives and processes the real-time image data, and stores the real-time image data in the image database.
2. The active / standby high-availability video storage method according to claim 1, characterized in that: The number of the main server and the number of the backup servers are both greater than one.
3. The active / standby high-availability video storage method according to claim 2, characterized in that: The main server processes the received real-time image data and stores the real-time image data in an image database, including: After receiving the real-time image data, the main server obtains current timestamp information in real time, and stores the real-time image data and the timestamp information in an image database.
4. The method for storing video recordings with high availability as primary and backup as claimed in claim 2, characterized in that: The status monitoring unit is also used to monitor the operating status of the candidate server in real time; When the state monitoring unit detects that the running state of the candidate server is abnormal, it sends an abnormal signal to the control unit. After receiving the abnormal signal, the control unit switches the video storage of the candidate server.
5. The method for storing video recordings with high availability and active / standby functions as claimed in claim 2, wherein: When the status monitoring unit detects that the main server has resumed operation, it sends a normal operation signal to the control unit; After receiving the normal operation signal, the control unit controls the main server to resume video storage and suspends the operation of the corresponding standby server.
6. The active / standby high-availability video storage method according to claim 3, characterized in that: After the server switching occurs, the control unit filters out the adjacent real-time image data in time series according to the timestamp information, and repairs and synthesizes the adjacent real-time image data.
7. The active / standby high-availability video storage method according to claim 3, characterized in that: The method further comprises: Record the fault data of the system during operation, and generate a video recording and storage fault log file based on the fault data.
8. A high-availability video storage device with primary and backup functions, characterized in that: include: The main server operation module is used for responding to the recording signal sent by the control unit, the recording unit obtains real-time image data, and sends the real-time image data to the main server; The main server processes the received real-time image data and stores the real-time image data in an image database; A status monitoring module, which is used to respond to the video signal sent by the control unit, and the operation status monitoring unit monitors the operation status of the main server in real time, and sends an abnormal signal to the control unit after abnormal data of the main server is detected; A server switching module, used for the control unit to start the alternative server after receiving the abnormal signal, and control the video recording unit to send the real-time image data to the alternative server; The alternative server running module is used for the alternative server to receive and process the real-time image data and store the real-time image data in the image database.
9. A computer device, characterized in that: It comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements the active-standby high-availability video storage method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the device where the computer-readable storage medium is located executes the computer program, the active-standby high-availability video storage method according to any one of claims 1 to 7 is implemented.