Image query method, device, equipment and storage medium
By acquiring and aggregating the image data collected by the camera in real time and updating the index structure, the problem of low image storage efficiency in the existing technology is solved, more efficient storage and retrieval is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202411800416.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-01
AI Technical Summary
In the prior art, the image storage method is fragmented storage and storage in units of cameras, resulting in low storage space utilization and affecting image retrieval efficiency and download efficiency.
By obtaining the image data collected by multiple cameras in real time, performing image aggregation processing according to the preset image aggregation strategy, generating image aggregation files, and updating camera index and image index to achieve more efficient image storage and retrieval.
It improves the utilization rate of storage space, facilitates image data management, improves the efficiency of image retrieval and download, and improves the query efficiency of target image data through two retrieval, thereby improving the user's experience.
Smart Images

Figure CN119739878A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to an image query method, apparatus, device and storage medium. Background Art
[0002] With the acceleration of urbanization and the continuous increase in traffic flow, urban management has become an important issue. In order to improve urban management efficiency, reduce traffic accidents and improve the urban living environment, the monitoring system plays an important role in urban management. The monitoring system monitors the city's operating status in real time through installed cameras, and captures illegal behaviors, and then saves the captured images in a storage device to provide evidence of illegal behaviors.
[0003] In the related art, when storing taken pictures, each photo is usually saved separately in a storage device. However, storing pictures in a discrete manner puts a relatively large pressure on the storage device. Pictures are usually stored in units of cameras, that is, the pictures collected by each camera are stored in a picture file. However, since pictures are generated randomly, such as more pictures during peak hours and fewer pictures at night, the storage capacity of the storage device is determined by the access capacity of the camera and cannot match the actual storage capacity. For example, the storage capacity of the storage device is strong, but the picture data collected by the corresponding camera is small, resulting in a waste of storage space. Summary of the invention
[0004] The embodiments of the present application provide a method, device, equipment and storage medium for image query, which solve the problems that the fragmented storage of images and the image storage method based on cameras are not convenient for image storage management, and the storage capacity of the storage device cannot be fully utilized, which affects the image retrieval efficiency, download efficiency and retrieval accuracy. The utilization rate of storage space can be improved, which is convenient for image data management, and the efficiency of image retrieval and image downloading is correspondingly improved. The target image is retrieved by two retrieval methods, which improves the query efficiency of the target image data, thereby improving the user experience.
[0005] In a first aspect, an embodiment of the present application provides an image query method, comprising:
[0006] Acquire image data collected by multiple cameras in real time;
[0007] Determine multiple first picture data according to a preset picture aggregation strategy, aggregate the multiple first picture data to obtain a picture aggregation file, and update the camera index and the picture index according to the aggregation position of the first picture data in the picture aggregation file, each picture index is used to record the storage information of the picture data collected by the same camera in one or more picture aggregation files; each camera index is used to record the storage information of the picture index corresponding to the same camera;
[0008] Receive image query keywords;
[0009] The camera index and the picture index are queried in sequence according to the picture query keyword to obtain target picture data.
[0010] Optionally, querying the camera index and the picture index in sequence according to the picture query keyword to obtain target picture data includes:
[0011] Extracting a first keyword corresponding to the information field of the camera index and a second keyword corresponding to the information field of the picture index from the picture query keyword;
[0012] querying the camera index according to the first keyword to confirm a target picture index from the picture index;
[0013] When it is confirmed that the target picture index exists, the picture index is queried according to the second keyword to obtain the target picture data.
[0014] Optionally, the camera index includes multiple information fields, and the multiple information fields are used to record at least the camera identification, the index file name of the corresponding picture index, the file storage address of the corresponding picture index, and the start time and end time of each corresponding picture index.
[0015] Optionally, the preset image aggregation strategy includes aggregating in units of a preset first time length, and generating a corresponding image aggregation file for each unit.
[0016] Optionally, each picture index is used to record storage information of picture data collected by the same camera in a plurality of picture aggregation files corresponding to consecutive first time lengths.
[0017] Optionally, the camera index is recorded in a processor, and the image index is recorded in a memory.
[0018] Optionally, after determining a plurality of first picture data according to a preset picture aggregation strategy, aggregating the plurality of first picture data to obtain a picture aggregation file, and updating a camera index and a picture index according to an aggregation position of the first picture data in the picture aggregation file, the method further includes:
[0019] When it is confirmed that the camera index is lost, the picture index is read from the memory, and the camera index is rebuilt according to the read picture index.
[0020] Optionally, the picture data includes digital image data and structured data obtained by extracting data from the image.
[0021] In a second aspect, an embodiment of the present application provides an image query device, including:
[0022] An image data acquisition module is used to acquire image data collected by multiple cameras in real time;
[0023] A first picture data determination module, used to determine a plurality of first picture data according to a preset picture aggregation strategy;
[0024] An aggregation processing module, used for performing aggregation processing on the plurality of first image data to obtain an image aggregation file;
[0025] An index updating module, used to update a camera index and a picture index according to the aggregation position of the first picture data in the picture aggregation file, each picture index is used to record the storage information of the picture data collected by the same camera in one or more picture aggregation files; each camera index is used to record the storage information of the picture index corresponding to the same camera;
[0026] A keyword receiving module, used for receiving image query keywords;
[0027] The target image data acquisition module is used to query the camera index and the image index in sequence according to the image query keyword to obtain the target image data.
[0028] Optionally, a target image data acquisition module is specifically used to extract a first keyword corresponding to the information field of the camera index and a second keyword corresponding to the information field of the image index from the image query keyword;
[0029] querying the camera index according to the first keyword to confirm a target picture index from the picture index;
[0030] When it is confirmed that the target picture index exists, the picture index is queried according to the second keyword to obtain the target picture data.
[0031] Optionally, the camera index includes multiple information fields, and the multiple information fields are used to record at least the camera identification, the index file name of the corresponding picture index, the file storage address of the corresponding picture index, and the start time and end time of each corresponding picture index.
[0032] Optionally, the preset image aggregation strategy includes aggregating in units of a preset first time length, and generating a corresponding image aggregation file for each unit.
[0033] Optionally, each picture index is used to record storage information of picture data collected by the same camera in a plurality of picture aggregation files corresponding to consecutive first time lengths.
[0034] Optionally, the camera index is recorded in a processor, and the image index is recorded in a memory.
[0035] Optionally, the image query device further includes an index reconstruction module, which is used to read the image index from the memory and rebuild the camera index according to the read image index when it is confirmed that the camera index is lost.
[0036] Optionally, the picture data includes digital image data and structured data obtained by extracting data from the image.
[0037] In a third aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a storage device configured to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the image query method described in the first aspect.
[0038] In a fourth aspect, an embodiment of the present application provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the image query method as described in the first aspect.
[0039] The embodiment of the present application obtains the image data collected by multiple cameras in real time; determines multiple first image data according to a preset image aggregation strategy, aggregates the multiple first image data to obtain an image aggregation file, and updates the camera index and the image index according to the aggregation position of the first image data in the image aggregation file, each image index is used to record the storage information of the image data collected by the same camera in one or more image aggregation files; each camera index is used to record the storage information of the image index corresponding to the same camera; receives an image query keyword; queries the camera index and the image index in turn according to the image query keyword to obtain the target image data. It can improve the utilization rate of storage space, facilitate image data management, and correspondingly improve the efficiency of image retrieval and image downloading. The target image is retrieved by two retrieval methods, which improves the query efficiency of the target image data, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is a flow chart of an image query method provided by an embodiment of the present application;
[0041] Figure 2 This is a schematic diagram of an aggregation process of image data provided by an embodiment of the present application;
[0042] Figure 3 It is a structural schematic diagram of a picture storage device provided in the related art;
[0043] Figure 4 It is a structural schematic diagram of another image storage device provided in the related art;
[0044] Figure 5 is a structural schematic diagram of a picture storage device provided in an embodiment of the present application;
[0045] Figure 6 is a flow chart of a method for acquiring target image data provided by an embodiment of the present application;
[0046] Figure 7 This is a schematic diagram of a camera index-based image query provided by an embodiment of the present application;
[0047] Figure 8 is a structural diagram of an image query device provided in an embodiment of the present application;
[0048] Fig. 9 It is a structural diagram of an image query device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0050] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0051] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0052] The following, in conjunction with the accompanying drawings, describes in detail the image query method, device, equipment and medium provided in the embodiments of the present application through specific embodiments and their application scenarios.
[0053] The image query method provided in the embodiment of the present application is applied to the scenario of managing the image data collected by the urban road camera. Based on the above usage scenario, it can be understood that the execution subject of this solution is the server.
[0054] Figure 1 is a flow chart of an image query method provided by an embodiment of the present application, such as Figure 1 As shown, including:
[0055] Step S101: Acquire image data collected by multiple cameras in real time.
[0056] The image data may include image content and a camera identifier corresponding to the image, etc. In one embodiment, the images captured by each camera are acquired in real time, and the image content of each image is identified and the camera identifier corresponding to the image is determined.
[0057] Optionally, the image data includes digital image data and structured data obtained by extracting data from the image. The digital image data may include the image, the size of the image, and the time when the image was collected. The structured data can be used to represent the content of the image, such as whether there is a red target vehicle in the collected image and the number of vehicles in the image.
[0058] Step S102: Determine, according to a preset picture aggregation strategy, multiple first picture data, aggregate the multiple first picture data to obtain a picture aggregation file, and update the camera index and picture index according to the aggregation position of the first picture data in the picture aggregation file, each picture index is used to record the storage information of the picture data collected by the same camera in one or more picture aggregation files; each camera index is used to record the storage information of the picture index corresponding to the same camera.
[0059] Among them, the preset picture aggregation strategy can be used to represent the method and rules of picture aggregation, etc. The picture aggregation strategy can be for aggregation processing according to the preset number of pictures, such as each unit includes 2000 pictures, and the picture data corresponding to the 2000 pictures collected by all cameras are obtained, wherein each picture index is used to record the storage information of the picture data collected by each camera in the picture aggregation file corresponding to multiple consecutive 2000 pictures. The first picture data can be picture data that meets the picture aggregation conditions. Picture aggregation processing can refer to combining multiple data objects together to form a new data object, wherein the new data object formed can be a picture aggregation file, which contains the characteristics of the original picture data, that is, the picture and the structured data of the picture.
[0060] The camera index is an index file used to indicate the storage location of the image index. In the specific implementation process, the camera index can be an index file corresponding to all cameras (for example Figure 7In the camera index, multiple image indexes corresponding to all cameras are stored in one camera index, and index files corresponding to the same camera are stored in a centralized manner; of course, they can also be stored in the order in which the camera index is updated during the image storage process). The camera index can also be an index file corresponding to each camera, and each index file is used to record all multiple image indexes corresponding to a camera. The camera index can also be, for example, multiple index files corresponding to each camera, and each index file is used to record multiple image indexes corresponding to a camera. The image index is indicative data for indicating the position of each image in the image aggregation file, and the image index can be structured data of the image, such as the license plate number, vehicle brand, and shooting time of the motor vehicle captured in the image. Among them, each image index is used to record the storage information of all or part of the image data collected by the same camera in one or more image aggregation files, and each camera index is used to record the storage information of all or part of the image indexes corresponding to the same or different cameras.
[0061] Optionally, the preset picture aggregation strategy includes aggregating in units of a preset first duration, and generating a picture aggregation file for each unit. Each picture index is used to record storage information of picture data collected by the same camera in picture aggregation files corresponding to multiple consecutive first durations.
[0062] For example, if every 6 hours is taken as a unit, all the image data collected within every 6 hours are aggregated to generate an image aggregation file, and each image index is used to record the storage information of the image data collected by the same camera in the image aggregation files corresponding to multiple consecutive 6 hours, such as recording the storage information of all images collected by camera 1 in the image aggregation file corresponding to 0:00-6:00, such as the storage information of images 1, 2, and 3 collected by camera 1, etc., and recording the storage information of all images collected by camera 2 in the image aggregation file corresponding to 0:00-6:00, such as the storage information of images 1, 2, and 3 collected by camera 2, etc. Among them, the storage information can be the storage address of the image in the image aggregation file. For another example, if every 1 hour is taken as a unit, all the image data collected within every 1 hour are aggregated to generate an image aggregation file.
[0063] The correspondence between the index files of the image index and the camera index described above can be determined based on the image aggregation strategy according to the appropriate index file size. For example, if there are a large number of cameras, all the image data collected within one hour are aggregated and processed to generate an image aggregation file, which can achieve a good balance between data management cost and data access speed. However, for a single image index, the storage information required for the images collected by a camera within one hour may only require a very small index file to record. Therefore, the image index can record the storage information corresponding to the images collected by a camera over a longer period of time (such as 6 hours, 12 hours, etc.). The basis for setting the camera index is the same as that for setting the image index. For example, the number of cameras and the historical length of time that images need to be saved may be different in different application scenarios. In a certain scenario, there may be a large number of cameras for image acquisition, and images within the past year need to be saved. If each image index corresponds to 6 hours of images from a camera, then each camera corresponds to 4×365=1460 image indexes. At this time, it may be necessary to correspond to one or more camera indexes for each camera based on the hardware configuration of the entire image storage system. In a certain scenario, there may be only two cameras for image acquisition, and only images within the past three months are saved. If each image index corresponds to 6 hours of images from a camera, then a total of 4×120×2=960 image indexes are required. At this time, only one camera index may be needed.
[0064] Optionally, the camera index includes multiple information fields, and the multiple information fields are used to record at least the camera identification, the index file name of the corresponding picture index, the file storage address of the corresponding picture index, and the start time and end time of each corresponding picture index. Each information field can be set according to the corresponding device information or naming rules. For example, the multiple picture indexes corresponding to camera 1 are named camera 1 index 1, camera 1 index 2, etc. in sequence, without specific limitation.
[0065] Among them, the camera identification is used to distinguish and identify each camera device, and each camera has unique identification information, such as camera ID, camera name, etc. The index file name of the picture index represents the name of the index file to which the picture data belongs. The file storage address of the corresponding picture index can be a download address for accessing or downloading the target picture. The corresponding start time and end time of each picture index can be the time when the camera starts to collect pictures and the end time when the camera collects pictures. Exemplarily, the start time and end time of the picture index can be the start time and end time of a certain period within a preset storage cycle, such as every 6 hours as a period, which can be 6:00-12:00, then the start time of each picture index is 6:00 and the end time is 12:00.
[0066] In one embodiment, first picture data is screened from picture data collected in real time by multiple cameras according to a preset aggregation strategy to determine multiple first picture data. Figure 2 is a schematic diagram of an aggregation processing of image data provided by an embodiment of the present application, such as Figure 2 As shown, aggregation is performed in units of a preset first time length, such as every 6 hours as a unit, and all the picture data collected by all cameras from 6:00 to 12:00 are determined as first picture data according to the picture data collection time, such as all the picture data collected by camera 1 and camera 2 from 6:00 to 12:00 are first picture data, and the determined multiple first picture data are aggregated to obtain a picture aggregation file, and then the picture index is updated according to the picture aggregation file. For example, the picture aggregation file can aggregate the determined first picture data every 6 hours, and each first picture data has a corresponding storage location in the picture aggregation file (which can be represented by a link), and the storage location of each first picture data and the corresponding structured data can be added as a record to the picture index used to record the storage information of the picture data taken by the camera in the corresponding time period according to the corresponding camera and shooting time. The picture aggregation file may also not aggregate the determined first picture data set every 6 hours, but instead determine a first picture data set at a certain interval within 6 hours, and aggregate a new first picture data set in the picture aggregation file each time. Accordingly, it is necessary to add a new record in the corresponding picture index according to the camera that took the newly aggregated first picture data, the shooting time, etc., to record the storage location of the first picture data and the corresponding structured data.
[0067] The camera index is updated according to the update of the image index. For example, the update of the image aggregation file may only add a new record in a certain image index, and the camera index will be updated accordingly with the end time of the image index. The update of the image aggregation file may also be to add a new image index. In this case, a new record needs to be added to the camera index to record the file name, storage address, start time, end time and other information of the newly added image index.
[0068] In another embodiment, aggregation can also be performed in units of a preset number of cameras, such as determining the image data collected by every 20 cameras between 0:00 and 1:00 as a group of first image data, and performing aggregation processing on the determined group of first image data, that is, multiple first image data, to obtain an image aggregation file.
[0069] In one embodiment, after obtaining the picture aggregation file, the camera index and the picture index are updated according to the aggregation position of the first picture data in the picture aggregation file. Exemplarily, the picture aggregation file stores the picture data collected by 20 cameras from 0:00 to 1:00. Since 0:00 to 1:00 is a non-peak period, the number of pictures actually collected by the cameras is small. In order to avoid wasting storage space, the picture aggregation file can appropriately store the first picture data collected by other cameras until the size of the picture aggregation file meets the preset storage threshold. If the picture data collected by camera 21 and camera 22 from 0:00 to 1:00 are newly added to the picture aggregation file, new picture indexes can be added to the camera index, namely the camera 21 index and the camera 22 index, thereby updating the camera index.
[0070] In another possible embodiment, if the picture indexes corresponding to the picture aggregation file are determined to be "Camera 1 Index 1 (0:00-1:00)" and "Camera 2 Index 1 (0:00-1:00)" respectively according to the aggregation position of the first picture data in the picture aggregation file, the last captured picture stored in the picture aggregation file can be determined after 1:00, and the picture index can be updated according to the capture time of the picture. Exemplarily, if the capture time of the last captured picture stored in the picture aggregation file is 0:40, the picture indexes "Camera 1 Index 1 (0:00-1:00)" and "Camera 2 Index 1 (0:00-1:00)" can be updated according to the capture time, and the updated picture indexes are: "Camera 1 Index 1 (0:00-0:40)" and "Camera 2 Index 1 (0:00-0:40)".
[0071] Step S103: receiving image query keywords.
[0072] In one embodiment, the image query keyword is the query information input by the user based on the image query requirements. The keyword input area can be set in advance in the image query interface, such as time, camera name, vehicle type, vehicle color and other structured data. After the user fills in the corresponding query keyword in the corresponding area, the system directly receives the image query keyword input by the user. In another possible embodiment, the user directly enters the query information "A brand black vehicle appears in the camera 1 acquisition area from 1:00 to 4:00" in the corresponding area. The system performs keyword recognition on the query information based on the preset keyword extraction rules, and obtains the image query keywords "1:00-4:00", "Camera 1" and "A brand black vehicle".
[0073] Step S104: query the camera index and the picture index in sequence according to the picture query keyword to obtain target picture data.
[0074] In one embodiment, the corresponding index is randomly queried according to the image query keyword to obtain the target image data. Exemplarily, the received image query keywords are: "Camera 1", "Brand A Black Vehicle" and "1:00-4:00", then the camera index is queried according to the image query keywords "Camera 1" and "1:00-4:00" to determine the image index, such as Camera 1 Index 1 (1:00-4:00), and the image index "Camera 1 Index 1 (1:00-4:00)" is queried according to the image query keyword "Brand A Black Vehicle", and the image 2 index (Brand A Black Vehicle) is obtained, and the image data of Image 2 corresponding to the aggregated position is obtained.
[0075] The embodiment of the present application obtains the image data collected by multiple cameras in real time; determines multiple first image data according to a preset image aggregation strategy, aggregates the multiple first image data to obtain an image aggregation file, and updates the camera index and the image index according to the aggregation position of the first image data in the image aggregation file, each image index is used to record the storage information of the image data collected by the same camera in one or more image aggregation files; each camera index is used to record the storage information of the image index corresponding to the same camera; receives an image query keyword; queries the camera index and the image index in turn according to the image query keyword to obtain the target image data. It can improve the utilization rate of storage space, facilitate image data management, and correspondingly improve the efficiency of image retrieval and image downloading. The target image is retrieved by two retrieval methods, which improves the query efficiency of the target image data, thereby improving the user experience.
[0076] Figure 3 is a structural diagram of a picture storage device provided in the related art, such as Figure 3 As shown, the structured data processing device obtains images and structured data, such as face capture data and vehicle capture data, from a video source (such as an IPC, NVR, or storage server, etc.). After receiving the images and structured data, the processing device performs parsing and processing, and after the parsing is completed, the image data is stored in the storage device, such as Figure 3 The pictures 1, 2, 3 and N shown in the figure return the URL of each picture after successful storage in the storage device, and store the URL of each picture in the database to facilitate subsequent picture retrieval and reading based on the picture URL.
[0077] Figure 4 is a structural diagram of another image storage device provided in the related art, such as Figure 4 As shown, the parsing and retrieval system obtains images and structured data, such as face capture data and vehicle capture data, from a video source (such as an IPC, NVR, or storage server, etc.) by controlling the data storage processing device. After receiving the images and structured data, the data storage processing device stores them according to the camera + acquisition time period, such as storing the images collected by camera 1 at 8:00-9:00 in image file 1, and storing the images collected by camera 1 at 9:00-10:00 in image file 2, and adding an image index to the end of each image file. When batch retrieval of images is required, the corresponding image file is found through the file index, and then the target image is found through the index at the end of the file and read from the storage medium.
[0078] Figure 5 is a structural diagram of a picture storage device provided in an embodiment of the present application, such as Figure 5 As shown, the parsing and retrieval system obtains images and structured data, such as face capture data and vehicle capture data, from a video source (such as an IPC, NVR, or storage server, etc.) by controlling the processing device. After receiving the images and structured data, the processing device aggregates multiple first image data of each unit into a file according to a preset image aggregation strategy, obtains an image aggregation file corresponding to each unit, and stores each image aggregation file in the storage device.
[0079] In one embodiment, the camera index is recorded in the processor, and the image index is recorded in the memory. The processor is used to perform image aggregation processing and recording on the received image data, that is, Figure 5 The processing device shown in the figure, the memory is a storage hardware that can store the data processed by the processor without participating in the corresponding data processing operation, that is, Figure 5 The camera index can be Figure 5The file index shown, each record in the file index corresponds to a record of relevant information of a picture index, and the relevant information of the picture index may include the camera ID, the picture index file name, the picture index file address, the start time of the picture index file, the end time of the picture index file, etc. Among them, the start time of the picture index file and the end time of the picture index file can be determined according to a preset storage period. If the storage period is 24 hours, the acquisition time of the first picture within 24 hours is determined to be the start time of the picture index file, such as 0:00, and the acquisition time of the last picture within 24 hours is determined to be the end time of the picture index file, such as 24:00. Since the amount of image data collected within 24 hours is large, it is not convenient for subsequent target image data query operations. The image index of each camera can be set according to the preset duration. For example, if the preset duration is 6 hours, the image index of camera 1 can be set to camera 1 + acquisition time 0:00-6:00, camera 1 + acquisition time 6:00-12:00, and camera 1 + acquisition time 12:00-18:00, and the image index of camera 2 can be set to camera 2 + acquisition time 0:00-6:00, camera 2 + acquisition time 6:00-12:00, and camera 2 + acquisition time 12:00-18:00, etc. Correspondingly, Figure 5 The camera 1 index shown may be camera 1+collection time 6:00-12:00, and the camera 2 index may be camera 2+collection time 6:00-12:00.
[0080] In one embodiment, after determining a plurality of first picture data according to a preset picture aggregation strategy, aggregating the plurality of first picture data to obtain a picture aggregation file, and updating a camera index and a picture index according to the aggregation position of the first picture data in the picture aggregation file, the method further includes:
[0081] When it is confirmed that the camera index is lost, the picture index is read from the memory, and the camera index is rebuilt according to the read picture index.
[0082] Among them, the data of the processor may be damaged or lost due to a terminal device failure, but because the memory is storage hardware, data loss will not occur due to device power outage or device damage. Therefore, when the camera index recorded in the processor is lost, the picture index can be read from the memory, and the camera index can be rebuilt based on the read picture index and re-recorded in the processor.
[0083] As described above, by reading the picture index from the memory when confirming that the camera index is lost, and rebuilding the camera index according to the read picture index, data recovery can be achieved based on the memory to avoid affecting the query result of the target picture data.
[0084] Figure 6 is a flow chart of a method for acquiring target image data provided by an embodiment of the present application, such as Figure 6 As shown, including:
[0085] Step S601: extracting a first keyword corresponding to the information field of the camera index and a second keyword corresponding to the information field of the picture index from the picture query keyword.
[0086] Among them, the first keyword is a keyword used to query the target aggregate file in the database, and the second keyword is a keyword for querying the target image data in the storage device. In one embodiment, the keyword corresponding to the time, such as 6:00-12:00, and the keyword corresponding to the camera identifier, such as camera 1, are extracted from the image query keyword to obtain the first keyword of the information field of the camera index, which are "6:00-12:00" and "Camera 1" respectively. The information field of the image index corresponds to the structured data of the recorded image. In one embodiment, the information field of the image index, such as vehicle color, vehicle brand and license plate number, is extracted from the image query keyword to obtain the second keyword of the information field of the image index.
[0087] Step S602: query the camera index according to the first keyword to confirm the target picture index from the picture index.
[0088] Figure 7 is a schematic diagram of a camera index-based image query provided by an embodiment of the present application, such as Figure 7 As shown, if the first keyword is "6:00-12:00", "Camera 1 Index 1" and "Camera 2 Index 1", the camera index is queried according to "6:00-12:00", "Camera 1 Index 1" and "Camera 2 Index 1", and "Camera 1 Index 1 (6:00-12:00)" and "Camera 2 Index 1 (6:00-12:00)" are respectively determined as the target image index. Among them, if the camera index is queried according to the first keyword and the target image index is not obtained, it can be determined that the image data required by the user cannot be queried, so there is no need to query the image index based on the second keyword, thereby improving the query efficiency of the target image data.
[0089] Step S603: When it is confirmed that the target image index exists, query the image index according to the second keyword to obtain target image data.
[0090] In one embodiment, if the corresponding target image index can be obtained by indexing the camera according to the first keyword, the queried target image index is queried according to the second keyword to determine the aggregation position of the target image in the image aggregation file, and obtain the image data at the aggregation position. Figure 2 As shown, if the second keyword is "black vehicle" or "license plate number AB00001", a query is performed in the target image index obtained by the first query based on "black vehicle" and "license plate number AB00001" to determine the aggregation position of the target image in the image aggregation file, and obtain the target image data at the aggregation position, that is, obtain the image data of the image containing a black vehicle and the license plate number AB00001 captured by camera 1 and camera 2 between 6:00 and 12:00.
[0091] In the above, a first keyword corresponding to the information field of the camera index and a second keyword corresponding to the information field of the picture index are extracted from the picture query keyword; the camera index is queried according to the first keyword to confirm the target picture index from the picture index; when the target picture index is confirmed to exist, the picture index is queried according to the second keyword to obtain the target picture data. The identified query keywords of different types can be queried step by step, and whether the target picture data exists and the location of the target picture can be quickly determined, thereby improving the efficiency of obtaining the target picture data.
[0092] Figure 8 is a schematic diagram of the structure of an image query device provided in an embodiment of the present application, such as Figure 8 As shown, including:
[0093] The image data acquisition module 81 is used to acquire image data collected by multiple cameras in real time;
[0094] A first picture data determination module 82, configured to determine a plurality of first picture data according to a preset picture aggregation strategy;
[0095] An aggregation processing module 83, configured to aggregate the plurality of first image data to obtain an image aggregation file;
[0096] An index updating module 84, configured to update a camera index and a picture index according to the aggregation position of the first picture data in the picture aggregation file, each picture index being respectively used to record the storage information of the picture data collected by the same camera in one or more picture aggregation files; each camera index being used to record the storage information of the picture index corresponding to the same camera;
[0097] The keyword receiving module 85 is used to receive the image query keyword;
[0098] The target image data acquisition module 86 is used to query the camera index and the image index in sequence according to the image query keyword to obtain the target image data.
[0099] The embodiment of the present application obtains the image data collected by multiple cameras in real time; determines multiple first image data according to a preset image aggregation strategy, aggregates the multiple first image data to obtain an image aggregation file, and updates the camera index and the image index according to the aggregation position of the first image data in the image aggregation file, each image index is used to record the storage information of the image data collected by the same camera in one or more image aggregation files; each camera index is used to record the storage information of the image index corresponding to the same camera; receives an image query keyword; queries the camera index and the image index in turn according to the image query keyword to obtain the target image data. It can improve the utilization rate of space, facilitate image management, and correspondingly improve the efficiency of image retrieval and image downloading. The target image is retrieved by two retrieval methods, which improves the query efficiency of the target image data, thereby improving the user experience.
[0100] In a possible embodiment, the target image data acquisition module 86 is used to:
[0101] Extracting a first keyword corresponding to the information field of the camera index and a second keyword corresponding to the information field of the picture index from the picture query keyword;
[0102] querying the camera index according to the first keyword to confirm a target picture index from the picture index;
[0103] When it is confirmed that the target picture index exists, the picture index is queried according to the second keyword to obtain the target picture data.
[0104] In a possible embodiment, the camera index includes multiple information fields, and the multiple information fields are used to record at least the camera identification, the index file name of the corresponding picture index, the file storage address of the corresponding picture index, and the start time and end time of each corresponding picture index.
[0105] In a possible embodiment, the preset picture aggregation strategy includes aggregating in units of a preset first time length, and generating a picture aggregation file corresponding to each unit.
[0106] In a possible embodiment, each picture index is used to record storage information of picture data captured by the same camera in a plurality of consecutive picture aggregation files corresponding to the first time length.
[0107] In a possible embodiment, the camera index is recorded in a processor, and the image index is recorded in a memory.
[0108] In a possible embodiment, the image query device further includes an index reconstruction module, and the index reconstruction module is used to:
[0109] When it is confirmed that the camera index is lost, the picture index is read from the memory, and the camera index is rebuilt according to the read picture index.
[0110] In a possible embodiment, the picture data includes digital image data and structured data obtained by extracting data from the image.
[0111] The embodiment of the present application also provides a picture query device, which can integrate a picture query apparatus provided in the embodiment of the present application. Fig. 9 is a schematic diagram of a structure of an image query device provided in an embodiment of the present application, with reference to Fig. 9 The image query device includes: an input device 93, an output device 94, a memory 92 and one or more processors 91; the memory 92 is used to store one or more programs; when one or more programs are executed by one or more processors 91, the one or more processors 91 implement the image query method provided in the above embodiment. The input device 93, the output device 94, the memory 92 and the processor 91 can be connected by a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.
[0112] The memory 92, as a computing device readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the image query method provided in any embodiment of the present application. The memory 92 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the device, etc. In addition, the memory 92 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 92 may further include a memory remotely arranged relative to the processor 91, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0113] The input device 93 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 94 may include a display device such as a display screen.
[0114] The processor 91 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 92, that is, implements the above-mentioned image query method.
[0115] The image query apparatus, device and computer provided above can be used to execute the image query method provided in any of the above embodiments, and have corresponding functions and beneficial effects.
[0116] The embodiment of the present application further provides a storage medium storing computer executable instructions. When the computer executable instructions are executed by a computer processor, they are used to execute the image query method provided in the above embodiment. The image query method includes:
[0117] Acquire image data collected by multiple cameras in real time;
[0118] Determine multiple first picture data according to a preset picture aggregation strategy, aggregate the multiple first picture data to obtain a picture aggregation file, and update the camera index and the picture index according to the aggregation position of the first picture data in the picture aggregation file, each picture index is used to record the storage information of the picture data collected by the same camera in one or more picture aggregation files; each camera index is used to record the storage information of the picture index corresponding to the same camera;
[0119] Receive image query keywords;
[0120] The camera index and the picture index are queried in sequence according to the picture query keyword to obtain target picture data.
[0121] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.
[0122] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application, whose computer executable instructions are not limited to the image query method described above, can also execute related operations in the image query method provided in any embodiment of the present application.
[0123] The image query apparatus, device and storage medium provided in the above embodiments can execute the image query method provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the image query method provided in any embodiment of the present application.
[0124] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A picture query method, characterized in that: include: Acquire image data collected by multiple cameras in real time; Determine multiple first picture data according to a preset picture aggregation strategy, aggregate the multiple first picture data to obtain a picture aggregation file, and update the camera index and the picture index according to the aggregation position of the first picture data in the picture aggregation file, each picture index is used to record the storage information of the picture data collected by the same camera in one or more picture aggregation files; each camera index is used to record the storage information of the picture index corresponding to the same camera; Receive image query keywords; The camera index and the picture index are queried in sequence according to the picture query keyword to obtain target picture data.
2. The image query method according to claim 1, characterized in that: The step of sequentially querying the camera index and the picture index according to the picture query keyword to obtain target picture data includes: Extracting a first keyword corresponding to the information field of the camera index and a second keyword corresponding to the information field of the picture index from the picture query keyword; querying the camera index according to the first keyword to confirm a target picture index from the picture index; When it is confirmed that the target picture index exists, the picture index is queried according to the second keyword to obtain the target picture data.
3. The image query method according to claim 2, characterized in that: The image query method according to any one of claims 1-3 is characterized in that the camera index includes multiple information fields, and the multiple information fields are used to record at least the camera identification, the index file name of the corresponding image index, the file storage address of the corresponding image index and the start time and end time of each corresponding image index.
4. The image query method according to claim 1, characterized in that: The preset picture aggregation strategy includes aggregating in units of a preset first time length, and generating a picture aggregation file corresponding to each unit.
5. The image query method according to claim 4, characterized in that: Each picture index is used to record storage information of picture data collected by the same camera in a plurality of picture aggregation files corresponding to a continuous first time length.
6. The image query method according to any one of claims 1 to 5, characterized in that: The camera index is recorded in a processor, and the picture index is recorded in a memory.
7. The image query method according to claim 6, characterized in that: After determining a plurality of first picture data according to a preset picture aggregation strategy, aggregating the plurality of first picture data to obtain a picture aggregation file, and updating a camera index and a picture index according to the aggregation position of the first picture data in the picture aggregation file, the method further includes: When it is confirmed that the camera index is lost, the picture index is read from the memory, and the camera index is rebuilt according to the read picture index.
8. The image query method according to any one of claims 1 to 5, characterized in that: The picture data includes digital image data and structured data obtained by extracting data from the image.
9. An image query device, characterized in that: include: An image data acquisition module is used to acquire image data collected by multiple cameras in real time; A first picture data determination module, used to determine a plurality of first picture data according to a preset picture aggregation strategy; An aggregation processing module, used for performing aggregation processing on the plurality of first image data to obtain an image aggregation file; An index updating module, used to update a camera index and a picture index according to the aggregation position of the first picture data in the picture aggregation file, each picture index is used to record the storage information of the picture data collected by the same camera in one or more picture aggregation files; each camera index is used to record the storage information of the picture index corresponding to the same camera; A keyword receiving module, used for receiving image query keywords; The target image data acquisition module is used to query the camera index and the image index in sequence according to the image query keyword to obtain the target image data.
10. An electronic device, comprising: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the image query method as described in any one of claims 1-8.
11. A storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the image query method according to any one of claims 1 to 8 when executed by a computer processor.