Feature library scheduling method and device and feature library retrieval method and device

文档序号:7515 发布日期:2021-09-17 浏览:37次 中文

1. A method for scheduling a feature library, the method comprising:

acquiring the request quantity of each feature library in a first storage medium; the first storage medium is a storage medium in a target storage medium, the target storage medium further comprises a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for a feature reading request aiming at the target storage medium; the request quantity of each feature library is determined according to the matching quantity of each feature library and the feature reading request;

acquiring the library capacity of each feature library;

determining the heat value of each feature library according to the request quantity and the library capacity of each feature library; the heat value is used for representing the influence degree of each feature library on the feature reading efficiency of the target storage medium when the feature library is scheduled in the target storage medium;

determining a feature library to be transferred in each feature library according to the sequence of the heat value;

and dispatching the feature library to be transferred to the second storage medium.

2. The method of claim 1, wherein determining the heat value of each feature library according to the request amount and the library capacity of each feature library comprises:

for any one target feature library in the feature libraries, determining a first heat value component according to the request quantity of the target feature library;

determining a second heat value component according to the library capacity of the target feature library;

determining a heat value of the target feature library according to the first heat value component and the second heat value component.

3. The method of claim 2, wherein for the target feature library, the determining the heat value of the target feature library from the first heat value component and the second heat value component comprises:

acquiring a regulation parameter value corresponding to the target feature library, and acquiring a third heat value component according to the regulation parameter value;

determining a heat value of the target feature library from the first, second, and third heat value components.

4. The method of claim 3, wherein determining the heat value of the target feature library from the first, second, and third heat value components comprises:

acquiring the library capacity weight of the target feature library; the library capacity weight is linearly related to the size of the library capacity of the target feature library;

performing weighted calculation on the second heat value component according to the library capacity weight;

and obtaining the heat value of the target feature library according to the first heat value component, the second heat value component after weighting calculation and the third heat value component.

5. The method of claim 3, wherein after scheduling the library of features to be transferred to the second storage medium, further comprising:

acquiring the characteristic library access frequency of the target storage medium; the feature library access frequency is used for representing the frequency of calling in and calling out of each feature library between the first storage medium and the second storage medium;

when the access frequency of the feature library is greater than or equal to the access frequency threshold, adjusting the weight of at least one of the first heat value component, the second heat value component and the third heat value component of each feature library, and updating the heat value of each feature library according to the adjustment result.

6. The method of claim 3, wherein after scheduling the library of features to be transferred to the second storage medium, further comprising:

acquiring request response time of the target storage medium; the request response time is the response time of the target storage medium to the characteristic reading request;

and when the request response time is greater than or equal to a response time threshold, adjusting the weight of at least one of the first heat value component, the second heat value component and the third heat value component of each feature library, and updating the heat value of each feature library according to an adjustment result.

7. The method according to any one of claims 1 to 6, wherein the first storage medium comprises a first storage area and a second storage area; for the storage of the feature library with the heat value sorted in the front, the first storage area takes precedence over the second storage area; determining the feature library to be transferred in each feature library according to the ranking of the heat value, comprising:

and determining a characteristic library to be transferred in the characteristic library of the first storage area according to the sequence of the heat value.

8. The method according to any one of claims 1 to 6, wherein before obtaining the request amount of each feature library in the first storage medium, further comprising:

determining the read hit heat of each feature in the target storage medium; the reading hit heat is determined according to the ratio of the number of times of reading of the features to the total number of times of reading of the target storage medium;

determining the quantity distribution state of the read hit heat;

and grouping the various features according to the quantity distribution state, and determining the obtained groups as feature libraries in the target storage medium.

9. A method for feature retrieval, the method comprising:

acquiring reference retrieval characteristics and characteristic library identification information;

determining a target feature library corresponding to the feature library identification information in a feature library of a first storage medium; the first storage medium is a storage medium in a target storage medium, the target storage medium further comprises a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for a feature reading request aiming at the target storage medium; scheduling the feature library in the first storage medium to the second storage medium when a heat value satisfies a condition, wherein the heat value is used for representing the influence degree of the feature library in the first storage medium on the feature reading efficiency of the target storage medium when the feature library in the first storage medium is scheduled in the target storage medium;

reading the stored characteristics from the target characteristic library;

and determining a target retrieval feature which is matched with the reference retrieval feature from the read features.

10. The method of claim 9, wherein determining the target feature library corresponding to the feature library identification information in the feature library of the first storage medium comprises:

determining target computer equipment in a computer equipment cluster in a load balancing mode; the feature libraries stored by the computer devices in the computer device cluster are consistent, and a first storage medium is configured in the target computer device;

determining the target feature library corresponding to the feature library identification information from a feature library in a first storage medium of the target computer device.

11. The method of claim 10, wherein the first storage medium comprises a first storage area and a second storage area; for the storage of the feature library with the heat value sorted in the front, the first storage area takes precedence over the second storage area; before determining the target feature library corresponding to the feature library identification information from the feature library in the first storage medium of the target computer device, the method further includes:

determining a corresponding hot value of the feature library in the first storage area when the feature library is scheduled in the target storage medium;

and scheduling the feature library in the first storage area with the sequence of the heat value meeting the condition into the second storage medium.

12. An apparatus for scheduling a feature library, the apparatus comprising:

the request quantity acquisition module is used for acquiring the request quantity of each feature library in the first storage medium; the first storage medium is a storage medium in a target storage medium, the target storage medium further comprises a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for a feature reading request aiming at the target storage medium; the request quantity of each feature library is determined according to the matching quantity of each feature library and the feature reading request;

the library capacity acquisition module is used for acquiring the library capacity of each feature library;

the heat value determining module is used for determining the heat value of each feature library according to the request quantity and the library capacity of each feature library; the heat value is used for representing the influence degree of each feature library on the feature reading efficiency of the target storage medium when the feature library is scheduled in the target storage medium;

the to-be-transferred feature library determining module is used for determining the to-be-transferred feature library in each feature library according to the sequence of the heat values;

and the first feature library scheduling module is used for scheduling the feature library to be transferred to the second storage medium.

13. A feature retrieval apparatus, characterized in that the apparatus comprises:

the identification information acquisition module is used for acquiring the reference retrieval characteristics and the characteristic library identification information;

the characteristic library determining module is used for determining a target characteristic library corresponding to the identification information of the characteristic library in the characteristic library of the first storage medium; the first storage medium is a storage medium in a target storage medium, the target storage medium further comprises a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for a feature reading request aiming at the target storage medium; scheduling the feature library in the first storage medium to the second storage medium when a heat value satisfies a condition, wherein the heat value is used for representing the influence degree of the feature library in the first storage medium on the feature reading efficiency of the target storage medium when the feature library in the first storage medium is scheduled in the target storage medium;

a target feature determination module for reading each stored feature from the target feature library;

and the retrieval characteristic determining module is used for determining a target retrieval characteristic matched with the reference retrieval characteristic from the read characteristics.

14. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 8 when executing the computer program.

15. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor realizes the steps of the method according to any one of claims 9 to 11 when executing the computer program.

Background

When processing data, it is necessary to read a feature library from a storage medium based on data features, and further data analysis is performed according to the read feature library.

In order to improve the feature reading efficiency of the feature library in the storage medium, the conventional technology eliminates the feature library from the high-speed storage medium, but the implementation mode is poor in flexibility, and the feature reading efficiency of the storage medium is still low.

It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present invention and therefore may include information that does not constitute prior art known to a person of ordinary skill in the art.

Disclosure of Invention

In view of the above, it is necessary to provide a method, an apparatus, a computer device and a storage medium for scheduling a feature library, which can improve the efficiency of reading features from the storage medium, and to provide a method, an apparatus, a computer device and a storage medium for retrieving a feature library, which can improve the efficiency of retrieving features.

A method of scheduling a feature library, the method comprising: acquiring the request quantity of each feature library in a first storage medium; the first storage medium is a storage medium in a target storage medium, the target storage medium further comprises a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for a feature reading request aiming at the target storage medium; the request quantity of each feature library is determined according to the matching quantity of each feature library and the feature reading request; acquiring the library capacity of each feature library; determining the heat value of each feature library according to the request quantity and the library capacity of each feature library; the heat value is used for representing the influence degree of each feature library on the feature reading efficiency of the target storage medium when the feature library is scheduled in the target storage medium; determining a feature library to be transferred in each feature library according to the sequence of the heat value; and dispatching the feature library to be transferred to the second storage medium.

In one embodiment, for the target feature library, the obtaining the request amount of each feature library in the first storage medium includes: acquiring a current request quantity curve of the target feature library corresponding to a current time period and a historical request quantity curve corresponding to a set historical time period; determining the current request quantity of the target feature library from the current request quantity curve; determining a minimum request quantity and a maximum request quantity of the target feature library from the historical request quantity curve; the determining a first heating value component according to the request quantity of the target feature library comprises: calculating the difference value of the current request quantity relative to the minimum request quantity to obtain a first request quantity difference value; calculating a difference value of the minimum request quantity relative to the maximum request quantity to obtain a second request quantity difference value; predicting the request quantity of the target feature library in a set future time period according to the first request quantity difference value and the second request quantity difference value; determining the first heating value component according to the request amount for setting the future time period.

In one embodiment, the determining a second component of the calorific value from the library capacity of the target feature library comprises: determining the minimum library capacity and the maximum library capacity corresponding to the feature library of the target storage medium; determining a difference value of the library capacity of the target feature library relative to the minimum library capacity to obtain a first library capacity difference value; determining a difference value of the minimum library capacity relative to the maximum library capacity to obtain a second library capacity difference value; determining the second heat value component from the first and second library capacity differences.

In one embodiment, the obtaining of the adjustment parameter value corresponding to the target feature library includes: when the target feature library carries an interested identifier, setting a regulation parameter value of the target feature library as a first parameter value; when the target feature library does not carry the interesting identification, setting the regulation parameter value of the target feature library as a second parameter value; the second parameter value is less than the first parameter value.

In one embodiment, the determining a library of features to be transferred in the library of features in the first storage area according to the ranking of the heat value includes: when the heat value of the feature library existing in the first storage area is lower than the heat value of each feature library of the second storage area, determining the corresponding feature library in the first storage area as the feature library to be transferred; and when the heat value of the characteristic library existing in the first storage area is lower than the heat value of each characteristic library of the second storage medium, determining the corresponding characteristic library in the first storage area as the characteristic library to be transferred.

In one embodiment, after determining the feature library to be transferred in the feature library of the first storage area according to the sorting of the heat value, the method further includes: determining the reading frequency of each feature library in the second storage area within a set historical time period; and scheduling the characteristic library with the reading frequency meeting the condition in the second storage area to the second storage medium.

