Standard video channel storage method and terminal equipment
By using H.265+ video compression algorithm, video frame comparison technology and Elasticsearch search technology in the video middle-end storage technology, problems such as single storage format, lack of disaster recovery redundancy mechanism, and low retrieval efficiency in traditional video middle-end storage technology are solved, and efficient, secure and intelligent video storage and retrieval are achieved.
Patent Information
- Application Number
- CN202411729927.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-04-15
AI Technical Summary
Traditional video middle-end storage technology has problems such as single storage format, lack of disaster recovery redundancy mechanism, low retrieval efficiency, large storage space usage, lack of video screenshot functions and slow storage speed, and cannot adapt to the efficiency, security and intelligence requirements of modern society for surveillance video storage.
A standard video middle-end storage method is proposed, including investigating and selecting the video streaming protocol of mainstream monitoring equipment manufacturers, designing a visual configuration interface, using H.265+ video compression algorithm HEVC, screenshots and feature code extraction through video frame comparison technology, using Elasticsearch to achieve rapid retrieval and positioning, and supporting the search function by graph.
It improves the flexibility, security, retrieval efficiency and space utilization of video storage, improves user operation experience, realizes efficient management and intelligent retrieval of video data, and is suitable for monitoring video management needs in multiple industries.
Smart Images

