Video retrieval method and device, electronic equipment and storage medium
By dividing the storage time into multiple small intervals and pre-recording the storage status, the problem of large pressure for batch video retrieval in cloud storage systems is solved, and high-precision video retrieval result query is realized, reducing system cost.
Patent Information
- Application Number
- CN202311241646.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-25
- Publication Date
- 2025-03-25
AI Technical Summary
In cloud storage systems, the pressure to search for batch videos has increased dramatically, and high-performance equipment is often required to deal with it or reduced search accuracy, which leads to increased system costs or reduced search accuracy.
By dividing each day into multiple storage time intervals, each interval is further divided into storage time intervals and storage time segments, the storage status of the videos recorded in each storage time interval is pre-recorded, and the recording storage results are quickly returned during query, and the detection is performed one by one when partial storage is incomplete.
Without significantly increasing business pressure, the video retrieval accuracy is improved, and the video storage results can be queried more carefully, reducing system costs and improving search accuracy.
Smart Images

Figure CN119691218A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a video retrieval method, device, electronic equipment and storage medium. Background Art
[0002] Video retrieval is one of the basic services in security systems. In a cloud storage system, there may be thousands of video storages connected. When batch retrieval of videos is required, the pressure on the cloud storage system increases dramatically. In order to cope with the pressure of batch retrieval, high-performance equipment is usually used or the retrieval accuracy is reduced, but this will increase the cost of the cloud storage system or lead to low retrieval accuracy. Summary of the invention
[0003] The present invention provides a video retrieval method, device, electronic equipment and storage medium, so as to improve the video retrieval accuracy without significantly increasing business pressure.
[0004] According to one aspect of the present invention, a video retrieval method is provided, the method comprising:
[0005] Determine at least one target storage time interval, the target storage time interval is the storage time range corresponding to the storage of the video to be retrieved, each day is pre-divided into multiple storage time intervals, each storage time interval is pre-divided into multiple storage time segments, and each storage time segment is pre-divided into multiple storage time segments;
[0006] Querying target storage record information corresponding to a target storage time interval, wherein the target storage record information is used to describe a video storage status of videos recorded in each storage time period in the target storage time interval, wherein the video storage status includes not stored, at least partially stored, and completely stored;
[0007] If the target storage record information indicates that the videos in all storage time periods in the target storage time interval have not been stored or have been completely stored, the video storage result of the target storage time interval is returned;
[0008] If the target storage record information indicates that at least a portion of the video recordings in at least one storage time period in the target storage time interval have been stored, then whether the video recordings in each storage time segment of at least one storage time period are stored is detected one by one.
[0009] According to another aspect of the present invention, a video retrieval device is provided, the device comprising:
[0010] A determination module, used to determine at least one target storage time interval, wherein the target storage time interval is a storage time range corresponding to the storage of the video to be retrieved, each day is pre-divided into a plurality of storage time intervals, each storage time interval is pre-divided into a plurality of storage time time segments;
[0011] A query module, used to query target storage record information corresponding to a target storage time interval, wherein the target storage record information is used to describe a video storage status of a video recorded in each storage time period in the target storage time interval, wherein the video storage status includes not stored, at least partially stored, and completely stored;
[0012] A retrieval module, configured to return the video storage result of the target storage time interval if the target storage record information indicates that the videos in all storage time periods in the target storage time interval have not been stored or have been completely stored;
[0013] The retrieval module is also used to detect whether the videos in each storage time segment of at least one storage time period are stored one by one if the target storage record information indicates that at least part of the videos in at least one storage time period in the target storage time interval have been stored.
[0014] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the video retrieval method described in any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the video retrieval method described in any embodiment of the present invention when executed.
[0019] According to the technical solution of the embodiment of the present invention, each day is pre-divided into multiple storage time intervals, each storage time interval is pre-divided into multiple storage time periods, each storage time period is pre-divided into multiple storage time segments, at least one target storage time interval is determined, and the target storage record information corresponding to the target storage time interval is queried for describing the video storage status of the video in each storage time period in the target storage time interval, and then according to the video storage status indicated in the description of the video storage status of the video in each storage time period in the target storage time interval, it is determined whether to directly return the video storage result in the target storage time interval, or to further detect whether the video in each storage time segment of at least one storage time period is stored one by one and then return the video storage result in the target storage time interval. When the video retrieval is performed in batches by using the solution of the present application, since the video storage status in each storage time period of each storage time interval is recorded in advance during the inspection process, the video storage result can be quickly queried during the retrieval, and for the case of partial incomplete storage, multiple storage time segments are further subdivided under each storage time period, so that the video storage result can be queried more finely and with high precision, so as to improve the video retrieval accuracy without significantly increasing the business pressure.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a flow chart of a video retrieval method provided according to an embodiment of the present invention;
[0023] Figure 2 It is a schematic diagram of a process of inspecting daily stored videos to obtain stored record information according to an embodiment of the present invention;
[0024] Figure 3 It is a schematic diagram of a process of performing video retrieval using storage record information obtained by inspecting daily storage videos according to an embodiment of the present invention;
[0025] Figure 4 is a structural schematic diagram of a video retrieval device provided according to an embodiment of the present invention;
[0026] Figure 5 It is a schematic diagram of the structure of an electronic device for implementing the video retrieval method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Figure 1 A flowchart of a video retrieval method is provided for an embodiment of the present invention. This embodiment can be applicable to the situation of querying the video storage status at each time point in a cloud storage system. The method can be executed by a video retrieval device, which can be implemented in the form of hardware and / or software. The device can be configured in any electronic device with network communication function.
[0030] like Figure 1 As shown, the video retrieval method of this embodiment may include the following process:
[0031] S110: Determine at least one target storage time interval, where the target storage time interval is a storage time range corresponding to when the video to be retrieved is stored.
[0032] Among them, each day is pre-divided into multiple storage time intervals, each storage time interval is pre-divided into multiple storage time periods, each storage time period is pre-divided into multiple storage time segments, the time length of each storage time interval is the same, the time length of each storage time period is the same, and the time length of each storage time segment is the same.
[0033] S120, querying target storage record information corresponding to the target storage time interval, where the target storage record information is used to describe the video storage status of the videos in each storage time period in the target storage time interval, where the video storage status includes not stored, at least partially stored, and completely stored.
[0034] An inspection is performed once for the videos stored every day. For each day that is pre-divided into multiple storage time intervals, the videos in each storage time interval can be used as the inspection granularity to determine the video storage status of the videos in each storage time period of each storage time interval. The video storage status of the videos in each storage time period can include not stored, at least partially stored, and completely stored. Not stored may mean that no videos are stored in the storage time period, at least partially stored may mean that at least one second of videos are stored in the storage time period, and completely stored may mean that the videos are completely stored at each time point in the storage time period.
[0035] Optionally, each day is pre-divided into multiple storage time intervals of fixed time length according to a first time interval, each storage time interval is pre-divided into multiple storage time periods of fixed time length according to a second time interval, and each storage time period is pre-divided into multiple storage time segments of fixed time length according to a third time interval.
[0036] Optionally, taking the first time interval as 3 minutes, the second time interval as 1 minute, and the third time interval as 2 seconds as an example, the time length of each storage time interval in the multiple storage time intervals is 3 minutes, the number of storage time periods in the multiple storage time periods is 3, the time length of each storage time segment in the multiple storage time segments is 2 seconds, and the target storage record information is represented by an octal value.
[0037] Alternatively, taking the first time interval as 2 minutes, the second time interval as 1 minute, and the third time interval as 2 seconds as an example, the time length of each storage time interval in the multiple storage time intervals is 2 minutes, the number of storage time periods in the multiple storage time periods is 2, the time length of each storage time segment in the multiple storage time segments is 2 seconds, and the target storage record information is represented by a binary value.
[0038] Taking the first time interval of 3 minutes, the second time interval of 1 minute, and the third time interval of 2 seconds as an example, the stored videos are inspected once every day, and each 64-bit number records the video storage status of one hour. Each day is pre-divided into multiple storage time intervals, and each 3 bits (corresponding to octal) records 3 minutes (corresponding to one storage time interval) of video, corresponding to one hour, a total of 60 bits, which are converted into decimal numbers and recorded in the database. Table 1 shows the video storage status of the video in each storage time interval using octal values to represent the meaning.
[0039] Table 1 Video storage status of videos in each storage time interval
[0040]
[0041] For example, the values recorded for the videos from 01:01:10 to 01:10:58 and 01:55:10 to 01:58:50 (there is no video recorded at other times) are as follows: the time range from 01:01:10 to 01:10:58 can be divided into 01:01:10–01:02:59, 01:03:00 to 01:05:59, 01:06:00 to 01:08:59, and 01:09:00 to 01:10:5; and the time range from 01:55:10 to 01:58:50 can be divided into 01:55:10 to 01:57:59 and 01:58:00 to 01:58:50. On this basis, the video storage status of the videos in each storage time interval is configured as follows:
[0042] 01:01:10-01:02:59 corresponds to 5;
[0043] 01:03:00-01:05:59 corresponds to 7;
[0044] 01:06:00-01:08:59 corresponds to 7;
[0045] 01:09:00-01:10:58 corresponds to 4;
[0046] 01:55:10-01:57:59 corresponds to 5;
[0047] 01:58:00-01:58:50 corresponds to 1;
[0048] The video storage status result corresponding to the 1-hour video is (in octal) 057740000000000000051, which is converted to decimal as 863565228548292649.
[0049] As an optional but non-limiting implementation, querying the target storage record information corresponding to the target storage time interval may include the following steps:
[0050] According to the date and the video identification associated with the target storage time interval, the target storage record information corresponding to the target storage time interval is searched from the pre-stored plurality of storage record information.
[0051] Among them, the pre-stored multiple storage record information is generated when inspecting the videos with different video IDs stored every day, and is used to describe the video storage status of the videos in each storage time period of different storage time intervals. The video ID is used to distinguish the video device coding ID of the video source.
[0052] See also Figure 2 , conduct an inspection on the videos stored every day, obtain all currently associated videos according to the date and the video ID, and divide each video file into the storage time intervals pre-divided for each day to determine the storage time interval to which it belongs. For example, every 3 minutes is used as a storage time interval, and the video storage status of the videos in each storage time period in each storage time interval is determined based on the time range corresponding to the videos in the storage time interval, and the video storage status of the videos in each storage time period in the storage time interval is stored to obtain a plurality of pre-stored storage record information.
[0053] Alternatively, see Figure 2 , the storage record information that has been stored in the pre-stored multiple storage record information is stored in the preset database, and the storage record information that has not been stored in the pre-stored is stored in the cache. For the storage record information generated by the daily inspection of the video, after some of the storage record information is generated, because the video has been stored in the warehouse, the corresponding inspection storage record information will also be stored in the preset database for storage. However, some videos have not yet been stored in the warehouse, so the storage record information corresponding to these videos will be stored in the cache. Therefore, when querying based on the date and video ID associated with the target storage time interval, the target storage record information corresponding to the target storage time interval will be queried in the preset database first. If the query is not found, the target storage record information corresponding to the target storage time interval will be queried in the cache.
[0054] S130: If the target storage record information indicates that the videos in all storage time periods in the target storage time interval have not been stored or have been completely stored, the video storage result of the target storage time interval is returned.
[0055] When the target storage record information indicates that no video is stored in all storage time periods in the target storage time interval, it means that no video is stored in the target storage time interval; when the target storage record information indicates that all video in all storage time periods in the target storage time interval are completely stored, it means that all video is stored in the target storage time interval and the directions at each time point in each storage time period are not missed and are completely stored. At this time, the result can be directly returned that there is no video stored in the target storage time or there is complete video storage.
[0056] S140: If the target storage record information indicates that at least a portion of the video recordings in at least one storage time period in the target storage time interval have been stored, then detect whether the video recordings in each storage time segment of at least one storage time period are stored one by one.
[0057] When the target storage record information indicates that at least part of the video recording has been stored in at least one storage time period in the target storage time interval, it means that there are some time points in the target storage time interval where the video recording has been stored, but the stored video recording is incomplete. At this time, it is necessary to further subdivide at least one storage time period in the target storage time interval into storage time segments, and check one by one whether there is any video recording stored in each subdivided storage time segment.
[0058] As an optional but non-limiting implementation, detecting whether the video is stored in each storage time segment of at least one storage time period one by one may include steps A1-A2:
[0059] Step A1: for each storage time segment of at least one storage time period, substitute the storage time point corresponding to each storage time segment and the recording identifier associated with the target storage time interval into multiple preset hash functions of the Bloom filter to obtain the corresponding target hash value.
[0060] Step A2: Determine whether to store the video within the storage time segment based on the target hash value, the first preset hash value set and the second preset hash value set.
[0061] Among them, the first preset hash value set includes hash values obtained by substituting the storage time points corresponding to the storage time segments in which the recordings have been stored in each storage time period of the target storage time interval and the recording identifiers associated with the target storage time interval into multiple preset hash functions of the Bloom filter when inspecting the recordings with different recording identifiers stored every day; the second preset hash value set includes hash values obtained by substituting the storage time points corresponding to the storage time segments in which the recordings have not been stored in each storage time period of the target storage time interval and the recording identifiers associated with the target storage time interval into multiple preset hash functions of the Bloom filter when inspecting the recordings with different recording identifiers stored every day.
[0062] See also Figure 2 For the case where the storage status of the video recording in a storage time interval is not not stored or completely stored, it means that the video recording in the storage time interval has been stored for at least one second. At this time, the storage time segments of each storage time period in the storage time interval can be divided, and the storage time segments in the storage time interval where the video recording is not stored and the storage time segments in which the video recording is stored can be calculated according to the Bloom filter calculation rules and pre-stored, so as to obtain the first preset hash value set and the second preset hash value set.
[0063] For example, every two seconds is a time segment, and the inspection results of 0 or 7 within 3 minutes are not calculated. For example, the video recordings of 01:01:10-01:10:58 and 01:55:10-01:58:50 (there is no video recording in the rest of the time). Among them, the time period with video recordings that needs to be calculated is 01:01:10-01:02:58, a total of 108 seconds, corresponding to a total of 54 hash values corresponding to data; 01:09:00-01:10:58, a total of 118 seconds, corresponding to a total of 59 hash values corresponding to data; 01:55:10-01:56:58, a total of 108 seconds, a total of 54 hash values corresponding to data; 01:57:00-01:58:50, a total of 110 seconds, a total of 54 hash values corresponding to data. In the above process, the time period without recording that needs to be calculated is 01:00:00-01:01:08, a total of 68 seconds, corresponding to the hash values corresponding to 34 data; 01:11:00-01:11:58, a total of 58 seconds, corresponding to 29 hash values; 01:54:00-01:55:08, a total of 68 seconds, corresponding to the hash values corresponding to 34 data; 01:58:52-01:59:58, a total of 66 seconds, corresponding to the hash values corresponding to 33 data.
[0064] Assuming that the false positive rate is set to 0.01 and the average completeness of video storage is 95%, the amount of data to be calculated is 2160. According to the calculation formula of the false positive rate of the Bloom filter, the length of the Bloom filter of a single camera per day is calculated to be about 4000 bits, the corresponding storage space is 500B, and the number of hash functions is 2. It can be seen that recording the storage status of each time segment video through hash values can greatly reduce the storage usage.
[0065] See also Figure 3 For the storage time period that needs to be analyzed for hash value hits, the storage time point corresponding to each storage time segment is obtained, and then the storage time point corresponding to each storage time segment and the video identification associated with the target storage time interval are substituted into the multiple preset hash functions of the Bloom filter to obtain the corresponding target hash value. Furthermore, based on the hash value hit of the target hash value in the first preset hash value set and the second preset hash value set, it can be determined whether the video in the storage time segment is stored.
[0066] Alternatively, see Figure 3 , based on the target hash value, the first preset hash value set and the second preset hash value set, determining whether each storage time segment direction is to be stored, comprising the following steps:
[0067] Step B1: If it is detected that the target hash value does not hit the hash value recorded in the first preset hash value set, it is determined that the video recording in the storage time segment is not stored.
[0068] Step B2: when it is detected that the target hash value hits the hash value recorded in the first preset hash value set, if it is detected that the target hash value does not hit the hash value recorded in the second preset hash value set, it is determined that the video within the storage time segment has been stored.
[0069] Step B3: When it is detected that the target hash value hits the hash value recorded in the first preset hash value set, if it is detected that the target hash value hits the hash value recorded in the second preset hash value set, the storage space used for video storage is detected to determine whether the video has been stored in the storage time segment.
[0070] When performing video retrieval, if the target storage record information indicates that the video in at least one storage time period in the target storage time interval has been at least partially stored, that is, the target storage record information indicates that the video storage status of the video in each storage time period in the target storage time interval is not unstored or completely stored, then it is necessary to detect the data integrity of different time periods in this storage time interval. According to the inspection results, obtain at least one storage time period that needs to be determined to be at least partially stored, that is, determine which storage time period has the video, and then divide the storage time period into multiple storage time segments with a segment of two seconds, and bring the storage time point corresponding to the video identification and the storage time segment into the two hash functions of the Bloom filter to calculate and obtain the corresponding target hash value.
[0071] At the same time, determine whether the hash value hits the first preset hash value set or the second preset hash value set. If the target hash value does not hit the first preset hash value set, then the video in the storage time segment is definitely not stored. In the case where it is detected that the target hash value hits the hash value recorded in the first preset hash value set, if the target hash value does not hit the second preset hash value set, then the video in the storage time segment is definitely stored. In other cases, it means that the video in the storage time segment may be stored, and it is necessary to check the underlying storage space used for video storage for detection and confirmation. The false positive rate of this solution is very low, which can effectively reduce the cache penetration problem.
[0072] According to the technical solution of the embodiment of the present invention, when batch video retrieval is performed, since the video storage status in each storage time period of each storage time interval is recorded in advance during the inspection process, the video storage result can be quickly queried during retrieval, and in view of the situation of incomplete partial storage, multiple storage time segments are further subdivided under each storage time period, so that the video storage result can be queried more finely and with high precision, thereby improving the video retrieval accuracy without significantly increasing business pressure.
[0073] Figure 4 A structural schematic diagram of a video retrieval device is provided for an embodiment of the present invention. This embodiment can be applied to the situation of querying the video storage status at each time point in a cloud storage system. The video retrieval device can be implemented in the form of hardware and / or software, and the device can be configured in any electronic device with network communication function.
[0074] like Figure 4 As shown, the video retrieval device of this embodiment may include the following:
[0075] The determination module 410 is used to determine at least one target storage time interval, where the target storage time interval is a storage time range corresponding to the storage of the video to be retrieved, each day is pre-divided into multiple storage time intervals, each storage time interval is pre-divided into multiple storage time segments, and each storage time segment is pre-divided into multiple storage time segments;
[0076] A query module 420 is used to query target storage record information corresponding to a target storage time interval, wherein the target storage record information is used to describe a video storage status of the video in each storage time period in the target storage time interval, wherein the video storage status includes not stored, at least partially stored, and completely stored;
[0077] A search module 430 is used to return the video storage result of the target storage time interval if the target storage record information indicates that the videos in all storage time periods in the target storage time interval have not been stored or have been completely stored;
[0078] The retrieval module 430 is further configured to detect whether the videos in each storage time segment of at least one storage time period are stored one by one if the target storage record information indicates that at least part of the videos in at least one storage time period in the target storage time interval have been stored.
[0079] Based on the above embodiment, optionally, querying the target storage record information corresponding to the target storage time interval includes:
[0080] According to the date and the video identification associated with the target storage time interval, the target storage record information corresponding to the target storage time interval is searched from the plurality of pre-stored storage record information;
[0081] Among them, the pre-stored multiple storage record information is generated when inspecting the videos with different video identifications stored every day, and is used to describe the video storage status of the videos in each storage time period of different storage time intervals. The video identification is used to distinguish the video device coding identification of the video source.
[0082] Based on the above embodiment, optionally, the time length of each storage time interval in the multiple storage time intervals is 3 minutes, the number of storage time periods in the multiple storage time periods is 3, the time length of each storage time segment in the multiple storage time segments is 2 seconds, and the target storage record information is represented by an octal value.
[0083] Based on the above embodiment, optionally, the time length of each storage time interval in the multiple storage time intervals is 2 minutes, the number of storage time periods in the multiple storage time periods is 2, the time length of each storage time segment in the multiple storage time segments is 2 seconds, and the target storage record information is represented by a binary value.
[0084] Based on the above embodiment, optionally, the stored storage record information among the pre-stored plurality of storage record information is stored in a preset database and the unstored storage record information is stored in a cache.
[0085] Based on the above embodiment, optionally, detecting whether the video recordings in each storage time segment of at least one storage time period are stored one by one includes:
[0086] For each storage time segment of at least one storage time period, substitute the storage time point corresponding to each storage time segment and the video identification associated with the target storage time interval into multiple preset hash functions of the Bloom filter to obtain the corresponding target hash value;
[0087] Based on the target hash value, the first preset hash value set and the second preset hash value set, determine whether the video within the storage time segment is stored; wherein the first preset hash value set includes, when inspecting the videos with different video identifiers stored each day, pre-substituting the storage time points corresponding to the storage time segments in each storage time period of the target storage time interval where the video has been stored and the video identifiers associated with the target storage time interval into the hash values obtained by multiple preset hash functions of the Bloom filter; the second preset hash value set includes, when inspecting the videos with different video identifiers stored each day, pre-substituting the storage time points corresponding to the storage time segments in each storage time period of the target storage time interval where the video has not been stored and the video identifiers associated with the target storage time interval into the hash values obtained by multiple preset hash functions of the Bloom filter.
[0088] Based on the above embodiment, optionally, determining whether to store each storage time segment direction based on the target hash value, the first preset hash value set and the second preset hash value set includes:
[0089] If it is detected that the target hash value does not hit the hash value recorded in the first preset hash value set, it is determined that the video recording in the storage time segment is not stored;
[0090] In the case where it is detected that the target hash value hits the hash value recorded in the first preset hash value set, if it is detected that the target hash value does not hit the hash value recorded in the second preset hash value set, it is determined that the video recording in the storage time segment has been stored;
[0091] In the case where it is detected that the target hash value hits the hash value recorded in the first preset hash value set, if it is detected that the target hash value hits the hash value recorded in the second preset hash value set, the storage space used for video storage is checked to determine whether the video within the storage time segment has been stored.
[0092] The video retrieval device provided in the embodiment of the present invention can execute the video retrieval method provided in any embodiment of the present invention, and has the corresponding functions and beneficial effects of executing the video retrieval method. For detailed process, please refer to the relevant operations of the video retrieval method in the above embodiment.
[0093] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0094] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0095] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0096] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0097] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a video retrieval method.
[0098] In some embodiments, the video retrieval method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the video retrieval method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the video retrieval method in any other appropriate manner (e.g., by means of firmware).
[0099] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0100] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0101] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.
[0102] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0103] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0104] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0105] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0106] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A video retrieval method, characterized in that: The method comprises: Determine at least one target storage time interval, the target storage time interval is the storage time range corresponding to the storage of the video to be retrieved, each day is pre-divided into multiple storage time intervals, each storage time interval is pre-divided into multiple storage time segments; Querying target storage record information corresponding to a target storage time interval, wherein the target storage record information is used to describe a video storage status of videos recorded in each storage time period in the target storage time interval, wherein the video storage status includes not stored, at least partially stored, and completely stored; If the target storage record information indicates that the videos in all storage time periods in the target storage time interval have not been stored or have been completely stored, the video storage result of the target storage time interval is returned; If the target storage record information indicates that at least a portion of the video recordings in at least one storage time period in the target storage time interval have been stored, then whether the video recordings in each storage time segment of at least one storage time period are stored is detected one by one.
2. The method according to claim 1, characterized in that Query the target storage record information corresponding to the target storage time interval, including: According to the date and the video identification associated with the target storage time interval, the target storage record information corresponding to the target storage time interval is searched from the plurality of pre-stored storage record information; Among them, the pre-stored multiple storage record information is generated when inspecting the videos with different video identifications stored every day, and is used to describe the video storage status of the videos in each storage time period of different storage time intervals. The video identification is used to distinguish the video device coding identification of the video source.
3. The method according to claim 1, characterized in that The time length of each storage time interval in the multiple storage time intervals is 3 minutes, the number of storage time periods in the multiple storage time periods is 3, the time length of each storage time segment in the multiple storage time segments is 2 seconds, and the target storage record information is represented by an octal value.
4. The method according to claim 1, characterized in that: The time length of each storage time interval in the multiple storage time intervals is 2 minutes, the number of storage time periods in the multiple storage time periods is 2, the time length of each storage time segment in the multiple storage time segments is 2 seconds, and the target storage record information is represented by a binary value.
5. The method according to claim 2, characterized in that: The stored storage record information among the pre-stored plurality of storage record information is stored in a preset database, and the unstored storage record information is stored in a cache.
6. The method according to claim 1, characterized in that Checking whether the videos in each storage time segment of at least one storage time period are stored one by one includes: For each storage time segment of at least one storage time period, substitute the storage time point corresponding to each storage time segment and the video identification associated with the target storage time interval into multiple preset hash functions of the Bloom filter to obtain the corresponding target hash value; Based on the target hash value, the first preset hash value set and the second preset hash value set, determine whether the video within the storage time segment is stored; wherein the first preset hash value set includes, when inspecting the videos with different video identifiers stored each day, pre-substituting the storage time points corresponding to the storage time segments in each storage time period of the target storage time interval where the video has been stored and the video identifiers associated with the target storage time interval into the hash values obtained by multiple preset hash functions of the Bloom filter; the second preset hash value set includes, when inspecting the videos with different video identifiers stored each day, pre-substituting the storage time points corresponding to the storage time segments in each storage time period of the target storage time interval where the video has not been stored and the video identifiers associated with the target storage time interval into the hash values obtained by multiple preset hash functions of the Bloom filter.
7. The method according to claim 6, characterized in that Determining whether to store each storage time segment direction based on the target hash value, the first preset hash value set, and the second preset hash value set includes: If it is detected that the target hash value does not hit the hash value recorded in the first preset hash value set, it is determined that the video recording in the storage time segment is not stored; In the case where it is detected that the target hash value hits the hash value recorded in the first preset hash value set, if it is detected that the target hash value does not hit the hash value recorded in the second preset hash value set, it is determined that the video recording in the storage time segment has been stored;. In the case where it is detected that the target hash value hits the hash value recorded in the first preset hash value set, if it is detected that the target hash value hits the hash value recorded in the second preset hash value set, the storage space used for video storage is checked to determine whether the video within the storage time segment has been stored.
8. A video retrieval device, characterized in that: The device comprises: A determination module, used to determine at least one target storage time interval, wherein the target storage time interval is a storage time range corresponding to the storage of the video to be retrieved, each day is pre-divided into a plurality of storage time intervals, each storage time interval is pre-divided into a plurality of storage time time segments; A query module, used to query target storage record information corresponding to a target storage time interval, wherein the target storage record information is used to describe a video storage status of a video recorded in each storage time period in the target storage time interval, wherein the video storage status includes not stored, at least partially stored, and completely stored; A retrieval module, configured to return the video storage result of the target storage time interval if the target storage record information indicates that the videos in all storage time periods in the target storage time interval have not been stored or have been completely stored; The retrieval module is also used to detect whether the videos in each storage time segment of at least one storage time period are stored one by one if the target storage record information indicates that at least part of the videos in at least one storage time period in the target storage time interval have been stored.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the video retrieval method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the video retrieval method according to any one of claims 1 to 7 when executed.