An apparatus for scheduling a feature library, the apparatus comprising: the request quantity acquisition module is used for acquiring the request quantity of each feature library in the first storage medium; the first storage medium is a storage medium in a target storage medium, the target storage medium further comprises a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for a feature reading request aiming at the target storage medium; the request quantity of each feature library is determined according to the matching quantity of each feature library and the feature reading request; the library capacity acquisition module is used for acquiring the library capacity of each feature library; the heat value determining module is used for determining the heat value of each feature library according to the request quantity and the library capacity of each feature library; the heat value is used for representing the influence degree of each feature library on the feature reading efficiency of the target storage medium when the feature library is scheduled in the target storage medium; the to-be-transferred feature library determining module is used for determining the to-be-transferred feature library in each feature library according to the sequence of the heat values; and the first feature library scheduling module is used for scheduling the feature library to be transferred to the second storage medium.

A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program: acquiring the request quantity of each feature library in a first storage medium; the first storage medium is a storage medium in a target storage medium, the target storage medium further comprises a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for a feature reading request aiming at the target storage medium; the request quantity of each feature library is determined according to the matching quantity of each feature library and the feature reading request; acquiring the library capacity of each feature library; determining the heat value of each feature library according to the request quantity and the library capacity of each feature library; the heat value is used for representing the influence degree of each feature library on the feature reading efficiency of the target storage medium when the feature library is scheduled in the target storage medium; determining a feature library to be transferred in each feature library according to the sequence of the heat value; and dispatching the feature library to be transferred to the second storage medium.

A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of: acquiring the request quantity of each feature library in a first storage medium; the first storage medium is a storage medium in a target storage medium, the target storage medium further comprises a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for a feature reading request aiming at the target storage medium; the request quantity of each feature library is determined according to the matching quantity of each feature library and the feature reading request; acquiring the library capacity of each feature library; determining the heat value of each feature library according to the request quantity and the library capacity of each feature library; the heat value is used for representing the influence degree of each feature library on the feature reading efficiency of the target storage medium when the feature library is scheduled in the target storage medium; determining a feature library to be transferred in each feature library according to the sequence of the heat value; and dispatching the feature library to be transferred to the second storage medium.

The target storage medium comprises a first storage medium and a second storage medium, and for a feature reading request aiming at the target storage medium, the response sequence of the first storage medium has priority over the second storage medium; in the process of scheduling the feature library, determining a request amount according to the matching number of each feature library in the first storage medium and the feature reading request; acquiring the library capacity of each feature library; determining a heat value for representing the influence degree of the feature reading efficiency according to the request quantity and the library capacity of each feature library; and scheduling the obsolete feature library in the first storage medium to the second storage medium according to the sorting of the heat values. The feature library with high heat value is stored in the first storage medium, and the feature reading request can be quickly responded, so that the feature reading efficiency of the whole storage medium is improved.

A method of feature retrieval, the method comprising: acquiring reference retrieval characteristics and characteristic library identification information; determining a target feature library corresponding to the feature library identification information in a feature library of a first storage medium; the first storage medium is a storage medium in a target storage medium, the target storage medium further comprises a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for a feature reading request aiming at the target storage medium; scheduling the feature library in the first storage medium to the second storage medium when a heat value satisfies a condition, wherein the heat value is used for representing the influence degree of the feature library in the first storage medium on the feature reading efficiency of the target storage medium when the feature library in the first storage medium is scheduled in the target storage medium; reading the stored characteristics from the target characteristic library; and determining a target retrieval feature which is matched with the reference retrieval feature from the read features.

In one embodiment, the determining, among the read features, a target retrieval feature that matches the reference retrieval feature includes: determining a feature vector distance between each read feature and the reference search feature; and determining the feature of which the feature vector distance is smaller than a preset distance threshold value in the read features as the target retrieval feature.

In one embodiment, after determining the target retrieval feature matching the reference retrieval feature from the read features, the method further includes: determining first face media information corresponding to the reference retrieval features and second face media information corresponding to the target retrieval features; obtaining the similarity of the first face media information and the second face media information according to the feature vector distance between the reference retrieval feature and the target retrieval feature; and determining a face feature comparison result according to the similarity.

A feature retrieval apparatus, the apparatus comprising: the identification information acquisition module is used for acquiring the reference retrieval characteristics and the characteristic library identification information; the characteristic library determining module is used for determining a target characteristic library corresponding to the identification information of the characteristic library in the characteristic library of the first storage medium; the first storage medium is a storage medium in a target storage medium, the target storage medium further comprises a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for a feature reading request aiming at the target storage medium; scheduling the feature library in the first storage medium to the second storage medium when a heat value satisfies a condition, wherein the heat value is used for representing the influence degree of the feature library in the first storage medium on the feature reading efficiency of the target storage medium when the feature library in the first storage medium is scheduled in the target storage medium; a target feature determination module for reading each stored feature from the target feature library; and the retrieval characteristic determining module is used for determining a target retrieval characteristic matched with the reference retrieval characteristic from the read characteristics.

A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program: acquiring reference retrieval characteristics and characteristic library identification information; determining a target feature library corresponding to the feature library identification information in a feature library of a first storage medium; the first storage medium is a storage medium in a target storage medium, the target storage medium further comprises a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for a feature reading request aiming at the target storage medium; scheduling the feature library in the first storage medium to the second storage medium when a heat value satisfies a condition, wherein the heat value is used for representing the influence degree of the feature library in the first storage medium on the feature reading efficiency of the target storage medium when the feature library in the first storage medium is scheduled in the target storage medium; reading the stored characteristics from the target characteristic library; and determining a target retrieval feature which is matched with the reference retrieval feature from the read features.

A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of: acquiring reference retrieval characteristics and characteristic library identification information; determining a target feature library corresponding to the feature library identification information in a feature library of a first storage medium; the first storage medium is a storage medium in a target storage medium, the target storage medium further comprises a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for a feature reading request aiming at the target storage medium; scheduling the feature library in the first storage medium to the second storage medium when a heat value satisfies a condition, wherein the heat value is used for representing the influence degree of the feature library in the first storage medium on the feature reading efficiency of the target storage medium when the feature library in the first storage medium is scheduled in the target storage medium; reading the stored characteristics from the target characteristic library; and determining a target retrieval feature which is matched with the reference retrieval feature from the read features.

The characteristic retrieval method, the characteristic retrieval device, the computer equipment and the storage medium are characterized in that the target storage medium comprises a first storage medium and a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for the characteristic reading request aiming at the target storage medium; when the heat value meets the condition, the feature library in the first storage medium is dispatched to the second storage medium, so that the feature libraries with high heat values are stored in the first storage medium; in the characteristic retrieval process, acquiring reference retrieval characteristics and characteristic library identification information; because the feature libraries with high heat values are stored in the first storage medium, the target feature library corresponding to the feature library identification information can be quickly positioned in the feature library of the first storage medium, and each stored feature can be quickly read from the target feature library; and determining a target retrieval feature which is matched with the reference retrieval feature from the read features. The characteristic library can be quickly positioned in the storage medium to read the characteristics, so that the characteristic retrieval efficiency of the whole storage medium is improved.

Drawings

FIG. 1 is a diagram of an application environment of a method for scheduling a feature library in one embodiment;

FIG. 2 is a flowchart illustrating a method for scheduling feature libraries in one embodiment;

FIG. 3 is a diagram illustrating a requested volume curve in one embodiment;

FIG. 4 is a diagram illustrating a distribution of library numbers in one embodiment;

FIG. 5 is a schematic diagram of a target storage medium in one embodiment;

FIG. 6 is a diagram illustrating hit rate thermal value distributions in one embodiment;

FIG. 7 is a diagram illustrating an exemplary implementation of a method for scheduling feature libraries;

FIG. 8 is a flow diagram that illustrates a method for feature retrieval in one embodiment;

FIG. 9 is a diagram of an application scenario of the feature retrieval method in one embodiment;

FIG. 10 is a block diagram of a scheduler of the feature library in one embodiment;

FIG. 11 is a block diagram showing the structure of a feature retrieval apparatus according to an embodiment;

FIG. 12 is a diagram illustrating an internal structure of a computer device according to an embodiment.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.

The feature library scheduling method, the feature library scheduling device, the computer device and the storage medium, and the feature library retrieval method, the feature library retrieval device, the computer device and the storage medium provided by the embodiment of the invention can be realized based on Cloud technology (Cloud technology). The cloud technology is a hosting technology for unifying series resources such as hardware, software, network and the like in a wide area network or a local area network to realize the calculation, storage, processing and sharing of data. The cloud technology is based on the general names of network technology, information technology, integration technology, management platform technology, application technology and the like applied in the cloud computing business model, can form a resource pool, is used as required, and is flexible and convenient. Background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture-like websites and more web portals. With the high development and application of the internet industry, each article may have its own identification mark and needs to be transmitted to a background system for logic processing, data in different levels are processed separately, and various industrial data need strong system background support and can only be realized through cloud computing.

The embodiment of the invention can be realized based on Cloud Storage (Cloud Storage), for example, each feature library is stored in a Cloud Storage mode. The distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system which integrates a large number of storage devices (storage devices are also referred to as storage nodes) of different types in a network through application software or application interfaces to cooperatively work through functions of cluster application, grid technology, distributed storage file system and the like, and provides data storage and service access functions to the outside.

At present, a storage method of a storage system is as follows: logical volumes are created, and when created, each logical volume is allocated physical storage space, which may be the disk composition of a certain storage device or of several storage devices. The client stores data on a certain logical volume, that is, the data is stored on a file system, the file system divides the data into a plurality of parts, each part is an object, the object not only contains the data but also contains additional information such as data identification (ID, ID entry), the file system writes each object into a physical storage space of the logical volume, and the file system records storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.

The process of allocating physical storage space for the logical volume by the storage system specifically includes: physical storage space is divided in advance into stripes according to a group of capacity measures of objects stored in a logical volume (the measures often have a large margin with respect to the capacity of the actual objects to be stored) and Redundant Array of Independent Disks (RAID), and one logical volume can be understood as one stripe, thereby allocating physical storage space to the logical volume.

The feature library scheduling method provided by the application can be applied to the application environment shown in fig. 1. The application environment includes a computer device 101 (which may also be referred to as a scheduling control device), a computer device 102 including a first storage medium, and a computer device 103 including a second storage medium. Computer devices 102 and 103 may each be in network communication with computer device 101. The computer device 101 obtains the heat value of each feature in the first storage medium, determines the feature library to be transferred according to the heat value, and schedules the feature library to be transferred to the second storage medium. The computer devices 101, 102 and 103 may be implemented by a server or a terminal. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and artificial intelligence platform. The terminal may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like.