Figure CN119835380A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of video storage, and in particular relates to a method and terminal device for storing a standard video in a central station. Background Art
[0002] With the rapid development of information technology, surveillance video plays an increasingly critical role in many fields. However, traditional video storage technology has many drawbacks, which seriously restricts its application efficiency.
[0003] Single storage format: Traditional systems only support limited video formats and are difficult to be compatible with the rich and diverse video formats in modern multimedia environments, such as common MP4, AVI, MOV, FLV, etc. This results in the need to convert formats when storing videos, which is not only time-consuming and labor-intensive, but may also affect video quality; Lack of disaster recovery and redundancy mechanism: When facing hardware failures, natural disasters or other emergencies, traditional storage systems are not equipped with effective disaster recovery and redundancy measures, which can easily cause video data loss, bringing huge potential risks to business operations;
[0004] Low retrieval efficiency: Traditional methods rely on browsing or simple timeline search for videos, and cannot support advanced retrieval functions such as keyword and image search. When processing massive video data, the time cost for users to locate the required video is extremely high and the efficiency is extremely low; Large storage space usage: Due to the lack of video compression function, video files are stored in their original size. As the amount of video data continues to increase, the storage space demand expands sharply, resulting in a significant increase in storage costs, and also affecting video transmission and playback performance;
[0005] Lack of video screenshot function: Only video stream files are stored without screenshot function, so users cannot quickly preview video content and can only watch the video in full to find information, which is not only inefficient but also easy to miss important clips; Slow storage speed and inconvenient management: The slow storage speed causes delays in uploading and downloading video data, affecting user experience. At the same time, there is a lack of a unified and visual management interface, and the user operation methods are single and cumbersome, making it difficult to intuitively manage video data.
[0006] To sum up, traditional video middleware storage technology can no longer meet the modern society's requirements for efficiency, security and intelligence of surveillance video storage, and innovative solutions are urgently needed.
[0007] In view of this, it is very meaningful to propose a method and terminal device for storing standard video in the middle. Summary of the invention
[0008] In order to solve the various problems faced by traditional video middle-end storage, improve the flexibility, security, retrieval efficiency, and space utilization of video storage, improve user operation experience, and be widely applicable to surveillance video management needs in multiple industry fields, the present invention provides a standard video middle-end storage method and terminal device to solve the above-mentioned technical defects.
[0009] In a first aspect, the present invention proposes a method for storing a standard video in a station, the method comprising the following steps:
[0010] In the early preparation stage, we researched and selected the video stream transmission protocols of mainstream surveillance equipment manufacturers, developed interface docking equipment, and conducted connectivity tests to ensure stable video stream transmission;
[0011] During the storage protocol setting phase, a visual configuration interface is designed to allow users to select storage methods, set storage policies, configure replica sets and corresponding physical machines and storage directory addresses, implement the storage logic of video data, support video file cutting by time, and configure replica sets and fault tolerance mechanisms;
[0012] In the storage compression processing stage, H.265+ video compression algorithm HEVC is used to select a certain number of the latest video files through a polling algorithm and arrange them in descending order by size, and then perform compression operations on them to reduce storage space occupation;
[0013] During the storage and retrieval execution phase, a keyword information system is built. When the similarity between the previous frame and the next frame is detected to be less than 95%, a screenshot is taken and the image feature code is extracted through video frame comparison technology. Elasticsearch is used to enable users to quickly retrieve and locate through keywords or uploaded pictures. The search by image function is supported. At the same time, the system supports extracting specific frames in the surveillance video and saving them as image files to achieve video snapshot and backtracking.
[0014] Preferably, in the storage and retrieval execution stage, the video frame comparison technology is implemented by a picture similarity algorithm, including a histogram-based similarity calculation:
[0015] The histogram intersection method of histogram similarity calculates the similarity based on the color or grayscale distribution of the image. For two images, their color or grayscale histograms are first counted. Assume that there are two histograms H1 and H2, where H1[i] and H2[i] represent the value of the i-th bin in the two histograms, that is, the number of pixels of the color or grayscale. The similarity S of the histogram intersection method is defined as:
[0016]
[0017] It is used to calculate the sum of the minimum values of the corresponding bins in the two histograms. The larger the value, the higher the similarity. Usually, in order to more intuitively represent the similarity, this value will be normalized to between 0 and 1, that is:
[0018]
[0019] Further preferably, the method further includes feature-based similarity calculation, including:
[0020] Feature extraction, using SIFT algorithm to extract feature points and their descriptors from two images respectively;
[0021] Feature matching, using a matching algorithm, including FLANN or BFMatcher, to find similar feature point pairs in two images;
[0022] Similarity calculation,is based on the number and quality of matched feature point pairs,including using the RANSAC algorithm to remove false matches to calculate,similarity.
[0023] Preferably, in the storage compression processing stage, the core compression formula includes discrete cosine transform DCT and quantization Q:
[0024]
[0025] Where x(m,n) is the pixel value of the input image or residual block, Y(k,l) is the transformed coefficient, M and N are the height and width of the image block, k and l are the frequency indices, and α(k) and α(l) are normalization factors;
[0026]
[0027] Among them, Q step (k,l) is the quantization step size associated with frequency indices k and l, which determines the fineness of the quantization.
[0028] Preferably, in the storage protocol setting stage, the storage method includes real-time storage and batch storage. Real-time storage ensures that the surveillance video can be recorded in a specified format instantly and without delay, and batch storage automatically cuts and stores video files at time intervals.
[0029] Preferably, in the storage and retrieval execution phase, all surveillance videos are first stored in their original quality, and a multi-copy cross-machine storage strategy is adopted to disperse and store copies of the video data on servers in different physical locations; the keyword information system includes the device name, device IP, device address, video file name, and key information of the person in charge, which will be used as a retrieval index to quickly locate video data.
[0030] Preferably, in the storage compression processing stage, video compression includes real-time compression and batch storage compression. Real-time compression uses real-time compression technology to reduce bandwidth occupancy and storage space requirements before the video stream is transmitted to the storage system, and batch storage compression applies an efficient video compression algorithm to the cut video files to further reduce the file size.
[0031] Preferably, in the storage protocol setting stage, visual management and control includes developing an intuitive and easy-to-use visual interface to display the real-time video stream, storage status, and historical record information of the monitoring point, support one-click operation, and provide a global overview function in a variety of ways to display the distribution of monitoring points, storage status and alarm information, and support custom report generation.
[0032] In a second aspect, an embodiment of the present invention further provides a terminal device for storing a standard video in a station, including:
[0033] The protocol docking module is configured to investigate and select the video stream transmission protocol of mainstream surveillance equipment manufacturers, develop interface docking equipment, and perform connectivity testing to ensure stable video stream transmission;
[0034] The storage management module is configured to design a visual configuration interface, allowing users to select storage methods, set storage policies, configure replica sets and corresponding physical machines and storage directory addresses, implement the storage logic of video data, support video file cutting by time, and configure replica sets and fault tolerance mechanisms;
[0035] A compression processing module is configured to use the H.265+ video compression algorithm HEVC, select a certain number of the latest video files through a polling algorithm and arrange them in descending order by size, and perform compression operations on them to reduce storage space occupation;
[0036] The retrieval module is configured to build a keyword information system. When the similarity between the previous frame and the next frame is detected to be less than 95%, a screenshot is taken and the image feature code is extracted through video frame comparison technology. Elasticsearch is used to enable users to quickly retrieve and locate through keywords or uploaded images. The search function by image is supported. At the same time, the system supports extracting specific frames in the surveillance video and saving them as image files to realize video snapshot and backtracking.
[0037] Further preferably, in the retrieval module, the video frame comparison technology is implemented through an image similarity algorithm, including histogram-based similarity calculation and feature-based similarity calculation; all surveillance videos are first stored in original quality, and a multi-copy cross-machine storage strategy is adopted to store copies of the video data in servers at different physical locations; the keyword information system includes device name, device IP, device address, video file name, and key information of the person in charge, which will be used as a retrieval index to quickly locate video data.
[0038] Preferably, the storage method in the protocol docking module includes real-time storage and batch storage. Real-time storage ensures that the surveillance video can be recorded in a specified format instantly and without delay, and batch storage automatically cuts and stores video files at time intervals.
[0039] Preferably, it also includes: a visual management and control module, which is configured to develop an intuitive and easy-to-use visual interface, display the real-time video stream, storage status, and historical record information of the monitoring point, support one-click operation, and provide a global overview function through a variety of methods, display the distribution of monitoring points, storage status and alarm information, and support custom report generation.
[0040] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.
[0041] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.
[0042] Compared with the prior art, the beneficial results of the present invention are:
[0043] 1. Flexibility of real-time and batch storage
[0044] Real-time video stream storage: Ensure that surveillance videos can be saved instantly and uninterruptedly in a specified format (such as MP4, AVI, etc.), which is crucial for surveillance scenarios that require instant response and backtracking.
[0045] Batch storage and time segmentation: By segmenting and storing videos by time periods, it is not only easier to manage, but also allows quick location of video data in a specific time period when needed, thus improving data retrieval efficiency.
[0046] 2. Data redundancy and security
[0047] Original video and copy storage: Direct storage of original video ensures data integrity and originality. At the same time, by storing copies across multiple machines, data redundancy and disaster recovery capabilities are enhanced. Even if a storage device fails, data can be quickly restored from other copies.
[0048] 3. Efficient retrieval based on Elasticsearch
[0049] Build and store keyword information: Store the basic information of the video (such as time, location, event description, etc.) in Elasticsearch. By using its powerful search engine function, you can quickly respond to user query needs and improve retrieval efficiency.
[0050] Video change screenshots and feature code storage: By capturing the changes in the video and storing the feature codes, fast retrieval based on image content is achieved. The timed screenshot method further enriches the retrieval database and provides strong support for subsequent image-based searches.
[0051] 4. Video compression saves storage space
[0052] Real-time and batch compression: Whether it is real-time compression or batch compression, it can effectively reduce the storage space occupied by video files and reduce storage costs. At the same time, the compressed video can also reduce bandwidth consumption during transmission and improve transmission efficiency.
[0053] 5. Video snapshot function improves user experience
[0054] Specific frames saved as image files: By extracting specific frames in the video (such as key events, abnormal behaviors, etc.) and saving them as image files, users can directly view these snapshots and quickly understand the video content, reducing the time cost of watching the video from beginning to end.
[0055] 6. Visualized integrated control enhances management efficiency
[0056] Surveillance video storage visualization: Provides an integrated surveillance video storage management platform that displays storage status, data distribution, performance monitoring and other information through a graphical interface, allowing managers to intuitively understand the operation of the entire storage system.
[0057] Global overview function: The global perspective allows managers to quickly grasp the overall situation of surveillance video storage, including storage capacity, access frequency, fault warning, etc., providing strong support for decision-making.
[0058] In summary, the surveillance video storage and processing solution provides a strong guarantee for the stable operation and efficient management of the surveillance system by improving data flexibility, enhancing data security, optimizing retrieval efficiency, saving storage space, improving user experience, and enhancing management efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and are used together with the description to explain the principles of the present invention. It will be easy to recognize other embodiments and many expected advantages of the embodiments because they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale with each other. The same reference numerals refer to corresponding similar parts.
[0060] Figure 1 A schematic diagram of a flow chart of a method for storing a standard video in a platform according to an embodiment of the present invention;
[0061] Figure 2 A schematic diagram of the architecture of a terminal device stored in a standard video middleware according to an embodiment of the present invention;
[0062] Figure 3 It is a schematic diagram of the structure of a computer device suitable for implementing an electronic device of an embodiment of the present invention. DETAILED DESCRIPTION
[0063] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0064] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0065] In a first aspect, an embodiment of the present invention discloses a method for storing a standard video in a station, such as Figure 1 As shown, the method comprises the following steps:
[0066] S1. In the early preparation stage, we researched and selected the video stream transmission protocols of mainstream surveillance equipment manufacturers, developed interface docking equipment, and conducted connectivity tests to ensure stable video stream transmission;
[0067] Specifically, video protocol research and selection: First, it is necessary to conduct a detailed research on the video streaming transmission protocols (such as RTSP, RTMP, HLS, etc.) of mainstream surveillance equipment manufacturers (such as Hikvision, Dahua, Uniview, etc.) on the market. According to the specific needs of the project and compatibility considerations, select the most suitable protocol for integration.
[0068] Protocol connection and debugging: For the selected video protocol, it is necessary to develop corresponding interfaces or use existing libraries (such as FFmpeg, OpenCV, etc.) to connect devices from different manufacturers. This includes writing code to parse video stream data, decode it, and convert it into a processable format. During the debugging process, it is necessary to ensure the stability and real-time performance of the video stream and solve possible delays, freezes, and other problems.
[0069] Connectivity test: After the connection is completed, a connectivity test is performed to ensure that all connected monitoring devices can stably transmit video streams to the system. The test should include network exception handling, device offline detection and reconnection mechanism, etc. to ensure the robustness of the system.
[0070] S2, storage protocol setting stage, design a visual configuration interface to allow users to select storage methods, set storage policies, configure replica sets and corresponding physical machines and storage directory addresses, implement the storage logic of video data, support video file cutting by time, and configure replica sets and fault tolerance mechanisms;
[0071] Specifically, visual configuration interface design: develop a user-friendly visual configuration interface that allows users to select storage methods (real-time storage or batch storage), set storage strategies (such as time-sliced shard storage), configure replica sets and corresponding physical machines and storage directory addresses through a graphical interface.
[0072] Real-time and batch video stream storage formats are highly practical. Real-time video stream storage ensures that video data can be captured and stored immediately when key events occur, which is essential for scenarios such as security monitoring and accident investigation. Support for multiple formats of storage increases compatibility and flexibility, making it easier for different devices and software to access. The immediacy of real-time video stream storage not only supports traditional post-event storage, but also emphasizes real-time, ensuring that video data can be captured and stored the moment it is generated, which is of great value for monitoring scenarios that require immediate response.
[0073] Batch storage and time segmentation effectively manage large-scale video data and avoid the difficulty of processing a single file that is too large. Time segmentation allows users to retrieve videos by time period and improve search efficiency. At the same time, regular cleaning of old data can free up storage space and optimize system performance. The time segmentation flexibility of batch storage and time segmentation storage not only facilitates management, but also provides higher flexibility. Users can customize the segmentation time interval according to actual needs to meet monitoring needs in different scenarios.
[0074] Storage strategy implementation: Implement the storage logic of video data according to user configuration. For real-time storage, it is necessary to ensure that data can be written to the storage medium immediately; for batch storage, it is necessary to write in batches after certain conditions (such as file size, time interval) are met. At the same time, it supports cutting video files by time to facilitate subsequent management and retrieval.
[0075] Replica sets and fault-tolerance mechanisms: Configure replica sets for video data to improve data reliability and availability. Specify physical machines and storage directory addresses for each replica set to ensure that data can be distributed and stored in multiple locations to prevent data loss caused by single point failures. At the same time, implement fault-tolerance mechanisms such as data redundancy verification and automatic repair to ensure data integrity and consistency.
[0076] The storage of original videos and multiple copies across machines is practical. The original video storage maintains the original quality of the video data, providing a reliable basis for high-precision analysis and legal evidence collection. Multiple copies are stored across machines to enhance data security and reliability, and prevent data loss caused by single point failures. Cross-machine storage can also improve the overall performance of the system through load balancing, ensuring stable operation during high concurrent access.
[0077] The combination of original video and copy storage ensures data integrity and improves data reliability. The original video is used for high-precision analysis and legal evidence collection, while the copy is used for disaster recovery and daily access. The two complement each other. It has the dual protection of original video and copy storage.
[0078] The distributed advantage of cross-machine multi-copy storage is that the copies are stored on multiple machines, which not only enhances the physical security of the data, but also improves the scalability and fault tolerance of the system through distributed storage. This design adapts to the needs of massive data storage and processing in the big data era.
[0079] The integrated visual management and control of surveillance video storage can provide an intuitive and easy-to-use visual interface, allowing managers to easily monitor the video storage status and perform information operations. The global overview function helps managers quickly understand the operation of the entire surveillance system and respond to and handle various events in a timely manner. This integrated management and control method not only improves work efficiency, but also reduces operational difficulty and error rate. It is very practical.
[0080] Provides a visual integrated management and control platform for surveillance video storage, realizing comprehensive management and operation of surveillance video storage. This integrated management and control method not only simplifies the operation process, but also improves management efficiency.
[0081] Through the global overview function, managers can grasp the operation of the entire monitoring system in real time, including video storage status, device status, alarm information, etc. This macro perspective helps managers quickly respond to and handle various events, improving the overall efficiency of the monitoring system. It provides a global overview of the macro perspective.
[0082] S3, storage compression processing stage, using H.265+ video compression algorithm HEVC, a certain number of the latest video files are screened out through a polling algorithm and arranged in descending order by size, and compression operations are performed on them to reduce storage space occupation;
[0083] Specifically, the compression algorithm is selected: the H.265+ (also known as HEVC) video compression algorithm is used, which has higher compression efficiency and better video quality than the previous generation H.264. According to the actual needs of the project, select the appropriate compression ratio for configuration.
[0084] The core compression formula includes discrete cosine transform DCT and quantization Q:
[0085]
[0086] where x(m,n) is the pixel value of the input image (or residual block), Y(k,l) is the transformed coefficient, M and N are the height and width of the image block, respectively, k and l are frequency indices, and α(k) and α(l) are normalization factors (these factors may be different for some DCT variants such as DCT-II).
[0087]
[0088] Among them, Q step (k,l) is the quantization step size associated with frequency index k and l, which determines how fine the quantization is. A larger quantization step size results in more information loss and higher compression ratios, but also introduces more distortion.
[0089] Polling algorithm implementation: Implement a polling algorithm to periodically scan the stored video files. The algorithm first selects the latest 100 video files (or adjusts the number according to actual needs), and then sorts them in descending order according to file size. This ensures that files that occupy larger space are processed first, improving the utilization of storage space.
[0090] Compression operation execution: Perform compression operation on the polled video file. According to the configured compression ratio, the H.265+ algorithm is used to re-encode and compress the video. The compressed file will replace the original file or be stored in the specified location to reduce the disk space occupied.
[0091] Furthermore, real-time and batch compression of video is very practical. Real-time compression can reduce network bandwidth usage and transmission delay, ensuring smooth transmission of video streams. At the same time, real-time compression can also reduce storage space requirements and save costs. Batch storage compression can further reduce file size and facilitate storage and transmission by efficiently compressing video data after it is cut into smaller files. This is especially important for long-term storage of large amounts of surveillance video data.
[0092] Real-time compression can optimize in real time, and compress the video stream in real time during transmission, reducing network bandwidth usage and transmission delay, while optimizing the efficiency of storage space. This real-time compression technology is of great significance for improving the real-time and economic performance of the monitoring system.
[0093] Batch storage compression can achieve refinement, and the video data is cut into smaller files before compression processing, realizing refined management and optimization of video data. This batch compression method not only improves compression efficiency, but also facilitates subsequent data processing and analysis.
[0094] S4, storage and retrieval execution phase, builds a keyword information system, uses video frame comparison technology to take screenshots and extract image feature codes when it detects that the similarity between the previous frame and the next frame is less than 95%, and uses Elasticsearch to enable users to quickly retrieve and locate through keywords or uploaded pictures. It supports the search by image function. At the same time, the system supports extracting specific frames in the surveillance video and saving them as image files to achieve video snapshots and backtracking.
[0095] Specifically, keyword information construction: According to the characteristics of the surveillance video, a set of keyword information system is constructed, including key information such as device name, device IP, device address, video file name, person in charge, etc. This information will be used as a search index to quickly locate video data.
[0096] Video frame comparison and screenshots: Video frame comparison technology is used to monitor changes in video content in real time. When the similarity between the previous frame and the next frame is detected to be less than 95%, a screenshot operation is performed and the image feature code is extracted. These screenshots and feature codes will be stored in search engines such as Elasticsearch for subsequent rapid retrieval and early warning.
[0097] Fast retrieval and positioning: With the powerful search capabilities of Elasticsearch, users can quickly retrieve relevant surveillance videos by entering keywords or uploading pictures. The system will provide information such as video time and video screenshots based on the search results to help users quickly locate key time nodes in the video. At the same time, it supports the image search function, and users can retrieve similar video frames or screenshots by uploading pictures.
[0098] Elasticsearch index and feature code storage are very practical. Through keyword indexing, users can quickly locate the target video and improve retrieval efficiency. This is particularly important for processing large amounts of surveillance video data, which can significantly reduce user search time. The basic information of the video is stored in Elasticsearch, and the powerful search capabilities of Elasticsearch are used to quickly retrieve video data. This intelligent indexing method improves the utilization and accessibility of video data.
[0099] The feature code storage captures the video change frames and generates feature codes, providing a basis for image search. In specific scenarios (such as face recognition and vehicle tracking), image matching can be used to quickly retrieve relevant video clips, improving the intelligence level of the monitoring system. By capturing the changing images of the video and storing feature codes, video retrieval based on image content is achieved. This innovative retrieval method breaks the limitations of traditional retrieval based on text keywords and improves the accuracy and efficiency of retrieval.
[0100] Video snapshot and backtracking: To further improve retrieval efficiency, the system supports extracting specific frames from surveillance videos and saving them as image files. These snapshot files can be displayed to users as thumbnails or key frames of the video, reducing the time it takes for users to watch the video from beginning to end. At the same time, through snapshot and screenshot information, users can easily backtrack to any time point in the video for viewing and analysis.
[0101] The video snapshot function extracts specific frames from the video and saves them as image files, so that users can quickly browse the video content and understand the general situation. This is of great significance for quickly locating key events and reducing viewing time. At the same time, the snapshot can also be used as a preview of the video content, improving the user experience and being very practical.
[0102] By extracting specific frames from the video and saving them as image files, the video content can be presented in images. This snapshot function not only allows users to quickly browse the video content, but also provides a visual preview of the video content, improving the user experience. Through the snapshot function, users can directly view the image of the key frame without having to watch the entire video from beginning to end, reducing viewing time, thereby saving time and improving work efficiency.
[0103] Furthermore, the image similarity algorithm includes histogram-based similarity calculation and feature-based similarity calculation, as follows:
[0104] Similarity based on histograms (such as histogram intersection method): The histogram intersection method of histogram similarity calculates the similarity based on the color or grayscale distribution of the image. For two images, their color or grayscale histograms are first counted. Suppose there are two histograms H1 and H2, where H1[i] and H2[i] represent the value of the i-th bin in the two histograms, that is, the number of pixels of the color or grayscale. The similarity S of the histogram intersection method is defined as:
[0105]
[0106] This formula calculates the sum of the minimum values of the corresponding bins in the two histograms. The larger the value, the higher the similarity. But usually, we will normalize this value to between 0 and 1 to more intuitively represent the similarity:
[0107]
[0108] Feature-based similarity (such as SIFT feature matching): SIFT (Scale Invariant Feature Transform) is an algorithm for extracting local features in an image. These features are invariant to certain extent to image scaling, rotation, and even affine transformations. By comparing the SIFT feature points extracted from two images and their descriptors, the similarity between them can be calculated. The specific steps include:
[0109] Feature extraction: Use the SIFT algorithm to extract feature points and their descriptors from the two images respectively.
[0110] Feature matching: Use a matching algorithm (such as FLANN or BFMatcher) to find similar feature point pairs in two images.
[0111] Similarity calculation: Calculate the similarity based on the number and quality of matched feature point pairs (such as using the RANSAC algorithm to remove false matches).
[0112] In summary, these improvements in surveillance video storage are highly practical and can significantly improve the performance, reliability and intelligence of the surveillance system to meet the surveillance needs in different scenarios. These improvements in surveillance video storage reflect innovations in terms of real-time performance, flexibility, reliability, intelligence, economy and user experience, providing new ideas and directions for the development and application of surveillance systems.
[0113] Further references Figure 2 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a terminal device, and the terminal device embodiment is Figure 1 Corresponding to the method embodiment shown, the terminal device can be specifically applied to various electronic devices.
[0114] In a second aspect, this embodiment also discloses a terminal device for storing a standard video in a station, such as Figure 2 As shown, including:
[0115] The protocol docking module 21 is configured to investigate and select the video stream transmission protocol of mainstream monitoring equipment manufacturers, develop interface docking equipment, and perform connectivity testing to ensure stable transmission of video streams;
[0116] The storage management module 22 is configured to design a visual configuration interface, allowing the user to select a storage method, set a storage strategy, configure a replica set and the corresponding physical machine and storage directory address, implement the storage logic of the video data, support cutting video files by time, and configure a replica set and a fault tolerance mechanism;
[0117] The compression processing module 23 is configured to use the H.265+ video compression algorithm HEVC, filter out a certain number of the latest video files through a polling algorithm and arrange them in descending order by size, and perform compression operations on them to reduce storage space occupation;
[0118] The retrieval module 24 is configured to build a keyword information system. When the similarity between the previous frame and the next frame is detected to be less than 95%, a screenshot is taken and a feature code of the image is extracted through the video frame comparison technology. Elasticsearch is used to realize fast retrieval and positioning by users through keywords or uploaded images. The search function by image is supported. At the same time, the system supports extracting specific frames in the surveillance video and saving them as image files to realize video snapshot and backtracking.
[0119] Furthermore, in the retrieval module 24, the video frame comparison technology is implemented through an image similarity algorithm, including histogram-based similarity calculation and feature-based similarity calculation; all surveillance videos are first stored in original quality, and a multi-copy cross-machine storage strategy is adopted to store copies of the video data in servers at different physical locations; the keyword information system includes device name, device IP, device address, video file name, and key information of the person in charge, which will be used as a retrieval index to quickly locate video data.
[0120] The storage methods described in the protocol docking module 21 include real-time storage and batch storage. Real-time storage ensures that the surveillance video can be recorded into a specified format immediately and without delay, and batch storage automatically cuts and stores video files at time intervals.
[0121] It also includes: a visual management and control module, which is configured to develop an intuitive and easy-to-use visual interface to display the real-time video stream, storage status, and historical record information of the monitoring points, support one-click operation, and provide a global overview function in a variety of ways to display the distribution of monitoring points, storage status, and alarm information, and support custom report generation.
[0122] The functions of the above modules correspond to the methods and will not be repeated here.
[0123] The embodiments of the present invention disclose a method and terminal device for storing a standard video in the middle platform. The characteristics of these surveillance video storage and processing have broad application prospects in many fields such as public safety, smart cities, retail business, industrial production, remote education and medical care, smart transportation and environmental protection, and can significantly improve management efficiency, reduce costs, and enhance security and reliability.
[0124] 1. Public safety and security
[0125] Real-time video stream storage and batch storage: In the field of public safety, real-time video stream storage ensures the immediate availability of surveillance footage, facilitating rapid response to emergencies. Batch storage facilitates subsequent investigations, especially time-based storage, which can quickly locate video clips before and after the incident.
[0126] Multi-copy cross-machine storage: Enhances data security and reliability. Even if a storage device fails, data can be quickly restored from other copies to ensure continuous operation of the monitoring system.
[0127] Elasticsearch keyword search: By storing basic video information and feature codes, you can quickly search for specific events or people, improving the efficiency of case detection.
[0128] 2. Smart mine construction
[0129] Video snapshot and compression technology: In smart mines, by extracting key frames from videos and saving them as image files, storage requirements can be greatly reduced while providing a quick overview of the mine's operating status. Real-time or batch compression technology further reduces storage costs and makes large-scale deployment possible.
[0130] Visualized integrated control: Provides a global monitoring view for mine decision-makers, and realizes real-time monitoring and scheduling of safety monitoring, environmental monitoring, production scheduling, emergency response and other aspects, which can not only significantly improve the safety and management efficiency of mines, but also lay the foundation for the future intelligent transformation of mines. The application of this invention patent in SDIC Xinjiang Lop Nur Potash Co., Ltd. fully demonstrates its innovativeness and practical value, and lays a solid foundation for promoting sustainable development in the mining industry.
[0131] 3. Retail and Business Analysis
[0132] Customer behavior analysis: Analyze customers’ behavior paths, dwell time, etc. in the store through surveillance videos, provide merchants with valuable customer behavior data, and optimize store layout and marketing strategies.
[0133] Security monitoring: Ensure store safety, prevent theft and other illegal activities, and respond quickly to emergencies.
[0134] 4. Industrial production monitoring
[0135] Production line monitoring: Real-time monitoring of production line status, timely detection and handling of equipment failures or production anomalies, and improved production efficiency.
[0136] Worker safety monitoring: Ensure that workers comply with safety regulations, prevent work-related accidents, and ensure production safety.
[0137] 5. Distance education and medical care
[0138] Remote education monitoring: ensure online classroom order, monitor students’ learning status, and improve teaching quality.
[0139] Telemedicine monitoring: In telemedicine, monitor the patient's condition and provide real-time video feedback to doctors to assist in diagnosis and treatment.
[0140] 6. Smart Transportation
[0141] Traffic flow monitoring: Analyze traffic flow through monitoring video, optimize traffic signal control, and alleviate traffic congestion.
[0142] Rapid response to accidents: Real-time video stream storage enables traffic accidents to be discovered and handled quickly, reducing the impact of accidents on traffic.
[0143] 7. Environmental protection
[0144] Environmental monitoring: Monitor environmentally sensitive areas such as nature reserves, rivers and lakes to promptly detect and handle pollution incidents.
[0145] Wildlife protection: Observe wildlife behavior through surveillance video to protect biodiversity.
[0146] In summary, the surveillance video storage and processing solution provides a strong guarantee for the stable operation and efficient management of the surveillance system by improving data flexibility, enhancing data security, optimizing retrieval efficiency, saving storage space, improving user experience, and enhancing management efficiency.
[0147] Reference below Figure 3 , which shows an electronic device (eg Figure 1 A schematic diagram of the structure of a computer device 600 (a server or terminal device as shown). Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0148] like Figure 3As shown, the computer device 600 includes a central processing unit (CPU) 601 and a graphics processing unit (GPU) 602, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 603 or a program loaded from a storage part 609 to a random access memory (RAM) 604. In the RAM 604, various programs and data required for the operation of the device 600 are also stored. The CPU 601, GPU 602, ROM 603 and RAM 604 are connected to each other through a bus 605. An input / output (I / O) interface 606 is also connected to the bus 605.
[0149] The following components are connected to the I / O interface 606: an input section 607 including a keyboard, a mouse, etc.; an output section 608 including a display such as a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 609 including a hard disk, etc.; and a communication section 610 including a network interface card such as a LAN card, a modem, etc. The communication section 610 performs communication processing via a network such as the Internet. A drive 611 may also be connected to the I / O interface 606 as needed. A removable medium 612, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 611 as needed so that a computer program read therefrom is installed into the storage section 609 as needed.
[0150] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 610, and / or installed from the removable medium 612. When the computer program is executed by the central processing unit (CPU) 601 and the graphics processing unit (GPU) 602, the above-mentioned functions defined in the method of the present invention are executed.
[0151] It should be noted that the computer-readable medium described in the present invention may be a computer-readable signal medium or a computer-readable medium or any combination of the above two. The computer-readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor device, apparatus or device, or any combination of the above. More specific examples of computer-readable media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution device, apparatus or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution device, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0152] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0153] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the device, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based device that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0154] The modules involved in the embodiments of the present invention may be implemented in software or hardware, and the modules described may also be arranged in a processor.
[0155] As another aspect, the present invention further provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the electronic device, the electronic device executes the method steps described in the first aspect.
[0156] The above description is only a preferred embodiment of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) to form a technical solution.
Claims
1. A method for storing a standard video in a station, characterized in that: The method comprises the following steps: In the early preparation stage, we researched and selected the video stream transmission protocols of mainstream surveillance equipment manufacturers, developed interface docking equipment, and conducted connectivity tests to ensure stable video stream transmission; During the storage protocol setting phase, a visual configuration interface is designed to allow users to select storage methods, set storage policies, configure replica sets and corresponding physical machines and storage directory addresses, implement the storage logic of video data, support video file cutting by time, and configure replica sets and fault tolerance mechanisms; In the storage compression processing stage, H.265+ video compression algorithm HEVC is used to select a certain number of the latest video files through a polling algorithm and arrange them in descending order by size, and then perform compression operations on them to reduce storage space occupation; During the storage and retrieval execution phase, a keyword information system is built. When the similarity between the previous frame and the next frame is detected to be less than 95%, a screenshot is taken and the image feature code is extracted through video frame comparison technology. Elasticsearch is used to enable users to quickly retrieve and locate through keywords or uploaded pictures. The search by image function is supported. At the same time, the system supports extracting specific frames from the surveillance video and saving them as image files to achieve video snapshot and backtracking.
2. The method for storing a standard video in a station according to claim 1, characterized in that: In the storage and retrieval execution phase, the video frame comparison technology is implemented through a picture similarity algorithm, including a histogram-based similarity calculation: The histogram intersection method of histogram similarity calculates the similarity based on the color or grayscale distribution of the image. For two images, their color or grayscale histograms are first counted. Assume that there are two histograms H1 and H2, where H1[i] and H2[i] represent the value of the i-th bin in the two histograms, that is, the number of pixels of the color or grayscale. The similarity S of the histogram intersection method is defined as: It is used to calculate the sum of the minimum values of the corresponding bins in the two histograms. The larger the value, the higher the similarity. Usually, in order to more intuitively represent the similarity, this value will be normalized to between 0 and 1, that is:
3. The method for storing a standard video in a station according to claim 2, characterized in that: It also includes feature-based similarity calculations, including: Feature extraction, using SIFT algorithm to extract feature points and their descriptors from two images respectively; Feature matching, using a matching algorithm, including FLANN or BFMatcher, to find similar feature point pairs in two images; Similarity calculation,is based on the number and quality of matched feature point pairs,including using the RANSAC algorithm to remove false matches to calculate,similarity.
4. The method for storing a standard video in a station according to claim 1, characterized in that: In the storage compression processing stage, the core compression formula includes discrete cosine transform DCT and quantization Q: Where x(m,n) is the pixel value of the input image or residual block, Y(k,l) is the transformed coefficient, M and N are the height and width of the image block, k and l are the frequency indices, and α(k) and α(l) are normalization factors; Among them, Q step (k,l) is the quantization step size associated with frequency indices k and l, which determines the fineness of the quantization.
5. The method for storing a standard video in a station according to claim 1, characterized in that: In the storage protocol setting stage, the storage methods include real-time storage and batch storage. Real-time storage ensures that the surveillance video can be recorded in a specified format immediately and without delay, and batch storage automatically cuts and stores video files at time intervals.
6. The method for storing a standard video in a station according to claim 1, characterized in that: In the storage and retrieval execution phase, all surveillance videos are first stored in original quality, and a multi-copy cross-machine storage strategy is adopted to disperse and store copies of video data on servers in different physical locations; the keyword information system includes key information such as device name, device IP, device address, video file name, and person in charge, which will be used as a retrieval index to quickly locate video data.
7. The method for storing a standard video in a station according to claim 1, characterized in that: In the storage compression processing stage, video compression includes real-time compression and batch storage compression. Real-time compression uses real-time compression technology to reduce bandwidth occupancy and storage space requirements before the video stream is transmitted to the storage system. Batch storage compression applies an efficient video compression algorithm to the cut video files to further reduce the file size.
8. The method for storing a standard video in a station according to claim 1, characterized in that: In the storage protocol setting stage, visual management and control includes developing an intuitive and easy-to-use visual interface to display the real-time video stream, storage status, and historical record information of the monitoring point, support one-click operation, and provide a global overview function in a variety of ways to display the distribution of monitoring points, storage status and alarm information, and support custom report generation.
9. A terminal device for storing standard video in a central station, characterized in that: include: The protocol docking module is configured to investigate and select the video stream transmission protocol of mainstream surveillance equipment manufacturers, develop interface docking equipment, and perform connectivity testing to ensure stable video stream transmission; The storage management module is configured to design a visual configuration interface, allowing users to select storage methods, set storage policies, configure replica sets and corresponding physical machines and storage directory addresses, implement the storage logic of video data, support video file cutting by time, and configure replica sets and fault tolerance mechanisms; A compression processing module is configured to use the H.265+ video compression algorithm HEVC, select a certain number of the latest video files through a polling algorithm and arrange them in descending order by size, and perform compression operations on them to reduce storage space occupation; The retrieval module is configured to build a keyword information system. When the similarity between the previous frame and the next frame is detected to be less than 95%, a screenshot is taken and the image feature code is extracted through video frame comparison technology. Elasticsearch is used to enable users to quickly retrieve and locate through keywords or uploaded images. The search function by image is supported. At the same time, the system supports extracting specific frames in the surveillance video and saving them as image files to realize video snapshot and backtracking.
10. The terminal device for storing the standard video in the middle of claim 9, characterized in that: In the retrieval module, the video frame comparison technology is implemented through an image similarity algorithm, including histogram-based similarity calculation and feature-based similarity calculation; all surveillance videos are first stored in original quality, and a multi-copy cross-machine storage strategy is adopted to store copies of video data in servers at different physical locations; the keyword information system includes device name, device IP, device address, video file name, and key information of the person in charge, which will be used as a retrieval index to quickly locate video data.
11. The terminal device for storing the standard video in the station according to claim 9, characterized in that: The storage methods in the protocol docking module include real-time storage and batch storage. Real-time storage ensures that the surveillance video can be recorded in a specified format immediately and without delay, and batch storage automatically cuts and stores video files at time intervals.
12. The terminal device for storing the standard video in the station according to claim 9, characterized in that: Also includes: The visual management and control module is configured to develop an intuitive and easy-to-use visual interface to display the real-time video stream, storage status, and historical record information of the monitoring points. It supports one-click operation and provides a global overview function in a variety of ways to display the distribution of monitoring points, storage status, and alarm information, and supports custom report generation.
13. An electronic device comprising: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.