Searching method and device, electronic equipment and storage medium
By using a trained model to categorize and tag data for direct memory retrieval, the method addresses inefficiencies in traditional data search, improving speed and accuracy in big data environments.
Patent Information
- Application Number
- CN202411106329.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-12-10
AI Technical Summary
Traditional data search methods in big data environments are slow and resource-intensive, leading to inefficiencies and performance degradation due to high time complexity and frequent database queries.
A search method involving a trained model to assign search tags based on confidence, categorize data, and store likely search results in category-specific memories, allowing direct retrieval from these memories rather than the database, supplemented by database searches when necessary.
This approach significantly enhances search efficiency and accuracy by prioritizing memory searches over database queries, providing faster and more precise results.
Smart Images

Figure CN119106052A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a search method, device, electronic device and storage medium. Background Art
[0002] At present, the process of searching for data in applications usually relies on traversing a search list or searching for data directly from a database. These traditional methods are not only slow, but also consume a lot of resources. When faced with massive amounts of data, the time complexity of traversing a search list is high, resulting in a slow system response. At the same time, frequent database query operations will also increase the burden on the database and affect the overall performance of the system. These defects are particularly evident in a big data environment, which seriously limits the efficiency of data processing and searching. Summary of the invention
[0003] The embodiments of the present application disclose a search method, device, electronic device and medium, which can improve search efficiency and provide users with a faster and more accurate search experience.
[0004] A first aspect of an embodiment of the present application discloses a search method, the method comprising:
[0005] Processing a plurality of to-be-searched data stored in a database by the trained search model to obtain a search tag corresponding to each of the to-be-searched data, wherein the search tag is used to characterize the search confidence corresponding to the to-be-searched data;
[0006] Classifying the plurality of data to be searched according to the data categories corresponding to the respective data to be searched, and obtaining data sets corresponding to the plurality of data categories respectively;
[0007] storing the to-be-searched data whose corresponding search tags meet the first preset condition in the first data set into a first memory, wherein the first memory is a memory corresponding to the data category to which the first data set belongs; the first data set is any of the data sets;
[0008] Receive a search request sent by a client, and determine the data category to be searched and the search keyword according to the search request;
[0009] In the second memory corresponding to the data category to be searched, the data to be searched matching the search keyword is searched as a first search result, and the first search result is fed back to the client.
[0010] In some possible embodiments, before the search model obtained through training processes the plurality of to-be-searched data stored in the database, the method further includes:
[0011] When the second preset condition is met, training the search model to be trained according to the multiple data stored in the database;
[0012] The second preset condition includes:
[0013] The amount of data to be searched updated in the database is greater than or equal to a data amount threshold; and / or,
[0014] The duration from the current moment to the last time the search model was trained reaches a preset duration threshold.
[0015] In some possible embodiments, before the search model obtained through training processes a plurality of to-be-searched data stored in a database, the following steps are included:
[0016] According to the data categories respectively corresponding to the multiple data to be searched stored in the database, data preprocessing is performed on the multiple data to be searched, wherein the data preprocessing includes data cleaning and / or dimension selection;
[0017] The search model obtained through training processes the plurality of to-be-searched data stored in the database, including:
[0018] The search model obtained through training is used to process the preprocessed multiple data to be searched.
[0019] In some possible embodiments, storing the to-be-searched data whose corresponding search tags meet the first preset condition in the first data set into the first memory includes:
[0020] Selecting, from the first data set, first data to be searched, the search confidence represented by the corresponding search tag being greater than a preset confidence threshold;
[0021] The first data to be searched are stored in the first memory in descending order of the search confidences represented by the search tags corresponding to the first data to be searched.
[0022] In some possible embodiments, the method further includes:
[0023] Selecting second data to be searched whose corresponding search frequency is higher than a preset frequency from the first data set, and storing each of the second data to be searched in the first memory in descending order of the search frequency corresponding to each of the second data to be searched;
[0024] and / or,
[0025] From the first data set, third data to be searched whose corresponding search moments are within a preset time period are selected, and each of the third data to be searched is stored in the first memory in order from near to far corresponding to the search moments.
[0026] In some possible embodiments, the method further includes:
[0027] When no data to be searched matching the search keyword is found in the second memory corresponding to the data category to be searched, the database is searched for data to be searched matching the search keyword as a second search result, and the second search result is fed back to the client.
[0028] In some possible embodiments, searching the database for to-be-searched data that matches the search keyword as the second search result includes:
[0029] Calculating the similarity between each of the to-be-searched data stored in the database and the search keyword, and taking the to-be-searched data having a similarity with the search keyword higher than a similarity threshold as the second search result;
[0030] Or, the similarity between each to-be-searched data contained in the first data set stored in the database and the search keyword is calculated, and the to-be-searched data having a similarity with the search keyword higher than the similarity threshold is used as the second search result.
[0031] A second aspect of an embodiment of the present application discloses a search device, the device comprising:
[0032] A processing module, used to process a plurality of to-be-searched data stored in a database through a search model obtained through training, and obtain a search tag corresponding to each of the to-be-searched data, wherein the search tag is used to characterize the search confidence corresponding to the to-be-searched data;
[0033] A classification module, used for classifying the plurality of data to be searched according to the data categories corresponding to the respective data to be searched, to obtain data sets corresponding to the plurality of data categories respectively;
[0034] A storage module is used to store the to-be-searched data whose corresponding search tags meet the first preset condition in the first data set into a first memory, wherein the first memory is a memory corresponding to the data category to which the first data set belongs; the first data set is any of the data sets;
[0035] A receiving module, used to receive a search request sent by a client, and determine the data category to be searched and the search keyword according to the search request;
[0036] The first retrieval module is used to search the data to be searched that matches the search keyword as a first search result in the second memory corresponding to the data category to be searched, and feed back the first search result to the client.
[0037] A third aspect of an embodiment of the present application discloses an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the method described in any of the above embodiments.
[0038] A fourth aspect of the embodiments of the present application discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor in an electronic device, the electronic device implements the method described in any of the above embodiments.
[0039] In an embodiment of the present application, a search model obtained through training obtains a search tag corresponding to each data to be searched stored in a database, and the search tag can be used to characterize the search confidence corresponding to the data to be searched; according to the data category corresponding to each data to be searched, multiple data to be searched are classified to obtain data sets corresponding to multiple data categories; the data to be searched whose corresponding search tags meet the first preset condition in the first data set are stored in a first memory, and the first memory is a memory corresponding to the data category to which the first data set belongs; a search request sent by a client can be received, and the data category to be searched and the search keyword to be searched can be determined according to the search request, and the data to be searched matching the search keyword can be searched in a second memory corresponding to the data category to be searched as the first search result and fed back to the client. In the implementation column of the present application, multiple data to be searched can be classified according to the data categories corresponding to the multiple data to be searched stored in the database, so as to obtain data sets corresponding to the multiple data categories. For the multiple data categories, corresponding memories can be respectively provided, and the search tags corresponding to the respective data to be searched can be determined by using the trained search model, so as to accurately identify the possibility of each data to be searched being searched, and store the data to be searched whose search tags in each data set meet the first preset condition in the memory corresponding to the data category of each data set, so that when the client searches, it gives priority to searching from the memory corresponding to the data category to be searched, rather than directly retrieving the search keyword from the database, and different data categories to be searched are searched in different memories, which can significantly improve the search efficiency, and because the search tags of the data to be searched stored in the memory meet the first preset condition, the possibility of finding the search results in the memory is higher, which can provide users with a search experience with faster search speed and more accurate search results. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be 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 paying creative work.
[0041] Figure 1 An application scenario diagram of a search method provided in an embodiment of the present application;
[0042] Figure 2 A flowchart of a search method provided in an embodiment of the present application;
[0043] Figure 3 A timing diagram of a search method provided in an embodiment of the present application;
[0044] Figure 4 A flowchart of another search method provided in an embodiment of the present application;
[0045] Figure 5 A flowchart of searching in a database when no search results are found in a second memory provided in an embodiment of the present application;
[0046] Figure 6 An application scenario diagram of another search method provided in an embodiment of the present application;
[0047] Fig. 7A A timing diagram of a data storage process of a search method provided in an embodiment of the present application;
[0048] Figure 7B A timing diagram of a data retrieval process of a search method provided in an embodiment of the present application;
[0049] Figure 8 A structural block diagram of a search device provided in an embodiment of the present application;
[0050] Fig. 9 A structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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 are within the scope of protection of this application.
[0052] It should be noted that the terms "including" and "having" and any variations thereof in the embodiments of the present application and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0053] In addition, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0054] Figure 1 This is an application scenario diagram of a search method provided in an embodiment of the present application. Figure 1 As shown, the application scenario of the search method may include a client 101, an intermediate server 102 and a database 103. The client sends a search request with search information and receives search results; the intermediate server 102 is responsible for information interaction, data processing and data storage with the client 101, and is specifically responsible for at least including but not limited to model training, data calculation, data storage and data search; the database 103 is responsible for data storage, sorting and classification, and the data stored in the database 103 is not limited to user information and log information.
[0055] The client 101 may be a personal computer (PC), a wireless terminal (i.e., a mobile terminal), or a Web terminal. The intermediate server 102 may be a server, a workstation, a supercomputer, or a server cluster system composed of multiple servers. The database 103 may be a Remote Dictionary Service (Redis) database, a distributed database, or a relational database.
[0056] A server is a specific information technology (Internet Technology, IT) device that provides computing power and runs software applications in a network environment. It provides computing or application services to other clients in the network. Generally speaking, servers have the ability to respond to service requests, provide services, and guarantee services. Compared with ordinary computers, servers have high-speed central processing unit (CPU) computing power, long-term reliable operation, strong input / output data throughput, and high scalability.
[0057] The intermediate server 102 processes the multiple data to be searched stored in the database 103 through the search model obtained by training, and obtains the search tags corresponding to each data to be searched. The database 103 then classifies the multiple data to be searched according to the data categories corresponding to each data to be searched, and obtains data sets corresponding to multiple data categories. The database 103 stores the data to be searched whose corresponding search tags meet the first preset condition in the first data set in the first memory of the intermediate server 102, and the first memory is a memory corresponding to the data category to which the first data set belongs. In the case where the intermediate server 102 receives the search request sent by the client 101, the intermediate server 102 determines the data category to be searched and the search keyword according to the search request, searches the data to be searched matching the search keyword in the second memory corresponding to the data category to be searched of the intermediate server 102 as the first search result, and feeds the first search result back to the client 101. In this way, part of the data to be searched is stored in the memory in advance, and when the client initiates a search request, the search keyword can be directly retrieved in the memory instead of the database, which can not only significantly improve the search efficiency, but also provide users with a search experience with faster search speed and more accurate search results.
[0058] Optionally, the intermediate server 102 and the database 103 may be integrated into the same server, that is, the various functions of the intermediate server 102 and the database 103 are respectively implemented by different modules of the same server, and the intermediate server 102 and the database 103 may also be respectively set as separate servers, but are not limited thereto. In addition, the various functions of the intermediate server 102 may be integrated and set on one server in a module manner, or may be separately set on a corresponding server, but are not limited thereto.
[0059] Exemplarily, the search model module is set on the model server, which is specifically responsible for at least including but not limited to storing the model parameters of the search model; the memory module is set on the storage server, which is specifically responsible for at least including but not limited to storing the first data set; the intermediate application module is set on the system server, which is specifically responsible for at least including but not limited to receiving search requests, determining the data category to be searched and the search keywords, sending search results and other functions.
[0060] In order to make the purpose and technical solution of this application clearer and more intuitive, the method and electronic device provided by the embodiment of this application will be described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain this application and are not used to limit this application.
[0061] like Figure 2 As shown, in one embodiment, a search method is provided, which may include the following steps:
[0062] S201, processing a plurality of to-be-searched data stored in a database through a trained search model to obtain a search tag corresponding to each to-be-searched data, where the search tag is used to characterize the search confidence corresponding to the to-be-searched data.
[0063] The multiple data to be searched stored in the database may be the original data of the database, which may be user information and log information reported by multiple clients and stored in the database according to an unordered set data structure. User information refers to the personal information and related data generated by the user when using the client, including the user's basic personal information or user account information, etc.; log information refers to the technical information automatically collected and recorded by the system when the user uses the client's services or during the operation of the client's system, including the product serial number or search behavior information of the client system. The data categories of the data to be searched stored in the database include, but are not limited to, text, images, audio, video, etc.
[0064] The search model can be a trained artificial intelligence model that has the ability to identify the search confidence corresponding to the data to be searched. The search confidence can be used to characterize the possibility of the data to be searched being searched. The higher the search confidence, the higher the possibility of the data to be searched being searched.
[0065] In some embodiments, the search model is trained using a machine learning (ML) algorithm or a deep learning (DL) algorithm to determine model parameters of the search model, and the trained search model is used to process multiple data to be searched stored in a database to obtain search tags corresponding to each data to be searched.
[0066] ML algorithm is not a specific algorithm, but a general term for many algorithms, including Logistic Regression (LR), Support Vector Machines (SVM), Random Forest (RF), etc. ML algorithm automatically discovers the laws and trends in the data through analysis and pattern recognition of large amounts of data, and uses these laws and trends to perform tasks such as prediction, classification, and clustering. DL algorithm is a branch of ML algorithm, which uses multi-layer neural networks (called deep neural networks) to simulate the complex decision-making ability of the human brain, so that computers can process data in a way inspired by the human brain. DL algorithms mainly include Artificial Neural Network (ANN), Convolutional Neural Networks (CNN), Generative Adversarial Networks (GAN), etc.
[0067] In some embodiments, multiple data to be searched stored in a database can be used as training data, and the search model to be trained can be trained based on the multiple data stored in the database. Each training data can have a corresponding actual search label, which is given in advance. The training data can be processed by the model to be trained to obtain a predicted search label, and the loss is calculated based on the predicted search label corresponding to the training data and the actual search label, and the parameters of the search model are adjusted according to the loss until the loss function value of the search model is less than or equal to the loss threshold, that is, the search model training is completed.
[0068] For example, the ML algorithm is used as the LR algorithm, and the training data is first converted into a linear combination:
[0069] z=w0+w1x1+w2x2+…+w n x n Formula (1);
[0070] Among them, z is the data to be searched, w0 is the bias term, w1,w2,…,w n are model weights, x1,x2,…,x n is the feature of the data to be searched, and n is the number of data to be searched.
[0071] Input the linearly combined data z to be searched into the Sigmoid function, map it to the interval [0,1], and obtain the predicted probability value σ(z) that may be searched:
[0072]
[0073] Then, the prediction results of the search model are evaluated using the log-likelihood loss function:
[0074]
[0075] Among them, m is the number of data to be searched, y i is the actual search label given in advance, h θ (x i ) is the search label predicted by the search model, that is, the probability value that the data to be searched may be searched. The higher the probability value, the more likely the data to be searched is to be searched.
[0076] Minimize the loss function Loss by gradient descent, first iteratively update the parameters w and bias w0 of the search model:
[0077]
[0078] Among them, α is the learning rate of the search model, Loss is the loss function parameter w j The partial derivative of .
[0079] According to the gradient calculation of the loss function Loss:
[0080]
[0081] Through continuous iteration, the training is completed after the loss function Loss is less than or equal to the predetermined loss threshold.
[0082] After the search model is trained, for the newly input data to be searched x, the linear combination of the newly input data to be searched x is calculated by formula (1), and the search label of the linear combination of the data to be searched x is obtained by formula (2) to predict the probability value that the data to be searched x may be searched.
[0083] S202, classifying a plurality of data to be searched according to the data categories corresponding to each of the data to be searched, and obtaining data sets corresponding to the plurality of data categories.
[0084] The data to be searched stored in the database has multiple data categories including text, image, audio, etc. Therefore, the multiple data to be searched are divided according to the data categories corresponding to each data to be searched, so that the data to be searched of each data category is separately divided into a data set.
[0085] S203, storing the to-be-searched data whose corresponding search tags meet the first preset condition in the first data set in the first memory, where the first memory is a memory corresponding to the data category to which the first data set belongs; the first data set is any data set.
[0086] The memory is a memory component used to store programs and various data information. In the embodiment of the present application, multiple memories can be set, and each memory can correspond to each data category one by one. The server can store the to-be-searched data of each data category in the memory corresponding to each data category, so as to realize the classified storage and classified management of data.
[0087] In some embodiments, a plurality of memories are provided in an intermediate server 102, and each memory corresponds to a data set of a data category. Optionally, the memory may include a Redis cache, a Memcached cache, an Ehcache cache, or other caches, but is not limited thereto. The following will take the memory as an example for detailed description.
[0088] Redis is an open source, in-memory data structure storage system that can be used as a database, cache, and message broker. Redis is not only completely based on memory, it can meet most operation requests at an extremely fast speed, and supports a variety of data types, including strings, lists, sets, ordered sets, hashes, etc. Therefore, using Redis cache as a storage device can not only save multiple types of data and reduce the pressure on the backend database, but also improve the system's response speed and processing capabilities.
[0089] Exemplarily, in the intermediate server 102, three storage devices, namely, text Redis cache, image Redis cache and audio Redis cache, are established according to the three data categories of text, image and audio to be searched, and the text data, image data and audio data to be searched whose search tags meet the first preset conditions are stored in the text Redis cache, image Redis cache and audio Redis cache, respectively.
[0090] The server can store the to-be-searched data whose search tags meet the first preset condition in each data set into the memory corresponding to the data category to which each data set belongs. Taking the first data set as an example, the to-be-searched data whose corresponding search tags meet the first preset condition in the first data set is stored in the first memory.
[0091] The first preset condition is a condition that is judged based on the value or category of the search tag. When the search tag of the data to be searched meets the first preset condition, it can be represented that the possibility of the data to be searched being searched is high.
[0092] Optionally, the first preset condition may include that the search confidence represented by the search tag of the data to be searched is greater than a preset confidence threshold, or the search confidence represented by the search tag of the data to be searched is within multiple preset confidence stages, but is not limited thereto.
[0093] The server can determine whether the search tags of each to-be-searched data in the first data set meet the first preset condition, and store the to-be-searched data whose search tags meet the first preset condition in the first memory. In this way, it is ensured that the search tags corresponding to the data stored in the first memory meet the requirements more, which is conducive to improving the search speed.
[0094] S204, receiving a search request sent by the client, and determining a data category to be searched and a search keyword according to the search request.
[0095] The intermediate server 102 receives the search request sent by the client, determines the data category of the search information according to the search request, and then uses the ML algorithm or the DL algorithm to extract the search keywords from the search information.
[0096] Optionally, there may be one or more clients; multiple clients may send search requests simultaneously or separately, which is not specifically limited in this application.
[0097] Search keywords, or features, are useful information extracted from the search information entered by the user in the client. Search information of different data categories has different types of search keywords, and different features can be extracted through different algorithms. In the search information of text data categories, the search keywords can be words or short sentences; in the search information of image data categories, the search keywords can be color features, texture features, shape features, or spatial relationship features; in the search information of audio data categories, the search keywords can be rhythm features or spectrum features.
[0098] Exemplarily, for search information of text data categories, methods such as term frequency-inverse document frequency (TF-IDF) algorithm, bag-of-words model (BOW) or word embedding (WE) algorithm can be used to extract corresponding features; for search information of image data categories, methods such as local binary pattern (LBP) operator, histogram of oriented gradient (HOG) or DL algorithm can be used to extract corresponding features; for search information of audio data categories, methods such as Mel-scale Frequency Cepstral Coefficients (MFCC), short time Fourier transform (STFT) or ML algorithm can be used to extract corresponding features.
[0099] S205: Search the second storage device corresponding to the data category to be searched for data to be searched that matches the search keyword as a first search result, and feed the first search result back to the client.
[0100] The second memory is the first memory storing the first data set. The data to be searched that matches the search keyword in the second memory refers to searching for a part in the data to be searched that is the same as the search keyword.
[0101] In the above embodiment, the multiple data to be searched stored in the database are processed by the trained search model to obtain the search tags corresponding to each data to be searched. The data to be searched in the database are divided into data sets corresponding to multiple data categories according to the data categories, and these data sets are respectively stored in the storage devices corresponding to the data categories. When a search request sent by the client is received, the data category and search keywords to be searched are determined according to the search request, and the data to be searched matching the search keywords are searched in the storage device of the corresponding data category, and the data to be searched is fed back to the client as the first search result.
[0102] For example, Figure 3 A timing diagram of a search method provided for an embodiment of the present application. Take an application scenario including a client, an intermediate server and a database, the database including data to be searched in two data categories of text and image, the intermediate server including an intermediate application module, an LR model module and a Redis cache, the LR model module stores an LR model, the Redis cache includes a first Redis cache module and a second Redis cache module, the first Redis cache module stores data to be searched in the text data category, and the second Redis cache module stores data to be searched in the image data category as an example.
[0103] like Figure 3As shown, the trained LR model module calls the data to be searched in the database, calculates the search tags corresponding to each data to be searched, and stores the search tags and the data to be searched in the database. According to the data category, the database divides the data to be searched carrying the search tags into a text data set and an image data set, and stores the text data in the text data set that meets the first predetermined condition in the first Redis cache module, and stores the image data in the image data set that meets the first predetermined condition in the second Redis cache module. When the client initiates a search request, the intermediate application module receives the search request, determines that the data category of the search request is a text data category, and the search keyword is a word, initiates a retrieval request to the first Redis cache module storing the text data category, retrieves the data matching the search keyword in the first Redis cache module, and finally returns the search result to the client. Since the data to be searched that is most likely to be searched in the database is classified and stored in different memories, when the client initiates a search request, the search keyword is directly retrieved in the corresponding memory according to the data category of the search request, which can not only significantly improve the search efficiency, but also provide users with a search experience with faster search speed and more accurate search results.
[0104] In some embodiments, the data to be searched stored in the database are disordered and need to be preprocessed to make the data to be searched in the database orderly, and then use the ordered data to be searched for subsequent training, classification or storage operations. Figure 4 A flowchart of another search method provided in an embodiment of the present application. Figure 4 As shown, the search method may include the following steps:
[0105] S401 , performing data cleaning on a plurality of data to be searched according to data categories respectively corresponding to the plurality of data to be searched stored in a database.
[0106] Data cleaning refers to the process of checking, processing and correcting data before analyzing, modeling or visualizing it. The purpose of data cleaning is to ensure the accuracy, completeness, consistency and reliability of data to improve the quality and accuracy of data analysis. The data cleaning process includes rechecking and verifying the data to be searched, deleting duplicate data to be searched, and correcting numerical anomalies and symbol errors in the data to be searched.
[0107] S402, selecting dimensions based on the multiple data to be searched after data cleaning.
[0108] Dimension selection refers to selecting appropriate dimensions according to the amount of training data and the scale of the network in a specific dataset. A dimension is a certain characteristic of a thing or phenomenon. By selecting appropriate dimensions for the data to be searched in the database, it is beneficial to balance the training speed and training quality of the search model.
[0109] Optionally, for the data preprocessing of multiple data to be searched stored in the database, data cleaning can be performed first and then dimension selection, or dimension selection can be performed first and then data cleaning, or other data preprocessing steps can be added in addition to data cleaning and dimension selection. This is not specifically limited in this article.
[0110] S403. Process the multiple preprocessed data to be searched through the trained search model.
[0111] As an implementation method, first perform data cleaning on the data to be searched in the database, then determine the dimensions of the data to be searched through dimension selection to complete data preprocessing. Then, train the search model based on the preprocessed data to be searched, and finally, further process the preprocessed data to be searched using the trained search model.
[0112] Exemplarily, taking the data to be searched in the database as the data to be searched of the text data category, and the data preprocessing as data cleaning and dimension selection. The dimensions of the data to be searched of this text data category include search content, search time, and the weather at the location of the client. After obtaining the data to be searched of the text data category in the database, first remove noise and special characters to complete data consistency checking, that is, remove duplicate data, fill in missing values, handle outliers, and convert data formats, etc., and then remove Chinese stop words such as "的", "和", "是", etc. and English stop words such as "a", "an", "the", etc. Stop words refer to words that appear frequently in the text but contribute little to the semantic understanding of the text. Perform dimension selection based on the data to be searched of the text data category after data cleaning, select the two dimensions of "search content" and "search time" that are helpful for training the search model, and exclude the irrelevant dimension of "the weather at the location of the client". Complete the training of the search model based on the data to be searched of the text data category after data cleaning and dimension selection. Finally, use the trained search model to further process the data to be searched of the text data category after data cleaning and dimension selection. By performing data preprocessing on the data to be searched in the database before training the search model, it not only facilitates the management of the database data but also helps to improve the training speed and training quality of the search model.
[0113] The search model obtained through training is used to process multiple pre-processed data to be searched, which can transform the data to be searched in the database from an unordered set data structure to an ordered set data structure, which is conducive to more efficient management and search of the data to be searched in the database.
[0114] S404, classifying the plurality of data to be searched according to the data categories corresponding to the respective data to be searched, and obtaining data sets corresponding to the plurality of data categories respectively.
[0115] S405, storing the to-be-searched data whose corresponding search tags meet the first preset condition in the first data set in the first memory, where the first memory is a memory corresponding to the data category to which the first data set belongs; the first data set is any data set.
[0116] In some embodiments, from the first data set, the first data to be searched whose search confidence represented by the corresponding search tag is greater than the confidence threshold is selected; and each first data to be searched is stored in the first memory in order from high to low according to the search confidence represented by the search tag corresponding to each first data to be searched.
[0117] After processing the first data set with the trained search model to obtain the search tags corresponding to each data to be searched in the first data set, first, based on the search confidence represented by the search tag, select the data to be searched in the first data set whose search confidence is greater than the confidence threshold as the first data to be searched, sort the first data to be searched in descending order, and store them in the first memory.
[0118] Exemplarily, the first data set contains five data to be searched, No. 1-5, and the search confidences represented by the search tags corresponding to the data to be searched, No. 1-5, are 0.1, 0.6, 0.3, 0.55 and 0.7, respectively, and the confidence threshold is 0.5. Select No. 2, No. 4 and No. 5 in the first data set that are greater than the confidence threshold of 0.5, and sort No. 2, No. 4 and No. 5 in the order from high to low according to the search confidence represented by the search tags corresponding to the data to be searched, and obtain a new sorting of No. 5, No. 2 and No. 4, and store No. 2, No. 4 and No. 5 in the first memory in the new sorting. No. 1 and No. 3, which belong to the first data set but do not exceed the confidence threshold of 0.5, are still stored in the database. The data to be searched stored in the memory is further determined by the search confidence represented by the search tag, and the data to be searched is sorted and stored, which can further speed up the search efficiency in the memory.
[0119] In other embodiments, in addition to storing the data to be searched with high search confidence in the first data set, statistics are collected on each data to be searched in the first data set, and the data to be searched with low search confidence but meeting other conditions are stored in the first memory. From the first data set, second data to be searched whose corresponding search frequency is higher than the preset frequency is selected, and each second data to be searched is stored in the first memory in the order of the search frequency corresponding to each second data to be searched from high to low; and / or, from the first data set, third data to be searched whose corresponding search time is within the preset time period is selected, and each third data to be searched is stored in the first memory in the order of the search time corresponding to each third data to be searched from near to far.
[0120] Since the search model is trained based on the selected multiple feature dimensions, the search confidence represented by the search label obtained by the search model is the degree of search that is most likely to be searched under the selected multiple feature dimensions. Therefore, some of the data to be searched may have a low search confidence represented by the search label due to poor performance in other dimensions, so it is necessary to supplement the data to be searched that is most likely to be searched under a single feature dimension by other means. By counting the search frequency of each data to be searched in the first data set, according to the preset frequency threshold, the high-frequency searched data to be searched is screened out as the second data to be searched, and the second data to be searched is stored in the first memory in descending order; similarly, by counting the search time period of each data to be searched in the first data set, the recently searched data to be searched is screened out as the third data to be searched, and the third data to be searched is stored in the first memory in the order from near to far in the search time. By counting the search frequency and / or search time period, the data to be searched that is most likely to be searched under a single feature dimension is supplemented, which can optimize the data to be searched stored in the first memory and further improve the search efficiency and search accuracy.
[0121] It should be noted that the second data to be searched and the third data to be searched usually overwrite the same data to be searched in the first data to be searched, so as to avoid the same data to be searched being stored in the first memory multiple times.
[0122] Optionally, when statistics are collected on each to-be-searched data of the first data set, search keywords of each to-be-searched data may be collected, or all features of each to-be-searched data may be collected, but the present invention is not limited thereto.
[0123] Optionally, in addition to the two characteristic dimensions of search frequency and search period, the most likely data to be searched under other characteristic dimensions such as search keywords and search fields may also be supplemented, and this application does not make specific limitations here.
[0124] To sum up, by storing in the first memory the data to be searched that is most likely to be searched under multiple single-feature dimensions, as well as the data to be searched that is most likely to be searched under multiple-feature dimensions, the diversity and accuracy of the matching data can be increased in the subsequent matching process with the search keywords, and the interference of irrelevant data can be reduced, which is conducive to improving the search efficiency.
[0125] S406, receiving a search request sent by the client, and determining a data category to be searched and a search keyword according to the search request.
[0126] S407: Search the second storage device corresponding to the data category to be searched for data to be searched that matches the search keyword as a first search result, and feed the first search result back to the client.
[0127] In an embodiment of the present application, data cleaning is first performed on multiple data to be searched stored in the database, and then dimension selection is performed on the multiple data to be searched after data cleaning. After completing data cleaning and dimension selection, the trained search model is used to process the multiple data to be searched, and subsequent steps such as data classification storage and receiving search requests for searching are completed. Through data preprocessing steps such as data cleaning and dimension selection, the multiple data to be searched stored in the database are transformed from an unordered set data structure to an ordered set data structure, which can not only improve data quality, reduce noise and deviation, and improve the accuracy and reliability of search model training and classification, but also improve the response speed of the database and optimize the search efficiency of the database.
[0128] In some embodiments, due to the increase in the amount of data to be searched in the database, especially when the new data to be searched contains features different from those of the existing data to be searched, the original parameters of the search model may be outdated and unable to accurately reflect the search tags of the latest data to be searched. Therefore, during operation, the search model also needs to be frequently retrained based on the latest multiple data to be searched stored in the database to update the model parameters. When the second preset condition is met, the search model to be trained is trained based on the multiple data stored in the database; the second preset condition includes: the amount of data to be searched updated in the database is greater than or equal to the data amount threshold; and / or, the time from the current moment to the last time the search model was trained reaches a preset time threshold.
[0129] During operation, the user information and log information newly uploaded by the client will be added to the database as new data to be searched. When the amount of data newly added to the database is greater than or equal to the predetermined data volume threshold, the search model will be retrained based on the new data to be searched stored in the database to ensure that the model parameters of the search model are updated; at the same time, when the amount of data newly added to the database does not reach the predetermined data volume threshold, but the time since the last time the search model was trained reaches the preset time threshold, the search model will also be retrained based on the new data to be searched stored in the database. In this way, it is possible to ensure that the model parameters of the search model are updated regularly, which is conducive to improving the accuracy of search results.
[0130] In the embodiment of the present application, the data to be searched in the database after data preprocessing is used to retrain the search model regularly and regularly, which can ensure that the data to be searched stored in the database is always the latest processed data, and the search tag of the data to be searched can always represent the latest search confidence of the data to be searched. This can not only avoid the problem of inaccurate or outdated search results caused by data lag, greatly improve the timeliness and relevance of data, but also can quickly and accurately classify and sort data in subsequent steps, which is conducive to improving the overall data management capabilities and search efficiency of the database.
[0131] In some embodiments, when no data to be searched matching the search keyword is found in the second memory corresponding to the data category to be searched, the database is searched for data to be searched matching the search keyword as a second search result, and the second search result is fed back to the client.
[0132] Figure 5 The flowchart of searching in the database when no search result is found in the second memory provided in the embodiment of the present application. Figure 5 As shown, the above method may further include the following steps:
[0133] S501, receiving a search request sent by a client, and determining a data category to be searched and a search keyword according to the search request.
[0134] S502, determining whether the to-be-searched data matching the search keyword is found in the second memory, if so, executing step S505, if not, executing step S503.
[0135] S503: Search the database for data to be searched that matches the search keyword according to the search keyword in the search request.
[0136] S504: Feedback the to-be-searched data in the database that matches the search keyword to the client as the second search result.
[0137] S505: Feedback the to-be-searched data in the second storage device that matches the search keyword to the client as the first search result.
[0138] It should be noted that the data to be searched that matches the search keyword may not be retrieved in the second memory. Therefore, if the data to be searched that matches the search keyword cannot be found in the second memory, a search can be performed in the database. After the data to be searched that matches the search keyword is searched in the database, the data to be searched that matches the search keyword is fed back to the client as the second search result. In this way, it can be ensured that when the matching data to be searched cannot be found in the second memory, accurate search results can still be fed back to the client, thereby providing a good search experience for the user.
[0139] In some embodiments, the entire database may be searched. The server may calculate the similarity between each to-be-searched data stored in the database and the search keyword, and use the to-be-searched data having a similarity with the search keyword higher than a similarity threshold as the second search result.
[0140] The similarity between each to-be-searched data stored in the database and the search keyword can be calculated. The scheme for calculating the similarity is not limited in the embodiment of the present application. For example, it can be calculated by cosine similarity, intelligent matching model, etc.
[0141] In some other embodiments, only the first data set stored in the database may be searched. The server may calculate the similarity between each to-be-searched data contained in the first data set stored in the database and the search keyword, and use the to-be-searched data whose similarity with the search keyword is higher than the similarity threshold as the second search result.
[0142] Optionally, if there are multiple data to be searched with similarities higher than the similarity threshold, all data to be searched with similarities higher than the similarity threshold can be fed back to the client as the second search result. Optionally, the data to be searched can be sorted in descending order according to the similarities corresponding to the data to be searched, and the data to be searched with the greatest similarity can be fed back to the client as the second search result.
[0143] Exemplarily, the search keyword for extracting search information is the initial text data, and the database stores a text data set and an image data set, wherein the text data set includes the first text data and the second text data, and the image data set includes the first image data and the second image data. When the search data that completely matches the initial text data cannot be retrieved in the second memory and the database, the similarity between the initial text data and the first text data and the second text data is calculated to be 0.99 and 0.9 using cosine similarity, and the similarity between the initial text data and the first image data and the second image data is calculated to be 0.9 and 0.7 using the Contrastive Language–Image Pre-training (CLIP) model, and the first text data and the second text data whose similarity is higher than the text similarity threshold of 0.9 are selected in the text data set, and the first image data whose similarity is higher than the image similarity threshold of 0.8 are selected in the image data set, and the above three are fed back to the client as the second search result.
[0144] When no data to be searched that completely matches the search keyword can be retrieved in the second memory and the database, by calculating the similarity between the search keyword and the data to be searched of the same data category or different data categories, the data to be searched with high similarity is selected as the second search result to be fed back to the client, thereby improving the accuracy of the fed-back search results.
[0145] In an embodiment of the present application, searching is performed first in the second memory instead of directly in the database, which can improve search efficiency. Moreover, when no searched data matching the search keyword can be found in the second memory, the search can continue in the database, thereby ensuring that the search results can be accurately fed back to the client, thereby improving the user experience.
[0146] For example, Figure 6 Another application scenario diagram provided by the embodiment of the present application. Figure 6As shown, the application scenario includes multiple clients 601, a system server 602, a first Redis server 603, a second Redis server 604, an LR server 605 and a database 606. The system server 602 includes an intermediate application module, and the LR server 605 includes an LR model. The LR server 605 completes the training of the LR model by calling the data to be searched in the database 606, and returns the corresponding search tag to the database 606. The database 606 stores the data to be searched in the first Redis server 603 and the second Redis server 604 according to the data category. After the client 601 sends a search request to the system server 602, the intermediate application module of the system server 602 receives the search request and retrieves the search keyword in the first Redis server 603 or the second Redis server 604 according to the data category of the search request. If no matching results are found, further search is performed in the database 606. Finally, the intermediate application module of the system server 602 feeds back the search results to the client 601 that issued the search request.
[0147] in accordance with Figure 4 In the application scenario, the entire operation process can be divided into two parts, the first part is the data storage process of the database 606 and the first Redis server 603, the second Redis server 604, and the LR server 605, and the second part is the data retrieval process of the client 601 and the intermediate application module of the system server 602, the first Redis server 603, the second Redis server 604, and the database 606. For example, the database 606 stores data of two data categories, text and image, the first Redis server 603 stores the data to be searched of the text data category, the second Redis server 604 stores the data to be searched of the image data category, the search keyword of the search information of the text data category is a word, and the search keyword of the search information of the image data category is a texture feature.
[0148] Fig. 7A A timing diagram of a data storage process of a search method provided in an embodiment of the present application. Fig. 7AAs shown, the database 606 first performs data cleaning, removes noise and special characters to complete the consistency check of the data to be searched, removes stop words to reduce the redundant information of the data to be searched, and then performs dimension selection to remove irrelevant dimensions. After completing data preprocessing, the LR server 605 calls the preprocessed data to be searched in the database 606, and after completing the training of the LR model, obtains the search tag corresponding to the preprocessed data to be searched, and stores the search tag in the database 606. The database 606 divides the data to be searched stored in the database 606 into a text data set and an image data set according to the data category, and selects the data to be searched whose search confidence represented by the search tag is greater than the confidence threshold in the text data set and the image data set as the first data to be searched. Similarly, the data to be searched whose search frequency is higher than the preset frequency is selected in the text data set and the image data set as the second data to be searched, and the data to be searched whose search period is within the preset time period is selected as the third data to be searched. The database 606 stores the first, second and third to-be-searched data of the text data category in the first Redis server 603 , and stores the first, second and third to-be-searched data of the image data category in the second Redis server 604 , according to the text and image data categories.
[0149] Figure 7B A timing diagram of a data retrieval process of a search method provided in an embodiment of the present application. Figure 7B As shown, when the client 601 initiates a search request, the system server 602 receives the search request, identifies that the data category of the search request is an image data category, extracts the texture feature of the search request, and retrieves the texture feature in the second Redis server 604. Since there is no to-be-searched data of the image data category matching the texture feature in the second Redis server 604, a search is performed in the database 606. In the database 606, the similarity between the texture feature and each to-be-searched data is calculated, and the to-be-searched data above the similarity threshold is retrieved as the second search result. The system server 602 feeds back the second search result to the client 601 that initiated the search request, and completes the response to the search request initiated by the client 601.
[0150] In summary, through data preprocessing, the search model can be trained using the data to be searched stored in the database in an ordered set data structure, ensuring the training speed and quality of model training. The processed data to be searched is divided into multiple data sets according to the data category, and the data to be searched that is most likely to be searched under multiple single feature dimensions and multi-feature dimensions in each data set is stored in the memory of the corresponding data category, which can not only reduce the interference of irrelevant data, but also significantly improve the search efficiency. At the same time, using the server as a memory can further improve the search efficiency. Finally, using high-similarity search results as an alternative to unmatched search results can effectively expand the breadth and depth of data applications, improve data utilization, and provide users with valuable search results for a better search experience.
[0151] Based on the search method provided in the above embodiment, Figure 8 This is a structural block diagram of a search device provided in an embodiment of the present application. Figure 8 As shown, in one embodiment, a search device 800 is provided, which includes a processing module 801, a classification module 802, a storage module 803, a receiving module 804 and a first retrieval module 805.
[0152] The processing module 801 is used to process the multiple to-be-searched data stored in the database through the trained search model to obtain a search tag corresponding to each to-be-searched data, where the search tag is used to represent the search confidence corresponding to the to-be-searched data;
[0153] A classification module 802, for classifying a plurality of to-be-searched data according to the data categories corresponding to each to-be-searched data, to obtain data sets corresponding to the plurality of data categories;
[0154] The storage module 803 is used to store the to-be-searched data whose corresponding search tags meet the first preset condition in the first data set into a first memory, where the first memory is a memory corresponding to the data category to which the first data set belongs; the first data set is any data set;
[0155] The receiving module 804 is used to receive the search request sent by the client, and determine the data category to be searched and the search keyword according to the search request;
[0156] The first search module 805 is used to search the data to be searched that matches the search keyword in the second storage corresponding to the data category to be searched as the first search result, and feed back the first search result to the client.
[0157] In one embodiment, the search device 800 further includes a training module.
[0158] A training module is used to train a search model to be trained based on multiple data to be searched stored in a database when a second preset condition is met; the second preset condition includes: the amount of data to be searched updated in the database is greater than or equal to a data amount threshold; and / or the time from the current moment to the last training of the search model reaches a preset time threshold.
[0159] In one embodiment, the search device 800 further includes a pre-processing module.
[0160] The preprocessing module is used to perform data preprocessing on the multiple data to be searched according to the data categories respectively corresponding to the multiple data to be searched stored in the database, and the data preprocessing includes data cleaning and / or dimension selection.
[0161] The processing module 801 is also used to process the pre-processed multiple to-be-searched data through the trained search model.
[0162] In one embodiment, the storage module 803 is also used to select, from the first data set, first data to be searched whose search confidence represented by the corresponding search tag is greater than a preset confidence threshold; and store each first data to be searched in the first memory in order from high to low of the search confidence represented by the search tag corresponding to each first data to be searched.
[0163] In one embodiment, the storage module 803 is also used to select second data to be searched whose corresponding search frequency is higher than a preset frequency from the first data set, and store each second data to be searched in the first memory in order of the search frequencies corresponding to each second data to be searched from high to low; and / or, select third data to be searched whose corresponding search time is within a preset time period from the first data set, and store each third data to be searched in the first memory in order of the search times corresponding to each third data to be searched from near to far.
[0164] In one embodiment, the search device 800 further includes a second retrieval module.
[0165] The second retrieval module is used to search for the data to be searched that matches the search keyword in the database as the second search result when the first retrieval module 805 fails to find the data to be searched that matches the search keyword in the second storage corresponding to the data category to be searched, and feed back the second search result to the client.
[0166] In one embodiment, the second retrieval module is also used to calculate the similarity between each data to be searched stored in the database and the search keyword, and use the data to be searched whose similarity with the search keyword is higher than the similarity threshold as the second search result; or, calculate the similarity between each data to be searched contained in the first data set stored in the database and the search keyword, and use the data to be searched whose similarity with the search keyword is higher than the similarity threshold as the second search result.
[0167] Fig. 9 This is a structural block diagram of an electronic device provided in an embodiment of the present application. Fig. 9 As shown, the electronic device 900 may include a memory 902 and a processor 901 , wherein the memory 902 stores a computer program, and when the computer program is executed by the processor 901 , the electronic device implements the search method described in the above embodiments.
[0168] The processor 901 may include one or more processing cores. The processor 901 uses various interfaces and lines to connect the various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory. Optionally, the processor 901 can be implemented in at least one hardware form of digital signal processing, field programmable gate array, and programmable logic array. The processor 901 can integrate one or a combination of a central processing unit, an image processor, and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to handle wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 901, but may be implemented separately through a communication chip.
[0169] The memory 902 may include a random access memory or a read-only memory. The memory may be used to store instructions, programs, codes, code sets or instruction sets. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the above-mentioned various method embodiments, etc. The data storage area may also store data created by the electronic device during use, etc.
[0170] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor implements the search method described in the above embodiments.
[0171] An embodiment of the present application discloses a computer program product, which includes a computer program. When the computer program can be executed by a processor, the processor implements the search method described in the above embodiments.
[0172] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a ROM, etc.
[0173] The above description is only a specific example of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A search method, characterized in that: include: Processing a plurality of to-be-searched data stored in a database by the trained search model to obtain a search tag corresponding to each of the to-be-searched data, wherein the search tag is used to characterize the search confidence corresponding to the to-be-searched data; Classifying the plurality of data to be searched according to the data categories corresponding to the respective data to be searched, and obtaining data sets corresponding to the plurality of data categories respectively; storing the to-be-searched data whose corresponding search tags meet the first preset condition in the first data set into a first memory, wherein the first memory is a memory corresponding to the data category to which the first data set belongs; The first data set is any of the data sets; Receive a search request sent by a client, and determine the data category to be searched and the search keyword according to the search request; In the second memory corresponding to the data category to be searched, the data to be searched matching the search keyword is searched as a first search result, and the first search result is fed back to the client.
2. The method according to claim 1, characterized in that Before the search model obtained through training processes the multiple to-be-searched data stored in the database, the method further includes: When the second preset condition is met, training the search model to be trained according to the multiple data stored in the database; The second preset condition includes: The amount of data to be searched updated in the database is greater than or equal to a data amount threshold; and / or, The duration from the current moment to the last time the search model was trained reaches a preset duration threshold.
3. The method according to claim 1 or 2, characterized in that: Before the search model obtained through training processes the multiple to-be-searched data stored in the database, it includes: According to the data categories respectively corresponding to the multiple data to be searched stored in the database, data preprocessing is performed on the multiple data to be searched, wherein the data preprocessing includes data cleaning and / or dimension selection; The search model obtained through training processes the plurality of to-be-searched data stored in the database, including: The search model obtained through training is used to process the preprocessed multiple data to be searched.
4. The method according to claim 1, characterized in that: The step of storing the to-be-searched data whose corresponding search tags meet the first preset condition in the first data set into the first memory includes: Selecting, from the first data set, first data to be searched, the search confidence represented by the corresponding search tag being greater than a preset confidence threshold; The first data to be searched are stored in the first memory in descending order of the search confidences represented by the search tags corresponding to the first data to be searched.
5. The method according to claim 4, characterized in that The method further comprises: Selecting second data to be searched whose corresponding search frequency is higher than a preset frequency from the first data set, and storing each of the second data to be searched in the first memory in descending order of the search frequency corresponding to each of the second data to be searched; and / or, From the first data set, third data to be searched whose corresponding search moments are within a preset time period are selected, and each of the third data to be searched is stored in the first memory in order from near to far corresponding to the search moments.
6. The method according to claim 1, characterized in that The method further comprises: When no data to be searched matching the search keyword is found in the second memory corresponding to the data category to be searched, the database is searched for data to be searched matching the search keyword as a second search result, and the second search result is fed back to the client.
7. The method according to claim 6, characterized in that The step of searching the database for the to-be-searched data that matches the search keyword as the second search result includes: Calculating the similarity between each of the to-be-searched data stored in the database and the search keyword, and taking the to-be-searched data having a similarity with the search keyword higher than a similarity threshold as the second search result; Or, the similarity between each to-be-searched data contained in the first data set stored in the database and the search keyword is calculated, and the to-be-searched data having a similarity with the search keyword higher than the similarity threshold is used as the second search result.
8. A search device, characterized in that: The device comprises: A processing module, used to process a plurality of to-be-searched data stored in a database through a search model obtained through training, and obtain a search tag corresponding to each of the to-be-searched data, wherein the search tag is used to characterize the search confidence corresponding to the to-be-searched data; A classification module, used for classifying the plurality of data to be searched according to the data categories corresponding to the respective data to be searched, to obtain data sets corresponding to the plurality of data categories respectively; A storage module is used to store the to-be-searched data whose corresponding search tags meet the first preset condition in the first data set into a first memory, wherein the first memory is a memory corresponding to the data category to which the first data set belongs; the first data set is any of the data sets; A receiving module, used to receive a search request sent by a client, and determine the data category to be searched and the search keyword according to the search request; The first retrieval module is used to search the data to be searched that matches the search keyword as a first search result in the second memory corresponding to the data category to be searched, and feed back the first search result to the client.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the processor is caused to implement the method according to any one of claims 1 to 7.