In one embodiment, the first storage medium and the second storage medium may also be in the same computer device. For example: the controller in the computer equipment acquires the heat value of each feature library in the first storage medium, determines the feature library to be transferred according to the heat value, and schedules the feature library to be transferred to the second storage medium.

In an embodiment, as shown in fig. 2, a method for scheduling a feature library is provided, and this embodiment is exemplified by applying the method to a scheduling control device, it is to be understood that the method may also be applied to a server, and may also be applied to a system including a terminal and a server, and is implemented by interaction between the terminal and the server. In this embodiment, the method includes the steps of:

s201, acquiring the request quantity of each feature library in a first storage medium; the first storage medium is a storage medium in a target storage medium, the target storage medium further comprises a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for a feature reading request aiming at the target storage medium; and the request quantity of each feature library is determined according to the matching quantity of each feature library and the feature reading request.

The target storage medium may refer to various types of media having a storage function, and may include at least one of a nonvolatile memory and a volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, hard disk, flash Memory, optical Memory, or the like. Volatile Memory can include video Memory, internal Memory, Random Access Memory (RAM), or external cache Memory. The target storage medium comprises a first storage medium (which can be called a hot storage) and a second storage medium (which can be called a cold storage), wherein both the first storage medium and the second storage medium can be nonvolatile storage media or volatile storage media, and the scheduling control device preferentially reads the characteristic data from the first storage medium. In one embodiment, the first storage medium is a volatile storage medium and the second storage medium is a non-volatile storage medium. In another embodiment, the first storage medium is a high-speed storage medium, the second storage medium is a non-high-speed storage medium (which may also be referred to as a persistent layer), the schedule control performs reading and writing of the features to the first storage medium during the operation, and the schedule control may write the features to the second storage medium at the end of the operation. In one embodiment, the scheduling control may schedule the corresponding feature from the second storage medium if the corresponding feature is found not to be stored in the first storage medium upon receiving the feature read request, and then respond to the feature read request based on the scheduled feature.

In one embodiment, the features stored in the target storage medium may be features corresponding to media information such as pictures and videos, and may be implemented in the form of feature vectors. In one embodiment, the feature may be obtained by performing feature vector transformation processing on specific content in the media information, for example: the method comprises the steps of quantizing information such as scene types, article types, person names and person ages of pictures, converting feature vectors of quantized results, and storing the feature vectors obtained through feature vector conversion into a target storage medium as features. In the field of artificial intelligence, a feature is usually a high-dimensional vector, such as: in the field of artificial intelligence, information such as pictures and videos is structurally expressed and converted into a high-dimensional vector form, and corresponding features are obtained.

In one embodiment, the features stored in the target storage medium may be divided into groups, and the grouped feature groups may be determined as a feature library (the feature library may also be referred to as a library for short). That is, a feature library refers to a set of features.

In an embodiment, the grouping and splitting process may be performed on the features pre-stored in the first storage medium and the second storage medium (the pre-storage may be random storage or storage according to a specific rule, which is not limited in this embodiment of the present invention), so as to obtain the feature libraries in the first storage medium and the second storage medium, respectively.

In one embodiment, the feature library may be distributed to the first storage medium and the second storage medium after all the features in the target storage medium are grouped to obtain the feature library. The allocation mode may be random allocation or allocation according to a certain rule. In one embodiment, the allocation according to a certain rule may be according to the type of the feature library, for example: the feature library is divided into a feature library needing to be used (for example, a picture feature library corresponding to a picture needing to be processed in the running process) and a feature library not needing to be used, and the feature library needing to be used can be distributed into the first storage medium, and the feature library not needing to be used can be distributed into the second storage medium.

In one embodiment, the target storage medium, upon receiving a feature read request, preferentially locates a feature library from the first storage medium, the located feature library being considered as the requested feature library, and reads the feature from the located feature library. In one embodiment, the request amount (QPS) may be updated according to the number of times the feature library is requested, that is, when a feature library is determined to be the requested feature library, the corresponding request amount is increased by 1. The higher the requested proportion of the feature library is, the feature library which is more likely to be read and written in the operation process of the scheduling control device is indicated, if the feature library is stored in the non-high-speed storage medium, the feature library needs to be frequently scheduled from the non-high-speed storage medium to the high-speed storage medium, so that too much time is wasted on feature scheduling when feature read response is performed, and the feature read request cannot be quickly responded. Therefore, the request amount of the feature library is an important factor affecting the reading efficiency of the feature library, and it is necessary to consider the request amount in the process of performing the feature library scheduling.

Each feature library in the first storage medium may refer to all or part of the feature libraries in the first storage medium.

In S201, when a scheduling trigger instruction is received or a preset scheduling interval time is reached, the scheduling control device obtains a request amount of each feature library in the first storage medium. The scheduled scheduling between the first storage medium and the second storage medium can also be realized by initiating the scheduling of the feature library between the first storage medium and the second storage medium under the trigger of the scheduling trigger instruction.

S202, acquiring the library capacity of each feature library.

In S202, the scheduling control device acquires the library capacity of each feature library.

The library capacity refers to the size of the feature amount that can be accommodated in the feature library. Thus, in embodiments of the present invention, the library capacity may also be referred to as the library size. The inventors found that the larger the library capacity of the feature library, the longer the cold start time thereof, and the greater the performance loss, so that a large library (i.e., a feature library having a library capacity greater than a preset library capacity threshold, or a feature library having a feature number greater than a preset library number threshold) can be configured as a resident high-speed storage medium. In particular, if the large library is stored in a non-high speed storage medium, scheduling from the non-high speed storage medium is required, and the cold start time of the large library is long, which results in a long time consuming for the whole feature reading, and thus the efficiency of the feature reading is low. Therefore, the library capacity is an important factor affecting the efficiency of reading the feature library, and it is necessary to consider the factor of the library capacity in the process of scheduling the feature library.

S203, determining the heat value of each feature library according to the request quantity and the library capacity of each feature library; the heat value is used for representing the influence degree of each feature library on the feature reading efficiency of the target storage medium when the feature library is scheduled in the target storage medium.

As described earlier, the request amount and the library capacity of the feature library affect the feature reading efficiency. Therefore, in S203, the scheduling control device determines a corresponding heat value according to the request amount and the library capacity of each feature library, and uses the heat value to represent the influence degree of the feature reading efficiency of the target storage medium when each feature library is scheduled in the target storage medium.

In one embodiment, for the feature library a, if its heat value is high, it indicates that the feature library a has a large influence on the feature reading efficiency, the feature library a may be stored in the first storage medium as much as possible, and if its heat value is low, it indicates that the feature library a has a small influence on the feature reading efficiency, the feature library a may be stored in the second storage medium.

In one embodiment, in addition to determining the heat value based on the requested amount and the library capacity, other factors may be combined to determine the heat value, such as: the heat value may be determined based on the type of features in the feature library, the degree of importance of the feature library, and the like. In an embodiment, when the feature type of a certain feature library is a feature type convenient for data reading and writing, a higher heating value adjustment value may be set for the feature library, when the importance degree of the certain feature library is higher, a higher heating value adjustment value may also be set for the feature library, and then the predetermined heating value may be adjusted according to the heating value adjustment value, and the scheduling processing of the feature library is performed based on the adjusted heating value.

And S204, determining the feature library to be transferred in each feature library according to the sequence of the heat value.

After determining the heat values of the feature libraries in the first storage medium, the scheduling control device may sort the heat values of the feature libraries from large to small, and determine the sorted feature libraries as feature libraries to be transferred, that is, eliminated feature libraries.

S205, dispatching the feature library to be transferred to the second storage medium.

In one embodiment, the library of features to be transferred may also not be temporarily scheduled to the second storage medium if the storage space in the first storage medium is large enough.

In one embodiment, after (of course, before) the feature library to be transferred is scheduled in the second storage medium, the heat values of the feature libraries in the second storage medium may be sorted, the feature library sorted before is determined as the feature library to be transferred, and then the feature libraries to be transferred are scheduled in the first storage medium. The calculation method of the heat value of the feature library in the second storage medium may refer to the calculation method of the heat value of the feature library in the first storage medium, and is not described herein again.

In one embodiment, the heat values of the feature libraries in the first storage medium and the second storage medium may also be uniformly ordered and uniformly scheduled. And sequentially storing the characteristic libraries which are sequenced in the first storage medium until the storage space of the first storage medium is full, and storing the characteristic libraries which are sequenced in the second storage medium until the storage space of the second storage medium is full. At this time, the feature library previously stored in the first storage medium and currently scheduled in the second storage medium is the feature library to be transferred.

In the scheduling method of the feature library, the target storage medium includes a first storage medium and a second storage medium, and for the feature reading request aiming at the target storage medium, the response sequence of the first storage medium has priority over the response sequence of the second storage medium; in the process of scheduling the feature library, determining a request amount according to the matching number of each feature library in the first storage medium and the feature reading request; acquiring the library capacity of each feature library; determining a heat value for representing the influence degree of the feature reading efficiency according to the request quantity and the library capacity of each feature library; and scheduling the obsolete feature library in the first storage medium to the second storage medium according to the sorting of the heat values. The feature library with high heat value is stored in the first storage medium, and the feature reading request can be quickly responded when being received, so that the feature reading efficiency of the whole storage medium is improved.

In one embodiment, the implementation process of determining the heat value of each feature library according to the request amount and the library capacity of each feature library may be: the request volume and the library capacity of each feature library are traversed one by one to determine the heat value of the feature libraries. Specifically, when traversing to a certain feature library 1, determining the heat value of the feature library 1 according to the request quantity and the library capacity of the feature library 1; then traversing the next feature library 2, and determining the heat value of the feature library 2 according to the request quantity and the library capacity of the feature library 2; and the like until the calculation of the heat values of all the feature libraries is completed.

In one embodiment, the determining the heat value of each feature library according to the request amount and the library capacity of each feature library comprises: for any one target feature library in the feature libraries, determining a first heat value component according to the request quantity of the target feature library; determining a second heat value component according to the library capacity of the target feature library; determining a heat value of the target feature library according to the first heat value component and the second heat value component.

A certain operation may be performed on the request amount of the target feature library, for example: a weighting operation (multiplication by a constant coefficient), a reciprocal operation (taking the reciprocal), and the like, and the operation result is regarded as the first calorific value component. The first heating value component may also be referred to as a request quantity component.

Certain operations can be performed on the library capacity of the target feature library, for example: weighting operation, reciprocal operation, etc., and the operation result is taken as the second calorific value component. The second heat value component may also be referred to as a bin capacity component or a bin size component.

