CN113127659B - Image data input method and device, electronic equipment and storage medium - Google Patents
Image data input method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN113127659B CN113127659B CN201911419619.5A CN201911419619A CN113127659B CN 113127659 B CN113127659 B CN 113127659B CN 201911419619 A CN201911419619 A CN 201911419619A CN 113127659 B CN113127659 B CN 113127659B
- Authority
- CN
- China
- Prior art keywords
- image data
- short
- data
- image
- characteristic value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/51—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/55—Clustering; Classification
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/58—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/583—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/58—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/5866—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, manually generated location and time information
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5018—Thread allocation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/548—Queue
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Library & Information Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention provides an image data input method, an image data input device, electronic equipment and a storage medium, wherein the method comprises the following steps: executing a first thread to input the acquired image data into a first image database; executing a second thread to extract short characteristic values of image data in a preset time period in the first image database, wherein the first thread and the second thread are parallel asynchronous threads, and the data length of the short characteristic values is smaller than that of the image data; and inputting the short characteristic value into a second image database, and establishing an index relation between the short characteristic value and the image data. The image data is recorded and the features are extracted through the two threads respectively, and the two threads are asynchronously parallel, so that the image data can be recorded without waiting for the features to be extracted and then recorded, and the image data recording efficiency is improved.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to an image data input method, an image data input device, an electronic device, and a storage medium.
Background
In the era of information digitization, more and more data are acquired, and more data need to be recorded, for example: and (5) recording image data. The image data recording system is used for acquiring images through a camera, converting the acquired images into digital information, extracting characteristic data, recording the characteristic data into a database, and recording the characteristic data into the database with the efficiency of 1000 pieces/s-1500 pieces/s per second by calculating with one piece of data of 3 KB. However, with the increase of cameras, the subdivision of specific business scenes and the increase of subdivision fields, the image data of faces, human bodies or vehicles and the like acquired by the cameras are required to be recorded at the same time, and the existing recording efficiency obviously cannot meet the recording requirement of the image data. It can be seen that the current image data entry system has the problem of low entry efficiency.
Disclosure of Invention
The embodiment of the invention provides an image data input method, an image data input device, electronic equipment and a storage medium, which can improve the input efficiency of image data.
In a first aspect, an embodiment of the present invention provides an image data input method, including:
executing a first thread, and inputting the acquired image data into a first image database;
executing a second thread, and extracting a short characteristic value of image data in a preset time period in the first image database, wherein the first thread and the second thread are parallel asynchronous threads, and the data length of the short characteristic value is smaller than that of the image data;
And inputting the short characteristic value into a second image database, and establishing an index relation between the short characteristic value and the image data.
Optionally, the executing the first thread inputs the acquired image data into a first image database, including:
When the message queue is detected to meet the preset packing condition, packing the image data in the message queue;
grouping the packed image data according to the attribute value of the image data to obtain grouped image data;
and respectively inputting the grouped image data into the first image database.
Optionally, the image data includes a data ID, and before the image data after being packed according to the attribute value of the image data is grouped to obtain grouped image data, the method further includes;
And de-duplicating the packed image data according to the data ID.
Optionally, the executing the second thread extracts a feature value of the image data in the first image database, including:
detecting whether image data with short characteristic values not extracted within preset time exists in the first image database;
if the image data without the short characteristic value is existed, the short characteristic value extraction is carried out on the image data without the short characteristic value according to a preset extraction rule, and the corresponding short characteristic value is obtained.
Optionally, the extracting rule includes an ordering rule, and extracting the feature value of the image data without extracting the feature value according to a preset extracting rule includes:
and sorting the image data without extracting the characteristic values according to a set sorting rule, and extracting the characteristic values according to the sorting.
Optionally, the extraction rule includes an extraction number, and the step of extracting the feature value of the image data without the extracted feature value according to a preset extraction rule includes:
counting the number of the image data without extracting short characteristic values;
Batching the image data without extracting short characteristic values according to the extraction quantity;
Short eigenvalue extraction is performed on the batched image data.
Optionally, the image data includes a data ID, and the step of storing the short feature value in the second image database and establishing an index relationship between the short feature value and the image data includes:
storing the short feature values in the second image database;
And storing the ID corresponding to the short characteristic value in a memory, and establishing an index relation between the short characteristic value and the corresponding ID so as to enable the short characteristic value and the image data to have the index relation.
In a second aspect, an embodiment of the present invention provides an image data entry apparatus, including:
The input module is used for executing a first thread and inputting the acquired image data into the first image database;
The extraction module is used for executing a second thread and extracting the characteristic value of the image data in the first image database, wherein the first thread and the second thread are parallel asynchronous threads;
and the storage module is used for storing the short characteristic value into a second image database and establishing an index relation between the short characteristic value and the image data.
In a third aspect, an embodiment of the present invention provides an electronic device, including: the image data input method comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the steps in the image data input method provided by the embodiment of the invention when executing the computer program.
In a fourth aspect, embodiments of the present invention provide a computer readable storage medium having a computer program stored thereon, which when executed by a processor implements the steps in the image data entry method provided by the embodiments of the present invention.
In the embodiment of the invention, a first thread is executed to input the acquired image data into a first image database; executing a second thread to extract short characteristic values of image data in a preset time period in the first image database, wherein the first thread and the second thread are parallel asynchronous threads, and the data length of the short characteristic values is smaller than that of the image data; and inputting the short characteristic value into a second image database, and establishing an index relation between the short characteristic value and the image data. The image data is recorded and the features are extracted through the two threads respectively, and the two threads are asynchronously parallel, so that the image data can be recorded without waiting for the features to be extracted and then recorded, and the image data recording efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an image data entry method provided by an embodiment of the present invention;
FIG. 2 is a flow chart of a first thread provided by an embodiment of the present invention;
FIG. 3 is a schematic diagram of a data table according to an embodiment of the present invention;
FIG. 4 is a flowchart of another first thread provided by an embodiment of the present invention;
FIG. 5 is a flow chart of a second thread provided by an embodiment of the present invention;
FIG. 6 is a flow chart of another second thread provided by an embodiment of the present invention;
FIG. 7 is a flowchart of another second thread provided by an embodiment of the present invention;
FIG. 8 is a flow chart of another image data entry method provided by an embodiment of the present invention;
FIG. 9 is a schematic diagram of another data table according to an embodiment of the present invention;
FIG. 10 is a schematic diagram of an image data entry device according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of an input module according to an embodiment of the present invention;
FIG. 12 is a schematic diagram of another input module according to an embodiment of the present invention;
Fig. 13 is a schematic structural diagram of an extraction module according to an embodiment of the present invention;
fig. 14 is a schematic structural diagram of another extraction module according to an embodiment of the present invention;
FIG. 15 is a schematic diagram of another memory module according to an embodiment of the present invention;
fig. 16 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, fig. 1 is a flowchart of an image data input method according to an embodiment of the present invention, as shown in fig. 1, including the following steps:
101. the first thread is executed to input the acquired image data into a first image database.
The image data may be image data collected by an image collecting device, and the image collecting device may be a camera disposed in each application scene, such as a traffic camera, a community camera, a public security camera, a customs camera, and the like. The image data may be digital data generated by the acquired picture, and the image data may be represented by a one-dimensional matrix vector, such as a picture-generated matrix vector. The above matrix vectors can be understood as color values corresponding to pixels of a picture, for example: the rows of the matrix correspond to the pixel heights of the pictures, the columns of the matrix correspond to the pixel widths of the pictures, and the matrix units correspond to the pixel points of the pictures. Specifically, for example, the pixels of a picture are 640 x 480, which means that the picture has 640 pixels horizontally and 480 pixels vertically, and there are 640 x 480=307,200 pixels in total, and the corresponding matrix has 640 columns, 480 rows, and 307,200 matrix units in total, and the pixel value of each pixel corresponds to the value of each matrix unit. The image data may be image data of a face, a human body, a vehicle, etc., and the image data further includes attribute information such as a data ID, a dimension, a type, a version, etc. The data ID is used to identify the image data so as to be different from other different image data; the dimension is used for describing the length of the image data, and the higher the dimension is, the longer the length of the image data is; the types described above may include: types of resident population, authentication collection, police heald staff, key staff and the like of the household register; the above version may be an algorithm version, such as an algorithm version that captures a face, an algorithm version that captures a body, and so on. The first thread may include execution functions such as data interception, data binning, and the like, and may further include at least one of functions such as data packing, data deduplication, and data grouping. The data monitoring may be monitoring whether image data is acquired; the data storage may be to input the acquired image data into an image database; the data packaging can be to acquire batch image data and input the batch image data into a database; the data deduplication may be deleting the duplicated image data, and only one piece of the duplicated image data is reserved; the data grouping may be grouping the image data by classification rules, which are preset by the user. The image database is used for storing the acquired image data and providing searching of the image data.
In the embodiment of the present invention, the image data may also be referred to as image raw data, image raw feature values, image matrix, etc., and the first thread may also be referred to as a consuming thread or an entering thread.
102. And executing a second thread to extract short characteristic values of the image data in a preset time period in the first image database.
Wherein the first thread in step 101 and the second thread in step 102 are asynchronous threads in parallel. The first thread and the second thread are parallel, and the short characteristic value of the extracted image data of the second thread can be executed at the same time of executing the image data input of the first thread; the first thread and the second thread are asynchronous, which means that the first thread and the second thread process different batches of image data. For example, while the first thread records the nth batch of image data, the second thread extracts the characteristic value of the nth-a batch of image data to obtain a short characteristic value, wherein a is a positive integer greater than or equal to 1. The above-described short feature values can be understood as feature values after feature extraction of image data. The above-mentioned feature values are far lower than the corresponding image data in terms of data length. In an understandable manner, the short feature value may also be referred to as a feature value of an image feature value, that is, a feature value obtained by extracting a feature value of an image, and then extracting features of the image feature value, where the short feature value may be represented by a matrix vector. Such as: the image feature values are (1,3,2,7,4, 55, 13, 255, 17, 91), and the feature extraction is performed on the feature values, so that the feature (1, 7, 13, 91) is obtained, the data length is greatly reduced, and it is noted that the feature values of the image data are used for accelerating the search, and the speed of searching the image data can be improved through the feature values of the image data. Taking the face feature values as examples, the face feature values in the database are the (1,3,2,7,4, 55, 13, 255, 17, 91), the feature values of the corresponding face feature values are the (1, 7, 13, 91), when searching the target face, the target face feature values are (1,3,2,7,4, 55, 13, 254, 17, 91), the extracted feature values of the target face feature values are (1, 7, 13, 91), when comparing, only the feature values (1, 7, 13, 91) of the target face feature values and the feature values of the face feature values in the database need to be compared, namely, the feature values (1, 7, 13, 91) of the face feature values in the database are 100% similar, and the comparison of the target face feature values (1,3,2,7,4, 55, 13, 254, 17, 91) and the face feature values (1,3,2,7,4, 55, 13, 255, 17, 91) in the database is not needed, so that the comparison quantity in the database is quite small. The above-mentioned preset time may be the day before the day, for example, the day is 2015, 5, 2, and the preset time period is 2015, 5, 1, i.e. the first thread inputs the image data of 2015, 5, 2, and the second thread extracts the characteristic value of the image data of 2015, 5, 1, which is input into the image database by the first thread. The preset time may also be a time period immediately before the current time period, for example, the current time period is 13:00-14:00, the preset time period is 12:00-13:00.
In the embodiment of the present invention, the short feature values of the image data may also be referred to as an accelerated search feature value, an accelerated search matrix vector, a search feature value, a comparison feature value, and the like. The second thread described above may also be referred to as a fetch thread.
103. And inputting the short characteristic value into a second image database, and establishing an index relation between the short characteristic value and the image data.
The short feature value is the feature value of the image data extracted in step 102, the second image database may be the same as the first image database, or the second image database and the first image database may be independent image databases. The image database may be a local database or a database on a cloud server. When the second image database and the first image database are the same database, the second image database and the first image database refer to different image data storage areas in the database. The above-mentioned index relationship is used for indexing corresponding image data according to the short feature value when searching the image, and may be a direct index or an indirect index. The above direct indexing can be understood as directly associating short features with corresponding image data. The indirect indexing mentioned above is understood to mean indexing by a short eigenvalue to a unique identifier associated with the image data, indexing by the unique identifier to the image data, such as: because the image data has a unique data ID, the short characteristic value and the data ID can be associated to establish an index relation between the short characteristic value and the image data, after the target short characteristic value is obtained by comparison, the data ID associated with the target short characteristic value can be obtained, and the corresponding image data can be obtained from the first image database according to the data ID.
In some possible embodiments, before receiving the image data and extracting the features of the image data, the process is further initialized, where the first thread and the second thread start executing the functions required to be executed at the same time when the process initialization is successful, and the process initialization may be understood as configuring the resources required by the first thread and the second thread into the memory. Thus, the first thread and the second thread can start working at the same time, and data backlog in the first thread is avoided.
It should be noted that, the image data input method provided by the embodiment of the invention can be applied to devices such as a computer, a server and the like for inputting image data.
In the embodiment of the invention, executing a first thread to input acquired image data into a first image database; executing a second thread to extract short characteristic values of image data in a preset time period in the first image database, wherein the first thread and the second thread are parallel asynchronous threads, and the data length of the short characteristic values is smaller than that of the image data; and inputting the short characteristic value into a second image database, and establishing an index relation between the short characteristic value and the image data. Thus, the image data is recorded and the features are extracted through the two threads respectively, and the two threads are asynchronously parallel, so that the image data can be recorded without waiting for the features to be extracted and then recorded, thereby improving the image data recording efficiency.
Optionally, referring to fig. 2, fig. 2 is a flowchart of a first thread provided in an embodiment of the present invention, as shown in fig. 2, including the following steps:
201. and when the message queue is detected to meet the preset packing condition, packing the image data in the message queue.
The message queue is used for temporarily storing the image data collected by the camera, and the message queue can be a first-in first-out queue, i.e. the image data stored first can be taken out first. The above-mentioned preset packing condition may be a time condition or a quantity condition. The above time condition is, for example, 1 second, and there is a time of packing the image data in the message queue every 1 second. The above number conditions, such as 10000 pieces of image data, are that when the image data in the message queue is detected to reach 10000 pieces, the image data in the message queue is packed. It should be noted that the above-mentioned 1 second time and 10000 pieces of image data are exemplary conditions, and should not be construed as limiting the embodiments of the present invention, and specific time conditions or number conditions may be set by a user. The above-mentioned packaging of image data refers to packaging an original independent piece of image data in a message queue into a batch of data for subsequent processing.
In some possible embodiments, when the preset packing condition is not met, the image data is added to the message queue to wait.
202. Grouping the packed image data according to the attribute value of the image data to obtain grouped image data.
The image data includes attribute information such as data ID, dimension, type, version, and time, and the attribute values include values corresponding to the attribute information such as data ID, dimension, type, version, and time, as shown in the data table of fig. 3. The attribute value of the data ID is configured when the image data is generated, for example, the attribute value of the data ID is configured according to the equipment number of the acquired image, the timestamp of the image, the face, the human body, the vehicle, and the like; the attribute value of the dimension may be a value obtained by encoding the dimension of the image data, for example, encoding the image data of 128 dimensions as 1, encoding the image data of 256 dimensions as 2, encoding the image data of 512 dimensions as 3, and the like; the attribute values of the above types can be the encoding of the image data types, for example, the types of resident population, authentication acquisition, police, key personnel and the like of the household are respectively encoded into the attribute values of 1,2,3, 4 and the like. The grouping of the packed image data may be grouping of a single attribute value according to dimensions, types, versions, etc., for example, grouping only dimensions, grouping only types, grouping only versions, etc. Multiple attribute value combinations may be used to group, for example, image data of the same dimension, type, and version into the same group.
203. The grouped image data are respectively input into a first image database.
The grouping image data is obtained in step 202, and the first image database is preset with a data table corresponding to each grouping attribute value, as shown in fig. 3. The entry of the group image data may be to enter each group image data into a data table of corresponding attribute values by attribute values grouped. The above-described entry of the packet image data may be according to a routing rule.
In some possible implementations, if the entry fails, step 201 is re-executed.
In the above steps, the image data meeting the packing conditions can be input into the image database in batches by packing the image data, so that the input efficiency of the image data is further improved. In addition, the grouping input is carried out according to the image data according to the attribute values, so that the image data can be conveniently inquired in the database, and the inquiring efficiency can be improved.
Optionally, referring to fig. 4, fig. 4 is a flowchart of another first thread provided in an embodiment of the present invention, as shown in fig. 4, including the following steps:
301. And when the message queue is detected to meet the preset packing condition, packing the image data in the message queue.
Wherein the image data includes a data ID.
302. And de-duplicating the packed image data according to the data ID.
In the process of acquiring image data, the camera transmits data to the message queue, the message queue is used for packaging the image data, repeated image data possibly appears in the process of transmitting and packaging, the repeated image data can reduce the efficiency of inputting the image data, the efficiency of extracting the characteristics of the image data can be influenced, and the repeated data can occupy the storage resources and I/O resources of an additional image database. When image data is queried, the amount of calculation of the query is increased. In the embodiment of the invention, different image data have different data IDs, and the image data with the same data ID can be discarded in traversing the data IDs in the packed image data so as to ensure that no repeated image data exists in the packed image data.
303. Grouping the packed image data according to the attribute value of the image data to obtain grouped image data.
304. The grouped image data are respectively input into a first image database.
In the steps, the duplication is removed from the packed image data, so that the repeated input condition is avoided, the data input efficiency is improved, and meanwhile, the waste of storage resources and I/O resources of an image database is avoided.
Optionally, referring to fig. 5, fig. 5 is a flowchart of a second thread provided in an embodiment of the present invention, as shown in fig. 5, including the following steps:
401. And detecting whether image data with short characteristic values not extracted within a preset time exists in the first image database.
For the image data recorded in the first image database, the corresponding data table has the corresponding short feature value extraction state, as shown in fig. 3, the short feature value state of the image data without extracting the short feature value is Null, and only whether the value of the short feature value extraction state in the data table is Null is detected, so that whether the image data is the image data without extracting the feature value can be judged. The preset time may be the day before the current day, or may be the previous time period of the current time period. The above detection may be a round robin monitoring of the image data in the first image database, e.g. monitoring once at 1 second.
In some possible embodiments, when the image data is entered in the same data table in batches, when detecting that the value of one image data in the data table is null, it may be considered that the values of all the image data in the data table are null.
402. If the image data without the short characteristic value is existed, the short characteristic value extraction is carried out on the image data without the short characteristic value according to the preset extraction rule, and the corresponding short characteristic value is obtained.
When the short eigenvalue status of the image data in the data table is detected to be Null (Null), it is indicated that there is image data from which eigenvalues are not extracted. The predetermined extraction rule may be extraction according to a sorting rule, or may be extraction according to a predetermined extraction amount, that is, extraction of a certain amount of image data as batch data. The above-mentioned ordering rule may be time ordering or attribute value ordering. Specifically, the short eigenvalue extraction of the image data may be: image data without short feature values are read from the first image data according to a preset extraction rule, and the image data without the short feature values are input into a short feature value extraction engine to extract the short feature values.
In the above steps, the short feature value extraction is performed on the image data without extracting the short feature value in the preset time, so that the short feature extraction can be performed on the image data asynchronously, and the influence of the image input speed of the first thread is small.
Optionally, referring to fig. 6, fig. 6 is a flowchart of another second thread provided in an embodiment of the present invention, as shown in fig. 6, including the following steps:
501. and detecting whether image data with short characteristic values not extracted within a preset time exists in the first image database.
502. And if the image data with the short characteristic values not extracted exist, sorting the image data with the short characteristic values not extracted according to a preset sorting rule, and extracting the characteristic values according to the sorting.
The above-mentioned ordering rule may be time ordering or attribute value ordering. The time ordering may be ordering all image data in which short feature values are not extracted within a preset time according to a type of image data with a sequential entry time, for example, if 5 groups of image data are provided, all short features are not extracted, and within the preset time, the image data are respectively A1, A2, B1, B2 and C1, wherein A1 and A2 are type data (i.e. have the same attribute value and are recorded in different data tables), B1 and B2 are type data, C1 is type data, entry time is from first to last A1, B1, A2, C1 and B2, A1 is arranged in the first, A1 and A2 are selected for extraction because A2 and A1 are type data, B1 and B2 are arranged behind A1 and A2, B1 and B2 are type data, A1 and B2 are extracted behind A1 and A2, and C1 is finally extracted. The attribute value sorting may be sorting according to attribute values corresponding to image data in all image data in which short feature values are not extracted within a preset time, where the attribute values include attribute values of dimension, type, version, etc., for example, sorting is performed according to the height of the dimension attribute values, short feature values of image data with low dimension are extracted first, and then short feature values of image data with high dimension are extracted; sequencing according to the importance degree of the types, firstly extracting short characteristic values of the image data corresponding to the types with high importance degree, and then extracting the short characteristic values of the image data corresponding to the types with low importance degree, wherein the importance degree can be positively related to the use frequency; and sorting according to the version use rate, firstly extracting short characteristic values of the image data corresponding to the version with high winning rate, and then extracting the short characteristic values of the image data corresponding to the version with low winning rate.
In some possible embodiments, the feature values of the same algorithm are preferentially extracted, and the algorithm may be an identification algorithm, a detection algorithm, a tracking algorithm, a clustering algorithm, or the like.
In the steps, the image data are sequenced, so that the extraction of the short characteristic values of the image data is ordered, and the extraction efficiency of the short characteristic values is further improved.
Optionally, referring to fig. 7, fig. 7 is a flowchart of another second thread provided in an embodiment of the present invention, as shown in fig. 7, including the following steps:
601. and detecting whether image data with short characteristic values not extracted within a preset time exists in the first image database.
602. If the image data without the short characteristic value is existed, counting the number of the image data without the short characteristic value.
The above number refers to the total number of image data for which the short feature value is not extracted within a preset time, and the preset time may be the day before the day or the period immediately before the current period.
603. And carrying out batch processing on the image data without extracting the short characteristic values according to the preset extraction quantity.
The preset extraction number can be set by the user, for example, if the extraction number is 5000, 5000 pieces of image data meeting the conditions can be extracted from the first image database at one time to extract short feature values. When the number of the image data without the short feature value extracted by the first image database is 10000, the image data without the short feature value extracted by the first image database is divided into two batches according to the extraction number, and each batch of the image data is respectively extracted with the short feature value.
604. Short eigenvalue extraction is performed on the batched image data.
The batched image data can be sequentially read out and input into the short eigenvalue extraction engine. The batched image data can be processed simultaneously by a plurality of short characteristic value extraction engines, for example, a GPU graphics processor is added to construct a plurality of short characteristic value extraction engines for processing, so that the concurrency performance of short characteristic value extraction can be improved, the extraction efficiency of the short characteristic values is improved, and the input efficiency of the image data is further improved.
In the steps, the image data can be distributed in batches, short characteristic values of the image data can be extracted in batches, the extraction efficiency of the short characteristic values is further improved, and the data input efficiency is further improved.
Optionally, referring to fig. 8, fig. 8 is a flowchart of another image data entry method provided in an embodiment of the present invention, as shown in fig. 8, including the steps of:
701. the first thread is executed to input the acquired image data into a first image database.
702. And executing a second thread to extract short characteristic values of the image data in a preset time period in the first image database.
703. The short feature values are stored in a second image database.
The second image database may be the same as the first image database. In one possible implementation manner, the second image database and the first image database are the same image database, and the extracted short feature value is stored in a data table corresponding to the corresponding image database, as shown in fig. 9, the extracted short feature value is recorded in a corresponding pq_code, and a Null value (Null) is changed to a pair of still short feature values. In another possible embodiment, the second image database and the first image database are different image databases, i.e. the image data and the short feature value are respectively stored in the two image databases, at this time, the image data in the first image database and the short feature value in the second image database have the same data ID, the state of the short feature value in the image database in the first image database is changed from Null to other values, such as changing Null to 1, which indicates that the short feature value has been extracted from the strip of image data, and the short feature value is entered into the second image database.
704. And storing the ID corresponding to the short characteristic value in the memory, and establishing an index relation between the short characteristic value and the corresponding ID so as to enable the short characteristic value and the image data to have the index relation.
The memory is a storage space directly addressed by the CPU, and the short feature value is configured with a data ID, wherein the data ID is a data ID corresponding to the image data from which the short feature value is extracted, that is, the short feature value and the corresponding image data have the same ID, so that an index relation between the short feature value and the corresponding data ID is established. Through the data ID, an index relationship between the feature value and the corresponding image data can be established. For example, when searching an image, extracting a short characteristic value of the image to be searched, reading the short characteristic value in the second image database into a memory, comparing the short characteristic value of the image to be searched with all the short characteristic values read into the memory to obtain a target short characteristic value with the similarity meeting the condition, indexing the target short characteristic value into the memory through the target short characteristic value, finding a corresponding data ID in the first image database through the target data ID in the memory, and reading image data corresponding to the data ID, namely the target image data corresponding to the image data to be searched.
In the above steps, the index relation between the short eigenvalue and the data ID is established, so that the corresponding image data can be indexed by the short eigenvalue during searching.
Referring to fig. 10, fig. 10 is a schematic structural diagram of an image data input device according to an embodiment of the present invention, as shown in fig. 10, including:
an input module 1001, configured to execute a first thread to input acquired image data into a first image database;
An extracting module 1002, configured to execute a second thread to extract a feature value of image data in the first image database, where the first thread and the second thread are parallel asynchronous threads;
and a storage module 1003, configured to store the short feature value in a second image database, and establish an index relationship between the short feature value and the image data.
Optionally, as shown in fig. 11, the entry module 1001 includes:
A detection unit 10011, configured to package image data in the message queue when detecting that the message queue meets a preset package condition;
a grouping unit 10012, configured to group the image data after the bagging according to the attribute value of the image data, so as to obtain grouped image data;
an entry unit 10013 is configured to enter the grouped image data into the first image database respectively.
Optionally, as shown in fig. 12, the image data includes a data ID, and the recording module 1001 further includes:
And a deduplication unit 10014, configured to deduplicate the packed image data according to the data ID.
Optionally, as shown in fig. 13, the extracting module 1002 includes:
A detecting unit 10021, configured to detect whether there is image data in the first image database, where the short feature value is not extracted within a preset time;
The first extraction unit 10022 is configured to, if there is image data with no short feature value extracted, perform short feature value extraction on the image data with no short feature value extracted according to a preset extraction rule, so as to obtain a corresponding short feature value.
Optionally, the extraction rule includes an ordering rule, and the first extraction unit 10022 is further configured to order the image data with the feature values not extracted according to the set ordering rule, and extract the feature values according to the ordering.
Optionally, as shown in fig. 14, the extraction rule includes an extraction number, and the extraction module 1002 includes:
a statistics unit 10023, configured to count the number of image data not extracted with short feature values;
a batch unit 10024 for batching the image data of the non-extracted short feature values according to the extraction quantity;
a second extraction unit 10025, configured to extract short feature values from the batched image data.
Alternatively, as shown in fig. 15, the image data includes a data ID, and the storage module 1003 includes:
A storage unit 10031 for storing the short feature value in the second image database;
And the association unit 10032 is configured to store an ID corresponding to the short feature value in the memory, and establish an index relationship between the short feature value and the corresponding ID, so that the short feature value has an index relationship with the image data.
It should be noted that the image data input device provided by the embodiment of the invention can be applied to devices such as a computer, a server and the like for inputting image data.
The image data input device provided by the embodiment of the invention can realize each process of the image data input method in the embodiment of the method, and in order to avoid repetition, the description is omitted. And the same beneficial effects can be achieved.
Referring to fig. 16, fig. 16 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 16, including: a memory 1602, a processor 1601, and a computer program stored on the memory 1602 and executable on the processor 1601, wherein:
the processor 1601 is configured to call a computer program stored in the memory 1602, and perform the following steps:
executing a first thread, and inputting the acquired image data into a first image database;
executing a second thread, and extracting a short characteristic value of image data in a preset time period in the first image database, wherein the first thread and the second thread are parallel asynchronous threads, and the data length of the short characteristic value is smaller than that of the image data;
And inputting the short characteristic value into a second image database, and establishing an index relation between the short characteristic value and the image data.
Optionally, the step of executing the first thread and recording the acquired image data into the first image database by the processor 1601 includes:
When the message queue is detected to meet the preset packing condition, packing the image data in the message queue;
grouping the packed image data according to the attribute value of the image data to obtain grouped image data;
and respectively inputting the grouped image data into the first image database.
Optionally, the image data includes a data ID, and before the processor 1601 performs grouping the image data after the grouping according to the attribute value of the image data to obtain the grouped image data, the method further includes;
And de-duplicating the packed image data according to the data ID.
Optionally, the executing second thread executed by the processor 1601 extracts a feature value of the image data in the first image database, including;
detecting whether image data with short characteristic values not extracted within preset time exists in the first image database;
if the image data without the short characteristic value is existed, the short characteristic value extraction is carried out on the image data without the short characteristic value according to a preset extraction rule, and the corresponding short characteristic value is obtained.
Optionally, the extracting rule includes an ordering rule, and the step performed by the processor 1601 to extract the feature value of the image data without extracting the feature value according to a preset extracting rule includes:
and sorting the image data without extracting the characteristic values according to a set sorting rule, and extracting the characteristic values according to the sorting.
Optionally, the extracting rule includes an extracting number, and the step performed by the processor 1601 to extract the feature value of the image data without extracting the feature value according to a preset extracting rule includes;
counting the number of the image data without extracting short characteristic values;
Batching the image data without extracting short characteristic values according to the extraction quantity;
Short eigenvalue extraction is performed on the batched image data.
Optionally, the image data includes a data ID, and the step of storing the short feature value in the second image database performed by the processor 1601 and establishing an index relationship between the short feature value and the image data includes;
storing the short feature values in the second image database;
And storing the data ID of the image data corresponding to the short characteristic value in a memory, and establishing an index relation between the short characteristic value and the ID of the corresponding data so as to enable the short characteristic value and the image data to have the index relation.
The electronic device may be a computer, a server, or the like, which may be used for image data input.
The electronic device provided by the embodiment of the invention can realize each process of the image data input method in the embodiment of the method, and in order to avoid repetition, the description is omitted. And the same beneficial effects can be achieved.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements each process of the image data input method provided by the embodiment of the invention, and can achieve the same technical effects, so that repetition is avoided, and no further description is provided herein.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM) or the like.
The foregoing disclosure is illustrative of the present invention and is not to be construed as limiting the scope of the invention, which is defined by the appended claims.
Claims (7)
1. An image data entry method, comprising the steps of:
Executing a first thread, and inputting the acquired image data into a first image database; the image data includes a data ID for identifying the image data to distinguish from other different image data;
the executing the first thread, inputting the acquired image data into a first image database, includes:
When the message queue is detected to meet the preset packing condition, packing the image data in the message queue;
De-duplicating the packed image data according to the data ID;
grouping the packed image data according to the attribute value of the image data to obtain grouped image data;
Respectively inputting the grouped image data into the first image database; the first image database is provided with a data table corresponding to each grouping attribute value in advance, and each grouping image data is recorded into the data table corresponding to the grouping attribute value according to the attribution grouping attribute value;
Executing a second thread, and detecting whether image data which does not extract short characteristic values within preset time exists in the first image database; if the image data without the short characteristic value is existed, the short characteristic value extraction is carried out on the image data without the short characteristic value according to a preset extraction rule, and the corresponding short characteristic value is obtained; for the image data recorded in the first image database, the data table corresponding to the grouping attribute values has corresponding short characteristic value extraction states, and the short characteristic value extraction state of the image data without extracting the short characteristic value is null; when the short characteristic value extraction state of one piece of image data in the data table is detected to be empty, the short characteristic value extraction state of all pieces of image data in the data table is considered to be empty; the first thread and the second thread are parallel asynchronous threads, and the data length of the short characteristic value is smaller than that of the image data;
And inputting the short characteristic value into a second image database, and establishing an index relation between the short characteristic value and the image data.
2. The method of claim 1, wherein the extraction rule includes a ranking rule, and the extracting the feature value of the image data without the extracted feature value according to the preset extraction rule includes:
and sorting the image data without extracting the characteristic values according to a set sorting rule, and extracting the characteristic values according to the sorting.
3. The method of claim 1, wherein the extraction rule includes an extraction number, and the step of extracting the short feature value from the image data without the short feature value according to the preset extraction rule includes:
counting the number of the image data without extracting short characteristic values;
Batching the image data without extracting short characteristic values according to the extraction quantity;
Short eigenvalue extraction is performed on the batched image data.
4. A method according to any one of claims 1 to 3, wherein the step of storing the short feature values in the second image database and establishing an index relationship between the short feature values and the image data comprises:
storing the short feature values in the second image database;
And storing the ID corresponding to the short characteristic value in a memory, and establishing an index relation between the short characteristic value and the corresponding ID so as to enable the short characteristic value and the image data to have the index relation.
5. An image data entry device, the device comprising:
The input module is used for executing a first thread and inputting the acquired image data into the first image database; the image data includes a data ID for identifying the image data to distinguish from other different image data; the executing the first thread, inputting the acquired image data into a first image database, includes: when the message queue is detected to meet the preset packing condition, packing the image data in the message queue; de-duplicating the packed image data according to the data ID; grouping the packed image data according to the attribute value of the image data to obtain grouped image data; respectively inputting the grouped image data into the first image database; the first image database is provided with a data table corresponding to each grouping attribute value in advance, and each grouping image data is recorded into the data table corresponding to the grouping attribute value according to the attribution grouping attribute value;
The extraction module is used for executing a second thread and detecting whether image data with short characteristic values not extracted within preset time exists in the first image database or not; if the image data without the short characteristic value is existed, the short characteristic value extraction is carried out on the image data without the short characteristic value according to a preset extraction rule, and the corresponding short characteristic value is obtained; for the image data recorded in the first image database, the data table corresponding to the grouping attribute values has corresponding short characteristic value extraction states, and the short characteristic value extraction state of the image data without extracting the short characteristic value is null; when the short characteristic value extraction state of one piece of image data in the data table is detected to be empty, the short characteristic value extraction state of all pieces of image data in the data table is considered to be empty; the first thread and the second thread are parallel asynchronous threads, and the data length of the short characteristic value is smaller than that of the image data;
and the storage module is used for storing the short characteristic value into a second image database and establishing an index relation between the short characteristic value and the image data.
6. An electronic device, comprising: memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the image data entry method according to any one of claims 1 to 4 when the computer program is executed.
7. A computer readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, implements the steps in the image data entry method according to any of claims 1 to 4.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911419619.5A CN113127659B (en) | 2019-12-31 | 2019-12-31 | Image data input method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911419619.5A CN113127659B (en) | 2019-12-31 | 2019-12-31 | Image data input method and device, electronic equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN113127659A CN113127659A (en) | 2021-07-16 |
| CN113127659B true CN113127659B (en) | 2024-09-27 |
Family
ID=76769350
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201911419619.5A Active CN113127659B (en) | 2019-12-31 | 2019-12-31 | Image data input method and device, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113127659B (en) |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108959456A (en) * | 2018-06-15 | 2018-12-07 | 珠海格力电器股份有限公司 | Method for automatically recovering complete data |
| CN110110006A (en) * | 2019-04-15 | 2019-08-09 | 平安普惠企业管理有限公司 | Data managing method and Related product |
Family Cites Families (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP5142705B2 (en) * | 2007-12-29 | 2013-02-13 | シャープ株式会社 | Image search device |
| US8948465B2 (en) * | 2012-04-09 | 2015-02-03 | Accenture Global Services Limited | Biometric matching technology |
| CN103412937B (en) * | 2013-08-22 | 2016-12-28 | 成都数之联科技有限公司 | A kind of search purchase method based on handheld terminal |
| CN103902702B (en) * | 2014-03-31 | 2017-11-28 | 北京皮尔布莱尼软件有限公司 | A kind of data-storage system and storage method |
| US11074289B2 (en) * | 2018-01-31 | 2021-07-27 | Microsoft Technology Licensing, Llc | Multi-modal visual search pipeline for web scale images |
| CN116308992A (en) * | 2018-10-31 | 2023-06-23 | Oppo广东移动通信有限公司 | Image processing method and device, electronic device, computer-readable storage medium |
| CN109815960A (en) * | 2018-12-21 | 2019-05-28 | 深圳壹账通智能科技有限公司 | Recognition method, device, device and medium for remake image based on deep learning |
| CN109840962A (en) * | 2018-12-27 | 2019-06-04 | 北京智慧云行科技有限责任公司 | Recognition of face movable attendance checking system and method |
| CN109710789A (en) * | 2018-12-28 | 2019-05-03 | 北京旷视科技有限公司 | Search method, device, electronic equipment and the computer storage medium of image data |
| CN110119396B (en) * | 2019-04-15 | 2023-10-20 | 北京铠悦科技有限公司 | Data management method and related product |
| CN110110113A (en) * | 2019-05-20 | 2019-08-09 | 重庆紫光华山智安科技有限公司 | Image search method, system and electronic device |
| CN110287346B (en) * | 2019-06-28 | 2021-11-30 | 深圳云天励飞技术有限公司 | Data storage method, device, server and storage medium |
-
2019
- 2019-12-31 CN CN201911419619.5A patent/CN113127659B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108959456A (en) * | 2018-06-15 | 2018-12-07 | 珠海格力电器股份有限公司 | Method for automatically recovering complete data |
| CN110110006A (en) * | 2019-04-15 | 2019-08-09 | 平安普惠企业管理有限公司 | Data managing method and Related product |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113127659A (en) | 2021-07-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI743835B (en) | Information processing method, device and storage medium thereof | |
| TWI740537B (en) | Information processing method, device and storage medium thereof | |
| US9204112B2 (en) | Systems, circuits, and methods for efficient hierarchical object recognition based on clustered invariant features | |
| EP2517154B1 (en) | Method and system for sample image index creation and image filtering and search | |
| CN106534344B (en) | Cloud platform video processing system and application method thereof | |
| CN104991959B (en) | A kind of method and system of the same or similar image of information retrieval based on contents | |
| CN110019876B (en) | Data query method, electronic device and storage medium | |
| CN111666443A (en) | Service processing method and device, electronic equipment and computer readable storage medium | |
| US9665773B2 (en) | Searching for events by attendants | |
| CN110888981A (en) | Title-based document clustering method and device, terminal equipment and medium | |
| CN117132926B (en) | Video processing method, related device, equipment and storage medium | |
| CN109710789A (en) | Search method, device, electronic equipment and the computer storage medium of image data | |
| CN109426831B (en) | Image similarity matching and model training method and device and computer equipment | |
| CN105589974A (en) | Surveillance video retrieval method and system based on Hadoop platform | |
| JP2023527239A (en) | Methods and devices for acquiring information and systems for detecting attention | |
| CN111177450B (en) | Image retrieval cloud identification method and system and computer readable storage medium | |
| CN112434049A (en) | Table data storage method and device, storage medium and electronic device | |
| CN110083731A (en) | Image search method, device, computer equipment and storage medium | |
| CN113127659B (en) | Image data input method and device, electronic equipment and storage medium | |
| CN109800215B (en) | Bidding processing method and device, computer storage medium and terminal | |
| CN116383423A (en) | Image retrieval result rearrangement method, device, computer equipment and medium | |
| CN110457998B (en) | Image data association method and apparatus, data processing apparatus, and medium | |
| CN112906466A (en) | Image association method, system and equipment and image searching method and system | |
| CN105843930A (en) | Video search method and device | |
| CN119597981B (en) | A multimodal target data intelligent processing system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |