CN109271545A - A kind of characteristic key method and device, storage medium and computer equipment - Google Patents

A kind of characteristic key method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN109271545A
CN109271545A CN201810873786.6A CN201810873786A CN109271545A CN 109271545 A CN109271545 A CN 109271545A CN 201810873786 A CN201810873786 A CN 201810873786A CN 109271545 A CN109271545 A CN 109271545A
Authority
CN
China
Prior art keywords
feature
compressive features
subset
retrieved
characteristic
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.)
Granted
Application number
CN201810873786.6A
Other languages
Chinese (zh)
Other versions
CN109271545B (en
Inventor
陈宇恒
樊俊良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Sensetime Technology Co Ltd
Original Assignee
Shenzhen Sensetime Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Sensetime Technology Co Ltd filed Critical Shenzhen Sensetime Technology Co Ltd
Priority to CN201810873786.6A priority Critical patent/CN109271545B/en
Publication of CN109271545A publication Critical patent/CN109271545A/en
Application granted granted Critical
Publication of CN109271545B publication Critical patent/CN109271545B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the present invention provides a kind of characteristic key method and device, storage medium and computer equipment, wherein the described method includes: treating retrieval character carries out feature extraction, obtains compressive features to be retrieved;It is searched from copy set and includes at least a targeted compression feature with the matched targeted compression characteristic set of the compressive features to be retrieved, the targeted compression characteristic set, include different compressive features in the copy set;The corresponding candidate feature of each targeted compression feature is determined from primitive character set, forms candidate feature set;It include at least one primitive character in the primitive character set;Candidate feature in the candidate feature set is compared with the feature to be retrieved, obtains the corresponding target candidate feature of the feature to be retrieved.

Description

A kind of characteristic key method and device, storage medium and computer equipment
Technical field
The present invention relates to information service fields, and in particular to a kind of characteristic key method and device, storage medium and calculating Machine equipment.
Background technique
Characteristic key service is a series of feature found out in known features with the characteristic matching to be retrieved of input.It is existing A series of known features storage having in the database, but is usually applied to intelligent video analysis, peace based on characteristic key service The fields such as anti-monitoring, the known features stored in database are magnanimity, such as: it is deposited in national citizen's face information database The face characteristic of storage is the face characteristic of national 1,400,000,000 citizens, including up to 1,400,000,000 known features.Therefore, feature inspection is being carried out Suo Shi searches the feature to be retrieved of input in 1,400,000,000 known features, and the information content that feature itself includes is bigger, causes Processing speed is very slow.
In the related technology, by the way that the compressed known compressive features of known features and the corresponding compression of feature to be retrieved are special Sign is matched, and the corresponding known features of known compressive features that will match to are as final search result, in this way, passing through pressure The retrieval of contracting feature improves recall precision, but greatly reduces retrieval precision.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of characteristic key method and device, storage medium and computer equipment, While improving the retrieval rate of characteristic key, the effective retrieval precision for improving characteristic key.
The technical solution of the embodiment of the present invention is achieved in that
The embodiment of the present invention provides a kind of characteristic key method, which comprises
It treats retrieval character and carries out feature extraction, obtain compressive features to be retrieved;
It is searched from copy set and the matched targeted compression characteristic set of the compressive features to be retrieved, the target Compressive features set includes at least a targeted compression feature, includes different compressive features in the copy set;
The corresponding candidate feature of each targeted compression feature is determined from primitive character set, forms candidate feature set; It include at least one primitive character in the primitive character set;
Candidate feature in the candidate feature set is compared with the feature to be retrieved, is obtained described to be retrieved The corresponding target candidate feature of feature.
In embodiments of the present invention, described to be searched and the matched target of compressive features to be retrieved from copy set Compressive features set, comprising:
Lookup and the matched targeted compression characteristic set of the compressive features to be retrieved from least two copy set, Compressive features included by each copy set are different.
In embodiments of the present invention, the copy set includes the first subset being stored in the first physical machine and is stored in Second subset in second physical machine, first subset are identical with the compressive features in the second subset;
Correspondingly, described to be searched from the copy set and the matched targeted compression spy of the compressive features to be retrieved Collection is closed
From the destination subset of each copy set, search and the matched target pressure of the compressive features to be retrieved Contracting characteristic set, the destination subset are chosen from first subset and the second subset.
In embodiments of the present invention, the copy set includes at least two clusters;It include at least one in the cluster Compressive features, characteristic type belonging to the compressive features in same cluster are identical;Correspondingly, it is described from copy set search with The matched targeted compression characteristic set of compressive features to be retrieved includes:
According to the characteristic feature of the feature to be retrieved and each cluster, determine that target is poly- from the copy set Class, the characteristic feature characterize characteristic type belonging to compressive features in corresponding cluster;
It is searched from the compressive features that the target clusters special with the matched targeted compression of the compressive features to be retrieved Collection is closed.
In embodiments of the present invention, described to be searched and the matched target of compressive features to be retrieved from copy set Compressive features set includes:
Determine the compression distance of each compressive features in the compressive features to be retrieved and the copy set, the pressure The similarity of contracting distance two compressive features of characterization;
The compression distance is less than the compressive features of the compression distance threshold value of setting as the targeted compression feature, shape At targeted compression characteristic set.
In embodiments of the present invention, the cluster is determined by clustering algorithm and the copy set;
The corresponding characteristic feature of the cluster is determined by the corresponding primitive character of compressive features in the cluster.
In embodiments of the present invention, described to determine that each targeted compression feature is corresponding candidate special from primitive character set Sign forms candidate feature set, comprising:
Determine the corresponding index of each targeted compression feature;Wherein, the index is for characterizing the targeted compression Position of the corresponding candidate feature of feature in the primitive character set;
Each mesh is obtained from the primitive character set according to corresponding index of each targeted compression feature The corresponding candidate feature of compressive features is marked, the candidate feature set is formed.
In embodiments of the present invention, before treating retrieval character and carrying out feature extraction, the method also includes:
It treats write-in characteristic and carries out feature extraction, obtain compressive features to be written;
By the first subset of the compressive features write-in target copy set to be written;The target copy set be combined into A copy set in few two copy set;
Corresponding first log of first subset is written into the feature to be written;
The target copy set is written into the corresponding compressive features of the feature to be written according to first log Corresponding second log of the second subset is written in the feature to be written by second subset.
In embodiments of the present invention, the method also includes:
If compressive features are sky in the first subset or second subset of the copy set, according to the first log or second The feature to be written recorded in log, which determines, restores compressive features;Wherein, it records to have in the first subset in first log and press Contracting feature is the feature to be written being written before sky;It is sky that record, which has compressive features in second subset, in second log Preceding feature to be written be written;
First subset or the second subset is written into the recovery compressive features.
In embodiments of the present invention, the method also includes:
If compressive features are sky in the first subset or second subset of the copy set, the copy set pair is searched The meta file answered;Record has compressive features in first subset or the second subset to be write before being sky in the meta file The compressive features entered;
The compressive features recorded in the meta file are determined as snapshot compressive features, the snapshot compressive features are written First subset or the second subset;
The acquisition time for obtaining the last one compressive features in the meta file, according to the acquisition time from the first log Or second determine supplement primitive character in log, by the corresponding compressive features write-in of the supplement primitive character first subset Or the second subset.
In embodiments of the present invention, the method also includes:
If compressive features are sky in the second subset of the copy set, determine recorded in second log most The record time of latter item feature to be written;
Synchronous primitive character is determined from first log according to the record time, the synchronous primitive character is institute State the feature to be written being written in first subset after recording the time;
By the synchronous primitive character corresponding compressive features write-in second subset.
The embodiment of the present invention also provides a kind of characteristic key device, and described device includes: extraction module, searching module, really Cover half block and comparison module;Wherein,
The extraction module carries out feature extraction for treating retrieval character, obtains compressive features to be retrieved;
The searching module, for being searched and the matched targeted compression of compressive features to be retrieved from copy set Characteristic set, the targeted compression characteristic set include at least a targeted compression feature, include difference in the copy set Compressive features;
The determining module, for determining the corresponding candidate feature of each targeted compression feature from primitive character set, Form candidate feature set;It include at least one primitive character in the primitive character set;
The comparison module, for comparing the candidate feature in the candidate feature set with the feature to be retrieved It is right, obtain the corresponding target candidate feature of the feature to be retrieved.
In embodiments of the present invention, the searching module includes: the first lookup submodule;
Described first searches submodule, for searching and the compressive features to be retrieved from least two copy set Matched targeted compression characteristic set, compressive features included by each copy set are different.
In embodiments of the present invention, the copy set includes the first subset being stored in the first physical machine and is stored in Second subset in second physical machine, first subset are identical with the compressive features in the second subset;
Correspondingly, the searching module further include: second searches submodule;
Described second searches submodule, for from the destination subset of each copy set, search with it is described to be checked The matched targeted compression characteristic set of the compressive features of rope, the destination subset is from first subset and the second subset It chooses.
In embodiments of the present invention, the copy set includes at least two clusters;It include at least one in the cluster Compressive features, characteristic type belonging to the compressive features in same cluster are identical;Correspondingly, the searching module further include: really Stator modules and third search submodule;
The determining submodule, for the characteristic feature according to the feature to be retrieved and each cluster, from described Determine that target cluster, the characteristic feature characterize characteristic type belonging to compressive features in corresponding cluster in copy set;
The third searches submodule, for searching and the pressure to be retrieved from the compressive features that the target clusters The targeted compression characteristic set of contracting characteristic matching.
In embodiments of the present invention, the searching module further include: computational submodule and Comparative sub-module;Wherein,
The computational submodule, for determining, each compression is special in the compressive features to be retrieved and the copy set The compression distance of sign, the compression distance characterize the similarity of two compressive features;
The Comparative sub-module, for using the compression distance be less than setting compression distance threshold value compressive features as The targeted compression feature forms targeted compression characteristic set.
In embodiments of the present invention, the determining module includes: index submodule and acquisition submodule;
The index submodule, for determining the corresponding index of each targeted compression feature;Wherein, the index is used In position of the corresponding candidate feature of the characterization targeted compression feature in the primitive character set;
The acquisition submodule, for indexing according to each targeted compression feature is corresponding from the primitive character collection The corresponding candidate feature of each targeted compression feature is obtained in conjunction, forms the candidate feature set.
In embodiments of the present invention, described device further include: writing module is used for:
It treats write-in characteristic and carries out feature extraction, obtain compressive features to be written;
By the first subset of the compressive features write-in target copy set to be written;The target copy set be combined into A copy set in few two copy set;
Corresponding first log of first subset is written into the feature to be written;
The target copy set is written into the corresponding compressive features of the feature to be written according to first log Corresponding second log of the second subset is written in the feature to be written by second subset.
In embodiments of the present invention, described device further include: the first recovery module is used for:
If compressive features are sky in the first subset or second subset of the copy set, according to the first log or second The feature to be written recorded in log, which determines, restores compressive features;Wherein, it records to have in the first subset in first log and press Contracting feature is the feature to be written being written before sky;It is sky that record, which has compressive features in second subset, in second log Preceding feature to be written be written;
First subset or the second subset is written into the recovery compressive features.
In embodiments of the present invention, described device further include: the second recovery module is used for:
If compressive features are sky in the first subset or second subset of the copy set, the copy set pair is searched The meta file answered;Record has compressive features in first subset or the second subset to be write before being sky in the meta file The compressive features entered;
The compressive features recorded in the meta file are determined as snapshot compressive features, the snapshot compressive features are written First subset or the second subset;
The acquisition time for obtaining the last one compressive features in the meta file, according to the acquisition time from the first log Or second determine supplement primitive character in log, by the corresponding compressive features write-in of the supplement primitive character first subset Or the second subset.
In embodiments of the present invention, described device further include: third recovery module is used for:
If compressive features are sky in the second subset of the copy set, determine recorded in second log most The record time of latter item feature to be written;
Synchronous primitive character is determined from first log according to the record time, the synchronous primitive character is institute State the feature to be written being written in first subset after recording the time;
By the synchronous primitive character corresponding compressive features write-in second subset.
The embodiment of the present invention also provides a kind of computer storage medium, is stored with computer in the computer storage medium Executable instruction after the computer executable instructions are performed, can be realized the side of characteristic key provided in an embodiment of the present invention Step in method.
The embodiment of the present invention also provides a kind of computer equipment, and the computer equipment includes memory and image procossing Device is stored with computer executable instructions on the memory, and described image processor runs the computer on the memory The step in the method for characteristic key provided in an embodiment of the present invention can be realized when executable instruction.
The embodiment of the present invention provides a kind of characteristic key method and device, storage medium and computer equipment, wherein will be to Compressive features in the corresponding compressive features of retrieval character and copy set are compared, and find out multiple targeted compression features, will The corresponding primitive character of multiple targeted compression features is found out and feature pair to be retrieved as candidate feature from multiple candidate features The target candidate feature answered;In this way, while improving the retrieval rate of characteristic key, the effective retrieval essence for improving characteristic key Degree.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and those figures show meet this public affairs The embodiment opened, and together with specification it is used to illustrate the technical solution of the disclosure.
Figure 1A is the composed structure schematic diagram one of the network architecture of the embodiment of the present invention;
Figure 1B is the composed structure schematic diagram two of the network architecture of the embodiment of the present invention;
Fig. 2 is the implementation process schematic diagram for the characteristic key method that the embodiment of the present invention one provides;
Fig. 3 is the composed structure schematic diagram of the network architecture provided by Embodiment 2 of the present invention;
Fig. 4 is the implementation process schematic diagram of feature adding method provided by Embodiment 2 of the present invention;
Fig. 5 is the implementation process schematic diagram of characteristic key method provided by Embodiment 2 of the present invention;
Fig. 6 is the implementation process schematic diagram of fault recovery method provided by Embodiment 2 of the present invention;
Fig. 7 A is the schematic diagram one of characteristic key method in the related technology;
Fig. 7 B is the schematic diagram two of characteristic key method in the related technology;
Fig. 7 C is the schematic diagram one for the characteristic key method that the embodiment of the present invention three provides;
Fig. 7 D is the schematic diagram two for the characteristic key method that the embodiment of the present invention three provides;
Fig. 8 is the structural schematic diagram one for the characteristic key device that the embodiment of the present invention four provides;
The composite structural diagram of searching module in the characteristic key device that Fig. 9 A provides for the embodiment of the present invention four;
Fig. 9 B is the structural schematic diagram two for the characteristic key device that the embodiment of the present invention four provides;
The composite structural diagram of determining module in the characteristic key device that Fig. 9 C provides for the embodiment of the present invention four;
Figure 10 is the composed structure schematic diagram for the computer equipment that the embodiment of the present invention four provides.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, the specific technical solution of invention is described in further detail.The following examples are intended to illustrate the invention, but does not have to To limit the scope of the invention.
Figure 1A is the composed structure schematic diagram of the network architecture of the embodiment of the present invention, and as shown in Figure 1A, which includes Retrieval facility 10, service node 11 are wherein interacted between retrieval facility 10, service node 11 by network 21.Retrieval is set Standby 10 can receive the retrieval request of user during realization, and retrieval request is sent to service node 11.Service section Database purchase in point 11 has known primitive character, and it is special that the corresponding compression of each primitive character is also stored in service node 11 Sign.The feature to be retrieved that service node 11 carries retrieval request carries out feature extraction, obtains compressive features to be retrieved, will be to The compressive features of retrieval and each compressive features are compared, find out with the matched targeted compression feature of compressive features to be retrieved, And the corresponding primitive character of targeted compression feature and feature to be retrieved are compared, it finds out the corresponding target of feature to be retrieved and waits Select feature.
Figure 1B is the composed structure schematic diagram of another network architecture of the embodiment of the present invention, as shown in Figure 1B, the network rack Structure includes retrieval facility 10, service node 11-1N and data serving node 20, wherein retrieval facility 10, service node 11 to It is interacted between 1N, data serving node 20 by network 21.Retrieval facility 10 can receive user during realization Retrieval request, and retrieval request is respectively sent to service node 11-1N.Service node 11 is stored with data into 1N respectively A part of the corresponding compressive features of known primitive character in service node 20, and the compressive features into 1N of service node 11 Summation is the corresponding compressive features of primitive character all in data serving node 20.Service node 11 receives retrieval to 1N and asks After asking, feature extraction is carried out to the feature to be retrieved that retrieval request carries respectively, obtains compressive features to be retrieved, it will be to be retrieved Compressive features and the compressive features that are stored be compared, find out and the matched targeted compression of compressive features to be retrieved be special Sign, and the index of targeted compression feature is notified to data serving node 20.Database purchase on data serving node 20 has Known primitive character, it is corresponding that data serving node 20 obtains targeted compression feature according to the index received from database Primitive character, i.e. candidate feature, and candidate feature is sent to service node 11-1N, service node 11-1N is respectively by each candidate Feature and feature to be retrieved are compared, and find out the corresponding target candidate feature of feature to be retrieved.
It, can also be directly to inspection when retrieval facility 10 receives retrieval request in the network structure shown in Figure 1A and Figure 1B The feature to be retrieved that rope request carries carries out feature extraction, obtains compressive features to be retrieved, by compressive features to be retrieved point Service node 11 is sent to 1N.
The application scenarios schematic diagram in conjunction with shown in Figure 1A and Figure 1B, the present embodiment propose a kind of characteristic key method, can While effectively improving the retrieval rate of characteristic key, the effective retrieval precision for improving characteristic key.
The characteristic key method that embodiment provides in order to better understand the present invention, below to part in the embodiment of the present invention Term is illustrated.
Primitive character, for characterize retrieval object long feature, such as: in national citizen's information bank each citizen face letter Breath.It wherein, will include the retrieval image of object to be retrieved as the input of neural network model, the output knot of neural network model Fruit is the primitive character, that is, feature to be retrieved for retrieving image.
Primitive character set, i.e. feature database, the set being made of primitive character.Wherein, corresponding different types of information, can Different feature databases is set, such as: include citizen's information bank of national citizen's information, includes the vehicle of national information of vehicles Information bank.It may include the feature database of multiple and different types in one database.
Compressive features, it is corresponding with primitive character, the short feature obtained after feature extraction is carried out to primitive character.Feature extraction Realization can by Sampling Compression, compression mapping etc. modes realize, so that primitive character be compressed.Such as: primitive character Size be 2K, to primitive character carry out feature extraction, obtain the compressive features of 32byte.Compressive features can be primitive character Key message.
Feature to be retrieved, the primitive character that user is retrieved by the needs that retrieval request inputs, by characteristic key in original The primitive character same or like with feature to be retrieved is searched in beginning characteristic set.
Target candidate feature is characterized the search result of retrieval, being searched in primitive character set with spy to be retrieved Levy same or like primitive character.
Copy set, the set being made of compressive features.One primitive character set can correspond to multiple copy set, each Copy set includes at least one compressive features, and the compressive features in each copy set do not overlap, that is to say, that an original The corresponding compressive features of primitive character in beginning characteristic set are stored in multiple copy set, and the compression in each copy set Feature does not overlap.One copy set may include multiple subsets.Pressure when copy set includes multiple subsets, in each subset Contracting feature is identical.When copy set includes two subsets, the two subsets are respectively the first subset and second subset, copy set Each subset in conjunction is respectively stored in different service nodes.It further include the corresponding index of each compressive features in copy set.
Copy set, the service node of a corresponding copy set.When copy set includes multiple subsets, each subset difference It is stored in corresponding service node, a copy set includes multiple service nodes, stores a subset on each service node. When copy set include the first subset and second subset when, copy set include two service nodes, be respectively main service node and From service node, the first subset is located on main service node, and second subset is located on second service node.
Cluster, the set being made of the identical compressive features of characteristic type, wherein compressive features itself do not have feature class Type, but using the characteristic type of the corresponding primitive character of each compressive features as the characteristic type of corresponding compressive features.
Characteristic feature characterizes the primitive character of the characteristic type of the compressive features in a cluster.
Snapshot document, it is fast for each to the compressive features and the file that is replicated of index in copy set According to file, record has acquisition time when being replicated, and replicated compressive features, the corresponding rope of each compressive features Draw, the information such as the storage location of compressive features.
Meta file, the file of the snapshot document of stored copies set.One meta file can store one or more copy sets The snapshot document of conjunction.
Embodiment one
The present embodiment provides a kind of characteristic key methods, as shown in Fig. 2, the described method comprises the following steps:
S201, retrieval character progress feature extraction is treated, obtains compressive features to be retrieved;
After retrieval facility receives search operaqtion, search operaqtion is responded, it is raw according to the corresponding retrieval image of search operaqtion At feature to be retrieved, wherein feature to be retrieved is to retrieve the characteristic information of retrieval object included in image, and retrieval object can For objects such as face, vehicles.Retrieval facility generates retrieval request according to retrieval character, and the retrieval request of generation is sent to clothes Business node.
After service node receives retrieval request, retrieval request is parsed, obtains the to be retrieved of retrieval request carrying Feature, and treat retrieval character and carry out feature extraction, obtain compressive features to be retrieved.
Here, when retrieval request is sent to service node by retrieval facility, retrieval request can be sent to interface proxy clothes Business, is sent to service node for retrieval request by interface proxy service.When the corresponding compressive features of a feature database be stored in it is more When a copy set, retrieval request is sent to the service node in each copy set.
Such as: the corresponding compressive features of a feature database are divided into three parts, and three parts are respectively stored in copy set A, pair In this collection B and copy set C, then by retrieval request be respectively sent to the service node of copy set A, copy set B service node and The service node of copy set C.
When a copy set includes main service node and when from service node, interface proxy service from main service node and from Destination service node is chosen in service node, and retrieval request is sent to the destination service node in each copy set.Such as: Ibid example, the service node of copy set A include main service node a and from service node a`, and the service node of copy set B includes master Service node b and from service node b`, the service node of copy set C include main service node c and from service node c`, choose clothes Node a, b` and c be engaged in as the destination service node of three copy sets, then retrieval request is sent to service node a, b` and c.Its In, a copy set can be randomly choosed when choosing destination service node, it can also be according to the resource feelings of each service node Condition or loading condition choose destination service node, such as: the main service node a included by the copy set A and from service node a When choosing destination service node in `, the retrieval request that main service node a is presently processing is 4, current from service node a` The retrieval request handled is 6, and the duty factor of main service node a is low from service node a`, chooses main service node a conduct Destination service node.The embodiment of the present invention is to the selection mode of selection destination service node without any restriction.
S202, it is searched and the matched targeted compression characteristic set of the compressive features to be retrieved from copy set;
The targeted compression characteristic set includes at least a targeted compression feature, includes different in the copy set Compressive features;Compressive features in compressive features to be retrieved and the copy set stored are compared by service node, from The determining and to be retrieved matched targeted compression feature of compressive features in copy set, forms targeted compression characteristic set.
In embodiments of the present invention, copy set is storable in the video memory of service node;Correspondingly, described from copy set It is searched and the matched targeted compression characteristic set of the compressive features to be retrieved in conjunction, comprising: pass through image processor (Graphics Processing Unit, GPU) is searched and the matched mesh of compressive features to be retrieved from copy set Mark compressive features set.It is searched from the copy set stored in video memory by GPU and the matched mesh of compressive features to be retrieved When marking compressive features set, support batch operation, service node that can handle simultaneously multiple retrieval requests based on GPU, It determines the corresponding compressive features to be retrieved of each retrieval request, and determines each compressive features pair to be retrieved from copy set The targeted compression characteristic set answered.
In one embodiment, described to be searched and the matched targeted compression of compressive features to be retrieved from copy set Characteristic set, comprising: searched from least two copy set special with the matched targeted compression of the compressive features to be retrieved Collection is closed, and compressive features included by each copy set are different.
Here, retrieval request is sent to the service node in each copy set by interface proxy service, and each service node is from certainly It is searched and the matched targeted compression characteristic set of the compressive features to be retrieved in the copy set of body storage.
Such as: ibid retrieval request is respectively sent to the service node of copy set A, copy set B by example, interface proxy service Service node and copy set C service node, at this point, the service node and copy of the service node of copy set A, copy set B The service node for collecting C is searched and the matched target pressure of the compressive features to be retrieved from the copy set that itself is stored respectively Contracting characteristic set.
In one embodiment, the copy set includes the first subset being stored in the first physical machine and is stored in second Second subset in physical machine, first subset are identical with the compressive features in the second subset;Correspondingly, described from institute Stating lookup and the matched targeted compression characteristic set of the compressive features to be retrieved in copy set includes: from each pair In the destination subset of this set, search and the matched targeted compression characteristic set of the compressive features to be retrieved, the target Subset is chosen from first subset and the second subset.Wherein, the first physical machine is main service node, the second physical machine For from service node.
Such as: the service node of copy set A includes main service node a and from service node a`, the service node of copy set B Including main service node b and from service node b`, the service node of copy set C includes main service node c and from service node c`, The destination service node that service node a, b` and c are respectively three copy sets is chosen, retrieval request is sent to service node a, b ` and c is searched in the first subset then stored on main service node a and is obtained targeted compression characteristic set A, from service node b It is searched in the second subset stored on ` and obtains targeted compression characteristic set B, then the first subset stored on main service node c Middle lookup obtains targeted compression characteristic set C, in the compressive features set be made of targeted compression characteristic set A, B and C, including There is all and matched targeted compression feature of compressive features to be retrieved.
In one embodiment, the copy set includes at least two clusters;It include at least one compression in the cluster Feature, characteristic type belonging to the compressive features in same cluster are identical;Correspondingly, it is described from copy set search with it is described The matched targeted compression characteristic set of compressive features to be retrieved includes: according to the feature to be retrieved and each cluster Characteristic feature determines that target cluster, the characteristic feature characterize in corresponding cluster belonging to compressive features from the copy set Characteristic type;It is searched and the matched targeted compression of compressive features to be retrieved from the compressive features that the target clusters Characteristic set.
Here, a copy set may include multiple clusters, and each cluster includes characteristic feature, to pass through characteristic feature table The characteristic type of compressive features in the corresponding cluster of sign.Wherein, the type for the object that characteristic type is characterized by primitive character, than Such as: when object is face, characteristic type can be the types such as long face, square face, pale skin, casting skin;For another example: object is automobile When, characteristic type is the types such as brand, color.
After receiving retrieval request, the characteristic feature of feature to be retrieved and each cluster that retrieval request is carried is carried out It compares, finds out characteristic feature similar in characteristic type and feature to be retrieved, the corresponding cluster of the characteristic feature found out is determined as Target cluster, wherein target cluster may include multiple clusters, can be and spy to be retrieved with characteristic feature similar in feature to be retrieved The similarity of sign is greater than the characteristic feature of the similarity threshold of setting.Target cluster compressive features in search with it is described to be checked The matched targeted compression characteristic set of the compressive features of rope.
Such as: it include cluster 1, cluster 2, cluster 3 and cluster 4 in copy set, cluster 1 includes characteristic feature 1, cluster 2 include characteristic feature 2, and cluster 3 includes characteristic feature 3, and cluster 4 includes characteristic feature 4;By characteristic feature 1 to typical case Feature 4 is compared with feature to be retrieved respectively, when determining characteristic feature 1 and characteristic feature 2 and characteristic matching to be retrieved, by allusion quotation The cluster 1 corresponding with characteristic feature of type feature 1 and cluster 2 are determined as target cluster, in the compressive features and cluster 2 of cluster 1 Targeted compression characteristic set is searched in compressive features.
For another example: including cluster 1 and cluster 2 in copy set 1, include cluster 3 and cluster 4, cluster 1 in copy set 2 It include characteristic feature 1, cluster 2 includes characteristic feature 2, and cluster 3 includes characteristic feature 3, and cluster 4 includes characteristic feature 4;Characteristic feature 1 to characteristic feature 4 is compared with feature to be retrieved respectively, determine characteristic feature 1 and characteristic feature 2 with to When retrieval character matches, the cluster 1 corresponding with characteristic feature of characteristic feature 1 and cluster 2 are determined as target cluster, in cluster 1 Compressive features and cluster 2 compressive features in search targeted compression characteristic set.
It should be noted that the cluster in each subset is identical when in a copy set including multiple subsets, than Such as: A copy set includes the first subset and second subset, and the cluster in the first subset includes cluster 1 and clusters 2, then the second son The cluster of concentration includes cluster 1 and cluster 2.
Wherein, mesh is determined from the copy set according to the characteristic feature of the feature to be retrieved and each cluster Mark cluster can include: the characteristic feature of each cluster in the feature to be retrieved and the copy set is compared, Determine the similarity of the characteristic feature of the feature to be retrieved and each cluster;It will be greater than the similarity of the similarity threshold of setting Corresponding cluster is determined as target cluster.
Such as: ibid example, the similarity threshold set as 80%, by characteristic feature 1 to characteristic feature 4 respectively with it is to be retrieved Feature is compared, and the similarity of characteristic feature 1 and feature to be retrieved is 86%, characteristic feature 2 and feature to be retrieved it is similar Degree is 82%, and the similarity of characteristic feature 3 and feature to be retrieved is 32%, and the similarity of characteristic feature 4 and feature to be retrieved is 50%, it is determined that characteristic feature 1 and the corresponding cluster 1 of characteristic feature 2 and cluster 2 cluster for target.
It here, can also be to the phase of each characteristic feature and feature to be retrieved when choosing target cluster from multiple clusters It is ranked up like degree, the cluster that similarity comes the setting quantity of front is clustered as target.Such as: ibid example, according to allusion quotation Type feature 1 is ranked up as characteristic feature 1, characteristic feature 2, typical case respectively with the similarity of feature to be retrieved to characteristic feature 4 Feature 4 and characteristic feature 3, accordingly, the sequence of cluster are as follows: cluster 1, cluster 2, cluster 4 and cluster 3, when two clusters of selection When as target cluster, target cluster includes cluster 1 and cluster 2.
In one embodiment, described to be searched and the matched targeted compression of compressive features to be retrieved from copy set Characteristic set comprises determining that the compression distance of each compressive features in the compressive features to be retrieved and the copy set, The compression distance characterizes the similarity of two compressive features;The compression distance is less than to the pressure of the compression distance threshold value of setting Contracting feature forms targeted compression characteristic set as the targeted compression feature.
Compression distance is the similarity between two compressive features, such as: compressive features 1 are 00110011, compressive features 2 It is 00111101, then compression distance are as follows: 3.Compression distance can also be indicated by percentage.The compression distance threshold value of setting it is big It is small to be configured according to actual needs.
S203, the corresponding candidate feature of each targeted compression feature is determined from primitive character set, form candidate feature Set;
It include at least one primitive character in the primitive character set, service node is according in targeted compression characteristic set Each targeted compression feature the corresponding primitive character of each targeted compression feature i.e. candidate feature is obtained from database, this In, there are mapping relations between compressive features and primitive character, according to the mapping relations between compressive features and primitive character The corresponding candidate feature of targeted compression feature is obtained from database, forms candidate feature set.
It is in one embodiment, described that the corresponding candidate feature of each targeted compression feature is determined from primitive character set, Form candidate feature set, comprising: determine the corresponding index of each targeted compression feature;Wherein, the index is used for table Levy position of the corresponding candidate feature of the targeted compression feature in the primitive character set;According to each target pressure The index of contracting feature obtains the corresponding candidate feature of each targeted compression feature from the primitive character set, is formed and is waited Select characteristic set.
At this point, including the first mapping relations of compressive features and index in copy set, service node determines target spy After collection is closed, index pair is obtained from database according to the corresponding index of targeted compression feature each in targeted compression characteristic set The candidate feature answered.
Such as: the targeted compression feature in targeted compression characteristic set includes: that compressive features 1, compressive features 2 and compression are special Sign 3, compressive features 1, compressive features 2 and the corresponding index of compressive features 3 are respectively as follows: 11,12 and 13, and service node will index 11,12 and 13 it is sent to database, index 11,12 and 13 corresponding primitive characters 1,2 and of primitive character is obtained from database Primitive character 3, primitive character 1, primitive character 2 and primitive character 3 are candidate feature, and the collection of composition is combined into candidate characteristic set conjunction.
Here, database can be located on service node, may be alternatively located on data serving node.
S204, the candidate feature in the candidate feature set is compared with the feature to be retrieved, is obtained described The corresponding target candidate feature of feature to be retrieved.
Service node obtain candidate feature set after, by the candidate feature in candidate feature set respectively with feature to be retrieved It is compared, the target candidate feature with characteristic matching to be retrieved is found out from candidate feature set.
In practical applications, after the service node in each copy set determines target candidate feature, by the target of itself determination Candidate feature is sent to retrieval facility.Here, the target candidate feature that itself is determined can be sent to interface proxy by service node Service, so that interface proxy service is collected the search result of each copy set, and is sent to retrieval for the result of collection and sets It is standby.
It should be noted that there are the targets that do not found out in copy set with characteristic matching to be retrieved in characteristic key The case where candidate feature.
In one embodiment, the cluster is determined by clustering algorithm and the copy set;It is described to cluster corresponding typical case Feature is determined by the corresponding primitive character of compressive features in the cluster.Wherein, it when service node receives sort operation, rings The sort operation is answered, from the original spy of classification corresponding with the compressive features in the copy set determining in primitive character set Sign forms classification primitive character set;It is original that the classification primitive character set is divided at least two by clustering algorithm Feature group, and characteristic feature is chosen for each primitive character group;Compression corresponding in each primitive character group is special Sign is determined as a cluster;The corresponding characteristic feature of each primitive character group is determined as to the characteristic feature of corresponding cluster.
Sort operation can also be triggered by the periodic automatic trigger of system by user's operation, and retrieval facility receives point When generic operation, classified by clustering algorithm to the primitive character in the feature database stored in database, by characteristic type phase With primitive character be divided in a primitive character group, and found out in each primitive character group of division and can characterize the original The characteristic feature of the characteristic type of beginning feature group.Wherein, in classification, it can be combined into unit with copy set, to each copy set Primitive character in corresponding primitive character set is classified.Clustering algorithm can for K-MEANS algorithm, K-MEDOIDS algorithm, The clustering algorithms such as CLARANS algorithm, BIRCH algorithm, DBSCAN algorithm, STING algorithm.After determining characteristic feature, by each group The corresponding compressive features of primitive character in primitive character group are determined as a cluster, and each group of primitive character group is corresponding Characteristic feature is determined as the characteristic feature of corresponding cluster.
Such as: primitive character set includes primitive character 101 to 110, is divided primitive character set by clustering algorithm For three primitive character groups: primitive character group 1, primitive character group 2 and primitive character group 3, wherein primitive character group 1 includes original Beginning feature 101,103,105 and 106, corresponding characteristic feature 1 are 103, and primitive character group 2 includes primitive character 102 and 109, Corresponding characteristic feature 2 is 109, and primitive character group 3 includes primitive character 104,107,108 and 110, corresponding characteristic feature 3 It is 104, then in service node, cluster 1 includes primitive character 101,103,105 and 106 corresponding compressive features, clusters 1 Characteristic feature is primitive character 103, and cluster 2 includes the corresponding compressive features of primitive character 102 and 109, clusters 2 characteristic feature For primitive character 109, cluster 3 includes primitive character 104,107,108 and 110 corresponding compressive features, clusters 3 typical case spy Sign is primitive character 104.
In one embodiment, before treating retrieval character and carrying out feature extraction, the method also includes: to spy to be written Sign carries out feature extraction, obtains compressive features to be written;By the compressive features write-in target copy set to be written First subset;The target copy set is combined into a copy set at least two copy set;By the feature to be written Corresponding first log of first subset is written;According to first log by the corresponding compressive features of the feature to be written The corresponding second day of the second subset is written in the feature to be written by the second subset that the target copy set is written Will.
When retrieval facility receives write operation, write operation is responded, write request is generated, write request is sent to The main service node of copy set.When a feature database corresponds to multiple copy sets, a copy set is selected from multiple copy sets, As target copy set, write request is sent to target copy set, the corresponding copy set of target copy set is combined into target copy Set.Wherein, retrieval request can be sent to interface proxy service by retrieval facility, by interface proxy service from multiple copy sets Middle selection target copy set.Here, the selection target copy set from multiple copy sets, can be according to the copy set of each copy set The quantity of included compressive features selection target copy set from multiple copy sets, such as: by the number for the compressive features for including Copy set where measuring the smallest copy set is determined as target copy set.
In practical applications, the state of retrieval facility may include original state and retrieval status.In original state, only receive Write operation, thus ghost set.In retrieval status, it can receive search operaqtion and write operation, looked into copy set The corresponding compressive features to be retrieved of the feature to be retrieved for looking for search operaqtion to be retrieved, and by received write operation to copy set Conjunction is updated.Here, when retrieval status, the execution sequencing of search operaqtion and write operation does not do any restriction, can The update of copy set is carried out based on received write operation between multiple search operaqtion.
When main service node receives write request, feature extraction is carried out to the feature to be written that write request carries, is obtained To compressive features to be written.Here, the algorithm of feature extraction is the same as obtaining the spy of compressive features to be retrieved from feature to be retrieved Levy the algorithm extracted.
The first subset is written in the compressive features that main service node is written into, and right in the first log of main service node The write operation of write-in compressive features is recorded, and the information of record includes feature to be written, write time, writing position, rope The information such as draw, while being written into feature write-in database.
When main service node the first log update when, main service node it is corresponding from service node based on the first log It updates, obtains the feature to be written that the first log is updated, treat write-in characteristic and carry out feature extraction, obtain compression to be written Second subset is written in feature, the compressive features being written into according to the first log, to guarantee the same of the first subset and second subset Step, and the write operation that compressive features to be written are written is recorded in the second log, the information of record includes to be written The information such as feature, write time, writing position, index, to guarantee that the first log is synchronous with the second log.
In embodiments of the present invention, main the first subset of service node is synchronous with the second subset from service node, to make Same copy set can the more retrieval requests of parallel processing, also, one of subset compressive features lose when, compression The subset of Character losing can carry out the recovery of compressive features according to another subset, to guarantee the recovery of copy set.
In embodiments of the present invention, when service node failure leads to the compressive features in the first subset or second subset When loss, fault recovery can be realized by following two mode, that is, realizes the extensive of the compressive features of the first subset or second subset It is multiple:
Mode one: if compressive features were sky in the first subset or second subset of the copy set, according to first day The feature to be written recorded in will or the second log, which determines, restores compressive features;Wherein, record has first in first log Compressive features are the feature to be written being written before sky in subset;There is record in second log compresses spy in second subset Levying is the feature to be written being written before sky;First subset or second son is written into the recovery compressive features Collection.
In the case that service node failure causes stored compressive features to be lost, according to writing in service node Log (corresponding first log of main service node, from corresponding second log of service node) when entering feature to be written is write to obtain All features to be written entered carry out feature extraction to the feature to be written obtained from log, and be restored compressive features, And compressive features will be restored according to log and be written in corresponding first subset or second subset, restore before failure first set or Compressive features in second set.
If compressive features are sky in mode two, the first subset or second subset of the copy set, the pair is searched The corresponding meta file of this set;It is sky that record, which has compressive features in first subset or the second subset, in the meta file The compressive features being written before;The compressive features recorded in the meta file are determined as snapshot compressive features, it will be described fast First subset or the second subset is written according to compressive features;Obtain adopting for the last one compressive features in the meta file Collect the time, determines supplement primitive character from the first log or the second log according to the acquisition time, the supplement is original First subset or the second subset is written in the corresponding compressive features of feature.
It is corresponding according to the service node in the case that service node failure causes stored compressive features to be lost Meta file the compressive features that are replicated of snapshot document and index fault recovery is carried out to the first subset or second subset.This In, one copy set is once replicated every a period of time, that is to say, that the compressive features stored in meta file are most Compressive features before nearly one acquisition time in copy set, i.e. snapshot compressive features can only be restored to acquire by meta file Snapshot compressive features before time, and acquisition time can be got to this section of fault time by the log on service node The feature to be written of time database be written.Here, by acquisition time to database be written this period fault time Feature to be written is known as supplementing primitive character, carries out feature extraction to supplement primitive character, it is corresponding to obtain supplement primitive character Compressive features, and the corresponding compressive features of primitive character will be supplemented according to log, corresponding first subset or second subset is written In, restore the compressive features before failure in first set or second set.
In practical applications, it when the compressive features in service node are lost, can determine whether to work as presence there are meta file When meta file, can directly pass-through mode two carry out compressive features recovery, when be not present meta file when, pass-through mode one is pressed The recovery of contracting feature.
In one embodiment, when second subset compressive features lose, the method also includes: if the copy set Second subset in compressive features be sky, when determining the record of the last item feature to be written recorded in second log Between;Determine that synchronous primitive character, the synchronous primitive character are the note from first log according to the record time The feature to be written in first subset is written after the record time;By the corresponding compressive features write-in of the synchronous primitive character The second subset.
When the compressive features of second subset are lost, after second subset failure, there is likely to be compressions for the first subset Here the second son is written according to the first log in the compressive features that the first subset is written after fault time by the write-in of feature again It concentrates, realizes that the first subset is synchronous with second subset.Wherein, the compressive features of the first subset are written after fault time also It is the compressive features that the write-in second subset recorded after the time is recorded in the second log.
It should be noted that the compression for causing it to store when a service node breaks down is special in the embodiment of the present invention When sign is empty, the fault recovery of compressive features is carried out to the service node according to the corresponding log of the service node or meta file, Wherein, fault recovery and characteristic key, feature write-in (feature addition) execution sequentially without any restriction, such as: During carrying out characteristic key, service node breaks down, at this point, terminal feature is retrieved, executes fault recovery, extensive to failure After the completion of multiple, continue characteristic key;For another example: before fault recovery, characteristic key is carried out according to retrieval request A, After fault recovery, characteristic key is carried out according to retrieval request B;For another example: before fault recovery, carrying out feature A to be written The write-in of corresponding compressive features a, is updated copy set, and after fault recovery, it is corresponding to carry out feature B to be written The write-in of compressive features b updates copy set again.
In practical applications, fragment storage can be carried out to the compressive features in each copy set according to stripping strategy, by one A copy set is divided into multiple fragments, and each fragment is divided into multiple clusters.The embodiment of the present invention to stripping strategy not Carry out any restriction.
Embodiment two
In embodiments of the present invention, by network structure shown in Fig. 3 to characteristic key side provided in an embodiment of the present invention Method is further described.Network structure shown in Fig. 3 includes: interface proxy service (shard-proxy) 301, service node 302, database 303 and object storage 304;Wherein, service node 302 includes the progress of work (worker) and GPU/CPU, service Compressive features used when worker is retrieved are stored in the memory of node.Each copy set (ReplicaSet) includes Two service nodes: main service node and from service node, wherein the worker of main service node is host process (master), It is to be stored with the first subset from process (slave), the video memory of main service node from the worker of service node, from service node Video memory in be stored with second subset.The first subset in main service node and a pair is constituted from the second subset of service node This set.
Each component shown in Fig. 3 is illustrated respectively below.
Interface proxy service 301, is used for feature database management and primitive character management, feature database management includes: feature database Between increase, the deletion of feature database, the modification of feature database, the lookup of feature database, stripping strategy and maintenance features library and fragment Mapping relations, primitive character management includes: the increase of primitive character, the deletion of primitive character and the retrieval of primitive character; Wherein, when receiving the retrieval request retrieved to primitive character, distribution is scheduled to retrieval request, and tie to retrieval Fruit is collected.
Wherein, interface proxy service 301 can connect multiple retrieval facility (not shown) simultaneously, pass through retrieval facility and user It interacts, so that user is managed feature database and primitive character by interface proxy service.In practical applications, interface Agency service 301 can also be directly as retrieval facility.
Service node 302, including the characteristic key service binding of Worker and GPU/CPU, Worker and GPU, in memory It is stored with compressive features.When service node receives the retrieval request of 301 distribution of interface proxy service, controlled by GPU/CPU Worker handles retrieval request to obtain search result, and search result is sent to interface proxy service.When service saves When point receives the write request of interface proxy service distribution, write request is handled by worker, is written in video memory The corresponding compressive features of feature to be written, and be written into feature and be sent to database 303.
ReplicaSet main service node in dotted line frame and constitutes one from service node as shown in the dotted line frame in Fig. 3 A ReplicaSet.Main service node is identical with the compressive features stored from service node, between different Replicaset Compressive features be not overlapped.Main service node and worker from service node are respectively master and slave.It is different The worker of Replicaset can simultaneously be handled a retrieval request, and be directed to a retrieval request, by Replicaset corresponding master or slave handles the retrieval request.
Based on the interaction between interface proxy service 301 and service node, master executes read operation and write operation, Slave executes read operation.When interface proxy service receives retrieval request, retrieval request is sent to respectively by interface proxy service Master or slave in copy set, retrieval request from copy set for reading the spy to be retrieved carried with retrieval request Levy corresponding target candidate feature;When interface proxy service receives write request, write request is sent to copy set pair The first subset is written in the master answered, the corresponding feature to be written of the feature to be written for being carried write request by master, And it is written into feature write-in database.Master by operation log (the first log), realize master the first subset and The synchronization of compressive features in the second subset of slave.
Database 303 can be Cassandra or other databases for storing primitive character set.
In practical applications, management by district is carried out to the compressive features in copy set, it is, by copy set Compressive features are divided into multiple fragments, and correspondingly, primitive character corresponding with the compressive features in the copy set is in database In also carry out management by district, and the fragment of primitive character is corresponding in the fragment with database of compressive features in copy set.Than Such as: the compressive features in copy set include compressive features 101, compressive features 102 to compressive features 200, and are divided into 3 points Piece, wherein fragment 1 includes compressive features 101, compressive features 102 to compressive features 130, and fragment 2 includes compressive features 131, pressure Contracting feature 132 to compressive features 180, fragment 3 includes compressive features 181, compressive features 182 to compressive features 200, correspondingly, In database, compressive features 101, compressive features 102 to the corresponding primitive character of compressive features 130 are a fragment, are referred to as divided Piece 1`, compressive features 131, compressive features 132 to the corresponding primitive character of compressive features 180 be a fragment, referred to as fragment 2`, Compressive features 181, compressive features 182 to the corresponding primitive character of compressive features 200 are a fragment, referred to as fragment 3`.
For each of copy set fragment, can be made of multiple clusters.Such as: for above-mentioned including compressive features 101, compressive features 102 to compressive features 130 fragment 1, including cluster A, cluster B and cluster C;For above-mentioned special including compression The fragment 2 of sign 131, compressive features 132 to compressive features 180, including cluster D and cluster E;For including compressive features 181, pressure Contracting feature 182 to compressive features 200 fragment 3, including cluster F, cluster G and cluster H.
Here, the compressive features in copy set are divided into multiple fragments, the compressive features in copy set is carried out Management by district, and compressive features included by each fragment are clustered, multiple clusters are divided into, thus as unit of fragment It is clustered, while improving cluster speed, improves clustering precision.
Object storage 304 is stored with the snapshot document of each copy set, snapshot text for storing meta file in meta file Part is used for copy set fast failure recovery.
In practical applications, interface proxy shown in Fig. 3 takes 301, service node 302, database 303 and object storage 304 can respectively correspond different physical machines.
Characteristic key method provided in an embodiment of the present invention is retouched in detail below with reference to network structure shown in Fig. 3 It states.Wherein, characteristic key method provided in an embodiment of the present invention may include following three scenes: feature addition, characteristic key and Fault recovery.
Scene 1, feature addition
The feature adding method of scene 1 is as shown in Figure 4, comprising:
S401, retrieval facility generate write request, and write request is sent to interface proxy service;
When needing to add primitive character in the database, user carries out write operation by retrieval facility, write operation Operation content is feature to be written, and retrieval facility is generated the write request for carrying feature to be written based on write operation, will be written Request is sent to interface proxy service 301.
S402, interface proxy service determine target copy set, and write request is sent to where target copy set The main service node of copy set;
After interface proxy service 301 receives write request, target copy set is chosen from multiple copy set, will be write Enter the main service node for the copy set that request is sent to where target copy set.Wherein, interface proxy service is from multiple copies It when choosing target copy set in set, can randomly choose, it is minimum capacity can be chosen according to the capacity situation of each copy set Copy set cooperation is target copy set, target copy set can also be determined according to the loading condition of each copy set, by target pair The copy set cooperation that this collection is stored is target copy set.It here, can be according to the compressive features stored in each copy set Quantity determine the capacity situation of each copy set, the capacity for storing the least copy set of compressive features is minimum.
S403, the feature to be written progress that the GPU scheduling master of main service node carries received write request are special Sign is extracted, and compressive features to be written are obtained;
S404, main service node GPU scheduling master be written into compressive features write-in video memory in the first subset;
Here, GPU is also that compressive features to be written generate index, is established between compressive features and index to be written First mapping relations, the index of the compressive features and generation that are written into are stored together into the first subset.
Wherein, establishing between compressive features and index to be written has the second mapping relations, passes through the first mapping relations And second mapping relations establish the corresponding relationship between feature to be written and corresponding compressive features to be written.
S405, main service node GPU scheduling master be written into feature be written the first log;
Here, when main service node is written into feature the first log of write-in, the time of write-in, the position of write-in are also recorded It sets and indexes and wait information relevant to the compressive features of write-in.
S406, main service node are synchronous with from service node according to the first log.
Information relevant to feature to be written is sent to by main service node by the first log in a manner of flowing (stream) From service node.Feature extraction is carried out to the feature to be written recorded in the first log from the GPU of service node scheduling slave, Compressive features to be written are obtained, in the second subset stored in the compressive features write-in video memory being written into, and are written into Feature be written in the second log, the time of relevant to compressive features to be written write-in is recorded in the second log, is written Position and index etc. information.
It should be noted that when from the compressive features write-in video memory that service node is written into, according in the first log Relevant to feature to be written information carries out write operation, therefore, compressive features in the first subset and second subset and every The position of one compressive features, the corresponding index of each compressive features are completely the same.
During feature addition, the Worker in main service node has recorded the write operation of each step to corresponding the In one log.First log is synchronized to slave by Master in a manner of flowing (stream), and slave is often synchronized to from master One write record will write oneself log i.e. second log.
In practical applications, Worker be each write-in primitive character (feature to be written) to GPU application video memory resource, When being inserted into new primitive character, compressive features to be written are calculated by GPU, and the compressive features to be written of calculating are stored in In applied video memory.
Here, the mapping relations of feature database and copy set store in the database, so that interface proxy services statelessization, It being capable of parallel dilatation.
Scene 2, characteristic key
The characteristic key method of scene 2 is as shown in Figure 5, comprising:
S501, retrieval facility generate retrieval request, and retrieval request is sent to interface proxy service;
When needing to retrieve primitive character in the database, user carries out search operaqtion, search operaqtion by retrieval facility Operation content be feature to be retrieved, retrieval facility generates the retrieval request for carrying feature to be retrieved based on search operaqtion, and will Retrieval request is sent to interface proxy service 301.
Here, retrieval facility can receive the image of object to be retrieved based on search operaqtion, by the image of object to be retrieved As the input of neural network model, the feature to be retrieved of the output of neural network model is obtained.
S502, interface proxy service distribute retrieval request to each copy set;
Retrieval request is distributed the service node in (map) to each copy set by interface proxy service.Include in copy set Main service node and when from service node, interface proxy service is according to service node main in each copy set and from service node Resource status determines destination service node from main service node and from service node, and retrieval request is sent to each copy The destination service node of concentration.That is, destination subset is chosen from the first subset and second subset of each copy set, Destination subset is the subset on destination service node.
After S503, service node receive retrieval request, feature extraction is carried out to the feature to be retrieved that retrieval request carries, Obtain compressive features to be retrieved;
After destination service node in each copy set receives retrieval request, worker is called to ask retrieval by GPU Ask and parsed, obtain feature to be retrieved, and call worker to treat retrieval character by GPU and carry out feature extraction, obtain to The compressive features of retrieval.
S504, service node are searched and the matched targeted compression feature of the compressive features to be retrieved from destination subset Set;
Here, when the destination subset in a copy set includes multiple clusters, corresponding destination service node passes through GPU tune The characteristic feature of feature to be retrieved and each cluster is compared with worker, determines that target clusters, wherein target cluster Characteristic feature is identical with the characteristic type of feature to be retrieved, such as: it is all pale skin, for another example, all side's of being faces.Determine that target is poly- After class, by target cluster in compressive features and feature to be retrieved be compared, and calculate separately target cluster in each compression Compression distance is less than the compressive features of compression distance threshold value as mesh by the compression distance between feature and compressive features to be retrieved Compressive features are marked, target signature set is formed.
S505, service node determine candidate feature set from the primitive character set in database;
Destination service node in each copy set calls worker to obtain targeted compression feature from database by GPU Gather corresponding candidate feature set.Here, worker is corresponding by targeted compression feature each in targeted compression characteristic set Index is sent to database, and database root reads the corresponding candidate spy of index according to the index received from primitive character set Sign, and read candidate feature is sent to destination service node.Wherein, be stored in primitive character set primitive character and Corresponding index, and index of the corresponding index of the primitive character compressive features corresponding with the primitive character in copy set It is identical.
Destination service node in each copy set candidate feature based on the received, forms candidate feature set, with A part of candidate feature is chosen from primitive character set to be compared with feature to be retrieved, improves recall precision.
It should be noted that destination service node can send the corresponding rope of multiple targeted compression features to database simultaneously Draw.
Each candidate feature in candidate feature set is compared with feature to be retrieved for S506, service node, obtains Target candidate feature.
Destination service node in each copy set, by each candidate feature and feature to be retrieved in candidate feature set It is compared, obtains the corresponding target candidate feature of each copy set.
Corresponding target candidate feature is sent to interface proxy service by S507, service node.
Respective target candidate feature is sent to interface proxy service by the destination service node in each copy set.By connecing Mouth agency service is collected integration to target candidate feature transmitted by the destination service node in each copy set, and sends To the retrieval facility for receiving search operaqtion.
Here, it when destination service node sends target candidate feature to interface proxy service, also sends special with target candidate Relevant characteristic information is levied, such as: retrieval object is user A, and feature to be retrieved is the feature of the facial image of user A, retrieval Result in target candidate feature it is identical as feature to be retrieved, be the feature of the facial image of user A, used in storage in database When the feature of the facial image of family A, the characteristic information of corresponding storage user A, such as: ID card information, nationality, native place and preceding Section's information etc..
In practical applications, an interface proxy service can correspond to multiple feature databases simultaneously.When interface proxy service receives When to retrieval request, the mapping relations of the feature database and copy set in database are checked;Retrieval request distribution (map) is arrived and is responsible for Some service node in the corresponding replicaset in this feature library, the cautious characteristic key that passes through of service is by the inspection of characteristic key Hitch fruit replies to interface proxy service;Search result is integrated in interface proxy service collects (reduce) into final result.
The search method of 2 feature of scene has following technical advantage:
On the one hand, when destination service node carries out characteristic key, using compressive features distance, (two compressions are special in GPU Similarity between sign) determine, the index for the compressive features being closer is found into and then passes through index in memory or data The primitive character that this batch is closer, i.e. candidate feature set are obtained in library, finally using the original spy in candidate feature set Sign calculates accurate similarity and is ranked up the advantage that the search method had both remained compressive features search speed, another fixed Improve retrieval precision to degree.On the other hand, when destination service node is retrieved by GPU, batch operation is supported, sufficiently The advantage of GPU parallel computation is utilized.Another aspect, is searched in GPU using compressive features, and cost is sufficiently lowered.For example, On 8G video card, reserve 500M space give retrieving use, for every 40byte characteristic (including 32Byte's The index of compressive features and 8Byte), maximum can load 1.9 hundred million compressive features.
Scene 3, fault recovery
The fault recovery method of scene 3 is as shown in Figure 6, comprising:
S600, it detects that video memory breaks down, judges the type of service node;
Here, when service node breaks down, such as: delay machine, the compressive features stored in the video memory of service node occur Abnormal, all compressive features stored in service node are lost.At this point, record fault time, and judge service node Type, if service node is main service node, the compressive features in the first subset are sky, execute S6011, if service section Point is from service node, then the compressive features in second subset is sky, execute S6021;
S6011, meta file is judged whether there is;
It accesses to object storage 304, it is determined whether there are the corresponding member texts of the copy set where current serving Node Part executes S6012 when there are meta file, when meta file is not present, executes S6013.The service section is stored in meta file The snapshot document of compressive features in the copy set of copy set belonging to point.
S6012, according to meta file carry out the first subset compressive features recovery;
Here, the compressive features recorded before the acquisition time for obtaining snapshot document in meta file, are restored to first In subset.According to be written feature of the acquisition time of snapshot document after reading acquisition time in the first log, mended Fill primitive character, i.e. the feature to be written that is written to this period between fault time of acquisition time, to supplement primitive character into Row feature extraction obtains the corresponding compressive features of supplement primitive character, by acquisition time to this period between fault time The compressive features of write-in are restored to the first subset, complete the recovery of the first subset.
Such as: fault time is 10:35 point, then record has all of feature to be written before 10:35 to write in the first log Operation, the time for finally successively being taken pictures to obtain file of taking pictures to the first subset is 10:15, then file of taking pictures in meta file note Record has the compressive features before 10:15 in the first subset;When there are meta file, according to the file of taking pictures in meta file by first Compressive features in subset before 10:15 are restored, and read the record time 10:15 of snapshot document, according to record time 10:15 10:15 in first log to the feature to be written between 10:35 is played back, 10:15 to 10:35 is obtained and the first subset is written Feature to be written, so that the compressive features in the first subset be restored.
S6013, according to the first log carry out the first subset compressive features recovery;
Feature extraction is carried out to the feature to be written recorded in the first log, it is corresponding to obtain feature to be written in the first log Compressive features, i.e., recovery compressive features, by restore compressive features be written the first subset, to the compressive features in the first subset into Row restores.
S6021, meta file is judged whether there is;
When there are meta file, S6022 is executed, when meta file is not present, executes S6023.
S6022, restored according to compressive features of the meta file to second subset;
Here, the compressive features recorded before the acquisition time for obtaining snapshot document in meta file, are restored to second In subset.According to be written feature of the acquisition time of snapshot document after reading acquisition time in the second log, mended Fill primitive character, i.e. the feature to be written that is written to this period between fault time of acquisition time, to supplement primitive character into Row feature extraction obtains the corresponding compressive features of supplement primitive character, by acquisition time to this period between fault time The compressive features of write-in are restored to second subset.At this point, the compressive features of second subset before fault time are restored, also need to hold Row S6024, to keep the first subset synchronous with second subset.
S6023, according to the second log carry out second subset compressive features recovery;
Feature extraction is carried out to the feature to be written recorded in the second log, it is corresponding to obtain feature to be written in the second log Compressive features, i.e., recovery compressive features, by restore compressive features be written second subset, to the compressive features in second subset into Row restores.
For from service node, restoring compressive features by the feature to be written that is written before fault time, at this point, also needing S6024 is executed, to keep the first subset synchronous with second subset.
S6024, according to the first log carry out the first subset it is synchronous with second subset.
There may be the write-ins of compressive features in fault time to current time, the first subset, at this point, reading first The feature to be written being written after fault time in will i.e. synchronous primitive character here can also be according to recording in the second log The record time of the last item feature to be written reads from being written in the first log after service node failure and synchronizes original spy Sign carries out feature extraction to synchronous primitive character, obtains the synchronous corresponding compressive features of primitive character, by synchronous primitive character pair The compressive features write-in second subset answered, it is synchronous with the first subset to complete second subset.
Snapshot compressive features and the original spy of supplement in scene 3, for the first subset, when being restored by meta file The set that corresponding compressive features are constituted is levied, it is identical as recovery compressive features when being restored by the first log.For Second subset, snapshot compressive features when being restored by meta file, the corresponding compressive features of supplement primitive character with it is synchronous The corresponding compressive features of primitive character are identical as recovery compressive features when being restored by the first log.
In scene 3, when main service node encounters fault recovery, executes following steps: if a, without meta file, passing through First log plays back all write operations;B, if there is meta file, all snapshot documents are loaded according to meta file;C, it is obtained from meta file It obtains to the position of the first log, and since the position, plays back subsequent write operation.Total service node encounters fault recovery When, before 3 steps as main service node, and send last operation serial number to main service node, it is same to collect main service node The write operation to come is walked, and is played back, wherein the last item write operation recorded in last the second log of operation serial number Serial number.
It should be noted that service node is at regular intervals, to the biggish copy set of the knots modification of compressive features into The export of row full dose saves as snapshot document, and generates a new meta file according to the newest snapshot document of all fragments, wherein It include the position of log where snapshot document in meta file.
Characteristic key method provided in an embodiment of the present invention has following technical advantage compared with the existing technology:
1, use GPU as the hardware foundation of characteristic key service, reinforce characteristic key in single machine service calculate it is parallel Degree.
2, the big library of depth characteristic (such as national citizen's face information) automatic multimachine horizontal data is divided, breaks through single machine meter It calculates, storage performance bottleneck.
3, copy set realizes multi-computer Redundancy, i.e., the stored copies set in multiple service nodes, linear improve are retrieved simultaneously Concurrently, and has a complete operation playback mechanism, timing snapshot policy guarantees that data are reliable and quick Fault recovery, has data Reliably, the characteristics such as disaster tolerance.Wherein, disaster tolerance refers to one of service node when something goes wrong, can be same by other storages The service node of the compressive features of sample carries out recovery processing.
Embodiment three
In the embodiment of the present invention, by four kinds of search methods to characteristic key method and present invention implementation in the related technology The characteristic key method that example provides is compared, wherein method 1 and method 2 are characteristic key method in the related technology, method 3 and method 4 be characteristic key method provided in an embodiment of the present invention.
Method 1, primitive character retrieval
Fig. 7 A is the schematic diagram of characteristic key method 1 in the related technology, as shown in Figure 7 A, the primitive character in database Array includes multiple primitive characters, will be in feature to be retrieved and primitive character array when carrying out the retrieval of feature to be retrieved Each primitive character is matched, and the target candidate feature with characteristic matching to be retrieved is found out.
Method 2, compressive features retrieval
Fig. 7 B is the schematic diagram of characteristic key method 2 in the related technology, as shown in Figure 7 B, the compressive features in database Array includes multiple compressive features.When carrying out the retrieval of feature to be retrieved, by the corresponding compression to be retrieved of feature to be retrieved Each compressive features in feature and compressive features array are matched, and are found out and the matched targeted compression of compressive features to be retrieved The corresponding primitive character of targeted compression feature is determined as target candidate feature by feature.
Method 3, compressive features retrieval+primitive character retrieval
Fig. 7 C is the schematic diagram of characteristic key method 3 provided in an embodiment of the present invention.Compression is stored in service node Feature array (i.e. copy set) is stored with initial characteristic data (i.e. primitive character set) in the database.It is to be checked when carrying out When the retrieval of Suo Tezheng, by each compressive features in the corresponding compressive features to be retrieved of feature to be retrieved and compressive features array Matched, find out with the matched targeted compression feature of compressive features to be retrieved, by the corresponding original spy of targeted compression feature Sign is determined as candidate feature, the determining target candidate feature with characteristic matching to be retrieved in candidate feature.
Method 4, cluster+compressive features retrieval+primitive character retrieval
Fig. 7 D is the schematic diagram of characteristic key method 4 provided in an embodiment of the present invention.Compression is stored in service node Feature array (i.e. copy set), and each compressive features array includes multiple clusters, each cluster includes corresponding typical case Feature: (primitive character 1, primitive character 2 ... in respective figure 7D are former by characteristic feature 1, characteristic feature 2 ... characteristic feature N Beginning feature N), it is stored with initial characteristic data (i.e. primitive character set) in the database.When the retrieval for carrying out feature to be retrieved When, feature to be retrieved is compared with the characteristic feature of each cluster, finds out target characteristic feature similar with retrieval character, it will The corresponding cluster of target characteristic feature is determined as target cluster, by feature to be retrieved corresponding compressive features and target to be retrieved Each compressive features in cluster are compared, and determine targeted compression feature, are looked into the corresponding candidate feature of targeted compression feature Look for target candidate feature.Here, each characteristic feature is provided with inverted index, to pass through the corresponding row of falling of target characteristic feature The target cluster for indexing to determine.
Here, by taking the complexity of method 1 is O (n), precision 1, speed are 4 as an example, from complexity, accuracy and speed this Three dimensions are compared the retrieval effectiveness of method 1, method 2, method 3 and method 4, and comparison result is as shown in table 1.
The retrieval effectiveness comparative example of the different search method of table 1
Method 1 Method 2 Method 3 Method 4
Complexity O(n) O(n) O(n) probe/nlist*O(n)
Precision 1 4 2 2 to 3
Speed 4 1 3 1 to 3
Wherein, in the complexity probe/nlist*O (n) of method 4, probe characterizes the quantity of target cluster, that is, It says, target cluster includes probe cluster, and nlist is the total quantity of cluster.In method 4, determined from nlist cluster Probe target cluster, is searched and the matched target of compressive features to be retrieved in the compressive features of probe target cluster Compressive features.Wherein, for the copy set after once clustering, nlist be it is fixed, for each compression to be retrieved Feature, nprobe can be different.
According to table 1, for precision: 1>method of method 3>=4>method of method 2, for speed: 1<method of method 3< 4≤method of=method 2.
Example IV
The embodiment of the present invention provides a kind of characteristic key device, as shown in figure 8, described device include: extraction module 801, Searching module 802, determining module 803 and comparison module 804;Wherein,
Extraction module 801 carries out feature extraction for treating retrieval character, obtains compressive features to be retrieved;
Searching module 802, for being searched and the matched targeted compression of compressive features to be retrieved from copy set Characteristic set, the targeted compression characteristic set include at least a targeted compression feature, and the copy set includes different Compressive features;
Determining module 803, for determining the corresponding candidate feature of each targeted compression feature, shape from primitive character set At candidate feature set;It include at least one primitive character in the primitive character set;
Comparison module 804, for comparing the candidate feature in the candidate feature set with the feature to be retrieved It is right, obtain the corresponding target candidate feature of the feature to be retrieved.
In one embodiment, as shown in Figure 9 A, searching module 802 includes: the first lookup submodule 8021;
First searches submodule 8021, for searching and the compressive features to be retrieved from least two copy set Matched targeted compression characteristic set, compressive features included by each copy set are different.
In one embodiment, the copy set includes the first subset being stored in the first physical machine and is stored in second Second subset in physical machine, first subset are identical with the compressive features in the second subset;
Correspondingly, as shown in Figure 9 A, searching module 802 further include: second searches submodule 8022;
Second searches submodule 8022, for searching and described to be retrieved from the destination subset of the copy set The matched targeted compression characteristic set of compressive features, the destination subset are selected from first subset and the second subset It takes.
In one embodiment, the copy set includes at least two clusters;It include at least one compression in the cluster Feature, characteristic type belonging to the compressive features in same cluster are identical;Correspondingly, as shown in Figure 9 A, searching module 802 is also wrapped It includes: determining that submodule 8023 and third search submodule 8024;
Submodule 8023 is determined, for the characteristic feature according to the feature to be retrieved and each cluster, from described Determine that target cluster, the characteristic feature characterize characteristic type belonging to compressive features in corresponding cluster in copy set;
Third searches submodule 8024, for searching and the pressure to be retrieved from the compressive features that the target clusters The targeted compression characteristic set of contracting characteristic matching.
In one embodiment, as shown in Figure 9 A, searching module 802 further include: computational submodule 8025 and Comparative sub-module 8026;Wherein,
Computational submodule 8025, for determining, each compression is special in the compressive features to be retrieved and the copy set The compression distance of sign, the compression distance characterize the similarity of two compressive features;
Comparative sub-module 8026, for using the compression distance be less than setting compression distance threshold value compressive features as The targeted compression feature forms targeted compression characteristic set.
In one embodiment, as shown in Figure 9 C, determining module 803 includes: index submodule 8031 and acquisition submodule 8032;
Submodule 8031 is indexed, for determining the corresponding index of each targeted compression feature;Wherein, the index is used In position of the corresponding candidate feature of the characterization targeted compression feature in the primitive character set;
Acquisition submodule 8032, for according to the index of each targeted compression feature from the primitive character set The corresponding candidate feature of each targeted compression feature is obtained, the candidate feature set is formed.
In one embodiment, as shown in Figure 9 B, described device further include: writing module 805 is used for:
It treats write-in characteristic and carries out feature extraction, obtain compressive features to be written;
By the first subset of the compressive features write-in target copy set to be written;The target copy set be combined into A copy set in few two copy set;
Corresponding first log of first subset is written into the feature to be written;
The target copy set is written into the corresponding compressive features of the feature to be written according to first log Corresponding second log of the second subset is written in the feature to be written by second subset.
In one embodiment, as shown in Figure 9 B, described device further include: the first recovery module 806 is used for:
If compressive features are sky in the first subset or second subset of the copy set, according to the first log or second The feature to be written recorded in log, which determines, restores compressive features;Wherein, it records to have in the first subset in first log and press Contracting feature is the feature to be written being written before sky;It is sky that record, which has compressive features in second subset, in second log Preceding feature to be written be written;
First subset or the second subset is written into the recovery compressive features.
In one embodiment, as shown in Figure 9 B, described device further include: the second recovery module 807 is used for:
If compressive features are sky in the first subset or second subset of the copy set, the copy set pair is searched The meta file answered;Record has compressive features in first subset or the second subset to be write before being sky in the meta file The compressive features entered;
The compressive features recorded in the meta file are determined as snapshot compressive features, the snapshot compressive features are written First subset or the second subset;
The acquisition time for obtaining the last one compressive features in the meta file, according to the acquisition time from described first Supplement primitive character is determined in log or second log, it will be described in the corresponding compressive features write-in of the supplement primitive character First subset or the second subset.
In one embodiment, as shown in Figure 9 B, described device further include: third recovery module 808 is used for:
If compressive features are sky in the second subset of the copy set, determine recorded in second log most The record time of latter item feature to be written;
Synchronous primitive character is determined from first log according to the record time, the synchronous primitive character is institute State the feature to be written being written in the first subset of the target copy set after recording the time;
By the synchronous primitive character corresponding compressive features write-in second subset.
It should be noted that the description of apparatus above embodiment, be with the description of above method embodiment it is similar, have The similar beneficial effect with embodiment of the method.For undisclosed technical detail in apparatus of the present invention embodiment, this hair is please referred to The description of bright embodiment of the method and understand.
It should be noted that in the embodiment of the present invention, if realizing above-mentioned Instant Messenger in the form of software function module Communication method, and when sold or used as an independent product, it also can store in a computer readable storage medium.Base In such understanding, substantially the part that contributes to existing technology can be in other words for the technical solution of the embodiment of the present invention The form of software product embodies, which is stored in a storage medium, including some instructions to So that instant messaging equipment (can be terminal, server etc.) execute each embodiment the method for the present invention whole or Part.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (Read Only Memory, ROM), magnetic disk Or the various media that can store program code such as CD.In this way, the embodiment of the present invention is not limited to any specific hardware It is combined with software.
Correspondingly, the embodiment of the present invention provides a kind of computer program product again, and the computer program product includes meter Calculation machine executable instruction after the computer executable instructions are performed, can be realized characteristic key provided in an embodiment of the present invention Step in method.
Correspondingly, the embodiment of the present invention provides a kind of storage medium (i.e. computer storage medium) again, and the computer is deposited Computer executable instructions are stored on storage media, the described computer executable instructions realize above-mentioned reality when being executed by processor The step of characteristic key method of example offer is provided.
Correspondingly, the embodiment of the present invention provides a kind of computer equipment, and Figure 10 is computer equipment of the embodiment of the present invention Composed structure schematic diagram, as shown in Figure 10, the equipment 1000 include memory 1005 and GPU1001, are deposited on memory 1005 Computer executable instructions are contained, whens computer executable instructions on GPU1001 run memory 1005 can realize above-mentioned reality The step of characteristic key method of example offer is provided.Wherein, as shown in Figure 10, computer equipment 1000 further includes at least one communication Bus 1002, user interface 1003 and at least one external communication interface 1004.Wherein, communication bus 1002 is arranged for carrying out this Connection communication between a little components.Wherein, user interface 1003 may include display screen, and external communication interface 1004 may include The wireline interface and wireless interface of standard.
The description of the above computer program product, computer equipment and computer storage medium embodiment, with the above method The description of embodiment be it is similar, have with embodiment of the method similar beneficial effect.For computer program product of the present invention, Undisclosed technical detail in computer equipment and computer storage medium embodiment, please refers to retouching for embodiment of the present invention method It states and understands.
It should be understood that " one embodiment " or " embodiment " that specification is mentioned in the whole text mean it is related with embodiment A particular feature, structure, or characteristic is included at least one embodiment of the present invention.Therefore, occur everywhere in the whole instruction " in one embodiment " or " in one embodiment " not necessarily refer to identical embodiment.In addition, these specific features, knot Structure or characteristic can combine in any suitable manner in one or more embodiments.It should be understood that in various implementations of the invention In example, magnitude of the sequence numbers of the above procedures are not meant that the order of the execution order, and the execution sequence of each process should be with its function It can determine that the implementation process of the embodiments of the invention shall not be constituted with any limitation with internal logic.The embodiments of the present invention Serial number is for illustration only, does not represent the advantages or disadvantages of the embodiments.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or device.
In several embodiments provided herein, it should be understood that disclosed device and method can pass through it Its mode is realized.Apparatus embodiments described above are merely indicative.In addition, shown or discussed each composition portion Mutual coupling or direct-coupling or communication connection is divided to can be through some interfaces, the INDIRECT COUPLING of equipment or unit Or communication connection, it can be electrical, mechanical or other forms.
Above-mentioned unit as illustrated by the separation member, which can be or may not be, to be physically separated, aobvious as unit The component shown can be or may not be physical unit;Both it can be located in one place, and may be distributed over multiple network lists In member;Some or all of units can be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
In addition, each functional unit in various embodiments of the present invention can be fully integrated in one processing unit, it can also To be each unit individually as a unit, can also be integrated in one unit with two or more units;It is above-mentioned Integrated unit both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above method embodiment can pass through The relevant hardware of program instruction is completed, and program above-mentioned can store in computer-readable storage medium, which exists When execution, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned includes: movable storage device, read-only deposits The various media that can store program code such as reservoir (Read Only Memory, ROM), magnetic or disk.
If alternatively, the above-mentioned integrated unit of the present invention is realized in the form of software function module and as independent product When selling or using, it also can store in a computer readable storage medium.Based on this understanding, the present invention is implemented Substantially the part that contributes to existing technology can be embodied in the form of software products the technical solution of example in other words, The computer software product is stored in a storage medium, including some instructions are used so that computer equipment (can be with It is personal computer, server or network equipment etc.) execute all or part of each embodiment the method for the present invention. And storage medium above-mentioned includes: various Jie that can store program code such as movable storage device, ROM, magnetic or disk Matter.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (10)

1. a kind of characteristic key method, which is characterized in that the described method includes:
It treats retrieval character and carries out feature extraction, obtain compressive features to be retrieved;
It is searched from copy set and the matched targeted compression characteristic set of the compressive features to be retrieved, the targeted compression Characteristic set includes at least a targeted compression feature, and the copy set includes different compressive features;
The corresponding candidate feature of each targeted compression feature is determined from primitive character set, forms candidate feature set;It is described It include at least one primitive character in primitive character set;
Candidate feature in the candidate feature set is compared with the feature to be retrieved, obtains the feature to be retrieved Corresponding target candidate feature.
2. the method according to claim 1, wherein described search and the pressure to be retrieved from copy set The targeted compression characteristic set of contracting characteristic matching, comprising:
Lookup and the matched targeted compression characteristic set of the compressive features to be retrieved, each from least two copy set Compressive features included by the copy set are different.
3. the method according to claim 1, wherein the copy set includes being stored in the first physical machine First subset and the second subset being stored in the second physical machine, the compressive features in first subset and the second subset It is identical;
Correspondingly, described to be searched and the matched targeted compression characteristic set packet of the compressive features to be retrieved from copy set It includes:
From the destination subset of the copy set, search and the matched targeted compression feature set of the compressive features to be retrieved It closes, the destination subset is chosen from first subset and the second subset.
4. method according to claim 1 or 2, which is characterized in that the copy set includes at least two clusters;It is described It include at least one compressive features in cluster, characteristic type belonging to the compressive features in same cluster is identical;Correspondingly, described It searches from copy set with the matched targeted compression characteristic set of the compressive features to be retrieved and includes:
According to the characteristic feature of the feature to be retrieved and each cluster, target cluster is determined from the copy set, The characteristic feature characterizes characteristic type belonging to compressive features in corresponding cluster;
It is searched and the matched targeted compression feature set of the compressive features to be retrieved from the compressive features that the target clusters It closes.
5. according to the method described in claim 3, it is characterized in that, treat retrieval character carry out feature extraction before, it is described Method further include:
It treats write-in characteristic and carries out feature extraction, obtain compressive features to be written;
By the first subset of the compressive features write-in target copy set to be written;The target copy set is combined at least two A copy set in a copy set;
Corresponding first log of first subset is written into the feature to be written;
The corresponding compressive features of the feature to be written are written the second of the target copy set according to first log Corresponding second log of the second subset is written in the feature to be written by subset.
6. according to the method described in claim 3, it is characterized in that, the method also includes:
If compressive features are sky in the first subset or second subset of the copy set, according to the first log or the second log The feature to be written of middle record, which determines, restores compressive features;Wherein, record has compression in the first subset special in first log Levying is the feature to be written being written before sky;Record has in second subset compressive features in second log be sky before institute The feature to be written of write-in;
First subset or the second subset is written into the recovery compressive features.
7. according to the method described in claim 3, it is characterized in that, the method also includes:
If compressive features are sky in the first subset or second subset of the copy set, it is corresponding to search the copy set Meta file;Record has before compressive features are empty in first subset or the second subset and is written in the meta file Compressive features;
The compressive features recorded in the meta file are determined as snapshot compressive features, it will be described in snapshot compressive features write-in First subset or the second subset;
The acquisition time for obtaining the last one compressive features in the meta file, according to the acquisition time from the first log or Supplement primitive character is determined in two logs, and first subset or institute is written into the corresponding compressive features of the supplement primitive character State second subset.
8. a kind of characteristic key device, which is characterized in that described device includes: extraction module, searching module, determining module and ratio To module;Wherein,
The extraction module carries out feature extraction for treating retrieval character, obtains compressive features to be retrieved;
The searching module, for being searched and the matched targeted compression feature of the compressive features to be retrieved from copy set Set, the targeted compression characteristic set include at least a targeted compression feature, and the copy set includes different compression Feature;
The determining module is formed for determining the corresponding candidate feature of each targeted compression feature from primitive character set Candidate feature set;It include at least one primitive character in the primitive character set;
The comparison module, for the candidate feature in the candidate feature set to be compared with the feature to be retrieved, Obtain the corresponding target candidate feature of the feature to be retrieved.
9. a kind of computer storage medium, which is characterized in that be stored with the executable finger of computer in the computer storage medium It enables, after which is performed, can be realized the described in any item method and steps of claim 1 to 7.
10. a kind of computer equipment, which is characterized in that the computer equipment includes memory and image processor, described to deposit Computer executable instructions are stored on reservoir, described image processor runs the computer executable instructions on the memory When can realize the described in any item method and steps of claim 1 to 7.
CN201810873786.6A 2018-08-02 2018-08-02 Feature retrieval method and device, storage medium and computer equipment Active CN109271545B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810873786.6A CN109271545B (en) 2018-08-02 2018-08-02 Feature retrieval method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810873786.6A CN109271545B (en) 2018-08-02 2018-08-02 Feature retrieval method and device, storage medium and computer equipment

Publications (2)

Publication Number Publication Date
CN109271545A true CN109271545A (en) 2019-01-25
CN109271545B CN109271545B (en) 2022-06-03

Family

ID=65148315

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810873786.6A Active CN109271545B (en) 2018-08-02 2018-08-02 Feature retrieval method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN109271545B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110942046A (en) * 2019-12-05 2020-03-31 腾讯云计算(北京)有限责任公司 Image retrieval method, device, equipment and storage medium
CN111263324A (en) * 2020-01-16 2020-06-09 南京审计大学金审学院 Wireless sensor network compressed sensing processing method based on K-medoids clustering
CN112395441A (en) * 2019-08-14 2021-02-23 杭州海康威视数字技术股份有限公司 Object retrieval method and device
CN112989093A (en) * 2021-01-22 2021-06-18 深圳市商汤科技有限公司 Retrieval method and device and electronic equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050198070A1 (en) * 2004-03-08 2005-09-08 Marpex Inc. Method and system for compression indexing and efficient proximity search of text data
CN102291301A (en) * 2011-08-10 2011-12-21 杭州迪普科技有限公司 Message characteristic matching method and device
CN102945273A (en) * 2012-11-06 2013-02-27 北京百度网讯科技有限公司 Method and equipment for providing search results
CN103942563A (en) * 2014-03-31 2014-07-23 北京邮电大学 Multi-mode pedestrian re-identification technology
CN105095435A (en) * 2015-07-23 2015-11-25 北京京东尚科信息技术有限公司 Similarity comparison method and device for high-dimensional image features
CN106354735A (en) * 2015-07-22 2017-01-25 杭州海康威视数字技术股份有限公司 Image target searching method and device
CN106778526A (en) * 2016-11-28 2017-05-31 中通服公众信息产业股份有限公司 A kind of extensive efficient face identification method based on Hamming distance
CN106874838A (en) * 2016-12-30 2017-06-20 中国科学院自动化研究所 Merge the vision Human bodys' response method of complementary characteristic
CN107633236A (en) * 2017-09-28 2018-01-26 北京达佳互联信息技术有限公司 Picture material understanding method, device and server
CN108073356A (en) * 2016-11-10 2018-05-25 杭州海康威视***技术有限公司 A kind of data storage, lookup method, device and data handling system

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050198070A1 (en) * 2004-03-08 2005-09-08 Marpex Inc. Method and system for compression indexing and efficient proximity search of text data
CN102291301A (en) * 2011-08-10 2011-12-21 杭州迪普科技有限公司 Message characteristic matching method and device
CN102945273A (en) * 2012-11-06 2013-02-27 北京百度网讯科技有限公司 Method and equipment for providing search results
CN103942563A (en) * 2014-03-31 2014-07-23 北京邮电大学 Multi-mode pedestrian re-identification technology
CN106354735A (en) * 2015-07-22 2017-01-25 杭州海康威视数字技术股份有限公司 Image target searching method and device
CN105095435A (en) * 2015-07-23 2015-11-25 北京京东尚科信息技术有限公司 Similarity comparison method and device for high-dimensional image features
WO2017012491A1 (en) * 2015-07-23 2017-01-26 北京京东尚科信息技术有限公司 Similarity comparison method and apparatus for high-dimensional image features
CN108073356A (en) * 2016-11-10 2018-05-25 杭州海康威视***技术有限公司 A kind of data storage, lookup method, device and data handling system
CN106778526A (en) * 2016-11-28 2017-05-31 中通服公众信息产业股份有限公司 A kind of extensive efficient face identification method based on Hamming distance
CN106874838A (en) * 2016-12-30 2017-06-20 中国科学院自动化研究所 Merge the vision Human bodys' response method of complementary characteristic
CN107633236A (en) * 2017-09-28 2018-01-26 北京达佳互联信息技术有限公司 Picture material understanding method, device and server

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
WENXUN ZHENG 等: "CODIS: A New Compression Scheme for Bitmap Indexes", 《ACM/IEEE SYMPOSIUM ON ARCHITECTURES FOR NETWORKING AND COMMUNICATIONS SYSTEMS》, 3 July 2017 (2017-07-03), pages 103 - 104 *
张景祥: "迁移学习技术及其应用研究", 《中国优秀博硕士学位论文全文数据库(博士)信息科技辑》, 15 November 2015 (2015-11-15), pages 140 - 8 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112395441A (en) * 2019-08-14 2021-02-23 杭州海康威视数字技术股份有限公司 Object retrieval method and device
CN110942046A (en) * 2019-12-05 2020-03-31 腾讯云计算(北京)有限责任公司 Image retrieval method, device, equipment and storage medium
CN110942046B (en) * 2019-12-05 2023-04-07 腾讯云计算(北京)有限责任公司 Image retrieval method, device, equipment and storage medium
CN111263324A (en) * 2020-01-16 2020-06-09 南京审计大学金审学院 Wireless sensor network compressed sensing processing method based on K-medoids clustering
CN111263324B (en) * 2020-01-16 2022-02-08 南京审计大学金审学院 Wireless sensor network compressed sensing processing method based on K-medoids clustering
CN112989093A (en) * 2021-01-22 2021-06-18 深圳市商汤科技有限公司 Retrieval method and device and electronic equipment
WO2022156284A1 (en) * 2021-01-22 2022-07-28 深圳市商汤科技有限公司 Retrieval method and apparatus, and electronic device

Also Published As

Publication number Publication date
CN109271545B (en) 2022-06-03

Similar Documents

Publication Publication Date Title
EP2936344B1 (en) Searchable data archive
CN106534344B (en) Cloud platform video processing system and application method thereof
CN109271545A (en) A kind of characteristic key method and device, storage medium and computer equipment
CN106354434A (en) Log data storing method and system
CN109656999B (en) Method, device, storage medium and apparatus for synchronizing large data volume data
CN110321383A (en) Big data platform method of data synchronization, device, computer equipment and storage medium
CN108228709B (en) Data storage method and system, electronic device, program, and medium
CN109145139A (en) A kind of image search method and device, equipment and storage medium
CN109189759A (en) Method for reading data, data query method, device and equipment in KV storage system
CN110515895B (en) Method and system for carrying out associated storage on data files in big data storage system
CN108090186A (en) A kind of electric power data De-weight method on big data platform
CN109947730A (en) Metadata restoration methods, device, distributed file system and readable storage medium storing program for executing
CN110609924A (en) Method, device and equipment for calculating total quantity relation based on graph data and storage medium
CN116821053B (en) Data reporting method, device, computer equipment and storage medium
CN110633379B (en) Graphics Processing Unit (GPU) -parallel-operation-based graphics searching system and method
CN112232290A (en) Data clustering method, server, system, and computer-readable storage medium
CN112052259A (en) Data processing method, device, equipment and computer storage medium
CN111061916A (en) Video sharing system based on multi-target library image recognition
CN115858322A (en) Log data processing method and device and computer equipment
CN115328876A (en) Method and device for recording page operation log
CN115510012A (en) Service data processing method and device, computer equipment and storage medium
CN108804502A (en) Big data inquiry system, method, computer equipment and storage medium
CN113868283A (en) Data testing method, device, equipment and computer storage medium
CN110275863A (en) File moving method, device and storage medium
CN111371818A (en) Data request verification method, device and equipment

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