In one embodiment, the result of the sum operation or the product operation of the first and second heat value components may be determined as the heat value of the target feature library.

In the embodiment, the corresponding heat value components are respectively determined according to the request quantity and the library capacity of the target feature library, and then the heat value of the target feature library is obtained based on the heat value components, so that the calculated heat value is fully fused with factors influencing the feature reading efficiency, such as the request quantity and the library capacity, and the accuracy and the reliability of the calculated heat value are further ensured.

In one embodiment, for the target feature library, the obtaining the request amount of each feature library in the first storage medium includes: acquiring a current request quantity curve of the target feature library corresponding to a current time period and a historical request quantity curve corresponding to a set historical time period; determining the current request quantity of the target feature library from the current request quantity curve; determining a minimum request quantity and a maximum request quantity of the target feature library from the historical request quantity curve; the determining a first heating value component according to the request quantity of the target feature library comprises: calculating the difference value of the current request quantity relative to the minimum request quantity to obtain a first request quantity difference value; calculating a difference value of the minimum request quantity relative to the maximum request quantity to obtain a second request quantity difference value; predicting the request quantity of the target feature library in a set future time period according to the first request quantity difference value and the second request quantity difference value; determining the first heating value component according to the request amount for setting the future time period.

The length of the time period may be determined according to actual conditions, and may be one day, one week, and the like. In one embodiment, the current time period may be the current day (i.e., the date the control device is scheduled to operate). The set historical time period may be a time period corresponding to the current time period in the historical time period, and taking the current day as an example of a tuesday, the historical time period may be every tuesday in the past month.

In one embodiment, the current demand profile is a demand profile for the current day. The historical request amount curve may be a curve obtained by integrating the request amount curves in the historical time period, for example, sampling points corresponding to the same time point of each request amount curve in the historical time period are calculated, an average value of the sampling points is calculated, the average value is determined as the historical request amount corresponding to the time point, and the historical request amount curve is obtained based on the historical request amount of each time period. The history request amount curve may also be all request amount curves of the history time period, and in this case, if the history request amount is to be determined, the request amount at the corresponding time point may be acquired from each history request amount curve in a sliding manner, and an average value is calculated based on the acquired request amount, and the average value is determined as the history request amount.

A schematic diagram of the current request amount curve and the historical request amount curve (which may be a curve obtained by integrating the request amount curves in the historical time period, or a certain request amount curve in the historical time period) may be as shown in fig. 3, where 301 represents the current request amount curve and 302 represents the historical request amount curve. Assuming that the current time is 13:00, the current request amount is 303, and the minimum request amount 304 and the maximum request amount 305 of the target feature library are obtained from the historical request amount curve.

The set future time period may be set according to actual circumstances, for example, a future day, a future week, or the like is determined as the set future time period.

In one embodiment, the request quantity of the target feature library in a set future time period is predicted according to the first request quantity difference value and the second request quantity difference value; the specific process of determining the first heat value component according to the request amount for setting the future time period may be:

the amount of requests to set the future time period is predicted by the following formula:

wherein q is the current request quantity, qminTo a minimum request amount, qmaxIs the maximum requested amount.

And further calculates a first heat value component based on the request amount for setting the future time period by the following formula:

in the above embodiment, the current request amount in the current request amount curve is determined, the historical request amount in the historical request amount curve is determined by means of a moving average, the difference between the current request amount and the historical request amount is determined, the request amount of the target feature library in the set future time period is predicted based on the difference, and the first heat value component is obtained based on the request amount of the set future time period. The future request amount is predicted based on the current request amount and the historical request amount, so that the calculated hot value fully considers the impending request and has strong adaptability.

In one embodiment, the determining a second component of the calorific value from the library capacity of the target feature library comprises: determining the minimum library capacity and the maximum library capacity corresponding to the feature library of the target storage medium; determining a difference value of the library capacity of the target feature library relative to the minimum library capacity to obtain a first library capacity difference value; determining a difference value of the minimum library capacity relative to the maximum library capacity to obtain a second library capacity difference value; determining the second heat value component from the first and second library capacity differences.

Calculating the library capacity ratio of the library capacity of the target feature library in the target storage medium by the following formula:

where s is the library capacity of the target feature library, sminTo a minimum reservoir capacity, smaxIs the maximum library capacity.

And further calculating a second heat value component based on the reservoir capacity ratio by the following formula:

in the embodiment, the second heat value component is determined based on the library capacity ratio of the library capacity of the target feature library in the target storage medium, and the calculation of the heat value fully considers the library capacity of the feature library, so that the feature library with a large library capacity is stored in the first storage medium as much as possible, thereby reducing the cold start time in the feature reading stage and further improving the feature reading efficiency of the storage medium.

In one embodiment, for the target feature library, the determining the heat value of the target feature library according to the first heat value component and the second heat value component comprises: acquiring a regulation parameter value corresponding to the target feature library, and acquiring a third heat value component according to the regulation parameter value; determining a heat value of the target feature library from the first, second, and third heat value components.

The control parameter value refers to a parameter for controlling the heat value, so that the heat value of the target feature library is more in line with the expectation of a user.

In one embodiment, the control parameter value may be a parameter value that takes on a value between [0,1 ]. If it is not desired to schedule a library of features from the first storage medium, this can be achieved by setting its tuning parameter value to a larger value.

The third thermal value component may also be referred to as a sensitivity component. In one embodiment, the third thermal value component may be a manually adjusted component.

In one embodiment, the heat value of the target feature library is calculated by the following formula:

where C represents a third calorific value component.

According to the embodiment, the corresponding heat value component is determined based on the request quantity, the library capacity and the regulation and control parameter, the heat value of the target feature library is obtained based on the heat value component, various factors influencing the feature reading efficiency can be fully considered, and the heat value of each feature library is accurately obtained.

In one embodiment, the determining the heat value of the target feature library from the first, second, and third heat value components comprises: acquiring the library capacity weight of the target feature library; the library capacity weight is linearly related to the size of the library capacity of the target feature library; performing weighted calculation on the second heat value component according to the library capacity weight; and obtaining the heat value of the target feature library according to the first heat value component, the second heat value component after weighting calculation and the third heat value component.

In one embodiment, the obtaining of the library capacity weight of the target feature library may be implemented by: and acquiring a linear corresponding relation between the library capacity weight and the characteristic library capacity, and determining the library capacity weight matched with the library capacity of the target characteristic library based on the linear corresponding relation. In one embodiment, assuming that there are two feature libraries 1 and 2, when the library capacity of the feature library 1 is greater than that of the feature library 2, the determined library capacity weight of the feature library 1 is also greater than that of the feature library 2.

The number distribution of all library capacities in the target storage medium (i.e., library number distribution) may be as shown in fig. 4. As shown in fig. 4, the bins for the number of headers are all small bins of <1w feature number. The small library is exchanged in and out of the first storage medium and the second storage medium with low cost, and the weight value of the small library on the size component of the library can be reduced when the heat value is calculated, so that the heat value is lower. In one embodiment, if the storage space of the first storage medium is insufficient and the feature library needs to be swapped out, the small library with the small number of features is prioritized, that is, the weight of the second heat value component of the small library is set to a smaller value, so that the heat value of the feature library becomes lower, and the small library is more likely to be dispatched to the second storage medium.

The above-described embodiment adjusts the second heat value component based on the bank size, and can store a large bank in the first storage medium based on the calculated heat value, thereby reducing the cold start time in the feature reading process and further improving the feature reading efficiency of the storage medium.

In one embodiment, the obtaining of the adjustment parameter value corresponding to the target feature library includes: when the target feature library carries an interested identifier, setting a regulation parameter value of the target feature library as a first parameter value; when the target feature library does not carry the interesting identification, setting the regulation parameter value of the target feature library as a second parameter value; the second parameter value is less than the first parameter value.

The interesting identifier may refer to an identifier set for the feature library in advance.

In one embodiment, the interest identifier is set for the feature library according to the feature type in the feature library, the importance degree of the feature library, and the like.

In one embodiment, when the feature type of a certain feature library is a feature type convenient for data reading and writing, an interest identifier may be set for the feature library, and when the importance degree of a certain feature library is higher, an interest identifier may also be set for the feature library.

In the above embodiment, the control parameter value is set based on the preset interested identifier, and the heat value of the feature library is determined based on the control parameter value, so that the heat value of the interested feature library can be maintained at a higher level and further stored in the first storage medium, thereby implementing the configuration of the feature library as required.

After determining the heat value of each feature library and completing scheduling of the feature library based on the heat value, the heat value of the feature library in the target storage medium may be updated periodically, and then the feature library may be rescheduled based on the updated heat value. In one embodiment, the swap-in and swap-out frequency (swap-in and swap-out times per unit time) and the request flat response time may be determined to measure the feature reading efficiency of the target storage medium, and then the heat value of the feature library in the target storage medium is updated based on the feature reading efficiency. Where flat response time refers to the average response time of a single feature read request.

In one embodiment, after the scheduling the library of features to be transferred to the second storage medium, the method further includes: acquiring the characteristic library access frequency of the target storage medium; the feature library access frequency is used for representing the frequency of calling in and calling out of each feature library between the first storage medium and the second storage medium; when the access frequency of the feature library is greater than or equal to the access frequency threshold, adjusting the weight of at least one of the first heat value component, the second heat value component and the third heat value component of each feature library, and updating the heat value of each feature library according to the adjustment result.

Here, the feature library access frequency refers to a swap-in and swap-out feature library frequency, that is, the number of times of swap-in and swap-out of a feature library between a first storage medium and a second storage medium per unit time (scheduling from the first storage medium to the second storage medium may be regarded as one swap-out, and scheduling from the second storage medium to the first storage medium may be regarded as one swap-in). In one embodiment, the feature library access frequency refers to the number of swap-in and swap-out times of the feature library between the first storage medium and the second storage medium when the feature library scheduling is performed according to the heat value.

The access frequency threshold may be determined based on actual conditions, such as: 20 times/s, etc.

In one embodiment, weights of the first, second, and third calorimetric components of the respective feature libraries are adjusted, and the calorimetric values are updated based on the adjusted weights. Determining the access frequency of the feature library corresponding to the updated heat value, if the access frequency of the feature library is still greater than or equal to the access frequency threshold, continuing to perform weight adjustment and updating the heat value until the access frequency of the feature library is less than the access frequency threshold or the updating frequency is greater than a set frequency threshold (the size of the frequency threshold can be determined according to the actual situation, and the size of the frequency threshold is not limited by the invention).

In one embodiment, the adjustment of the weights may be implemented by at least the following: 1. the adjustment is made randomly, e.g., by randomly selecting a component of the calorific value and randomly setting its weight to a greater or lesser value. 2. The weight adjustment is performed based on the degree of influence of the heat value component on the feature library entry/exit frequency, and for example, when the influence of the library capacity on the feature library entry/exit frequency is large, the weight of the second heat value component may be adjusted so that the weight of the feature library having a large library capacity is adjusted to a larger value and the weight of the feature library having a small library capacity is adjusted to a smaller value.

In the embodiment, the weight of the heat value component is adjusted, the heat value of the feature library is updated based on the adjustment result, and the storage medium with lower access frequency of the feature library can be obtained based on the updated heat value, so that the response efficiency of the whole storage medium to the feature reading request is improved.

In one embodiment, after the scheduling the library of features to be transferred to the second storage medium, the method further includes: acquiring request response time of the target storage medium; the request response time is the response time of the target storage medium to the characteristic reading request; and when the request response time is greater than or equal to a response time threshold, adjusting the weight of at least one of the first heat value component, the second heat value component and the third heat value component of each feature library, and updating the heat value of each feature library according to an adjustment result.

Wherein, the request response time refers to the response time of the storage medium to the characteristic reading request. In one embodiment, the request response time may refer to an average of response times of the respective feature libraries to the feature read request, and thus, the request response time may also be referred to as a request flat response time.

The response time threshold may be determined from practical considerations, such as: 2ms, etc.

In one embodiment, weights of the first, second, and third calorimetric components of the respective feature libraries are adjusted, and the calorimetric values are updated based on the randomly adjusted weights. Determining the request response time corresponding to the updated heat value, and if the request response time is still greater than or equal to the access frequency threshold, continuing to adjust until the request response time is less than the access frequency threshold or the update times is greater than the set times threshold (the size of the times threshold can be determined according to the actual situation, and the size of the times threshold is not limited by the invention).

In one embodiment, the adjustment of the weights may be implemented by at least the following: 1. the adjustment is made randomly, e.g., by randomly selecting a component of the calorific value and randomly setting its weight to a greater or lesser value. 2. The weight adjustment is performed according to the influence degree of the hot value component on the request response time, for example, when the influence of the request amount on the request response time is large, the weight of the first hot value component may be adjusted to adjust the weight of the feature library with a large request amount to a larger value and the weight of the feature library with a small request amount to a smaller value.

In the embodiment, the weight of the heat value component is adjusted, the heat value of the feature library is updated based on the adjustment result, and a storage medium with shorter response time can be obtained based on the updated heat value, so that the response time of the whole storage medium to the feature reading request is reduced.

In one embodiment, after the weights of the heating value components are adjusted, an adjusted feature library access frequency and request response time may be determined, ending the heating value update process when both are less than the corresponding thresholds (or both are decreasing).

In one embodiment, the weighting of the heating metric component may be adjusted in conjunction with the feature pool access frequency and the request response time. For example: if the access frequency of the feature library of the target storage medium is greater than a certain threshold and the request response time is greater than a certain threshold, it indicates that the scheduling efficiency of the whole target storage medium has a bottleneck, and at this time, the target storage medium level expansion is probably needed; if the access frequency of the feature library of the target storage medium is greater than a certain threshold value but the request response time is not greater than the threshold value, the contribution proportions of the first heat value component, the second heat value component and the third heat value component to the heat value can be adjusted, the swap-in and swap-out frequency is reduced, and whether the request flat response time is favorably reduced or not is observed; if the characteristic library access frequency of the target storage medium is not greater than a certain threshold value but the request response time is greater than the threshold value, the contribution proportions of the first heat value component, the second heat value component and the third heat value component to the heat value can be adjusted to see whether reducing the frequency of swapping in and out is beneficial to reducing the request flat response time.

The embodiment updates the heat value by combining the access frequency of the feature library and the request flat response time, so that the adjusted target storage medium meets the requirements on the access frequency of the feature library and the request flat response time, and the feature reading efficiency of the target storage medium can be effectively ensured.

In one embodiment, the first storage medium includes a first storage area and a second storage area; for the storage of the feature library with the heat value sorted in the front, the first storage area takes precedence over the second storage area; determining the feature library to be transferred in each feature library according to the ranking of the heat value, comprising: and determining a characteristic library to be transferred in the characteristic library of the first storage area according to the sequence of the heat value.

After obtaining the feature library based on the feature grouping, the scheduling control device may allocate the feature library to the first storage medium and the second storage medium according to whether the scheduling control device needs to be used in the operation process, allocate the feature library that needs to be used to the first storage medium, and allocate the feature library that needs to be used to the second storage medium. Then, when the feature libraries in the target storage medium need to be scheduled, the heat values of the feature libraries can be determined, and then the feature library to be transferred is determined in the feature library of the first storage area based on the heat values.

The first storage area may be referred to as a permanent area or a hot area, and the second storage area may be referred to as a temporary area or a cold area. According to the embodiment of the invention, the feature library with low heat value in the first storage area is dispatched to the second storage medium, so that the feature libraries in the first storage area are all feature libraries with high heat values.

In the above embodiment, the storage areas of the high-speed storage medium are divided, the first storage area stores some specified feature libraries, and the second storage area stores unspecified feature libraries. The algorithm calculates the heat value of a certain feature library, the feature library with the high heat value is stored in a first storage area, the feature library with the low heat value can be dynamically dispatched to a high-speed storage medium, and the feature library with the high heat value in the non-high-speed storage medium can be dynamically dispatched to the high-speed storage medium in a stepped manner (for example, the feature library is dispatched to the first storage area first and then can be dispatched to a second storage area to realize the stepped dispatching). The characteristic library in the first storage area can have higher characteristic reading efficiency, and the overall characteristic reading efficiency of the target storage medium is further improved.

In one embodiment, the determining a library of features to be transferred in the library of features in the first storage area according to the ranking of the heat value includes: when the heat value of the feature library existing in the first storage area is lower than the heat value of each feature library of the second storage area, determining the corresponding feature library in the first storage area as the feature library to be transferred; and when the heat value of the characteristic library existing in the first storage area is lower than the heat value of each characteristic library of the second storage medium, determining the corresponding characteristic library in the first storage area as the characteristic library to be transferred.

In one embodiment, a feature library having a higher heat value than the heat value of each feature library in the first storage area may be determined as the replacement library. If the second storage area stores the replacement library, the replacement library may be scheduled to the first storage area, or of course, the replacement library may not be scheduled, and when the characteristics of the replacement library need to be read, the corresponding characteristics are directly read from the second storage area. If a replacement library is stored in the second storage medium, the replacement library may be dispatched to the first storage medium, or more specifically, to the first storage area of the first storage medium. In one embodiment, the feature library in the second storage medium may be scheduled into the first storage medium by progressive loading, for example: determining the remaining storage space of the first storage medium, loading the replacement library into the first storage medium, splitting the replacement library when the storage space of the first storage medium is insufficient to accommodate the replacement library, loading a part obtained by splitting the replacement library into the first storage medium, and loading the rest part of the replacement library into the first storage medium if the first storage medium has additional storage space subsequently.

Loading the feature library refers to loading the query (requirement) features to be retrieved (i.e., read by the scheduling control device during operation) and the feature library to be retrieved (i.e., possibly read by the scheduling control device during operation) from the non-high-speed storage medium to the high-speed storage medium.

In one embodiment, as shown in fig. 5, the first storage medium 501 is split into a permanent area and a temporary area. The permanent area, the temporary area, and the second storage medium 502 each store a feature library. The feature libraries in the resident area are ordered, as indicated by the open arrows in FIG. 5, with the higher the heat value of the feature library earlier in the sequence. It should be noted that, in fig. 5, each feature library in the temporary area is stored in the second storage medium, in other embodiments, each feature library in the permanent area may also be stored in the second storage medium, or only feature libraries that are not stored in the first storage medium may be stored without storing feature libraries in the permanent area and the temporary area.

The implementation of scheduling the feature libraries in the temporary area and the second storage medium to the permanent area has at least the following two cases: 1. the temporary area has a replacement library (library 5) which may be scheduled into the permanent area (curve 1) at this time, but of course, since the library 5 may be directly scheduled in the first storage medium, the library 5 may not be scheduled into the permanent area. 2. If there is no replacement library in the temporary area, the library 5 needs to be read from the persistent layer and progressively loaded into the first storage medium (represented by curve 2).

According to the embodiment, the heat value of the feature library in the whole target storage medium is used for determining the feature library to be transferred in the first storage area, so that the heat value of the feature library in the first storage area is higher than that of the first storage area and higher than that of the second storage medium, the feature library in the first storage area has higher feature reading efficiency, and further the whole feature reading efficiency of the target storage medium is improved.

In one embodiment, the first storage area determines the feature library to be transferred according to the heat value, and then the feature library to be transferred is dispatched to the second storage medium. The second storage area can also implement obsolete scheduling of the feature library in the same manner.

In other embodiments, the second storage area may determine the library of features to be transferred in a simpler manner in order to reduce the amount of computation. Further, the feature library to be transferred can be determined in at least two ways:

1. LRU (Least Recently Used) culling: and recording the feature library which is not used recently in the second storage area, and eliminating the feature library from the second storage area.

2. LFU (Least Frequently Used) culled: the least frequently used feature library in the second storage area is recorded and eliminated from the second storage area.

In one embodiment, after determining the feature library to be transferred in the feature library of the first storage area according to the sorting of the heat value, the method further includes: determining the reading frequency of each feature library in the second storage area within a set historical time period; and scheduling the characteristic library with the reading frequency meeting the condition in the second storage area to the second storage medium.

Wherein, the set historical time period can be the past week, month, year, etc.

The reading frequency refers to the number of times that the corresponding feature library matches the feature reading request, that is, the feature library is to be read by a certain feature reading request.

In the above embodiment, the feature library to be transferred is determined in the second storage area according to the reading frequency of each feature library in the second storage area, and the feature library to be transferred is scheduled to the second storage medium, so that the operation process is simple, the operation amount is small, the scheduling efficiency of the second storage medium is high, and the scheduling efficiency of the whole target storage medium is further improved.

In one embodiment, before obtaining the request amount of each feature library in the first storage medium, the method further includes: determining the read hit heat of each feature in the target storage medium; the reading hit heat is determined according to the ratio of the number of times of reading of the features to the total number of times of reading of the target storage medium; determining the quantity distribution state of the read hit heat; and grouping the various features according to the quantity distribution state, and determining the obtained groups as feature libraries in the target storage medium.

After retrieval occurs for a certain feature library (i.e. the scheduling control device receives a feature reading request for a target storage medium), if some features of the feature library are hit, recording of the reading hit is carried out, and the reading hit heat of the features in the feature library is calculated.

