A search library management method, search method, device and medium
Through the separation management method of hot retrieval database and cold retrieval database, the storage cost and retrieval efficiency problems caused by the expansion of the face retrieval database are solved, efficient and reliable identity recognition retrieval is achieved, and the dependence on high-performance processors is reduced.
Patent Information
- Application Number
- CN201911044479.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-10-30
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-10-08
AI Technical Summary
In application scenarios such as smart retail and smart communities, as the number of users with new identities increases, the size of the face retrieval database continues to expand, resulting in high storage costs. The retrieval reliability, accuracy and efficiency of existing retrieval methods cannot meet the needs.
Using the separation management method of hot retrieval database and cold retrieval database, by obtaining the attribute parameters of hot data, migrating hot data to cold retrieval database, and calculating the matching degree between cold data and hot data, the hot database can be downgraded and the cold database can be upgraded to maintain the hot database. The size of the retrieval library is within the threshold range, which improves the effectiveness and efficiency of the retrieval library.
It reduces the dependence on high-performance processors, reduces storage costs, improves the reliability, accuracy and efficiency of the retrieval database, and ensures the timeliness of hot data and the accuracy of retrieval results.
Smart Images

Figure CN110865992B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a search library management method, a search method, a device and a medium. Background Art
[0002] At present, the application of artificial intelligence technology for identity recognition and retrieval has been implemented and promoted to a certain extent in application scenarios such as smart retail, smart communities, smart finance, and security.
[0003] In the above application scenarios, in order to improve the retrieval efficiency, the retrieval library for identity recognition is generally fixedly stored in a processor with better concurrency and memory access speed. Taking the face retrieval scenario as an example, the face database is usually stored in the graphics processing unit (GPU) memory. However, in these application scenarios, with the addition of a large number of new identity users, a large amount of high-quality processors with high prices (such as GPU) resources will be consumed, greatly increasing the storage cost of retrieval. In addition, the retrieval reliability, accuracy and efficiency of existing retrieval methods need to be further improved. Summary of the invention
[0004] The present application provides a search library management method, a search method, a device and a medium to solve at least one of the above technical problems.
[0005] In one aspect, the present application provides a search library management method, wherein the search library includes a hot search library and a cold search library, and the method includes:
[0006] When the total number of hot data stored in the hot search library is greater than a first preset scale threshold, obtaining attribute parameters of each hot data stored in the hot search library;
[0007] If it is determined that the attribute parameters of the hot data meet the hot data management conditions, the hot data meeting the hot data management conditions is migrated to the cold search library;
[0008] Calculating first matching degrees of each cold data stored in the cold search library and each hot data in the hot search library;
[0009] If it is determined that the first matching degree satisfies the cold data management condition, the cold data satisfying the cold data management condition is migrated to the hot search library.
[0010] On the other hand, the present application also provides a retrieval method, which uses a data-managed retrieval library for retrieval, wherein the retrieval library includes a hot retrieval library and a cold retrieval library, and the method includes:
[0011] Obtain the feature data to be retrieved of the object;
[0012] Searching the feature data to be searched in a hot search library managed by the search library to obtain a search result;
[0013] Returning the search result;
[0014] The retrieval database is managed by the following retrieval database management method, and the database management method includes:
[0015] When the total number of hot data stored in the hot search library is greater than a first preset scale threshold, obtaining attribute parameters of each hot data in the hot search library;
[0016] If it is determined that the attribute parameters of the hot data meet the hot data management conditions, the hot data meeting the hot data management conditions is migrated to the cold search library;
[0017] Calculating first matching degrees of each cold data stored in the cold search library and each hot data in the hot search library;
[0018] If it is determined that the first matching degree satisfies the cold data management condition, the cold data satisfying the cold data management condition is migrated to the hot search library.
[0019] On the other hand, the present application also provides a search library management device, wherein the search library includes a hot search library and a cold search library, and the device includes:
[0020] an attribute acquisition module, configured to acquire attribute parameters of each hot data stored in the hot search library when the total amount of hot data stored in the hot search library is greater than a first preset scale threshold;
[0021] A first migration module, configured to migrate the hot data satisfying the hot data management condition to the cold search library if it is determined that the attribute parameters of the hot data satisfy the hot data management condition;
[0022] A first calculation module, used for calculating a first matching degree between each cold data stored in the cold search library and each hot data in the hot search library;
[0023] The second migration module is configured to migrate the cold data satisfying the cold data management condition to the hot search library if it is determined that the first matching degree satisfies the cold data management condition.
[0024] On the other hand, the present application also provides a retrieval device, the device comprising:
[0025] A feature management module, used to obtain the feature data to be retrieved of the object;
[0026] The above-mentioned search library management device is used to manage data in the search library, and the search library includes a hot search library and a cold search library;
[0027] A retrieval module, used to search the characteristic data to be searched in the data-managed hot search library to obtain a search result;
[0028] The return module is used to return the search result.
[0029] On the other hand, a retrieval library management device is also provided, the device comprising a processor and a memory, the memory storing at least one instruction, at least one program, a code set or an instruction set, the at least one instruction, the at least one program, the code set or the instruction set being loaded and executed by the processor to implement any of the above-mentioned retrieval library management methods.
[0030] On the other hand, a retrieval device is also provided, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement any of the above-mentioned retrieval methods.
[0031] On the other hand, a computer-readable storage medium is provided, wherein the storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded by a processor and executed by any of the retrieval library management methods described above.
[0032] On the other hand, a computer-readable storage medium is provided, wherein the storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded by a processor and executed by any of the retrieval methods described above.
[0033] The present application provides a search library management method, search method, device and medium, which have the following technical effects:
[0034] The retrieval library of the embodiment of the present application includes a hot retrieval library and a cold retrieval library. When the total number of hot data stored in the hot retrieval library is greater than a first preset scale threshold, the attribute parameters of each hot data stored in the hot retrieval library are obtained; if it is determined that the attribute parameters of the hot data meet the hot data management conditions, the hot data meeting the hot data management conditions are migrated to the cold retrieval library; the first matching degree between each cold data stored in the cold retrieval library and each hot data in the hot retrieval library is calculated; if it is determined that the first matching degree meets the cold data management conditions, the cold data meeting the cold data management conditions are migrated to the hot retrieval library. Thus, by separating the hot and cold data of the retrieval library, when the total number of hot data stored in the hot retrieval library is greater than the first preset scale threshold, the hot and cold library promotion and demotion logic is triggered, thereby ensuring that the scale of the hot retrieval library is within the threshold range, improving the effectiveness of the hot data in the hot retrieval library, and improving the retrieval reliability, accuracy and efficiency of the retrieval based on the managed hot retrieval library. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;
[0037] Figure 2 It is a flowchart of a search library management method provided in an embodiment of the present application;
[0038] Figure 3 It is a flowchart of the steps of migrating hot data to a cold search library provided in an embodiment of the present application;
[0039] Figure 4 It is a schematic diagram of a process for migrating hot data to a cold search library provided in an embodiment of the present application;
[0040] Figure 5 It is a flowchart of the steps of performing data management on a hot search library provided in an embodiment of the present application;
[0041] Figure 6 It is a schematic diagram of the process of clearing the cold search library provided in the embodiment of the present application;
[0042] Figure 7 It is a flowchart of the steps of performing data management on a cold search library provided in an embodiment of the present application;
[0043] Figure 8 It is a structural block diagram of a search library management device provided in an embodiment of the present application;
[0044] Fig. 9 It is a flowchart of a search method provided in an embodiment of the present application;
[0045] Fig.10 It is a schematic diagram of the framework of the retrieval method based on the face retrieval scenario implemented in this application;
[0046] Fig.11 is a structural block diagram of a retrieval device provided in an embodiment of the present application;
[0047] Fig.12 It is a schematic diagram of the hardware structure of a device provided by the present application for implementing the method provided by an embodiment of the present application. DETAILED DESCRIPTION
[0048] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.
[0049] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0050] First, the technical terms that may be involved in the present invention are briefly described:
[0051] Face recognition: refers to the process of extracting facial features and performing similarity comparison. Depending on the application scenario, face recognition is mainly divided into three categories: 1:1 face verification (Face Verification), 1:N face recognition (Face Recognition) and face retrieval (Face Retrieval).
[0052] 1:N face recognition: Find one or more faces with the highest similarity to the face to be retrieved in a large-scale face database.
[0053] SDK: Software Development Kit (SDK) is generally a collection of development tools used by software engineers to build application software for specific software packages, software frameworks, hardware platforms, business systems, etc.
[0054] CPU / GPU: CPU is the central processing unit and GPU is the image processing unit; both are computing resources for video multimedia.
[0055] At present, identity recognition and retrieval have been implemented and promoted to a certain extent in application scenarios such as smart retail, smart community, smart finance, and security. In these application scenarios, in order to improve retrieval efficiency, the retrieval library for identity recognition is generally fixedly stored in a processor with better concurrency and memory access speed. Existing retrieval methods are mainly suitable for application scenarios with fixed retrieval base libraries, such as scenarios where the retrieval base library is registered in advance (such as access control, attendance, etc.); for scenarios where the retrieval base library is not fixed (such as smart retail, smart community, etc.), with the large number of new identity users joining, the scale of the retrieval base library continues to increase, which brings huge challenges to existing retrieval methods.
[0056] Taking face retrieval as an example, the face database is usually stored in the graphics processing unit (GPU) memory. However, in these application scenarios, with the addition of a large number of new identity users, a large amount of excellent processor (such as GPU) resources will be consumed, greatly increasing the storage cost of retrieval. In addition, the retrieval reliability, accuracy and efficiency of existing retrieval methods need to be further improved.
[0057] In addition, the inventors also found that: in the process of identity recognition, a retrieval algorithm is usually used to perform identity retrieval in the retrieval library. However, the retrieval accuracy based on the retrieval algorithm depends on the size of the retrieval library. The larger the size of the retrieval library, the higher the model accuracy and computing performance requirements of the retrieval algorithm. For example, taking the face retrieval scenario as an example, as the number of user identities in the retrieval library increases, the accuracy of the general face recognition algorithm will drop significantly. As shown in Table 1 below, for the same retrieval algorithm model, at an error rate of one thousandth, the first hit rate of faces with different retrieval library sizes.
[0058] Table 1 Relationship between retrieval accuracy and retrieval database size
[0059] Search database size / number of people 100 500 1000 Accuracy / % 100 99.2 78.4
[0060] In order to solve at least one of the above technical problems, the present application provides a search library management method, a search method, a device and a medium.
[0061] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0062] Please refer to Figure 1 , which shows a schematic diagram of an implementation environment provided by an embodiment of the present application. The implementation environment may include: a terminal 10, and a server 20 connected to the terminal 10 via a network.
[0063] The terminal 10 may specifically include software running in a physical device, such as an application installed on the device, etc., and may also include at least one of the physical devices of the type of a smart phone, a desktop computer, a tablet computer, a laptop computer, a digital assistant, a smart wearable device, etc., with an application installed. Specifically, an operating system is running on the terminal 10, and the operating system may be a desktop operating system such as a Windows operating system, a Linux operating system, or a Mac OS (Apple desktop operating system), or a mobile operating system such as an iOS (Apple mobile terminal operating system) or an Android operating system.
[0064] The server 20 may be an independent server, or a server cluster composed of multiple independent servers, or a distributed server, or a cloud server that provides basic cloud computing services such as cloud computing servers, cloud databases, and cloud storage. The distributed server may be a blockchain structure, and any node in the blockchain structure may execute or participate in executing the search library management method or the search method.
[0065] It should be understood that Figure 1 The implementation environment shown in the figure is only an application environment of the present application scheme and does not constitute a limitation on the application environment of the present application scheme. Other application environments may also include more or fewer computer devices than shown in the figure, or network connection relationships between computer devices.
[0066] The following describes a specific embodiment of a search library management method of the present application. Figure 2 This is a flowchart of a search library management method provided in the embodiment of the present application. The present application provides method operation steps as described in the embodiment or flowchart, but based on conventional or non-creative labor, more or fewer operation steps may be included. The order of steps listed in the embodiment is only one of many step execution orders and does not represent the only execution order. Figure 2As shown, the execution subject of the method may be a server in the above application environment, the search library includes a hot search library and a cold search library, and the method may include:
[0067] S201: When the total number of hot data stored in the hot search library is greater than a first preset scale threshold, obtain attribute parameters of each hot data stored in the hot search library.
[0068] In this embodiment, the hot search library is a search base library for searching. The hot search library stores a large amount of hot data for searching and comparing, and the hot data includes but is not limited to the user's identity and the user's basic data. The user's basic data includes object data, such as face images, face feature images, voiceprints, irises, etc.
[0069] For example, taking the scenario of detecting faces, if user A enters a smart retail mall, the acquisition device collects the facial image of user A, and then the hot search library obtains the facial image of user A, and based on the features of the facial image, checks whether there are corresponding facial image features in the hot search library. If so, it means that user A has visited before. If not, it means that user A is a new visitor, and it is necessary to register an identity ID for the user, and associate the registered identity ID with the corresponding facial image features as newly added hot data and store them in the hot search library.
[0070] The cold search library is used to store cold data to be managed. Under the preset management conditions, the cold data in the cold search library and the hot data in the hot search library are managed, including but not limited to data migration, data deletion, data merging, data transfer to disk, data synchronization, etc.
[0071] In application scenarios such as smart retail, smart communities, smart finance, and security, there will be a large number of users who keep visiting. To identify the large number of users who keep visiting, a retrieval algorithm is usually used to search the database. As the inventors have discovered, the retrieval algorithm is related to the size of the database. Therefore, in order to improve the accuracy of the retrieval, when the retrieval base exceeds the first preset scale threshold, the number of retrieval bases has exceeded the computing power of the retrieval algorithm, and there is a problem of low accuracy of the retrieval results, so it is necessary to trigger the management strategy for the hot retrieval library. The first preset scale threshold is adaptively adjusted according to the theoretical accuracy of the retrieval algorithm, the theoretical precision of the retrieval model, and the theoretical computing power.
[0072] When the total number of hot data stored in the hot search library is greater than the first preset scale threshold, it represents the triggering of the management condition for the hot search library. At this time, it is necessary to obtain the attribute parameters of each hot data stored in the hot search library in order to filter the hot data that needs to be managed. The attribute parameters of the hot data include at least one of the recording time of the hot data and the user activity associated with the hot data. For example, the recording time may be the visit time of the user associated with the recorded hot data, and the activity may be based on the number of visits by the user within a preset time period (for example, one week, one month, half a year or one year, etc.).
[0073] It should be noted that the value of the first preset scale threshold is not fixed, and it can be adaptively configured according to the retrieval algorithm to match different retrieval algorithms and improve retrieval performance.
[0074] In practical applications, taking the scene of face detection as an example, if the rated base database size corresponding to the retrieval accuracy requirement achieved by the specified face retrieval algorithm is 10,000, the first preset scale threshold can be configured as 10,000. Afterwards, when it is detected that the total number of hot data stored in the current hot retrieval library is greater than the first preset scale threshold, the database management of the hot retrieval library is triggered. In database management, the attribute parameters of each hot data stored in the hot retrieval library (such as the storage time and activity of the hot data) can be obtained during non-routine working hours (such as at night, in the early morning, or other periods with fewer retrieval requests), and then the hot data that meets the predetermined conditions is managed based on the attribute parameters, thereby avoiding affecting the normal facial feature addition, deletion, modification and query business during the working hours, and making full use of the machine's nighttime resources.
[0075] In other embodiments, when it is determined that the total number of hot data stored in the hot search library is less than the first preset scale threshold k1, the deep data management of the hot search library may not be triggered first; it is further determined whether the total number of hot data stored in the hot search library is greater than the third preset scale threshold k3 (k3 is less than k1), and if the determination result is yes, the data management of the hot search library is triggered again. Thus, by streamlining the total number of data in the hot search library, the search efficiency and accuracy based on the hot search library are further improved.
[0076] S203: If it is determined that the attribute parameters of the hot data meet the hot data management conditions, the hot data meeting the hot data management conditions is migrated to the cold search library.
[0077] After triggering the data management of the hot search library and obtaining the attribute parameters of each hot data in the hot search library, it is necessary to filter out the hot data that needs to be managed from all the hot data, and then perform corresponding data management on the filtered hot data.
[0078] The attribute parameters of the hot data include at least one of the last recorded timestamp of the hot data and the user activity associated with the hot data.
[0079] In this embodiment, Figure 3 and 4 As shown, the attribute parameters of the hot data include the last recorded timestamp of the hot data and the user activity associated with the hot data. If it is determined that the attribute parameters of the hot data meet the hot data management conditions, the hot data meeting the hot data management conditions is migrated to the cold search library, including:
[0080] S301: If it is determined that the time interval between the most recent recording timestamp of the hot data and the first preset time is greater than or equal to a first preset threshold, and it is determined that the user activity associated with the hot data is less than a second preset threshold, it is determined that the attribute parameters of the hot data meet the hot data management conditions.
[0081] Among them, the most recently recorded timestamp is the time recorded for the most recent visit of the user identity associated with the hot data. The first preset time includes but is not limited to the current management time, other fixed times, etc. The first preset time can be configured according to the user visit situation in the actual application scenario. For example, in a scenario where the visit time is relatively frequent, such as in a smart community scenario, since users need to go in and out of the community frequently, the first preset time can be configured to a smaller value, such as half a month, a month, a quarter, or half a year. In a scenario where the visit time is not frequent, such as in a smart retail scenario, since users occasionally enter a retail mall, the first preset time can be configured to a larger value, such as a quarter, half a year, a year, etc.
[0082] The object activity is an activity index that characterizes the user corresponding to the hot data in the second preset time period. Specifically, the object activity can be determined based on the number of active times of the user in the preset time period and the second preset time period. The number of active times can be the cumulative number of visits, the cumulative number of uses, etc. The second preset time and the number of active times can be configured according to the user's visit situation in the actual application scenario. For example, in a scenario where visits are frequent, such as in a smart community scenario, since users need to frequently enter and exit the community, the second preset time can be configured as a smaller value and the number of active times can be configured as a larger value, such as configuring the second preset time to be nearly three days, nearly a week, nearly half a month, etc.; the corresponding number of active times can be determined according to the situation, such as 5 to 20 times. In a scenario where visits are not frequent, such as in a smart retail scenario, since users occasionally enter a retail mall, the second preset time can be configured as a larger value, such as nearly half a month, nearly a month, etc.; the corresponding number of active times can be determined according to the situation, such as 3 to 8 times.
[0083] For example, in a smart retail scenario, within a preset management cycle, the hot data corresponding to the user ID of user B is queried, and the last record timestamp in the hot data base is t1. In the past month, the cumulative number of visits to the smart retail mall by user B is m times. If the time interval between t1 and the current query is greater than the first preset threshold (for example, one year), and m is less than the second preset threshold (for example, 5 times), it is determined that the attribute parameters of the hot data corresponding to user B meet the hot data management conditions.
[0084] In other embodiments, the attribute parameters of the hot data may only include the timestamp of the last record of the hot data or the user activity associated with the hot data. For example, in a security scenario, the attribute parameters of the hot data may only include the timestamp of the last record.
[0085] The hot search library of the present application performs identity screening corresponding to the hot data through the most recent record timestamp of the hot data and / or the activity of the associated user, thereby ensuring the timeliness and reliability of the search results.
[0086] S303: Determine the hot data that meets the hot data management condition as the hot data to be managed.
[0087] S305: Migrate the hot data to be managed to the cold search library.
[0088] When the preset management cycle is reached, the hot data to be managed is migrated to the cold search library. The preset management cycle includes but is not limited to one day, one week, one month, etc.
[0089] In one embodiment, migrating the hot data to be managed to the cold search library includes:
[0090] S3051: Calculate the second matching degree between the hot data to be managed and each cold data in the cold search library.
[0091] The second matching degree is used to characterize the similarity between the hot data to be managed and each cold data in the cold search library. The number of the second matching degrees is multiple, which can be determined by calculating the similarity between the hot data to be managed and all the cold data. The similarity includes but is not limited to cosine similarity.
[0092] S3053: Determine whether a maximum second matching degree among the multiple second matching degrees corresponding to the hot data to be managed is greater than or equal to a third preset threshold.
[0093] S3055: If the determination result is yes, merge the hot data to be managed and the cold data whose maximum second matching degree is greater than or equal to the third preset threshold;
[0094] S3057: If the determination result is no, the hot data to be managed whose maximum second matching degree is less than the third preset threshold is stored in the cold search library.
[0095] Among them, the third preset threshold is a preset value, and its value can be configured but not limited to any value between 0.8 and 1. Data merging refers to merging the hot data to be managed to the corresponding cold data storage location. Among the multiple second matching degrees corresponding to the hot data to be managed, if it is determined that the maximum second matching degree is greater than or equal to the third preset threshold, it indicates that cold data similar to the hot data to be managed corresponding to the maximum second matching degree has been stored in the cold retrieval library, and it is necessary to merge the corresponding hot data to be managed with the cold data, and delete the hot data to be managed in the hot retrieval library. Correspondingly, if it is determined that the maximum second matching degree is less than the third preset threshold, it indicates that the hot data to be managed corresponding to the maximum second matching degree is new cold data, and it is directly stored in the cold retrieval library.
[0096] This application triggers the hot database demotion strategy through the first preset scale threshold of the hot search database, and sinks the identities in the database with poor timeliness to the cold storage, thereby ensuring the scale and identity of the hot search database are up to date, and improving the accuracy and speed of retrieval. The hot database demotion strategy ensures that the hot data in the search base database are all hot database identities that have been degraded by time activity, so that the returned search results are all the most recent object information corresponding to the query identity.
[0097] S205: Calculate the first matching degree between each cold data stored in the cold search library and each hot data in the hot search library.
[0098] The first matching degree is used to characterize the similarity between each cold data stored in the cold search library and each hot data in the hot search library. The number of the first matching degrees can be multiple, which can be determined by calculating the similarity between all cold data and all hot data. The similarity includes but is not limited to cosine similarity.
[0099] S207: If it is determined that the first matching degree satisfies the cold data management condition, the cold data satisfying the cold data management condition is migrated to the hot search library.
[0100] The hot search library is searched using the identity in the cold search library. After calculating the first matching degree of all cold data in the cold search library and all hot data in the hot search library, if there is cold data that meets the cold data management conditions, the cold data is upgraded to a new library.
[0101] In this embodiment, Figure 5 As shown, if it is determined that the first matching degree meets the cold data management condition, migrating the cold data meeting the cold data management condition to the hot search library includes:
[0102] S401: If it is determined that the maximum first matching degree among the multiple first matching degrees corresponding to the cold data is greater than or equal to a fourth preset threshold, it is determined that the first matching degree meets the cold data management condition.
[0103] S403: Determine the cold data that meets the cold data management condition as the cold data to be managed.
[0104] S405: Migrate the cold data to be managed to the hot search library.
[0105] Among them, the fourth preset threshold value can be a preset value, and its numerical value can be configured but not limited to any value between 0.8 and 1. Use the identity in the cold search library to search the hot search library. Among the multiple first matching degrees corresponding to each cold data, if it is determined that the maximum first matching degree is greater than or equal to the fourth preset threshold, it means that hot data similar to the cold data corresponding to the maximum first matching degree has been stored in the hot search library. In other words, the user corresponding to the identity of the cold data has recently visited again, so the identity information of the user is registered in the hot search library, and the cold data corresponding to the cold data management conditions that meet the cold data management conditions are determined as cold data to be managed and data migration is performed to the hot search library. For example, in one case, the user identifier of the cold search library can be directly overwritten with the user identifier of the hot search library, and the cold data corresponding to the identity in the cold search library can be deleted. In another case, the cold data corresponding to the identity in the cold search library can be directly deleted.
[0106] Correspondingly, if it is determined that the maximum first matching degree is less than the fourth preset threshold, it indicates that the user corresponding to the identity of the cold data has not revisited recently. At this time, the cold data is not migrated and is still stored in the cold search library.
[0107] The retrieval library of the embodiment of the present application includes a hot retrieval library and a cold retrieval library. When the total number of hot data stored in the hot retrieval library is greater than a first preset scale threshold, the attribute parameters of each hot data stored in the hot retrieval library are obtained; if it is determined that the attribute parameters of the hot data meet the hot data management conditions, the hot data meeting the hot data management conditions are migrated to the cold retrieval library; the first matching degree between each cold data stored in the cold retrieval library and each hot data in the hot retrieval library is calculated; if it is determined that the first matching degree meets the cold data management conditions, the cold data meeting the cold data management conditions are migrated to the hot retrieval library. Thus, by separating the hot and cold data of the retrieval library, when the total number of hot data stored in the hot retrieval library is greater than the first preset scale threshold, the hot and cold library promotion and demotion logic is triggered, which ensures that the scale of the hot retrieval library is within the threshold range, improves the effectiveness of the hot data in the hot retrieval library, and is also conducive to improving the retrieval reliability, accuracy and retrieval efficiency based on the managed hot retrieval library.
[0108] In some embodiments, such as Figure 6 As shown, the method may also include:
[0109] S501: Detecting the total number of cold data stored in the cold search library;
[0110] S503: If the total number of cold data detected is greater than the second preset scale threshold, the difference between the total number of cold data detected and the second preset scale threshold is used as the number N to be transferred, where N is a positive integer;
[0111] S505: sorting all cold data in the cold search library in the order of the most recent record time;
[0112] S507: Transfer the top N cold data to the disk.
[0113] The second preset scale threshold may be determined according to the storage performance of the cold search library. For example, the second preset scale threshold includes but is not limited to 100,000, 500,000, 1 million, etc.
[0114] Specifically, after completing the above-mentioned cold storage to hot storage process, the total number of all cold data in the current cold search library is determined. If it reaches the second preset scale threshold (configurable as 1 million), the cold storage cleaning module is triggered, and the identities of all remaining cold search libraries are sorted according to the time of the most recent visit, and the cold search library is cleaned up. The main task is to write the cold data with the longest visit time in the cold search library (for example, the TOP N) from the memory to the disk and delete it from the memory to ensure that the scale of the cold search library is controllable. The cold storage information written to the disk is mainly used for backup. The business selects the required identity ID according to time or other dimensions for offline processing or targeted reactivation and re-entry into the hot storage.
[0115] In some embodiments, the hot search library is stored in a memory corresponding to an image processor or a sound processor used to match the object to be searched, and the cold search library is stored in a memory corresponding to a central processing unit;
[0116] The object to be retrieved includes but is not limited to at least one of the following: face, audio, and iris.
[0117] For example, in the scenario of face retrieval, if there are N face identities in the retrieval library, the M face identities that meet the timeliness requirements can be stored in the video memory of the image processor GPU, and the remaining NM face identities can be stored as cold data in the memory of the central processing unit CPU. Thus, by storing hot and cold data separately, the dependence and demand on high-performance GPUs is greatly reduced, and the storage cost of the retrieval library is reduced.
[0118] This application separates the hot and cold retrieval libraries so that they do not affect each other and do not affect online requests during the database management process, making full use of time resources to search the hot retrieval library online during the day and use the cold retrieval library to search the hot retrieval library at night. At the same time, the hot retrieval library with higher query popularity is stored in the GPU video memory, and the cold retrieval library with inactive identities is stored in the CPU memory. It also ensures that the scale of the hot and cold libraries is within the specified threshold. When the upper limit of the hot library scale reaches the threshold, the hot and cold library upgrade and downgrade process is triggered; when the upper limit of the cold library scale reaches the threshold, the library clearing logic is triggered to ensure maximum utilization of the machine CPU, GPU and disk resources, reduce the demand for expensive GPUs, and reduce retrieval costs.
[0119] The following are device embodiments of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0120] Please refer to Figure 8 , which shows a structural block diagram of a search library management device provided in an embodiment of the present application. The device has the function of implementing the server side in the above method example, and the function can be implemented by hardware or by hardware executing corresponding software. The search library includes a hot search library and a cold search library, and the device 60 may include:
[0121] The attribute acquisition module 601 is used to acquire the attribute parameters of each hot data stored in the hot search library when the total number of hot data stored in the hot search library is greater than a first preset scale threshold;
[0122] A first migration module 602 is configured to migrate the hot data satisfying the hot data management condition to the cold search library if it is determined that the attribute parameters of the hot data satisfy the hot data management condition;
[0123] A first calculation module 603 is used to calculate a first matching degree between each cold data stored in the cold search library and each hot data in the hot search library;
[0124] The second migration module 604 is configured to migrate the cold data satisfying the cold data management condition to the hot search library if it is determined that the first matching degree satisfies the cold data management condition.
[0125] In some embodiments, the attribute parameter of the hot data includes at least one of a timestamp of the last recording of the hot data and a user activity associated with the hot data.
[0126] In some embodiments, when the attribute parameters of the hot data include the timestamp of the last record of the hot data and the user activity associated with the hot data, the first migration module includes:
[0127] A first determination unit, configured to determine that the attribute parameter of the hot data meets the hot data management condition if it is determined that the time interval between the most recent recording timestamp of the hot data and the first preset time is greater than or equal to a first preset threshold, and if it is determined that the user activity associated with the hot data is less than a second preset threshold, determine that the attribute parameter of the hot data meets the hot data management condition;
[0128] A second determining unit, configured to determine the hot data satisfying the hot data management condition as the hot data to be managed;
[0129] The first migration unit is used to migrate the hot data to be managed to the cold search library.
[0130] In some embodiments, the first migration unit comprises:
[0131] A calculation subunit, used for calculating the second matching degree between the hot data to be managed and each cold data in the cold search library;
[0132] A determination unit, configured to determine whether a maximum second matching degree among a plurality of second matching degrees corresponding to the hot data to be managed is greater than or equal to a third preset threshold;
[0133] A data merging subunit, configured to merge the hot data to be managed and the cold data whose maximum second matching degree is greater than or equal to a third preset threshold value if the determination result is yes;
[0134] The storage subunit is used to store the hot data to be managed whose maximum second matching degree is less than the third preset threshold into the cold search library if the determination result is no.
[0135] In some embodiments, the second migration module includes:
[0136] A third determining unit, configured to determine that the first matching degree satisfies the cold data management condition if it is determined that the maximum first matching degree is greater than or equal to a fourth preset threshold value among the multiple first matching degrees corresponding to the respective cold data;
[0137] A fourth determining unit, configured to determine the cold data satisfying the cold data management condition as the cold data to be managed;
[0138] The second migration unit is used to migrate the cold data to be managed to the hot search library.
[0139] In some embodiments, the apparatus further comprises:
[0140] A detection module, used for detecting the total number of cold data stored in the cold search library;
[0141] A quantity determination module, configured to, if the total number of cold data detected is greater than a second preset scale threshold, use the difference between the total number of cold data detected and the second preset scale threshold as the number N to be transferred, where N is a positive integer;
[0142] A sorting module, used to sort all cold data in the cold search library in the order of the most recent record time;
[0143] The transfer module is used to transfer the top N cold data to the disk.
[0144] In some embodiments, the hot search library is stored in a memory corresponding to an image processor or a sound processor used to match the object to be searched, and the cold search library is stored in a memory corresponding to a central processing unit;
[0145] The object to be retrieved includes at least one of the following: face, audio and iris.
[0146] An embodiment of the present application provides a retrieval library management device, which may include a processor and a memory, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the retrieval library management method provided in the above method embodiment.
[0147] An embodiment of the present application also provides a computer-readable storage medium, in which at least one instruction, at least one program, code set or instruction set is stored, and the at least one instruction, at least one program, code set or instruction set is loaded by a processor and executes any of the above-mentioned retrieval library management methods.
[0148] The following describes a specific embodiment of a search method of the present application. Fig. 9 This is a flowchart of a search method provided in the embodiment of the present application. The present application provides the method operation steps described in the embodiment or flowchart, but based on conventional or non-creative labor, more or fewer operation steps may be included. The order of steps listed in the embodiment is only one of many step execution orders and does not represent the only execution order. Fig. 9 As shown, the execution subject of the method may be a server in the above application environment, and a search library that has undergone data management is used for search, wherein the search library includes a hot search library and a cold search library. The method may include:
[0149] S701: Acquire feature data to be retrieved of the object.
[0150] In this embodiment, the object here may be a user's face, audio, iris, etc.
[0151] For example, taking face retrieval as an example, a user's face image is collected by a collection device, and then the face image is processed to obtain feature data to be retrieved.
[0152] The acquisition device includes but is not limited to a face photo captured by a camera, a selfie of an ID card, and an original video frame. The image processing includes but is not limited to image preprocessing, face detection and registration, and face feature extraction. Among them, image preprocessing includes image noise reduction processing, etc. Face detection and registration are used to obtain a face frame and face registration to obtain five-point information of the face. Face feature extraction can be based on the face feature SDK to calculate features based on the five points of the face to obtain feature data to be retrieved.
[0153] S703: Searching the feature data to be searched in the data-managed hot search library to obtain search results.
[0154] S705: Return the search result.
[0155] Wherein, the retrieval library performs data management through at least one of the above-mentioned retrieval library management methods.
[0156] In some embodiments, the retrieval method may further include a step of managing a database, and the step of managing the database may include:
[0157] When the total number of hot data stored in the hot search library is greater than a first preset scale threshold, obtaining attribute parameters of each hot data in the hot search library;
[0158] If it is determined that the attribute parameters of the hot data meet the hot data management conditions, the hot data meeting the hot data management conditions is migrated to the cold search library;
[0159] Calculating first matching degrees of each cold data stored in the cold search library and each hot data in the hot search library;
[0160] If it is determined that the first matching degree satisfies the cold data management condition, the cold data satisfying the cold data management condition is migrated to the hot search library.
[0161] It should be noted that the specific content and beneficial effects of managing the database here are similar to those in the above embodiment and will not be repeated here.
[0162] For example, after determining the feature data to be retrieved, a conventional retrieval algorithm model trained based on machine learning is used to perform a similarity search on the feature data to be retrieved in a hot search library that has been managed by data. If hot data with a similarity reaching a preset threshold is retrieved, the corresponding hot data is returned as a search result. If hot data with a similarity reaching a preset threshold is not retrieved, it means that the user corresponding to the feature data to be retrieved is a new identity user, and a new identity and its corresponding feature data are inserted for the new identity user in the hot search library, and the new identity is added to the library.
[0163] It should be noted that the data management of the retrieval library using any of the above-mentioned retrieval library management methods is performed periodically.
[0164] When the scale of the hot search library reaches the set threshold, the data management strategy is triggered to complete the sinking of hot data in the hot search library, and keep the scale of the hot search library controllable and the latest hot data in the library. The cold search library receives the hot data sunk from the hot search library, and searches the hot search library at a fixed time (configurable) every day to complete the high threshold merge with the hot search library. When the scale of the cold search library reaches the set threshold, the clearing logic is triggered to ensure that the scale of the cold search library is controllable.
[0165] In the retrieval process, the present application uses a hot retrieval library that has undergone data management to perform retrieval instead of a cold retrieval library, which can greatly improve retrieval efficiency. The cold retrieval library serves as a transition library and is stored in the same retrieval library as the hot retrieval library, which facilitates data reading and writing between the two and is also conducive to efficient management of hot data in the hot retrieval library. In the database management process, by separating the hot and cold data of the retrieval library, when the total number of hot data stored in the hot retrieval library is greater than the first preset scale threshold, the cold and hot library promotion and demotion logic is triggered, ensuring that the scale of the hot retrieval library as the retrieval base is within the threshold range, which not only improves the effectiveness of the hot data in the hot retrieval library, but also improves the reliability, accuracy and efficiency of retrieval based on the managed hot retrieval library.
[0166] The following uses the face retrieval scenario as an example to specifically illustrate the retrieval method of the present application. Fig.10 FIG. 1 is a schematic diagram of the framework of the retrieval method based on the face retrieval scenario implemented in this application. Fig.10 As shown, the framework can include three parts: face input, face preprocessing and face retrieval.
[0167] Among them, 1) the face input part can obtain face pictures through the acquisition module. The acquisition module includes but is not limited to face pictures captured by a camera, ID card selfies, and original video frames.
[0168] 2) The face preprocessing part can be implemented by a face picture preprocessing module, a face detection / registration module and a face feature extraction module. The face picture preprocessing module is used to preprocess the acquired face picture, and the preprocessing includes but is not limited to noise reduction processing. The face detection / registration module is used to detect the preprocessed face picture to obtain a face frame, and perform face registration based on the face frame to obtain five-point face information. The face feature extraction module is used to calculate face features based on the acquired five-point face information. In practical applications, face preprocessing can be performed by running a software development kit (SDK).
[0169] 3) The face search part may include a search library, which includes a hot search library and a cold search library, wherein the hot search library is stored in the video memory of the GPU, and the hot search library may include a face feature management module, a search module, and a hot search library management module. The cold search library is stored in the memory of the CPU, and the cold search library may include a cold search library management module and a cold search library cleaning module. The hot search library management module, the cold search library management module, and the cold search library cleaning module are independent of each other and can be performed concurrently and synchronously, so that the face search service can make full use of the computing resources of the GPU and CPU for deep learning calculations, greatly improving the overall computing power of the device.
[0170] The facial feature management module is used to perform corresponding feature management operations (such as adding, deleting, modifying and checking features) on the search library. The hot search library serves as a search base library, which stores hot data for face search. The hot search library management module is used to manage the hot data stored in the hot search library, and when the above hot data management conditions are met, the hot data is migrated to the cold search library to implement the strategy of reducing the hot library to the cold library. The search module is used to search the hot search library for hot data similar to the facial features to be searched, and return the search results based on the search similarity results.
[0171] The cold search library management module is used to manage the cold data stored in the cold search library. When the above cold data management conditions are met, the cold data is migrated to the hot search library to implement the strategy of upgrading the cold library to the hot library. The cold search library cleaning module is used to clean the cold data stored in the cold search library. When the above data cleaning conditions are met, the cold data is transferred to the disk.
[0172] The retrieval method of the present application can apply the mainstream 1:N face retrieval framework in the field of computer vision CV, and play an important role in identity archiving, identity retrieval, and identity merging in scenarios such as smart retail, smart communities, and security, thereby ensuring the timeliness and retrieval performance of identity retrieval.
[0173] The retrieval method based on the retrieval hot and cold storage promotion and demotion strategy proposed in this application solves a series of problems caused by the excessive size of the retrieval base in the current retrieval. The strategy mainly includes the strategy of sinking the hot storage to the cold storage based on timeliness and the strategy of upgrading the cold storage to the hot storage based on retrieval of the hot storage. The two major strategies are carried out simultaneously according to their own rules, ensuring the controllable size of the hot retrieval library and the timeliness of the information in the library. The new retrieval base designed based on this strategy helps to improve the performance of the retrieval algorithm and resource utilization.
[0174] The following are device embodiments of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0175] Please refer to Fig.11, which shows a structural block diagram of a retrieval device provided in an embodiment of the present application. The device has the function of implementing the server side in the above method example, and the function can be implemented by hardware or by hardware executing corresponding software. The device 80 may include:
[0176] The feature management module 801 is used to obtain the feature data to be retrieved of the object;
[0177] The search library management device 802 is used to manage the data of the search library, and the search library includes a hot search library and a cold search library;
[0178] A search module 803 is used to search the feature data to be searched in the data-managed hot search library to obtain a search result;
[0179] The return module 804 is used to return the search result.
[0180] In one embodiment, the search library management device is any of the search library management devices described above, and the search library management device may include:
[0181] an attribute acquisition module, configured to acquire attribute parameters of each hot data stored in the hot search library when the total amount of hot data stored in the hot search library is greater than a first preset scale threshold;
[0182] A first migration module, configured to migrate the hot data satisfying the hot data management condition to the cold search library if it is determined that the attribute parameters of the hot data satisfy the hot data management condition;
[0183] A first calculation module, used for calculating a first matching degree between each cold data stored in the cold search library and each hot data in the hot search library;
[0184] The second migration module is configured to migrate the cold data satisfying the cold data management condition to the hot search library if it is determined that the first matching degree satisfies the cold data management condition.
[0185] In some embodiments, the retrieval library management device includes a hot retrieval library management module and a cold retrieval library management module.
[0186] The hot search library management module includes the attribute acquisition module and the first migration module;
[0187] The cold search library management module includes the first calculation module and the second migration module.
[0188] In a feasible embodiment, the retrieval module can also be used to calculate the first matching degree between each cold data stored in the cold retrieval library and each hot data in the hot retrieval library, and to calculate the second matching degree between the hot data to be managed and each cold data in the cold retrieval library. In this way, the above-mentioned calculation subunit and the first calculation module in the retrieval library management device can be omitted, the function of the retrieval module is fully utilized, and there is no need to configure more feature matching function modules, thereby reducing the retrieval cost.
[0189] In some embodiments, the hot search library is stored in an image processor or a sound processor for matching the object to be searched, and the cold search library is stored in a central processor;
[0190] The object to be retrieved includes at least one of the following: face, audio and iris.
[0191] An embodiment of the present application provides a retrieval device, which may include a processor and a memory, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the retrieval method provided in the above method embodiment.
[0192] An embodiment of the present application also provides a computer-readable storage medium, in which at least one instruction, at least one program, code set or instruction set is stored, and the at least one instruction, at least one program, code set or instruction set is loaded by a processor and executes any of the above-mentioned retrieval methods.
[0193] Further, Fig.12 The hardware structure diagram of a device for implementing the search library management method or search method provided in the embodiment of the present application is shown. The device may be a computer terminal, a mobile terminal or other device. The device may also participate in or include the apparatus provided in the embodiment of the present application. Fig.12 As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Fig.12 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.12 More or fewer components as shown, or with Fig.12 Different configurations are shown.
[0194] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0195] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the methods described in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, to implement the above-mentioned neural network processing method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0196] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0197] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0198] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of the present application are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0199] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and server embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0200] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0201] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A search library management method, characterized in that: The search library includes a hot search library and a cold search library, and the method includes: When the total number of thermal data stored in the thermal search library is greater than a first preset scale threshold, obtaining attribute parameters of each thermal data in the thermal search library; the first preset scale threshold matches the rated base library scale corresponding to the retrieval accuracy requirement required to be achieved by the retrieval algorithm adapted to the retrieval library; If it is determined that the attribute parameters of the hot data meet the hot data management conditions, the hot data meeting the hot data management conditions are migrated to the cold search library; the migrating the hot data meeting the hot data management conditions to the cold search library includes: calculating the second matching degree of the hot data to be managed and each cold data in the cold search library, the hot data to be managed being the hot data meeting the hot data management conditions; judging whether the maximum second matching degree is greater than or equal to a third preset threshold value among the multiple second matching degrees corresponding to the hot data to be managed; if the judgment result is yes, merging the hot data to be managed whose maximum second matching degree is greater than or equal to the third preset threshold value with the cold data; if the judgment result is no, storing the hot data to be managed whose maximum second matching degree is less than the third preset threshold value into the cold search library; Calculating first matching degrees of each cold data stored in the cold search library and each hot data in the hot search library; If it is determined that the first matching degree satisfies the cold data management condition, the cold data satisfying the cold data management condition is migrated to the hot search library.
2. The method according to claim 1, characterized in that: The attribute parameters of the hot data include at least one of the last recorded timestamp of the hot data and the user activity associated with the hot data; In a case where the attribute parameters of the hot data include the most recent record timestamp of the hot data and the user activity associated with the hot data, if it is determined that the attribute parameters of the hot data meet the hot data management condition, migrating the hot data meeting the hot data management condition to the cold search library includes: If it is determined that the time interval between the most recent recording timestamp of the hot data and the first preset time is greater than or equal to a first preset threshold, and it is determined that the user activity associated with the hot data is less than a second preset threshold, it is determined that the attribute parameters of the hot data meet the hot data management conditions; Determine the hot data that meets the hot data management condition as the hot data to be managed; Migrate the hot data to be managed to the cold retrieval library.
3. The method according to claim 1, characterized in that If it is determined that the first matching degree satisfies the cold data management condition, migrating the cold data satisfying the cold data management condition to the hot search library includes: If, among the multiple first matching degrees corresponding to the cold data, it is determined that the maximum first matching degree is greater than or equal to a fourth preset threshold, it is determined that the first matching degree meets the cold data management condition; Determine the cold data that meets the cold data management conditions as the cold data to be managed; Migrate the cold data to be managed to the hot search library.
4. The method according to claim 1, characterized in that The method further comprises: Detecting the total number of cold data stored in the cold retrieval library; If the total number of cold data detected is greater than the second preset scale threshold, the difference between the total number of cold data detected and the second preset scale threshold is used as the number N to be transferred, where N is a positive integer; Sorting all cold data in the cold search library in the order of the most recent record time; Transfer the top N cold data to disk.
5. The method according to claim 1, characterized in that The hot search library is stored in a memory corresponding to an image processor or a sound processor used to match the object to be searched, and the cold search library is stored in a memory corresponding to a central processing unit; The object to be retrieved includes at least one of the following: face, audio and iris.
6. A search method, characterized in that: A search library that has undergone data management is used for search, wherein the search library includes a hot search library and a cold search library, and the method includes: Obtain the feature data to be retrieved of the object; Searching the feature data to be searched in a hot search library managed by the search library to obtain a search result; Returning the search result; The search library manages data by the following search library management method, which includes: When the total number of thermal data stored in the thermal search library is greater than a first preset scale threshold, obtaining attribute parameters of each thermal data in the thermal search library; the first preset scale threshold matches the rated base library scale corresponding to the retrieval accuracy requirement required to be achieved by the retrieval algorithm adapted to the retrieval library; If it is determined that the attribute parameters of the hot data meet the hot data management conditions, the hot data meeting the hot data management conditions are migrated to the cold search library; the migrating the hot data meeting the hot data management conditions to the cold search library includes: calculating the second matching degree of the hot data to be managed and each cold data in the cold search library, the hot data to be managed being the hot data meeting the hot data management conditions; judging whether the maximum second matching degree is greater than or equal to a third preset threshold value among the multiple second matching degrees corresponding to the hot data to be managed; if the judgment result is yes, merging the hot data to be managed whose maximum second matching degree is greater than or equal to the third preset threshold value with the cold data; if the judgment result is no, storing the hot data to be managed whose maximum second matching degree is less than the third preset threshold value into the cold search library; Calculating first matching degrees of each cold data stored in the cold search library and each hot data in the hot search library; If it is determined that the first matching degree satisfies the cold data management condition, the cold data satisfying the cold data management condition is migrated to the hot search library.
7. A search library management device, characterized in that: The retrieval library includes a hot retrieval library and a cold retrieval library, and the device includes: An attribute acquisition module, used for acquiring attribute parameters of each thermal data stored in the thermal search library when the total number of thermal data stored in the thermal search library is greater than a first preset scale threshold; the first preset scale threshold matches the rated base library scale corresponding to the retrieval accuracy requirement required to be achieved by the retrieval algorithm adapted to the retrieval library; A first migration module is used to migrate the hot data that meets the hot data management conditions to the cold search library if it is determined that the attribute parameters of the hot data meet the hot data management conditions; the migration of the hot data that meets the hot data management conditions to the cold search library includes: calculating the second matching degree of the hot data to be managed and each cold data in the cold search library, the hot data to be managed being the hot data that meets the hot data management conditions; judging whether the maximum second matching degree is greater than or equal to a third preset threshold value among the multiple second matching degrees corresponding to the hot data to be managed; if the judgment result is yes, merging the hot data to be managed whose maximum second matching degree is greater than or equal to the third preset threshold value with the cold data; if the judgment result is no, storing the hot data to be managed whose maximum second matching degree is less than the third preset threshold value in the cold search library; A first calculation module, used for calculating a first matching degree between each cold data stored in the cold search library and each hot data in the hot search library; The second migration module is configured to migrate the cold data satisfying the cold data management condition to the hot search library if it is determined that the first matching degree satisfies the cold data management condition.
8. A search device, characterized in that: The retrieval is performed using a data-managed retrieval library, wherein the retrieval library includes a hot retrieval library and a cold retrieval library, and the device includes: A feature management module, used to obtain the feature data to be retrieved of the object; The search library management device of claim 7 is used to manage data in the search library, wherein the search library includes a hot search library and a cold search library; A retrieval module, used to search the characteristic data to be searched in the data-managed hot search library to obtain a search result; The return module is used to return the search result.
9. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded by the processor and executes the retrieval library management method as described in any one of claims 1 to 5, or the retrieval method as described in claim 6.
10. A search library management device, characterized in that: The device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded by the processor and executes the retrieval library management method described in any one of claims 1 to 5.
11. A retrieval device, characterized in that: The device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded by the processor and executes the retrieval method described in claim 6.
Citation Information
Patent Citations
Data management method, equipment and system
CN104536904A
Method and device for managing disks in distributed storage system
CN105701028A
Consistent hash-based hierarchical mixed storage system and method
CN107844269A
Data management system and method based on hybrid storage, terminal and medium
CN109491618A
Cold and hot data storage method and device and electronic device
CN109857737A
Cited By
Chemical industry chain knowledge graph entity alignment method and system
CN122452716A
