Surveillance video retrieval method, device, equipment and program product
By conducting preliminary search in IPC and returning the surveillance video event index set in batches, the video loss problem caused by limited memory space in IPC is solved, and the user experience is improved.
Patent Information
- Application Number
- CN202510578520.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-19
AI Technical Summary
In the prior art, due to the limited memory space available to IPC, the search results of surveillance video recording events may be partially lost, resulting in the illusion of video loss and affecting the user experience.
By receiving the monitoring video search request, a preliminary search is carried out to determine the index ID range of the monitoring video event index set associated with the first time range, and a secondary search is performed within the index ID range, and the second monitoring video event index set associated with the type range is determined in batches, and returned to the search terminal batch by batch to avoid recording loss caused by insufficient cache.
Without adding cache, the illusion of surveillance video events and video loss is effectively avoided, and the user experience is improved.
Smart Images

Figure CN120508678A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of surveillance, and in particular to a surveillance video retrieval method, apparatus, device and program product. Background Art
[0002] An Internet Protocol Camera (IPC) is a video recording device that transmits audio and video data over a network. It enables real-time video and audio monitoring over the internet or a local area network (LAN) and can also be used for video playback. Generally, upon receiving a request from a client, the IPC first searches all stored surveillance video events, filters them based on the client's desired playback timeframe (e.g., one day) and the type of surveillance video event being requested, and then saves the search results to a buffer.
[0003] The IPC typically allocates memory space to create a buffer to store surveillance video event retrieval results. Because IPC memory is limited, the IPC typically limits the maximum buffer length by limiting the maximum number of surveillance video event retrieval results to minimize memory usage.
[0004] However, as IPC supports more and more detection functions, and users are allowed to shorten recording delays, the probability of overlapping video clips within the same time range for surveillance video events of the same type decreases. This results in a potentially large number of surveillance video events within a given time range (e.g., a day). Limiting the maximum number of surveillance video event retrieval results may prevent the buffer from storing all retrieval results for surveillance video events within a given time range (e.g., a day), resulting in some data loss. This creates the illusion of video loss and severely impacts the user experience. Summary of the Invention
[0005] In view of this, the embodiments of the present application provide a surveillance video retrieval method, device, equipment and program product to solve the problem in the prior art that due to the limited memory space available to the IPC, some retrieval results may be lost, creating the illusion of video loss and affecting the user experience.
[0006] A first aspect of an embodiment of the present application provides a surveillance video retrieval method, the method comprising:
[0007] receiving a surveillance video retrieval request, wherein the surveillance video retrieval request includes a first time range and a type range;
[0008] Perform a preliminary search based on the first time range to determine an index ID range of a first surveillance video event index set associated with the first time range;
[0009] A second search is performed in the surveillance video events corresponding to the index ID range, a second surveillance video event index set associated with the type range is determined in batches, and the second surveillance video event index set is returned to the search terminal in sequence according to the batches.
[0010] In conjunction with the first aspect, in a first possible implementation of the first aspect, performing a preliminary search based on the first time range to determine an index ID range of a first surveillance video event index set associated with the first time range includes:
[0011] Determining a video data file ID associated with the first time range, where the video data file ID is an ID of a video data file obtained by dividing the video data;
[0012] According to the video data file ID associated with the first time range, an index ID range of a first surveillance video event index set associated with the first time range is determined.
[0013] In conjunction with the first possible implementation of the first aspect, in a second possible implementation of the first aspect, determining the video data file ID associated with the first time range includes:
[0014] Sequentially extracting the video data file IDs, and determining a second time range corresponding to each extracted video data file ID based on a pre-stored correspondence between the video data file ID and the time range;
[0015] According to the time overlap relationship between the second time range and the first time range, the video data file ID associated with the first time range is determined.
[0016] In conjunction with the first possible implementation of the first aspect, in a third possible implementation of the first aspect, determining, based on the video data file ID associated with the first time range, an index ID range of a first surveillance video event index set associated with the first time range includes:
[0017] Determining, based on the video data file ID associated with the first time range, a position of the surveillance video event index group corresponding to the video data file ID in the video index file;
[0018] The surveillance video event index is taken out in sequence according to the position of the surveillance video event index group, and the index ID range of the first surveillance video event index set associated with the first time range is determined according to the overlapping relationship between the third time range corresponding to the surveillance video event index and the first time range.
[0019] In conjunction with the third possible implementation of the first aspect, in a fourth possible implementation of the first aspect, determining, based on an overlapping relationship between a third time range corresponding to the surveillance video event index and the first time range, an index ID range of the first surveillance video event index set associated with the first time range includes:
[0020] If the third time range corresponding to the surveillance video event index overlaps with the first time range, and the surveillance video event index is the first surveillance video event index in the surveillance video event index group that overlaps with the first time range, then determining the ID of the surveillance video event index to be the minimum ID in the index ID range;
[0021] If the third time range corresponding to the surveillance video event index overlaps with the first time range, and the surveillance video event index is the surveillance video event index after the determined minimum ID, then the ID of the surveillance video event index is updated to the maximum ID of the index ID range until the comparison of all surveillance video event indexes in the surveillance video event index group is completed, and the maximum ID of the index ID range is obtained. The index ID range of the first surveillance video event index set is determined based on the minimum ID and the maximum ID.
[0022] In combination with the first possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, performing a second search in the surveillance video events corresponding to the index ID range to determine a second surveillance video event index set associated with the type range includes:
[0023] Determine the location range of the first surveillance video event index set in the video index file according to the index ID range;
[0024] The surveillance video event indexes are sequentially retrieved according to the position range, and the surveillance video event indexes are filtered according to the type range to obtain the second surveillance video event index set.
[0025] In combination with the first possible implementation of the first aspect, in a sixth possible implementation of the first aspect, writing the second surveillance video event index set to the cache in batches includes:
[0026] Determine the number of surveillance video event indexes included in a single batch based on the size of the cache;
[0027] The batch to which the surveillance video event indexes in the second surveillance video event index set belong is determined according to the number of surveillance video event indexes included in a single batch, and the determined batches are written into the cache batch by batch.
[0028] In combination with any one of the first aspect to the sixth possible implementation manner of the first aspect, in a seventh possible implementation manner of the first aspect, before performing a preliminary search based on the first time range to determine the index ID range of the first surveillance video event index set associated with the first time range, the method further includes:
[0029] During the recording process, if a backward time jump occurs, a new set of surveillance video event indexes is applied for. When the sum of the first surveillance video event number corresponding to the current video data file and the newly applied surveillance video event index number is greater than the first quantity threshold, the newly applied first number of surveillance video event indexes are corresponded to the current video data file, and the second number of surveillance video event indexes are corresponded to the switched video data file; if the sum is less than the first quantity threshold, all the newly applied surveillance video event indexes are corresponded to the current video data file, wherein the first quantity threshold is the upper limit of the number of surveillance video events corresponding to a single video data file, the first quantity is the difference between the first quantity threshold and the first number of surveillance video events, and the second quantity is the difference between the newly applied number of surveillance video event indexes and the first quantity;
[0030] If a forward time jump occurs, the next video data file is switched to, the third number of surveillance video events that have not yet ended are ended, and a third number of surveillance video event index IDs are newly applied for corresponding to the switched video data file.
[0031] In combination with any one of the first aspect to the sixth possible implementation manner of the first aspect, in an eighth possible implementation manner of the first aspect, before performing a preliminary search based on the first time range to determine the index ID range of the first surveillance video event index set associated with the first time range, the method further includes:
[0032] During the recording process, detect whether the preset recording data file switching conditions are met;
[0033] When the preset video data file switching condition is met, all surveillance video events corresponding to the current video data file are stopped, and a new surveillance video event index ID corresponding to the video data file to be switched is applied for the same type of surveillance video events.
[0034] In combination with any one of the eighth possible implementation manners of the first aspect, in a ninth possible implementation manner of the first aspect, during the video recording process, detecting whether a preset video data file switching condition is met includes:
[0035] During the recording process, if a set of surveillance video data is obtained and the current video data file is full, the preset video data file switching condition is met;
[0036] During the recording process, if a new surveillance video event triggers recording and the number of surveillance video events corresponding to the current video data file reaches the upper limit, the preset video data file switching condition is met.
[0037] In conjunction with any one of the eighth possible implementation manners of the first aspect, in a tenth possible implementation manner of the first aspect, during the recording process, if a new surveillance video event triggers recording, and the number of surveillance video events corresponding to the current video data file reaches an upper limit, and a preset video data file switching condition is met, the method further includes:
[0038] Apply for a new surveillance video event index ID corresponding to the video data file to be switched for the new surveillance video event.
[0039] A second aspect of an embodiment of the present application provides a surveillance video retrieval device, the device comprising:
[0040] a retrieval request receiving unit, configured to receive a surveillance video retrieval request, wherein the surveillance video retrieval request includes a first time range and a type range;
[0041] a preliminary search unit, configured to perform a preliminary search based on the first time range to determine an index ID range of a first surveillance video event index set associated with the first time range;
[0042] The second retrieval unit is used to perform a second retrieval in the surveillance video events corresponding to the index ID range, determine the second surveillance video event index set associated with the type range in batches, and return the second surveillance video event index set to the retrieval terminal in sequence according to the batches.
[0043] In conjunction with the second aspect, in a first possible implementation manner of the second aspect, the preliminary search unit includes:
[0044] a video data file ID determining subunit, configured to determine a video data file ID associated with the first time range, wherein the video data file ID is an ID of a video data file obtained by dividing the video data;
[0045] The index ID range determining subunit is configured to determine an index ID range of a first surveillance video event index set associated with the first time range based on the video data file ID associated with the first time range.
[0046] In conjunction with the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, the video data file ID determination subunit includes:
[0047] A time range determination module is used to sequentially retrieve the video data file IDs and determine a second time range corresponding to each retrieved video data file ID based on a pre-stored correspondence between the video data file IDs and the time ranges;
[0048] The video data file ID determining module is configured to determine the video data file ID associated with the first time range according to a temporal overlap between the second time range and the first time range.
[0049] In combination with the first possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the index ID range determination subunit includes:
[0050] a position determination module, configured to determine, based on the video data file ID associated with the first time range, a position of the surveillance video event index group corresponding to the video data file ID in the video index file;
[0051] An index ID range determination module is used to sequentially retrieve surveillance video event indexes according to the positions of the surveillance video event index groups, and determine the index ID range of the first surveillance video event index set associated with the first time range based on the overlapping relationship between the third time range corresponding to the surveillance video event index and the first time range.
[0052] In combination with the third possible implementation manner of the second aspect, in a fourth possible implementation manner of the second aspect, the index ID range determination module includes:
[0053] a minimum ID determination submodule, configured to determine, if a third time range corresponding to a surveillance video event index overlaps with the first time range, and the surveillance video event index is the first surveillance video event index in the surveillance video event index group that overlaps with the first time range, determine that the ID of the surveillance video event index is the minimum ID of the index ID range;
[0054] A maximum ID determination module is used to update the ID of the surveillance video event index to the maximum ID of the index ID range if the third time range corresponding to the surveillance video event index overlaps with the first time range, and the surveillance video event index is the surveillance video event index after the determined minimum ID, until the comparison of all surveillance video event indexes in the surveillance video event index group is completed, the maximum ID of the index ID range is obtained, and the index ID range of the first surveillance video event index set is determined based on the minimum ID and the maximum ID.
[0055] In conjunction with the second aspect, in a fifth possible implementation manner of the second aspect, the second retrieval unit includes:
[0056] a position range determining subunit, configured to determine a position range of the first surveillance video event index set in the video index file according to the index ID range;
[0057] The screening subunit is configured to sequentially retrieve surveillance video event indexes according to the position range, and screen the surveillance video event indexes according to the type range to obtain the second surveillance video event index set.
[0058] In conjunction with the second aspect, in a sixth possible implementation manner of the second aspect, the second retrieval unit includes:
[0059] A quantity determination subunit, configured to determine the number of surveillance video event indexes included in a single batch according to the size of the cache;
[0060] The batch determination subunit is used to determine the batch to which the surveillance video event indexes in the second surveillance video event index set belong according to the number of surveillance video event indexes included in a single batch, and write the determined batches into the cache batch by batch.
[0061] In combination with any one of the second aspect to the sixth possible implementation manner of the second aspect, in a seventh possible implementation manner of the second aspect, the apparatus further includes:
[0062] The first jump processing unit is used to apply for a new set of surveillance video event indexes if a backward time jump occurs during the video recording process. When the sum of the number of first surveillance video events corresponding to the current video data file and the number of newly applied surveillance video event indexes is greater than a first quantity threshold, the newly applied first number of surveillance video event indexes are corresponded to the current video data file, and the second number of surveillance video event indexes are corresponded to the switched video data file; if the sum is less than the first quantity threshold, all the newly applied surveillance video event indexes are corresponded to the current video data file, wherein the first quantity threshold is the upper limit of the number of surveillance video events corresponding to a single video data file, the first quantity is the difference between the first quantity threshold and the first number of surveillance video events, and the second quantity is the difference between the newly applied number of surveillance video event indexes and the first quantity;
[0063] The second jump processing unit is used to switch to the next video data file if a forward time jump occurs, end the third number of surveillance video events that have not yet ended, and newly apply for the third number of surveillance video event index IDs corresponding to the switched video data file.
[0064] A third aspect of an embodiment of the present application provides a surveillance video retrieval device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the surveillance video retrieval device implements the method described in any one of the first aspects.
[0065] A fourth aspect of the embodiments of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the method in the above-mentioned first aspect or its various implementations.
[0066] A fifth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of the first aspects are implemented.
[0067] A sixth aspect of the present application provides a chip for implementing the methods described in each implementation of the first aspect. Specifically, the chip includes a processor configured to retrieve and execute a computer program from a memory, causing a device equipped with the chip to execute the methods described in the first aspect or its implementations.
[0068] The beneficial effects of the embodiments of the present application compared with the prior art are: after receiving a surveillance video retrieval request, the embodiments of the present application perform a preliminary search based on the first time range included in the retrieval request, determine the index ID range of the first surveillance video event index set associated with the first time range, and then perform a secondary search in the surveillance video events corresponding to the index ID range, determine in batches the second surveillance video event index set associated with the type range included in the surveillance video retrieval request, and return the second surveillance video event index set to the retrieval terminal in batches. Since the index ID range obtained by the preliminary retrieval only occupies a very small cache, and the second surveillance video event index set is generated in batches and written to the cache, without increasing the cache, it can effectively avoid the illusion of surveillance video events and video loss caused by insufficient cache, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0070] Figure 1 This is a schematic diagram of an implementation flow of a surveillance video retrieval method provided in an embodiment of the present application;
[0071] Figure 2 This is a flowchart of a surveillance video event index processing when switching video data files provided by an embodiment of the present application;
[0072] Figure 3 This is a flowchart of a surveillance video event index processing when switching video data files provided by an embodiment of the present application;
[0073] Figure 4 This is a schematic diagram of an implementation flow of determining a video data file ID associated with a first time range provided by an embodiment of the present application;
[0074] Figure 5 Schematic diagram of a surveillance video retrieval device provided in an embodiment of the present application;
[0075] Figure 6 It is a schematic diagram of a surveillance video retrieval device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0076] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0077] In order to illustrate the technical solution described in this application, specific embodiments are provided below.
[0078] IPC (Internet Protocol Camera) supports multiple detection functions, each corresponding to a variety of surveillance events. Multiple surveillance events can trigger IPC recording simultaneously. For example, when a person enters the detection area of an IPC's surveillance image, multiple surveillance events, including motion detection, intrusion detection, entry detection, and human presence detection, can trigger IPC recording. Only one copy of the recorded data is ultimately stored, divided into separate clips based on the start and end time ranges of each surveillance event. These clips can overlap in time.
[0079] The time range of a video clip corresponding to a surveillance recording event can generally be divided into three parts: pre-recording time, detection trigger time, and extended recording time. The detection trigger time refers to the time from when the detection function is triggered to when it ends; the pre-recording time refers to the time period during which recording begins before the detection function is triggered; and the extended recording time refers to the time period during which recording continues after the detection function ends. Both pre-recording time and extended recording time are user-configurable recording options on the IPC. Recording operations within different time ranges can be considered to be in pre-recording, event-triggered, and extended recording states, respectively.
[0080] Generally, IPC merges video clips with overlapping time ranges corresponding to the same type of surveillance recording event. This means that if a detection function is triggered, or has ended but recording is in the extended state, and an object or condition reappears to trigger the detection function, the recording will exit the extended state (if the recording is currently in the extended state) and re-enter, or remain in the event-triggered state, and the video clip corresponding to the current surveillance recording event will be considered to be continuing.
[0081] When the IPC receives a retrieval request from a client, it first searches all stored surveillance video events, filters them based on the client's desired playback time range (e.g., one day) and the type of surveillance video event. It then saves the retrieval results into a buffer. The IPC typically allocates memory space to create a buffer to store the surveillance video event retrieval results. Because the IPC has limited memory space, it typically limits the maximum buffer length by limiting the maximum number of surveillance video event retrieval results to minimize memory usage.
[0082] However, as IPC supports more and more detection functions, and users are allowed to shorten recording delays, the probability of overlapping video clips within the same time range for surveillance video events of the same type decreases. This results in a potentially large number of surveillance video events within a given time range (e.g., a day). Limiting the maximum number of surveillance video event retrieval results may prevent the buffer from storing all retrieval results for surveillance video events within a given time range (e.g., a day), resulting in some data loss. This creates the illusion of video loss and severely impacts the user experience.
[0083] In order to solve the above problems, the present application embodiment proposes a surveillance video retrieval method, such as Figure 1 As shown, the implementation process of this method includes:
[0084] In S101 , a surveillance video retrieval request is received, where the surveillance video retrieval request includes a first time range and a type range.
[0085] The surveillance video retrieval request in the embodiment of the present application may be a surveillance video event query request, or may be a surveillance video event download request or playback request.
[0086] In the embodiment of the present application, before receiving a surveillance video retrieval request, the IPC stores surveillance video events and video data according to a predetermined surveillance video event storage mechanism.
[0087] IPC video data and surveillance video events are stored in different files: video data is stored in the video data file, and surveillance video events are stored in the video index file. The length of the video data file is a preset fixed value. The video data stored in the video data file corresponds to a set of surveillance video events with an upper limit. The upper limit of the number of surveillance video events corresponding to a single video data file is calculated as follows:
[0088]
[0089] Among them, C 监控录像事件 Indicates the upper limit of the number of surveillance video events corresponding to a single video data file, L 录像数据文件 Indicates the length of a single video data file, L 监控录像事件 Indicates the length of the video data corresponding to a preset single surveillance video event, and S indicates the magnification factor that allows the video data file to correspond to a larger number of surveillance video events. For example: L 录像数据文件 The value is 256MB, L 监控录像事件 The value is 1MB, and S is 3.0, then the calculated C 监控录像事件 The value is 756, which means that a 25BMB video data file can correspond to a maximum of 756 surveillance video events.
[0090] When storing surveillance video events on an SD card, the upper limit of the number of stored surveillance video events is calculated as follows:
[0091] C 全部监控录像事件 =C 监控录像事件 *C 录像数据文件 .
[0092] Among them, C 全部监控录像事件 Indicates the upper limit of the number of surveillance video events stored in the SD card, C 监控录像事件 Indicates the upper limit of the number of surveillance video events corresponding to a single video data file, that is, the first quantity threshold, C 录像数据文件 Indicates the number of video data files stored in the SD card.
[0093] Surveillance video events are stored using surveillance video event indexes. One surveillance video event index stores one surveillance video event. The surveillance video event index can be managed using an ID. The value range of the surveillance video event index ID is 0 to C.全部监控录像事件 -1. Video data files can also be managed using IDs. The value range of the video data file ID is 0 to C 录像数据文件 -1.
[0094] When a new surveillance video event triggers recording, the surveillance video event index ID is incremented by 1, and the new surveillance video event index represented by the incremented surveillance video event index ID is selected to store the new surveillance video event. That is, the surveillance video event index ID is incremented sequentially to store surveillance video events. The increment is continuous, and there is no unused ID between any two used IDs. If the surveillance video event index ID exceeds the value range, it will restart from 0, and the old surveillance video event index will be overwritten by the new surveillance video event index. The calculation method for updating the surveillance video event index ID is as follows:
[0095] ID 下一个监控录像事件索引 =(ID 当前监控录像事件索引 +1)%C 全部监控录像事件 .
[0096] Where ID 下一个监控录像事件索引 Indicates the surveillance video event index ID to be used, ID 当前监控录像事件索引 Indicates the latest surveillance video event index ID currently in use.
[0097] The number of actual surveillance video events corresponding to a video data file is only allowed to be less than or equal to C 监控录像事件 Therefore, the total number of actual surveillance video events corresponding to all video data files in the SD card should be less than or equal to C 全部监控录像事件 .
[0098] When storing video data, if any of the following switching conditions is met, it is necessary to switch to the next video data file for storage:
[0099] Switching condition 1: The current video data file is full.
[0100] Switching condition 2: A new surveillance video event occurs, making the number of actual surveillance video events corresponding to the current video data file greater than C 监控录像事件 .
[0101] When switching video data files, the video data file ID is incremented by 1, and the video data file represented by the incremented video data file ID is selected as the next video data file after switching, that is, the video data files are switched in the order of increasing video data file ID. When the video data file ID exceeds the value range, it means that all video data files on the SD card are full. If the video recording supports and the loop overwrite function is turned on, the video data file ID will restart from 0 and the old video data file will be overwritten by the new video data; otherwise, the video recording will stop. The calculation method for updating the video data file ID is as follows:
[0102] ID 下一个录像数据文件 =(ID 当前录像数据文件 +1)%C 录像数据文件 .
[0103] Where ID 下一个录像数据文件 Indicates the ID of the next video data file to be switched. 当前录像数据文件 Indicates the ID of the video data file currently in use.
[0104] When switching to the next video data file, if the switching condition 1 above is met and a loop overwrite is not required, all currently recorded surveillance video events need to be segmented. That is, the current time is used as the end time of all currently recorded surveillance video events. Then, a new surveillance video event index equal to the number of currently recorded surveillance video events is requested for storage, and the current time is used as the start time of the requested surveillance video event index. The type and number of currently recorded surveillance video events remain unchanged before and after the switch, but each surveillance video event will correspond to two video segments before and after the switch, belonging to two different video data files with different time ranges.
[0105] For example: before switching, there are n surveillance video events being recorded, and the corresponding surveillance video event index IDs are m~m+(n-1). After switching, n surveillance video events are still used, and the corresponding surveillance video event index IDs are m+n~m+(2*n-1). These n surveillance video events continue to be stored through the n surveillance video event indexes after switching.
[0106] When it is necessary to switch to the next video data file, if the switching condition 2 is met and there is no need to perform a cyclic overwrite, it is also necessary to first perform the segmentation processing of the surveillance video event, and then increase the surveillance video event index ID by the number of newly added surveillance video event indexes. The new surveillance video event is corresponded to the switched video data file.
[0107] For example, before the switch, there are k surveillance video events being recorded, and the corresponding surveillance video event index IDs are m+n to m+(2*n-1). After the switch, the same k surveillance video events are used, and the corresponding surveillance video event index IDs are m+2*n to m+2*n+(k-1). These k surveillance video event indexes continue to be used to store these k surveillance video events. If j new surveillance video event indexes are added, the corresponding surveillance video event index IDs become m+2*n to m+2*n+(k-1)+j.
[0108] When it is necessary to switch to the next video data file, if a cyclic overwrite is required, the group of surveillance video event indexes corresponding to the next video data file to be switched will be deleted first, and then the surveillance video event segmentation processing will be performed based on whether the switching condition one or the switching condition two is met, or the surveillance video event segmentation processing will be performed and then the surveillance video event index ID will be automatically increased by the number of newly added surveillance video event indexes.
[0109] In possible implementations, if a time jump occurs during recording, there are two different processing methods depending on the direction of the time jump:
[0110] First, when time jumps backward (time becomes longer), it is necessary to first apply for a new set of surveillance video event index IDs. If the sum of the number of surveillance video events corresponding to the current video data file and the number of newly applied surveillance video event index IDs is greater than the first quantity threshold (the upper limit of the number of surveillance video events corresponding to a single video data file), the switching condition 2, that is, the video data file switching condition, is met. Then, the part of the above sum that is less than or equal to the first quantity threshold, that is, the newly applied first quantity of surveillance video event indexes, will continue to be matched by the current video data file; then perform the surveillance video event segmentation processing; then, the part greater than the first quantity threshold, that is, the newly applied second quantity of surveillance video event indexes, will be transferred to the switched video data file; if the video data file switching condition is not met, then continue to use the current video data file. Among them, the first quantity can be the difference between the first quantity threshold and the first number of surveillance video events, that is, the difference between the first quantity threshold and the first number of surveillance video events, and the second quantity can be the difference between the newly applied number of surveillance video event indexes and the first quantity.
[0111] When jumping forward (time becomes smaller), in order to prevent the corresponding video clip from being unable to be found in the video data file according to the surveillance video event, it is necessary to switch to the next video data file, delete the surveillance video event index corresponding to the next video data file to be switched, and then perform the segmentation processing of the surveillance video event.
[0112] In an embodiment of the present application, the operation of cyclically overwriting the video data file will precede the overwriting of the surveillance video event index. After deleting the surveillance video event index corresponding to the next video data file to be switched, there is no need to delete the surveillance video event index to be overwritten.
[0113] During recording, both the video data file ID and the surveillance video event index ID increase sequentially. Any video data file ID can correspond to a group of surveillance video event index IDs. This group of surveillance video event index IDs corresponding to a video data file ID is called a surveillance video event index group, and the surveillance video event index IDs within a group increase sequentially. The two surveillance video event index groups corresponding to any two consecutive video data file IDs also satisfy a sequentially increasing relationship. There are no unused surveillance video event index IDs between the two surveillance video event index groups, nor are there surveillance video event indexes corresponding to video data file IDs other than the two consecutive video data file IDs.
[0114] According to the above mechanism, the monitoring video event index processing flow when the video data file that meets the switching condition 1 is switched is as follows: Figure 2 Shown, including:
[0115] In S201 , video recording starts.
[0116] The IPC (network camera) begins acquiring video data from the monitored area, which will be used for subsequent storage and event retrieval. Simultaneously, the IPC analyzes the acquired video data based on user-defined detection functions (such as motion detection and intrusion detection) to determine whether a corresponding surveillance recording event has been triggered.
[0117] In S202, a set of video data is obtained.
[0118] A set of video data can be obtained according to a predetermined data length to be stored in a video data file.
[0119] In S203, it is determined whether the current video data file is full.
[0120] Determine whether the video data file currently being used, that is, the video data file currently being written, is full. If the current video data file is full, execute S204; if not, execute S209.
[0121] In S204, the ID of the video data file to be switched is calculated.
[0122] If the current video data file is full, calculate the ID of the video data file to be switched, which can be expressed as follows:
[0123] ID 下一个录像数据文件=(ID 当前录像数据文件 +1)%C 录像数据文件 .
[0124] Where ID 下一个录像数据文件 Indicates the ID of the next video data file to be switched. 当前录像数据文件 Indicates the ID of the video data file currently in use.
[0125] In S205 , it is determined whether loop coverage needs to be performed.
[0126] If loop coverage needs to be performed, execute S206; otherwise, execute S207.
[0127] In S206, the surveillance video event index corresponding to the video data file to be switched is deleted.
[0128] When a cyclic overwrite is required, the surveillance video event index corresponding to the video data file to be switched is deleted, and S207 is executed.
[0129] In S207, all surveillance video events corresponding to the current video data file are stopped.
[0130] When the loop overwrite is not required, all surveillance video events corresponding to the current video data file can be stopped and S208 can be executed. In addition, if the video data file to be switched already has video data stored (that is, all video data files are full), but the loop overwrite is not allowed, after executing S207, jump to S211, that is, end the video recording.
[0131] In S208 , a new surveillance video event index ID corresponding to the video data file to be switched is requested for the same type of surveillance video event.
[0132] Apply for a new surveillance video event index ID of the same type for all currently stopped surveillance video events.
[0133] In S209 , the storage of the video data and the surveillance video events is processed.
[0134] The video event index corresponding to the new video event index ID is stored in the video index file, and the video data is stored in the switched video data file.
[0135] In S210 , it is determined whether the video recording is finished.
[0136] If the video recording has not ended, the process returns to S102 to continue acquiring video data. If the video recording has ended, the process proceeds to S211.
[0137] In S211 , the video recording is ended.
[0138] Ending the recording can release the memory buffer, clean up temporary resources, close the recording data file, etc.
[0139] The index processing flow of surveillance video event when switching surveillance video event that meets switching condition 2 is as follows: Figure 3 Shown, including:
[0140] In S301 , video recording starts.
[0141] The IPC (network camera) begins acquiring video data from the monitored area, which will be used for subsequent storage and event retrieval. Simultaneously, the IPC analyzes the acquired video data based on user-defined detection functions (such as motion detection and intrusion detection) to determine whether a corresponding surveillance recording event has been triggered.
[0142] In S302 , a new surveillance video recording event triggers video recording.
[0143] New surveillance video events may include any of events such as motion detection events, area intrusion events, or area entry events.
[0144] In S303 , it is determined whether the number of surveillance video events corresponding to the current video data file has reached a first number threshold.
[0145] If the number of surveillance video events corresponding to the current video data file has reached the first threshold, that is, C 监控录像事件 , then execute S304; if it does not reach the first quantity threshold, then execute S310.
[0146] In S304, the ID of the video data file to be switched is calculated.
[0147] If the current video data file is full, calculate the ID of the video data file to be switched, which can be expressed as follows:
[0148] ID 下一个录像数据文件 =(ID 当前录像数据文件 +1)%C 录像数据文件 .
[0149] Where ID 下一个录像数据文件 Indicates the ID of the next video data file to be switched. 当前录像数据文件 Indicates the ID of the video data file currently in use.
[0150] In S305 , it is determined whether loop coverage needs to be performed.
[0151] If loop coverage needs to be performed, execute S306; otherwise, execute S307.
[0152] In S306, the surveillance video event index corresponding to the video data file to be switched is deleted.
[0153] When a cyclic overwrite is required, the surveillance video event index corresponding to the video data file to be switched is deleted, and S307 is executed.
[0154] In S307, all surveillance video events corresponding to the current video data file are stopped.
[0155] If loop overwriting is not required, all surveillance video events corresponding to the current video data file can be stopped and S308 can be executed. In addition, if the video data file to be switched already contains video data (i.e., all video data files are full), but loop overwriting is not allowed, after executing S307, the process jumps to S312 to end the video recording.
[0156] In S308 , a new surveillance video event index ID corresponding to the video data file to be switched is requested for the same type of surveillance video event.
[0157] Apply for a new surveillance video event index ID of the same type for all currently stopped surveillance video events.
[0158] In S309 , a new surveillance video event index ID corresponding to the video data file to be switched is requested for the new surveillance video event.
[0159] Based on the new surveillance video event index ID applied for in S308 , a corresponding surveillance video event index ID is applied for the new surveillance video event.
[0160] In S310 , the storage of video data and surveillance video events is processed.
[0161] The video event index corresponding to the new video event index ID is stored in the video index file, and the video data is stored in the switched video data file.
[0162] In S311, it is determined whether the video recording is finished.
[0163] If the video recording has not ended, the process returns to S302 to continue acquiring video data. If the video recording has ended, the process proceeds to S312.
[0164] In S312, the video recording is ended.
[0165] Ending the recording can release the memory buffer, clean up temporary resources, close the recording data file, etc.
[0166] In S102, a preliminary search is performed based on the first time range to determine the index ID range of the first surveillance video event index set associated with the first time range.
[0167] To facilitate retrieval, when processing surveillance video event storage, embodiments of the present application may additionally store parameter information corresponding to the currently stored video data file in the IPC memory: the data file index ID range and the video data file ID time range. The data file index ID range includes the minimum surveillance video event index ID and the maximum surveillance video event index ID. The video data file ID time range includes the minimum surveillance video event start time and the maximum surveillance video event end time.
[0168] The data file's index ID range identifies the corresponding surveillance video event index group for the video data file, and the video data file ID's time range identifies the total start and end time range for the corresponding surveillance video events. Both are saved and updated when the video data file processes the surveillance video event index storage. They are associated with the video data file ID and are read from the IPC memory using the video data file ID when used.
[0169] After the SD card is inserted into the IPC, it traverses all the surveillance video event indexes in the video index file, reconstructs the index ID range of each video data file and the time range of the video data file ID, and saves them to the IPC memory.
[0170] During the initial search, the video data file ID associated with the first time range can be first determined, and then the index ID range of the first surveillance video event index set associated with the first time range can be determined based on the data file ID. The video data file ID is the ID of the video data file obtained by dividing the video data.
[0171] When determining the video data file ID associated with the first time range, you can do the following: Figure 4 Shown, including:
[0172] In S401, the video data file IDs are retrieved in sequence, and the second time range corresponding to each retrieved video data file ID is determined based on the pre-stored correspondence between the video data file ID and the time range.
[0173] The video data file IDs can be retrieved in order from smallest to largest.
[0174] In S402, based on the time overlap between the second time range and the first time range, the video data file ID associated with the first time range is determined.
[0175] The second time range corresponding to the sequentially retrieved video data file IDs is compared with the first time range to determine whether there is any overlap between the two. If there is an overlap, the video data file corresponding to the second time range is considered to be related to the first time range, and the video data ID is determined to be associated with the first time range.
[0176] After determining the associated video data file ID, the index ID range of the associated first surveillance video event index set is retrieved according to the associated video data file ID. The position of the surveillance video event index group corresponding to the video data file ID in the video index file can be determined first according to the video data file ID associated with the first time range.
[0177] The starting position of the surveillance video event index group corresponding to the video data file in the video index file can be expressed as:
[0178] O 监控录像事件索引组 =
[0179] O 首个监控录像事件索引 +ID 监控录像事件索引组最小 *L 监控录像事件索引 .
[0180] Among them, O 监控录像事件索引组 Indicates the starting position of the surveillance video event index group corresponding to the current video data file ID in the video index file, 首个监控录像事件索引 Indicates the starting position of the first surveillance video event index in the video index file in the SD card, ID 监控录像事件索引组最小 Indicates the minimum surveillance video event index ID in the surveillance video event index group, L 监控录像事件索引 Indicates the storage length of a single surveillance video event index in the video index file.
[0181] After determining the starting position of the surveillance video event index group corresponding to the current video data file ID in the video index file, the total length of the content of the surveillance video event index group corresponding to the current video data file ID can be further determined, which can be expressed as:
[0182] L 监控录像事件索引组 =
[0183] (ID 监控录像事件索引组最大 -ID 监控录像事件索引组最小 )*L 监控录像事件索引 .
[0184] Among them, L 监控录像事件索引组 Indicates the total length of the content of the surveillance video event index group corresponding to the current video data file ID. 监控录像事件索引组最大 Indicates the maximum surveillance video event index ID in the surveillance video event index group.
[0185] According to the starting position of the surveillance video event index group corresponding to the current video data file ID in the video index file, combined with the total length of the content of the surveillance video event index group corresponding to the current video data file ID, the ending position of the surveillance video event index group corresponding to the current video data file ID in the video index file can be determined, that is, the starting and ending positions of the surveillance video event index group in the video index file can be obtained.
[0186] The surveillance video event indexes are taken out in sequence according to the start and end positions of the surveillance video event index group, and the index ID range of the first surveillance video event index set associated with the first time range is determined according to the overlapping relationship between the third time range corresponding to the surveillance video event index and the first time range.
[0187] Based on the position of the surveillance video event index group in the video index file, the surveillance video event indexes are retrieved one by one to obtain the third time range included in the surveillance video event index, i.e., the start and end time range of the surveillance video event recorded in the surveillance video event index. The third time range is compared with the first time range. If the three time ranges overlap, the surveillance video event index is considered to belong to the first surveillance video event index set.
[0188] When determining the index ID range of the first surveillance video event index set, if a surveillance video event index associated with the first time range is detected, and the surveillance video event index is the first surveillance video event index in the surveillance video event index group that overlaps with the first time range, then the ID of the surveillance video event index is determined to be the minimum ID in the index ID range.
[0189] If a surveillance video event index associated with the first time range is detected as a surveillance video event index subsequent to the surveillance video event index with the smallest ID, the ID of the surveillance video event index is updated to the maximum ID of the index ID range. This maximum ID is continuously updated until all surveillance video event indexes in the surveillance video event index group are compared, resulting in the maximum ID of the index ID range. The index ID range of the first surveillance video event index set is then determined based on the minimum and maximum IDs.
[0190] In S103, a second search is performed in the surveillance video events corresponding to the index ID range, and a second surveillance video event index set associated with the type range is determined in batches, and the second surveillance video event index set is returned to the search terminal in sequence according to the batches.
[0191] Based on the determined index ID range, the position range of the first surveillance video event index set in the video index file can be determined, and then the surveillance video event indexes are taken out in sequence based on the position range, and the surveillance video event indexes are filtered by type range to obtain the second surveillance video event index set.
[0192] The starting position of the first surveillance video event index set in the position range of the video index file can be expressed as:
[0193] O 第一监控录像事件索引集合 =
[0194] O 首个监控录像事件索引 +ID 第一监控录像事件索引集合最小 *L 监控录像事件索引 .
[0195] Among them O 第一监控录像事件索引集合 Indicates the starting position of the first surveillance video event index set in the video index file, ID 第一监控录像事件索引集合最小 Indicates the minimum surveillance video event index ID in the first surveillance video event index set.
[0196] L 第一监控录像事件索引集合 =
[0197] (ID 第一监控录像事件索引集合最大 -ID 第一监控录像事件索引集合最小 )*L 监控录像事件索引 .
[0198] Among them L 第一监控录像事件索引集合 Indicates the total length of the content of the first surveillance video event index set, ID 第一监控录像事件索引集合最大 Indicates the maximum surveillance video event index ID in the first surveillance video event index set.
[0199] The ending position of the first surveillance video event index set in the video index file can be determined based on the starting position of the first surveillance video event index set in the video index file and the total length of the first surveillance video event index set. The position range of the first surveillance video event index set in the video index file is determined based on the starting position and ending position of the first surveillance video event index set in the video index file.
[0200] According to the position range of the first surveillance video event index set in the video index file, the surveillance video event index can be taken out in sequence, and compared with the type range of the retrieval request based on the type information recorded in the surveillance video event index. If the type of the surveillance video event index belongs to the type range, it is determined that the surveillance video event index meets the retrieval requirements.
[0201] In the embodiment of the present application, when determining the second surveillance video event index set in batches, the surveillance video event indexes that meet the retrieval requirements can be added to the second surveillance video event index set one by one. If the number of surveillance video event indexes in the second surveillance video event index set reaches a preset cache threshold, the addition of surveillance video event indexes that meet the retrieval requirements is suspended, and the cached second surveillance video event index set is first returned to the retrieval terminal. The data in the second surveillance video event index set is then cleared, and surveillance video event indexes that meet the retrieval requirements continue to be added until all surveillance video event indexes in the first surveillance video event index set are screened.
[0202] Through the embodiment of the present application, the surveillance video event index group is divided into video data files. When the video data file is switched, the surveillance video event index is updated to continue recording the surveillance video events, so that the surveillance video event index does not need to record more than two video data file IDs, simplifying the surveillance video event index content.
[0203] When the time jumps forward, the video data file is switched. The end time of the surveillance video event recorded by the surveillance video event index will not be reduced, so that the start time of all surveillance video event indexes in the surveillance video event index group corresponding to a video data file is incremental.
[0204] For the two groups of surveillance video event index groups corresponding to two video data files with consecutive IDs, the surveillance video event index IDs are continuously increased. There are no unused surveillance video event index IDs or those belonging to the third video data file in the middle, which simplifies the calculation complexity of the starting position of the surveillance video event index in the video index file.
[0205] Use the surveillance video event index set to correspond to a group of surveillance video event indexes that meet the search conditions. The first search only generates the first surveillance video event index set, and the second search provides complete results that meet the query conditions in batches. This not only reduces memory usage, but also enables the client to obtain all surveillance video events that meet the query conditions.
[0206] The incremental nature of the start time of all surveillance video event indexes in the surveillance video event index group ensures that a surveillance video event index group only has one first surveillance video event index set, further reducing the number of first surveillance video event index sets and simplifying the processing logic.
[0207] The surveillance video event indexes in the first surveillance video event index set are sorted in ascending order of start time, thereby avoiding the problem that the start time of the surveillance video event may become smaller in the query result provided to the client.
[0208] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0209] Figure 5 A surveillance video retrieval device provided in an embodiment of the present application includes:
[0210] The retrieval request receiving unit 501 is configured to receive a surveillance video retrieval request, where the surveillance video retrieval request includes a first time range and a type range.
[0211] The preliminary search unit 502 is configured to perform a preliminary search based on the first time range to determine an index ID range of a first surveillance video event index set associated with the first time range.
[0212] The second retrieval unit 503 is used to perform a second retrieval in the surveillance video events corresponding to the index ID range, determine the second surveillance video event index set associated with the type range in batches, and return the second surveillance video event index set to the retrieval terminal in sequence according to the batches.
[0213] Figure 5 The surveillance video retrieval device shown is Figure 1 The surveillance video event retrieval method shown corresponds to this.
[0214] Figure 6 This is a schematic diagram of a surveillance video retrieval device provided in an embodiment of the present application. Figure 6 As shown, the surveillance video retrieval device 6 of this embodiment includes: a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and executable on the processor 60, such as a surveillance video retrieval program. When the processor 60 executes the computer program 62, it implements the steps of the aforementioned surveillance video retrieval method embodiments. Alternatively, when the processor 60 executes the computer program 62, it implements the functions of the modules / units in the aforementioned device embodiments.
[0215] For example, the computer program 62 may be divided into one or more modules / units, which are stored in the memory 61 and executed by the processor 60 to implement the present application. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 62 in the surveillance video retrieval device 6.
[0216] The surveillance video retrieval device 6 can be a computing device such as a desktop computer, a notebook, a palmtop computer, a cloud server, etc. The surveillance video retrieval device can include, but is not limited to, a processor 60 and a memory 61. It can be understood by those skilled in the art that Figure 6 It is only an example of a surveillance video retrieval device 6 and does not constitute a limitation on the surveillance video retrieval device 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the surveillance video retrieval device may also include input and output devices, network access devices, buses, etc.
[0217] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0218] The memory 61 can be an internal storage unit of the surveillance video retrieval device 6, such as a hard disk or memory of the surveillance video retrieval device 6. The memory 61 can also be an external storage device of the surveillance video retrieval device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the surveillance video retrieval device 6. Furthermore, the memory 61 can also include both an internal storage unit of the surveillance video retrieval device 6 and an external storage device. The memory 61 is used to store the computer program and other programs and data required by the surveillance video retrieval device. The memory 61 can also be used to temporarily store data that has been output or is about to be output.
[0219] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0220] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0221] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0222] In the embodiments provided in this application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are merely illustrative. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0223] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0224] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0225] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by hardware related to computer program instructions. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0226] In addition, an embodiment of the present application also provides a computer program product, which, when running on a computer, enables the computer to execute the methods in the above-mentioned implementation manners.
[0227] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A surveillance video retrieval method, characterized in that: The method comprises: receiving a surveillance video retrieval request, wherein the surveillance video retrieval request includes a first time range and a type range; Perform a preliminary search based on the first time range to determine an index ID range of a first surveillance video event index set associated with the first time range; A second search is performed in the surveillance video events corresponding to the index ID range, a second surveillance video event index set associated with the type range is determined in batches, and the second surveillance video event index set is returned to the search terminal in sequence according to the batches.
2. The method according to claim 1, characterized in that Performing a preliminary search based on the first time range to determine an index ID range of a first surveillance video event index set associated with the first time range includes: Determining a video data file ID associated with the first time range, where the video data file ID is an ID of a video data file obtained by dividing the video data; According to the video data file ID associated with the first time range, an index ID range of a first surveillance video event index set associated with the first time range is determined.
3. The method according to claim 2, characterized in that Determining the video data file ID associated with the first time range includes: Sequentially extracting the video data file IDs, and determining a second time range corresponding to each extracted video data file ID based on a pre-stored correspondence between the video data file ID and the time range; According to the time overlap relationship between the second time range and the first time range, the video data file ID associated with the first time range is determined.
4. The method according to claim 2, characterized in that Determining, based on the video data file ID associated with the first time range, an index ID range of a first surveillance video event index set associated with the first time range includes: Determining, based on the video data file ID associated with the first time range, a position of the surveillance video event index group corresponding to the video data file ID in the video index file; The surveillance video event index is taken out in sequence according to the position of the surveillance video event index group, and the index ID range of the first surveillance video event index set associated with the first time range is determined according to the overlapping relationship between the third time range corresponding to the surveillance video event index and the first time range.
5. The method according to claim 4, characterized in that Determining an index ID range of a first surveillance video event index set associated with the first time range based on an overlapping relationship between a third time range corresponding to the surveillance video event index and the first time range includes: If the third time range corresponding to the surveillance video event index overlaps with the first time range, and the surveillance video event index is the first surveillance video event index in the surveillance video event index group that overlaps with the first time range, then determining the ID of the surveillance video event index to be the minimum ID in the index ID range; If the third time range corresponding to the surveillance video event index overlaps with the first time range, and the surveillance video event index is the surveillance video event index after the determined minimum ID, then the ID of the surveillance video event index is updated to the maximum ID of the index ID range until the comparison of all surveillance video event indexes in the surveillance video event index group is completed, and the maximum ID of the index ID range is obtained. The index ID range of the first surveillance video event index set is determined based on the minimum ID and the maximum ID.
6. The method according to claim 1, characterized in that Performing a second search in the surveillance video events corresponding to the index ID range to determine a second surveillance video event index set associated with the type range includes: Determine the location range of the first surveillance video event index set in the video index file according to the index ID range; The surveillance video event indexes are sequentially retrieved according to the position range, and the surveillance video event indexes are filtered according to the type range to obtain the second surveillance video event index set.
7. The method according to any one of claims 1 to 6, characterized in that Before performing a preliminary search based on the first time range to determine the index ID range of the first surveillance video event index set associated with the first time range, the method further includes: During the recording process, if a backward time jump occurs, a new set of surveillance video event indexes is applied for. When the sum of the first surveillance video event number corresponding to the current video data file and the newly applied surveillance video event index number is greater than the first quantity threshold, the newly applied first number of surveillance video event indexes are corresponded to the current video data file, and the second number of surveillance video event indexes are corresponded to the switched video data file; if the sum is less than the first quantity threshold, all the newly applied surveillance video event indexes are corresponded to the current video data file, wherein the first quantity threshold is the upper limit of the number of surveillance video events corresponding to a single video data file, the first quantity is the difference between the first quantity threshold and the first number of surveillance video events, and the second quantity is the difference between the newly applied number of surveillance video event indexes and the first quantity; If a forward time jump occurs, the next video data file is switched to, the third number of surveillance video events that have not yet ended are ended, and a third number of surveillance video event index IDs are newly applied for corresponding to the switched video data file.
8. The method according to any one of claims 1 to 6, characterized in that Before performing a preliminary search based on the first time range to determine the index ID range of the first surveillance video event index set associated with the first time range, the method further includes: During the recording process, detect whether the preset recording data file switching conditions are met; When the preset video data file switching condition is met, all surveillance video events corresponding to the current video data file are stopped, and a new surveillance video event index ID corresponding to the video data file to be switched is applied for the same type of surveillance video events.
9. The method according to claim 8, characterized in that During the recording process, the preset recording data file switching conditions are detected, including: During the recording process, if a set of surveillance video data is obtained and the current video data file is full, the preset video data file switching condition is met; During the recording process, if a new surveillance video event triggers recording and the number of surveillance video events corresponding to the current video data file reaches the upper limit, the preset video data file switching condition is met.
10. The method according to claim 8, characterized in that During the recording process, if a new surveillance video event triggers recording, and the number of surveillance video events corresponding to the current video data file reaches an upper limit, and a preset video data file switching condition is met, the method further includes: Apply for a new surveillance video event index ID corresponding to the video data file to be switched for the new surveillance video event.
11. A surveillance video retrieval device, characterized in that: The device comprises: A retrieval request receiving unit, configured to receive a surveillance video retrieval request, wherein the surveillance video retrieval request includes a first time range and a type range; a preliminary search unit, configured to perform a preliminary search based on the first time range to determine an index ID range of a first surveillance video event index set associated with the first time range; The second retrieval unit is used to perform a second retrieval in the surveillance video events corresponding to the index ID range, determine the second surveillance video event index set associated with the type range in batches, and return the second surveillance video event index set to the retrieval terminal in sequence according to the batches.
12. A surveillance video retrieval device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the surveillance video retrieval device implements the method according to any one of claims 1 to 10.
13. A computer program product comprising computer program instructions, characterized in that When the computer program is executed, the method according to any one of claims 1 to 10 is performed.
Citation Information
Cited By
Large-scale video storage index merging method based on index group and group offset
CN121326858A