For a certain feature, the read hit heat can be calculated according to the following formula:

wherein n represents the number of times a certain feature is read; n represents the total number of times the target storage medium is read; alpha represents the undetermined coefficient, the main purpose of which is to control the magnitude of the heat value in the reading life.

In one embodiment, the magnitude of α may be determined according to practical circumstances, such as 500, 1000, and the like.

For a certain feature library where 1000 reads occur, α may take the value of 1000. The distribution state of the number of the feature library (also called hit thermal value distribution) can be shown in fig. 6, and the features in the feature library can be divided into uniform or not only desired feature libraries according to the distribution features shown in fig. 6 (the abscissa of fig. 6 represents the size of the library, and the ordinate represents the heat of the read hit).

For a feature library, the searching service is likely not to know the splitting mode a priori, and only the detection can be carried out by a posterior technical means, so that the size of the split library is controlled within a reasonable range. In the embodiment, the dynamic splitting of the feature library is performed according to the read hit heat of the read features, the feature library with low read hit heat is distributed to the non-high-speed storage medium, inactive feature data can be eliminated in an online retrieval mode, the split feature library is easier to realize dynamic scheduling, the read hit heat of the features in the same feature library can be consistent, and when feature reading is performed subsequently, feature reading can be performed intensively on a main feature library (namely, the feature reading frequency contained in the feature library is high), so that the time for positioning the feature library can be effectively reduced, and the efficiency of feature reading is further improved.

In one embodiment, the features in the target storage medium may also be de-banked in other ways. For example, the unpacking may be performed in at least the following ways:

1. splitting a library by space, for example, splitting each layer into a face library in a scene needing face retrieval in a certain market;

2. splitting the database by time, for example, splitting the database into a face database every day in some monitoring scenes;

3. the database is split by logic classification, for example, if a national face database exists, the face database can be split into province city databases, prefecture city databases and the like, the size of each database is reduced, and the concurrency can be improved during retrieval.

In one embodiment, a bank splitting approach to read hit heat may be combined with at least one of the above-described bank splitting approaches. For example: in some monitoring scenes, the face library is split into one face library every day, the reading hit heat of the features in the face library obtained by splitting is determined, and each face library is further split according to the reading hit heat to obtain a more detailed feature library. In an embodiment, after performing the library splitting process according to the spatial, temporal, logical classification, and the like, all the initial feature libraries obtained by splitting may be further subjected to the library splitting process, or only a part of the initial feature libraries may be further subjected to the library splitting process, for example: and determining the library capacity of the initial feature library obtained by splitting, and further splitting the feature library of which the library capacity is larger than a set library capacity threshold value, namely further splitting according to the reading hit heat.

In one embodiment, a method for scheduling a feature library is provided, which is described by taking the method as an example applied to the scheduling control device in fig. 1, and includes the following steps:

1. dynamic library splitting scheme for feature library

The target storage medium includes a high-speed storage medium and a non-high-speed storage medium, in which features are stored, respectively. Respectively carrying out feature library splitting (library splitting) processing on the features in the high-speed storage medium and the non-high-speed storage medium to obtain feature libraries in the high-speed storage medium and the non-high-speed storage medium:

the following description will use a high-speed storage medium as an example to describe a library splitting implementation process (the library splitting process for non-high-speed storage media is similar to the library splitting process for high-speed storage media, and is not described here again):

firstly, performing library splitting processing on the feature library according to the modes of space, time, logic classification and the like to obtain an initial feature library.

Further unpacking is performed on the large library in the initial feature library. For an initial feature library D0 requiring further unbundling, the heat value in the read life of a feature is calculated as follows:

after the read hit heat of each feature in the initial feature library D0 is calculated, the initial feature library D0 is subjected to a library splitting process according to a specific library splitting rule. Wherein, the library splitting rule is as follows: and uniformly dividing the small libraries according to the distribution characteristics of the read hit heat.

The small library into which the initial feature library requiring further unbinning is divided and the initial feature library not requiring further unbinning are determined as feature libraries in the high-speed storage medium. The high-speed storage medium is divided into a permanent area and a temporary area, wherein the permanent area can store a characteristic library with the read hit heat degree in the front.

And for the feature library obtained by splitting, scheduling by using the following dynamic scheduling algorithm:

2. dynamic scheduling of feature libraries

And calculating the heat value of each characteristic library in the target storage medium.

For any one of the target feature libraries:

calculating a first component of the calorific value according to the following formula:

calculating a second component of the calorific value according to the following formula:

and acquiring preset sensitivity (namely the regulation parameter value), and acquiring a third heat value component according to the sensitivity. Specifically, the sensitivity is set in at least the following two ways: firstly, the sensitivity of a specific feature library is increased, for example, the sensitivity of a certain feature library in a high-speed storage medium is set to be 0.65, so that the feature library is prevented from being swapped out of the high-speed storage medium; and secondly, the high-speed storage medium and the non-high-speed storage medium are set with different sensitivities to prevent frequent swap-in and swap-out, for example, the sensitivity of each feature library in the high-speed storage medium is set to be higher than that of each feature library in the non-high-speed storage medium.

And then calculating the heat value of the target feature library according to the following formula:

and completing the calculation of the heat value of all the feature libraries in the target storage medium in the manner.

Assume that the target storage medium has a library 1/2/3/4/5/6 of feature libraries, which correspond to the following information (units are omitted):

the heat values for these feature libraries are calculated based on QPS, library size, sensitivity, maximum QPS (maximum request), minimum QPS (minimum request), maximum library size, and minimum library size (as shown in the second column).

It is assumed that the resident area of the high-speed storage medium of the target storage medium stores library 1, library 2, and library 3, the temporary area stores library 4 and library 5, and the non-high-speed storage medium of the target storage medium stores library 6.

And finishing the scheduling of the feature library based on the heat values of all the feature libraries in the target storage medium. The following scheduling process for a portion of the feature library is illustrated:

in the above table, the heat value of each feature library in the permanent area is compared with the heat value of each feature library in the temporary area. Comparing library 3 with library 5, it can be seen that although library 3 has a larger library capacity, the QPS request is not active, but only 50/s, and the heat value of library 3 is 1.580 calculated according to the algorithm. Although the bank 5 is small, its QPS has already reached 489, and the heat value of the bank 5 calculated according to the algorithm is 1.659, which is higher than that of the bank 3, and belongs to the active bank. Therefore, the library 5 can already replace the library 3, that is, the library 3 is the library of the features to be transferred in the high-speed storage medium, and the scheduling control device can schedule the library 3 into the non-high-speed storage medium, so that the overall feature reading efficiency of the retrieval system, i.e. the target storage medium, is higher.

The LRUs for each feature library in the temporary area may then be computed, the feature library to be transferred in the temporary area determined based on the computed LRUs, and the feature library to be transferred in the temporary area scheduled to the non-high speed storage medium.

Of course, if there is a feature library in the non-high-speed storage medium with a higher heat value than that of each feature library in the permanent area, the corresponding feature library in the non-high-speed storage medium may be scheduled to the permanent area or the temporary area.

3. Evaluation of reading efficiency of feature library

After the feature library in the target storage medium is scheduled, the feature reading efficiency of the target storage medium is evaluated, and then the feature library can be scheduled and adjusted. In particular, swap-in and swap-out feature library frequencies and request flat response times may be used to evaluate feature reading efficiency.

If the frequency of the characteristic library for swapping in and out of the target storage medium is greater than a certain threshold and the request flat response time is greater than a certain threshold, it is indicated that the scheduling efficiency of the whole target storage medium has a bottleneck, and the target storage medium is subjected to capacity expansion processing at the moment;

if the frequency of the swap-in and swap-out feature library is greater than a certain threshold value but the request flat response time is not greater than the threshold value, the contribution proportion of a first heat value component, a second heat value component and a third heat value component in each feature library to the heat value can be adjusted, the swap-in and swap-out frequency is reduced, whether the request flat response time is reduced is determined, and if the swap-in and swap-out frequency and the request flat response time are reduced, the process of updating the heat value can be stopped;

if the frequency of the swap-in and swap-out feature library is not greater than a certain threshold value but the request flat response time is greater than the threshold value, the contribution proportions of the first heat value component, the second heat value component and the third heat value component to the heat value are adjusted, whether the reduction of the swap-in and swap-out frequency is favorable for the reduction of the request flat response time is determined, and if the swap-in and swap-out frequency and the request flat response time are reduced, the process of updating the heat value can be stopped.

And rescheduling the feature library in the target storage medium based on the updated heat value.

The above embodiment has at least the following beneficial effects:

1. after dynamic library splitting, the feature library can be gradually split from large to small, the split library is convenient for dynamic scheduling, so that the activity degree of the split feature library in a target storage medium is measured, and an inactive feature library is put into a non-high-speed storage medium, so that the storage cost is reduced.

2. The high-speed storage medium occupies a large head cost in the target storage medium, and the embodiment of the invention introduces a heat value calculation model, comprehensively considers factors such as the upcoming request quantity, the size of the library, the sensitivity and the like of the feature library and can obtain an accurate heat value. And reliable scheduling of the feature library of the target storage medium can be realized.

3. Through Tencent cloud face recognition service verification, under the scene of a large number of long-tailed small libraries, the number of feature libraries resident in a high-speed storage medium is reduced, the capacity occupation of the high-speed storage medium is reduced to a half, the corresponding machine resource cost can be reduced to a half, but libraries with the same order of magnitude can be supported at the moment, and the utilization rate of the high-speed storage medium is greatly improved.

The application also provides an application scenario applying the feature library scheduling method. Specifically, as shown in fig. 7, the application of the scheduling method of the feature library in the application scenario is as follows:

the application scenario includes a scheduling control device 701, a computer device cluster 702 (in fig. 7, the number of the computer device clusters is 3, and in an actual application scenario, the number of the computer device clusters may be greater or smaller), and a persistent storage computer device 703. The cluster of computer devices is a distributed architecture. Each computer device cluster may include at least one computer device 7021 (also referred to as a search node), and the feature libraries stored in the computer devices in the same computer device cluster are the same, so as to achieve a backup effect.

Each computer device of the cluster of computer devices is configured with a high-speed storage medium and the persistent storage computer device is configured with a non-high-speed storage medium.

And each computer device and the persistent storage computer device of the computer device cluster respectively carry out library splitting processing on the stored characteristics to obtain corresponding characteristic libraries.

When the dispatching cycle is reached, the dispatching control equipment determines the heat values of all the feature libraries of each computer equipment cluster, then the feature libraries with low heat values in the permanent area are dispatched to the non-high-speed storage medium through the persistent storage computer equipment, and the feature libraries of which the LRUs meet the conditions in the temporary area are dispatched to the non-high-speed storage medium through the persistent storage computer equipment. In addition, the feature library with high heat value in the persistent storage computer device can also be loaded into a high-speed storage medium of a matched computer device cluster.

The embodiment realizes the storage of the feature library in a distributed mode, can reliably store the feature library, realizes the backup of the feature library among different computer equipment, and effectively ensures the safety of the stored features.

In one embodiment, the computer devices in a cluster of computer devices may also refer to different processes.

The feature library in the target storage medium can be scheduled based on the feature library scheduling method in the foregoing embodiment. The feature retrieval method may be implemented based on the scheduled target storage medium. Further, the feature retrieval method provided in the subsequent embodiments may be implemented based on the foregoing embodiments of the feature library scheduling method, that is, the specific implementation manner of the feature retrieval method may refer to each embodiment of the feature library scheduling method, and in addition, the specific implementation manner of the feature library scheduling method may also refer to each embodiment of the feature retrieval method. The related contents of the two embodiments may be combined or applied to each other, and not all possible combinations are listed for saving text space.

In one embodiment, as shown in fig. 8, a feature retrieving method is provided, which is described by taking the method as an example applied to the scheduling control device in fig. 1, and includes the following steps:

s801, acquiring reference retrieval features and feature library identification information.

In the fields of artificial intelligence and the like, a feature library needs to be read from a storage medium, required features are matched based on the read feature library, and then the purposes of comparing human face pictures and videos and the like are achieved. The process of retrieving the desired features from the storage medium may be referred to as a feature retrieval process.

The reference retrieval feature refers to the basis of feature retrieval, that is, a feature matching the reference retrieval feature needs to be retrieved from a storage medium. For specific contents and forms of the reference retrieval features, reference may be made to the foregoing embodiment of the scheduling method of the feature library, and details are not described here.

Since the features are stored in the form of a feature library, in the process of feature retrieval, a feature library to be corresponded needs to be located first. Therefore, in S801, the feature library identification information is first obtained, so as to locate the corresponding feature library according to the feature library identification information. The feature library identification information may be a feature library identifier, a serial number, or the like.

The implementation process of S801 may be: and receiving a characteristic retrieval request, wherein the characteristic retrieval request comprises reference retrieval characteristics and characteristic library identification information.

S802, determining a target feature library corresponding to the feature library identification information in a feature library of a first storage medium; the first storage medium is a storage medium in a target storage medium, the target storage medium further comprises a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for a feature reading request aiming at the target storage medium; the feature library in the first storage medium is scheduled to the second storage medium when a heat value satisfies a condition, the heat value being used to characterize a degree of influence of the feature library in the first storage medium on a feature reading efficiency of the target storage medium when scheduled within the target storage medium.

The setting mode of the target storage medium can be seen in the foregoing scheduling method embodiments of the feature library. Briefly, the target storage medium comprises a first storage medium and a second storage medium, and the feature library in the first storage medium is dispatched to the second storage medium based on the heat value of each feature library in the first storage medium. After scheduling, the heat value of each feature library in the first storage medium is at a higher level, and the feature retrieval request can be quickly responded. In addition, the splitting of the feature library in the storage medium may also refer to the foregoing embodiment of the scheduling method of the feature library, and is not described herein again.

Since the first storage medium performs the feature reading in preference to the second storage medium, the feature is read from the first storage medium first when the feature retrieval request is received. Accordingly, S802 locates a target feature library corresponding to the feature library identification information among the feature libraries of the first storage medium.

S803, reading the stored features from the target feature library.

At least one feature is stored in the target feature library, and S803 reads each stored feature (all features or some of the features).

S804, determining a target retrieval feature matched with the reference retrieval feature in the read features.

S804, matching calculation is carried out on the read features and the reference retrieval features, and the features with matching meeting conditions are determined as the final retrieval result, namely the target retrieval features are obtained.

In the above feature retrieval method, the target storage medium includes a first storage medium and a second storage medium, and for a feature read request to the target storage medium, the response order of the first storage medium has priority over the response order of the second storage medium; when the heat value meets the condition, the feature library in the first storage medium is dispatched to the second storage medium, so that the feature libraries with high heat values are stored in the first storage medium; in the characteristic retrieval process, acquiring reference retrieval characteristics and characteristic library identification information; because the feature libraries with high heat values are stored in the first storage medium, the target feature library corresponding to the feature library identification information can be quickly positioned in the feature library of the first storage medium, and each stored feature can be quickly read from the target feature library; and determining a target retrieval feature which is matched with the reference retrieval feature from the read features. The characteristic library can be quickly positioned in the storage medium to read the characteristics, so that the characteristic retrieval efficiency of the whole storage medium is improved.

In one embodiment, the determining, in the feature library of the first storage medium, a target feature library corresponding to the feature library identification information includes: determining target computer equipment in a computer equipment cluster in a load balancing mode; the feature libraries stored by the computer devices in the computer device cluster are consistent, and a first storage medium is configured in the target computer device; determining the target feature library corresponding to the feature library identification information from a feature library in a first storage medium of the target computer device.

The embodiment realizes the storage of the feature library in a distributed mode, and can reliably store the feature library.

In one embodiment, the first storage medium includes a first storage area and a second storage area; for the storage of the feature library with the heat value sorted in the front, the first storage area takes precedence over the second storage area; before determining the target feature library corresponding to the feature library identification information from the feature library in the first storage medium of the target computer device, the method further includes: determining a corresponding hot value of the feature library in the first storage area when the feature library is scheduled in the target storage medium; and scheduling the feature library in the first storage area with the sequence of the heat value meeting the condition into the second storage medium.

According to the embodiment, the storage areas of the high-speed storage medium are divided, the feature library with the high heat value is stored in the first storage area, the feature library in the first storage area can have high feature reading efficiency, and therefore the overall feature reading efficiency of the target storage medium is improved. In addition, the traditional technology searches the whole high-speed storage medium, but in the scheme, important libraries are concentrated in the resident area, and only the library search needs to be carried out in the resident area, so that the utilization rate of the target storage medium is improved.

In one embodiment, the determining, among the read features, a target retrieval feature that matches the reference retrieval feature includes: determining a feature vector distance between each read feature and the reference search feature; and determining the feature of which the feature vector distance is smaller than a preset distance threshold value in the read features as the target retrieval feature.

As described in the previous embodiments, the features may be in the form of feature vectors. The present embodiment calculates the distance between the features by using the feature vector distance. In one embodiment, dot products, euclidean distances, and the like between the respective features and the reference retrieval features may be calculated as feature vector distances.

The preset distance threshold value can be determined according to actual conditions, and the specific size of the preset distance threshold value is not limited in the embodiment of the invention.

According to the embodiment, the target retrieval characteristics which are similar as much as possible are determined from the numerous characteristics according to the characteristic vector distance between the characteristics, the determination process is simple and convenient, and the efficiency of characteristic retrieval can be effectively improved.

In one embodiment, after determining the target retrieval feature matching the reference retrieval feature from the read features, the method further includes: determining first face media information corresponding to the reference retrieval features and second face media information corresponding to the target retrieval features; obtaining the similarity of the first face media information and the second face media information according to the feature vector distance between the reference retrieval feature and the target retrieval feature; and determining a face feature comparison result according to the similarity.

The face media information may refer to pictures, videos, and the like containing face information.

In scenes such as face recognition, two pieces of face media information are often needed to be compared, for example: and determining whether the persons indicated in the pictures are the same person or not through picture comparison.

In the embodiment, the similarity between the first face media information and the second face media information is determined based on the feature vector distance between the features, and then the face feature comparison result is output, and the face feature comparison result can be applied to scenes such as person identification, evasion tracking and the like. Because the feature library in the storage medium is subjected to scheduling optimization processing, when the feature library is searched, the target search features can be searched in the shortest time, and further, the face feature comparison result can be quickly output, and the face comparison efficiency is effectively ensured.

The application also provides an application scene, and the application scene applies the characteristic retrieval method. Specifically, as shown in fig. 9, the application of the feature library search method in the application scenario is as follows:

the application scenario includes a retrieval access layer (which may be implemented by a computer device), a retrieval node cluster (3 retrieval node clusters are a/B/C in fig. 9, and in an actual application scenario, the number of the retrieval node clusters may be greater or smaller), and a persistent storage computer device configured with a non-high-speed storage medium. At least one retrieval node can be contained in each retrieval node cluster, the retrieval nodes (also called examples, such as example 1 and example 2 in fig. 9, which can be realized by a high-speed storage medium) in the same retrieval node cluster store the same feature library, and meanwhile, the retrieval nodes are divided into a permanent area and a temporary area.

And each retrieval node of the retrieval node cluster performs database splitting processing on the stored characteristics to obtain a corresponding characteristic database. When the dispatching cycle is reached, the dispatching control equipment determines the heat values of all the feature libraries of each retrieval node cluster, then dispatches the feature libraries with low heat values in the permanent area to the non-high-speed storage medium, and dispatches the feature libraries of which the LRU meets the conditions in the temporary area to the non-high-speed storage medium. In addition, the feature library with high heat value in the non-high-speed storage medium can be loaded into the search nodes of the matched search node cluster.

When a face feature retrieval request is received, the retrieval access layer positions a retrieval node cluster through a routing strategy, and determines a corresponding instance through a load balancing mode. In the example, a corresponding feature library is located, corresponding features are read based on the located feature library, and target face features matched with reference face features in the face feature retrieval request are determined. And outputting a face feature comparison result based on the comparison result of the reference face feature and the target face feature.

According to the embodiment, after the dynamic database splitting, the feature database is gradually split from large to small, the split database is convenient for dynamic scheduling, so that the activity degree of the split database in the face retrieval system is measured, and the inactive database is placed in a non-high-speed storage medium, so that the storage cost is reduced, and the face feature retrieval efficiency can be effectively ensured.

It should be understood that, although the steps in the above-described flowcharts are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the above-mentioned flowcharts may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or the stages is not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a part of the steps or the stages in other steps.

Based on the same idea as the feature library scheduling method in the above embodiment, the present invention also provides a feature library scheduling apparatus, which can be used to execute the feature library scheduling method. For convenience of illustration, the structure diagram of the embodiment of the scheduling apparatus of the feature library only shows a part related to the embodiment of the present invention, and those skilled in the art will understand that the illustrated structure does not constitute a limitation of the apparatus, and may include more or less components than those illustrated, or combine some components, or arrange different components.

In one embodiment, as shown in fig. 10, there is provided a feature library scheduling apparatus 1000, which may be a part of a computer device using a software module or a hardware module, or a combination of the two modules, and specifically includes: a request quantity obtaining module 1001, a library capacity obtaining module 1002, a heat value determining module 1003, a to-be-transferred feature library determining module 1004, and a first feature library scheduling module 1005, wherein:

a request amount obtaining module 1001 configured to obtain a request amount of each feature library in the first storage medium; the first storage medium is a storage medium in a target storage medium, the target storage medium further comprises a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for a feature reading request aiming at the target storage medium; and the request quantity of each feature library is determined according to the matching quantity of each feature library and the feature reading request.

A library capacity obtaining module 1002, configured to obtain library capacities of the feature libraries.

A heat value determination module 1003, configured to determine a heat value of each feature library according to the request amount and the library capacity of each feature library; the heat value is used for representing the influence degree of each feature library on the feature reading efficiency of the target storage medium when the feature library is scheduled in the target storage medium.

A to-be-transferred feature library determining module 1004, configured to determine the to-be-transferred feature library in each feature library according to the ranking of the heat value.

A first feature library scheduling module 1005, configured to schedule the feature library to be transferred to the second storage medium.

In the scheduling device of the feature library, the feature libraries with high heat values are stored in the first storage medium, and the feature reading request can be quickly responded, so that the feature reading efficiency of the whole storage medium is improved.

In one embodiment, the heat value determination module includes: a first component determination submodule, configured to determine, for any one of the feature libraries, a first calorific value component according to a requested quantity of the target feature library; the second component determination submodule is used for determining a second heat value component according to the library capacity of the target feature library; and the first heat value determining submodule is used for determining the heat value of the target feature library according to the first heat value component and the second heat value component.

In one embodiment, for the target feature library, the request quantity obtaining module includes: the request quantity curve acquisition submodule is used for acquiring a current request quantity curve of the target feature library corresponding to a current time period and a historical request quantity curve corresponding to a set historical time period; the first request quantity obtaining submodule is used for determining the current request quantity of the target feature library from the current request quantity curve; the second request quantity obtaining submodule is used for determining the minimum request quantity and the maximum request quantity of the target feature library from the historical request quantity curve; a first component determination submodule comprising: a first request quantity difference value calculating unit, configured to calculate a difference value between the current request quantity and the minimum request quantity to obtain a first request quantity difference value; the second request quantity difference calculation unit is used for calculating the difference of the minimum request quantity relative to the maximum request quantity to obtain a second request quantity difference; a request quantity prediction unit for predicting a request quantity of the target feature library in a set future time period according to the first request quantity difference and the second request quantity difference; a first component determination unit configured to determine the first calorific value component from the request amount for setting the future time period.

In one embodiment, the second component determination sub-module comprises: the library capacity determining unit is used for determining the minimum library capacity and the maximum library capacity corresponding to the feature library of the target storage medium; a first library capacity difference determining unit, configured to determine a difference between the library capacity of the target feature library and the minimum library capacity to obtain a first library capacity difference; a second library capacity difference determining unit, configured to determine a difference between the minimum library capacity and the maximum library capacity to obtain a second library capacity difference; a second component determination unit configured to determine the second calorific value component from the first library capacity difference and the second library capacity difference.

In one embodiment, the first heat value determination submodule includes: a third component determining unit, configured to obtain a control parameter value corresponding to the target feature library, and obtain a third heat value component according to the control parameter value; a heat value determination unit for determining a heat value of the target feature library according to the first heat value component, the second heat value component, and the third heat value component.

In one embodiment, the heat value determination unit includes: a library capacity weight acquiring subunit, configured to acquire a library capacity weight of the target feature library; the library capacity weight is linearly related to the size of the library capacity of the target feature library; the weighting subunit is used for carrying out weighted calculation on the second heat value component according to the library capacity weight; and the heat value determining subunit is used for obtaining the heat value of the target feature library according to the first heat value component, the weighted and calculated second heat value component and the third heat value component.

In one embodiment, the third component determination unit includes: the first parameter value setting subunit is configured to set, when the target feature library carries the identifier of interest, a regulation parameter value of the target feature library as a first parameter value; the second parameter value setting subunit is configured to set, when the target feature library does not carry the identifier of interest, a regulation parameter value of the target feature library as a second parameter value; the second parameter value is less than the first parameter value.

In one embodiment, the apparatus further comprises: the access frequency acquisition module is used for acquiring the access frequency of the feature library of the target storage medium; the feature library access frequency is used for representing the frequency of calling in and calling out of each feature library between the first storage medium and the second storage medium; and the first heat value updating module is used for adjusting the weight of at least one of the first heat value component, the second heat value component and the third heat value component of each feature library when the access frequency of the feature library is greater than or equal to the access frequency threshold, and updating the heat value of each feature library according to the adjustment result.

In one embodiment, the apparatus further comprises: a response time obtaining module, configured to obtain a request response time of the target storage medium; the request response time is the response time of the target storage medium to the characteristic reading request; and the second heat value updating module is used for adjusting the weight of at least one of the first heat value component, the second heat value component and the third heat value component of each feature library when the request response time is greater than or equal to a response time threshold value, and updating the heat value of each feature library according to the adjustment result.

In one embodiment, the first storage medium includes a first storage area and a second storage area; for the storage of the feature library with the heat value sorted in the front, the first storage area takes precedence over the second storage area; and the to-be-transferred feature library determining module is further used for determining the to-be-transferred feature library in the feature library of the first storage area according to the sequence of the heat values.

In one embodiment, the to-be-transferred feature library determination module includes: a first to-be-transferred feature library determining submodule, configured to determine, when a heat value of a feature library existing in the first storage area is lower than a heat value of each feature library of the second storage area, the corresponding feature library in the first storage area as the to-be-transferred feature library; and the second to-be-transferred feature library determining submodule is used for determining the corresponding feature library in the first storage area as the to-be-transferred feature library when the heat value of the feature library existing in the first storage area is lower than the heat value of each feature library of the second storage medium.

In one embodiment, the apparatus further comprises: the reading frequency determining module is used for determining the reading frequency of each feature library in the second storage area in a set historical time period; and the second feature library scheduling module is used for scheduling the feature library with the reading frequency meeting the condition in the second storage area to the second storage medium.

In one embodiment, the apparatus further comprises: a hit heat determination module for determining read hit heat of each feature in the target storage medium; the reading hit heat is determined according to the ratio of the number of times of reading of the features to the total number of times of reading of the target storage medium; the distribution state determining module is used for determining the quantity distribution state of the read hit heat; and the characteristic grouping module is used for grouping the characteristics according to the quantity distribution state and determining the obtained grouping as a characteristic library in the target storage medium.

For specific limitations of the scheduling apparatus of the feature library, reference may be made to the above limitations of the scheduling method of the feature library, and details are not described here. The modules in the scheduling device of the feature library can be implemented in whole or in part by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.

The present invention also provides a feature retrieval apparatus, which is operable to execute the above-described feature retrieval method, based on the same idea as the feature retrieval method in the above-described embodiment. For convenience of explanation, the structural schematic diagram of the embodiment of the feature retrieval device only shows a part related to the embodiment of the present invention, and those skilled in the art will understand that the illustrated structure does not constitute a limitation of the device, and may include more or less components than those illustrated, or combine some components, or arrange different components.

In one embodiment, as shown in fig. 11, a feature retrieval apparatus 1100 is provided, which may be a part of a computer device using a software module or a hardware module, or a combination of the two, and specifically includes: an identification information acquisition module 1101, a feature library determination module 1102, a target feature determination module 1103, and a retrieval feature determination module 1104, wherein:

an identification information obtaining module 1101 is configured to obtain the reference retrieval feature and the feature library identification information.

A feature library determining module 1102, configured to determine a target feature library corresponding to the feature library identification information in a feature library of a first storage medium; the first storage medium is a storage medium in a target storage medium, the target storage medium further comprises a second storage medium, and the response sequence of the first storage medium has priority over the second storage medium for a feature reading request aiming at the target storage medium; the feature library in the first storage medium is scheduled to the second storage medium when a heat value satisfies a condition, the heat value being used to characterize a degree of influence of the feature library in the first storage medium on a feature reading efficiency of the target storage medium when scheduled within the target storage medium.

A target feature determining module 1103, configured to read the stored features from the target feature library.

A retrieval feature determining module 1104, configured to determine, among the read features, a target retrieval feature that matches the reference retrieval feature.

In the characteristic retrieval device, the characteristic library can be quickly positioned in the storage medium to read the characteristics, so that the characteristic retrieval efficiency of the whole storage medium is improved.

In one embodiment, a feature library determination module includes: the device determining submodule is used for determining target computer devices in a computer device cluster in a load balancing mode; the feature libraries stored by the computer devices in the computer device cluster are consistent, and a first storage medium is configured in the target computer device; and the target feature library determining sub-module is used for determining the target feature library corresponding to the feature library identification information from the feature library in the first storage medium of the target computer equipment.

In one embodiment, the first storage medium includes a first storage area and a second storage area; for the storage of the feature library with the heat value sorted in the front, the first storage area takes precedence over the second storage area; a feature library determination module comprising: the second hot value determining submodule is used for determining a corresponding hot value when the feature library in the first storage area is scheduled in the target storage medium; and the feature library scheduling submodule is used for scheduling the feature libraries in the first storage area with the heat value sequences meeting the conditions into the second storage medium.

In one embodiment, a retrieval feature determination module includes: a distance determination submodule for determining a feature vector distance between each of the read features and the reference retrieval feature; and the target retrieval feature determining submodule is used for determining the feature of which the feature vector distance is smaller than a preset distance threshold value in the read features as the target retrieval feature.

In one embodiment, the apparatus further comprises: the media information determining module is used for determining first face media information corresponding to the reference retrieval characteristics and second face media information corresponding to the target retrieval characteristics; the similarity determining module is used for obtaining the similarity of the first face media information and the second face media information according to the feature vector distance between the reference retrieval feature and the target retrieval feature; and the face comparison result determining module is used for determining a face feature comparison result according to the similarity.

For the specific definition of the feature retrieval device, reference may be made to the above definition of the feature retrieval method, which is not described herein again. The modules in the feature retrieval device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.

In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 12. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing the characteristic data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a scheduling method of a feature library or a feature retrieval method.

Those skilled in the art will appreciate that the architecture shown in fig. 12 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.

In one embodiment, there is also provided a computer device comprising a memory and a processor, the memory having a computer program therein, the processor implementing the steps of the above method embodiments when executing the computer program.

In an embodiment, a computer-readable storage medium is provided, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.

In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer-readable storage medium. The computer instructions are read by a processor of a computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the steps in the above-mentioned method embodiments.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.

The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.

The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种数据库迁移的方法、装置、设备及可读介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!